吴学文 лет назад: 6
Родитель
Сommit
0b01bed9bf
21 измененных файлов с 283 добавлено и 60 удалено
  1. 2 0
      Api/src/main/java/com/java110/api/listener/owner/EditOwnerListener.java
  2. 1 0
      Api/src/main/java/com/java110/api/listener/owner/SaveOwnerListener.java
  3. 2 0
      UserService/src/main/java/com/java110/user/listener/owner/AbstractOwnerBusinessServiceDataFlowListener.java
  4. 2 0
      WebService/src/main/java/com/java110/web/smo/impl/OwnerServiceSMOImpl.java
  5. 5 0
      WebService/src/main/resources/components/ownerPackage/add-owner/addOwner.html
  6. 13 0
      WebService/src/main/resources/components/ownerPackage/add-owner/addOwner.js
  7. 5 0
      WebService/src/main/resources/components/ownerPackage/edit-owner/editOwner.html
  8. 15 1
      WebService/src/main/resources/components/ownerPackage/edit-owner/editOwner.js
  9. 4 0
      WebService/src/main/resources/components/ownerPackage/list-owner-member/listOwnerMember.html
  10. 20 3
      WebService/src/main/resources/components/ownerPackage/list-owner/listOwner.html
  11. 10 1
      WebService/src/main/resources/components/ownerPackage/list-owner/listOwner.js
  12. 7 1
      WebService/src/main/resources/components/ownerPackage/member-select-owner/memberSelectOwner.html
  13. 1 0
      WebService/src/main/resources/components/ownerPackage/member-select-owner/memberSelectOwner.js
  14. 4 4
      WebService/src/main/resources/components/ownerPackage/search-owner/searchOwner.html
  15. 53 41
      WebService/src/main/resources/components/ownerPackage/viewOwnerInfo/viewOwnerInfo.html
  16. 8 0
      WebService/src/main/resources/components/ownerPackage/viewOwnerInfo/viewOwnerInfo.js
  17. 9 0
      java110-bean/src/main/java/com/java110/dto/OwnerDto.java
  18. 10 0
      java110-bean/src/main/java/com/java110/vo/api/ApiOwnerDataVo.java
  19. 41 9
      java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml
  20. BIN
      java110-front/src/main/resources/static/img/noPhoto.gif
  21. 71 0
      java110-front/src/main/resources/static/js/vc-validate.js

+ 2 - 0
Api/src/main/java/com/java110/api/listener/owner/EditOwnerListener.java

@@ -127,6 +127,8 @@ public class EditOwnerListener extends AbstractServiceApiDataFlowListener {
         Assert.jsonObjectHaveKey(paramIn, "sex", "请求报文中未包含sex");
         Assert.jsonObjectHaveKey(paramIn, "ownerTypeCd", "请求报文中未包含sex");
         Assert.jsonObjectHaveKey(paramIn, "communityId", "请求报文中未包含communityId");
+        Assert.jsonObjectHaveKey(paramIn, "idCard", "请求报文中未包含身份证号");
+
     }
 
     /**

+ 1 - 0
Api/src/main/java/com/java110/api/listener/owner/SaveOwnerListener.java

@@ -291,6 +291,7 @@ public class SaveOwnerListener extends AbstractServiceApiDataFlowListener {
         Assert.jsonObjectHaveKey(paramIn, "sex", "请求报文中未包含sex");
         Assert.jsonObjectHaveKey(paramIn, "ownerTypeCd", "请求报文中未包含sex");
         Assert.jsonObjectHaveKey(paramIn, "communityId", "请求报文中未包含communityId");
+        Assert.jsonObjectHaveKey(paramIn, "idCard", "请求报文中未包含身份证号");
 
         JSONObject paramObj = JSONObject.parseObject(paramIn);
 

+ 2 - 0
UserService/src/main/java/com/java110/user/listener/owner/AbstractOwnerBusinessServiceDataFlowListener.java

@@ -48,6 +48,7 @@ public abstract class AbstractOwnerBusinessServiceDataFlowListener extends Abstr
         businessOwnerInfo.put("memberId", businessOwnerInfo.get("member_id"));
         businessOwnerInfo.put("ownerTypeCd", businessOwnerInfo.get("owner_type_cd"));
         businessOwnerInfo.put("communityId", businessOwnerInfo.get("community_id"));
+        businessOwnerInfo.put("idCard", businessOwnerInfo.get("id_card"));
         businessOwnerInfo.remove("bId");
         businessOwnerInfo.put("statusCd", statusCd);
     }
@@ -83,6 +84,7 @@ public abstract class AbstractOwnerBusinessServiceDataFlowListener extends Abstr
         currentOwnerInfo.put("memberId", currentOwnerInfo.get("member_id"));
         currentOwnerInfo.put("ownerTypeCd", currentOwnerInfo.get("owner_type_cd"));
         currentOwnerInfo.put("communityId", currentOwnerInfo.get("community_id"));
+        currentOwnerInfo.put("idCard", currentOwnerInfo.get("id_card"));
 
 
         currentOwnerInfo.put("operate", StatusConstant.OPERATE_DEL);

+ 2 - 0
WebService/src/main/java/com/java110/web/smo/impl/OwnerServiceSMOImpl.java

@@ -252,6 +252,7 @@ public class OwnerServiceSMOImpl extends BaseComponentSMO implements IOwnerServi
         //Assert.jsonObjectHaveKey(pd.getReqData(), "ownerTypeCd", "请求报文中未包含ownerTypeCd节点");
         Assert.jsonObjectHaveKey(pd.getReqData(), "link", "请求报文中未包含link");
         Assert.jsonObjectHaveKey(pd.getReqData(), "sex", "请求报文中未包含sex");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "idCard", "请求报文中未包含身份证号");
         Assert.jsonObjectHaveKey(pd.getReqData(), "remark", "未包含小区楼备注");
     }
 
@@ -266,6 +267,7 @@ public class OwnerServiceSMOImpl extends BaseComponentSMO implements IOwnerServi
         Assert.jsonObjectHaveKey(pd.getReqData(), "name", "请求报文中未包含name");
         Assert.jsonObjectHaveKey(pd.getReqData(), "link", "请求报文中未包含link");
         Assert.jsonObjectHaveKey(pd.getReqData(), "sex", "请求报文中未包含sex");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "idCard", "请求报文中未包含身份证号");
         Assert.jsonObjectHaveKey(pd.getReqData(), "remark", "未包含小区楼备注");
     }
 

+ 5 - 0
WebService/src/main/resources/components/ownerPackage/add-owner/addOwner.html

@@ -34,6 +34,11 @@
                                 <div class="col-sm-10"><input v-model="addOwnerInfo.age" type="number"
                                                               placeholder="必填,请填写年龄" class="form-control"></div>
                             </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">身份证</label>
+                                <div class="col-sm-10"><input v-model="addOwnerInfo.idCard" type="number"
+                                                              placeholder="必填,请填写身份证" class="form-control"></div>
+                            </div>
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">手机</label>
                                 <div class="col-sm-10"><input v-model="addOwnerInfo.link" type="number"

+ 13 - 0
WebService/src/main/resources/components/ownerPackage/add-owner/addOwner.js

@@ -15,6 +15,7 @@
                 remark:'',
                 ownerId:'',
                 ownerPhoto:'',
+                idCard:'',
                 videoPlaying:false
             }
         },
@@ -66,6 +67,18 @@
                             errInfo:"性别不能为空"
                         }
                     ],
+                    'addOwnerInfo.idCard':[
+                        {
+                            limit:"required",
+                            param:"",
+                            errInfo:"身份证号不能为空"
+                        },
+                        {
+                            limit:"idCard",
+                            param:"",
+                            errInfo:"不是有效的身份证号"
+                        }
+                    ],
                     'addOwnerInfo.link':[
                         {
                             limit:"required",

+ 5 - 0
WebService/src/main/resources/components/ownerPackage/edit-owner/editOwner.html

@@ -36,6 +36,11 @@
                                 <div class="col-sm-10"><input v-model="editOwnerInfo.age" type="number"
                                                               placeholder="必填,请填写年龄" class="form-control"></div>
                             </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">身份证</label>
+                                <div class="col-sm-10"><input v-model="editOwnerInfo.idCard" type="number"
+                                                              placeholder="必填,请填写身份证" class="form-control"></div>
+                            </div>
                             <div class="form-group row">
                                 <label class="col-sm-2 col-form-label">手机</label>
                                 <div class="col-sm-10"><input v-model="editOwnerInfo.link" type="number"

+ 15 - 1
WebService/src/main/resources/components/ownerPackage/edit-owner/editOwner.js

@@ -1,5 +1,6 @@
 (function(vc){
-    var _fileUrl = 'https://hc.demo.winqi.cn/callComponent/download/getFile/fileByObjId';
+    //var _fileUrl = 'https://hc.demo.winqi.cn/callComponent/download/getFile/fileByObjId';
+    var _fileUrl = '/callComponent/download/getFile/fileByObjId';
     vc.extends({
         propTypes: {
             notifyLoadDataComponentName:vc.propTypes.string
@@ -14,6 +15,7 @@
                 sex:'',
                 remark:'',
                 ownerPhoto:'',
+                idCard:'',
                 videoPlaying:false
             }
         },
@@ -66,6 +68,18 @@
                             errInfo:"性别不能为空"
                         }
                     ],
+                    'editOwnerInfo.idCard':[
+                        {
+                            limit:"required",
+                            param:"",
+                            errInfo:"身份证号不能为空"
+                        },
+                        {
+                            limit:"idCard",
+                            param:"",
+                            errInfo:"不是有效的身份证号"
+                        }
+                    ],
                     'editOwnerInfo.link':[
                         {
                             limit:"required",

+ 4 - 0
WebService/src/main/resources/components/ownerPackage/list-owner-member/listOwnerMember.html

@@ -12,6 +12,7 @@
                             <th data-hide="phone">名称</th>
                             <th data-hide="phone">性别</th>
                             <th data-hide="phone">年龄</th>
+                            <th data-hide="phone">身份证</th>
                             <th data-hide="phone">联系方式</th>
                             <th data-hide="phone">创建员工</th>
                             <th data-hide="phone">备注</th>
@@ -34,6 +35,9 @@
                             <td>
                                 {{owner.age}}
                             </td>
+                            <td>
+                                {{owner.idCard}}
+                            </td>
                             <td>
                                 {{owner.link}}
                             </td>

+ 20 - 3
WebService/src/main/resources/components/ownerPackage/list-owner/listOwner.html

@@ -5,9 +5,11 @@
                 <div class="ibox-title">
                     <h5>查询条件</h5>
                     <div class="ibox-tools" style="top:10px;">
-                        <!-- <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
-                                 v-on:click="_moreCondition()">更多
-                         </button>-->
+                        <div class="ibox-tools" style="top:10px;">
+                            <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
+                                    v-on:click="_moreCondition()">{{listOwnerInfo.moreCondition == true?'隐藏':'更多'}}
+                            </button>
+                        </div>
                     </div>
                 </div>
                 <div class="ibox-content">
@@ -38,6 +40,17 @@
                         </div>
 
                     </div>
+                    <div class="row" v-if="listOwnerInfo.moreCondition == true">
+
+                        <div class="col-sm-4">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入业主身份证号"
+                                       v-model="listOwnerInfo.conditions.idCard" class=" form-control">
+                            </div>
+                        </div>
+
+
+                    </div>
 
 
                 </div>
@@ -65,6 +78,7 @@
                             <th data-hide="phone">名称</th>
                             <th data-hide="phone">性别</th>
                             <th data-hide="phone">年龄</th>
+                            <th data-hide="phone">身份证</th>
                             <th data-hide="phone">联系方式</th>
                             <th data-hide="phone">创建员工</th>
                             <th class="text-right">操作</th>
@@ -86,6 +100,9 @@
                             <td>
                                 {{owner.age}}
                             </td>
+                            <td>
+                                {{owner.idCard}}
+                            </td>
                             <td>
                                 {{owner.link}}
                             </td>

+ 10 - 1
WebService/src/main/resources/components/ownerPackage/list-owner/listOwner.js

@@ -7,13 +7,15 @@
                 owners:[],
                 total:0,
                 records:1,
+                moreCondition: false,
                 _currentOwnerId:'',
                 _eventName:'',
                 conditions:{
                     ownerTypeCd:'1001',
                     ownerId:'',
                     name:'',
-                    link:''
+                    link:'',
+                    idCard:''
                 }
             }
         },
@@ -195,6 +197,13 @@
                                 console.log('请求失败处理');
                              }
                            );
+            },
+             _moreCondition: function () {
+                if (vc.component.listOwnerInfo.moreCondition) {
+                    vc.component.listOwnerInfo.moreCondition = false;
+                } else {
+                    vc.component.listOwnerInfo.moreCondition = true;
+                }
             }
         }
     })

+ 7 - 1
WebService/src/main/resources/components/ownerPackage/member-select-owner/memberSelectOwner.html

@@ -44,6 +44,12 @@
                 </div>
 
                 <div class="row">
+                    <div class="col-sm-3">
+                        <div class="form-group">
+                            <label class="col-form-label">身份证:</label>
+                            <label class="">{{ownerInfo.idCard}}</label>
+                        </div>
+                    </div>
                     <div class="col-sm-3">
                         <div class="form-group">
                             <label class="col-form-label">联系方式:</label>
@@ -56,7 +62,7 @@
                             <label class="">{{ownerInfo.userName}}</label>
                         </div>
                     </div>
-                    <div class="col-sm-6">
+                    <div class="col-sm-3">
                         <div class="form-group">
                             <label class="col-form-label">备注:</label>
                             <label class="">{{ownerInfo.remark}}</label>

+ 1 - 0
WebService/src/main/resources/components/ownerPackage/member-select-owner/memberSelectOwner.js

@@ -12,6 +12,7 @@
                 sex:"",
                 userName:"",
                 remark:"",
+                idCard:"",
                 link:"",
                 sexName:''
             }

+ 4 - 4
WebService/src/main/resources/components/ownerPackage/search-owner/searchOwner.html

@@ -41,9 +41,9 @@
                                         <th>名称</th>
                                         <th>性别</th>
                                         <th>年龄</th>
+                                        <th>身份证</th>
                                         <th>联系方式</th>
                                         <th>创建员工</th>
-                                        <th>备注</th>
                                         <th>操作</th>
                                     </tr>
                                     </thead>
@@ -63,13 +63,13 @@
                                             {{owner.age}}
                                         </td>
                                         <td>
-                                            {{owner.link}}
+                                            {{owner.idCard}}
                                         </td>
                                         <td>
-                                            {{owner.userName}}
+                                            {{owner.link}}
                                         </td>
                                         <td>
-                                            {{owner.remark}}
+                                            {{owner.userName}}
                                         </td>
                                         <td>
                                             <button class="btn btn-primary btn-xs" v-on:click="chooseOwner(owner)">选择

+ 53 - 41
WebService/src/main/resources/components/ownerPackage/viewOwnerInfo/viewOwnerInfo.html

@@ -13,53 +13,65 @@
             <div class="ibox-content">
                 <div class="row">
                     <div class="col-sm-3">
-                        <div class="form-group">
-                            <label class="col-form-label">业主ID:</label>
-                            <label class="">{{viewOwnerInfo.ownerId}}</label>
-                        </div>
-                    </div>
-                    <div class="col-sm-3">
-                        <div class="form-group">
-                            <label class="col-form-label">名称:</label>
-                            <label class="">{{viewOwnerInfo.name}}</label>
-                        </div>
-                    </div>
-                    <div class="col-sm-3">
-                        <div class="form-group">
-                            <label class="col-form-label">性别:</label>
-                            <label class="">{{viewOwnerInfo.sex == 0 ? '男' : '女'}}</label>
-                        </div>
+                        <image width="120px" height="140px" src="viewOwnerInfo.ownerPhoto"/>
                     </div>
-                    <div class="col-sm-3">
-                        <div class="form-group">
-                            <label class="col-form-label">年龄:</label>
-                            <label class="">{{viewOwnerInfo.age}}</label>
+                    <div class="col-sm-9">
+                        <div class="row">
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">业主ID:</label>
+                                    <label class="">{{viewOwnerInfo.ownerId}}</label>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">名称:</label>
+                                    <label class="">{{viewOwnerInfo.name}}</label>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">性别:</label>
+                                    <label class="">{{viewOwnerInfo.sex == 0 ? '男' : '女'}}</label>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">年龄:</label>
+                                    <label class="">{{viewOwnerInfo.age}}</label>
+                                </div>
+                            </div>
                         </div>
-                    </div>
-
-                </div>
 
-                <div class="row">
-                    <div class="col-sm-3">
-                        <div class="form-group">
-                            <label class="col-form-label">联系方式:</label>
-                            <label class="">{{viewOwnerInfo.link}}</label>
-                        </div>
-                    </div>
-                    <div class="col-sm-3">
-                        <div class="form-group">
-                            <label class="col-form-label">创建员工:</label>
-                            <label class="">{{viewOwnerInfo.userName}}</label>
-                        </div>
-                    </div>
-                    <div class="col-sm-6">
-                        <div class="form-group">
-                            <label class="col-form-label">备注:</label>
-                            <label class="">{{viewOwnerInfo.remark}}</label>
+                        <div class="row">
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">身份证:</label>
+                                    <label class="">{{viewOwnerInfo.idCard}}</label>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">联系方式:</label>
+                                    <label class="">{{viewOwnerInfo.link}}</label>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">创建员工:</label>
+                                    <label class="">{{viewOwnerInfo.userName}}</label>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="form-group">
+                                    <label class="col-form-label">备注:</label>
+                                    <label class="">{{viewOwnerInfo.remark}}</label>
+                                </div>
+                            </div>
                         </div>
                     </div>
-
                 </div>
+
             </div>
         </div>
     </div>

+ 8 - 0
WebService/src/main/resources/components/ownerPackage/viewOwnerInfo/viewOwnerInfo.js

@@ -18,7 +18,9 @@
                 sex:"",
                 userName:"",
                 remark:"",
+                idCard:"",
                 link:"",
+                ownerPhoto:"/img/noPhoto.gif",
                 showCallBackButton:$props.showCallBackButton
             }
         },
@@ -64,6 +66,8 @@
                              function(json,res){
                                 var listOwnerData =JSON.parse(json);
                                 vc.copyObject(listOwnerData.owners[0],vc.component.viewOwnerInfo);
+                                //加载图片
+                                vc.component._loadOwnerPhoto();
                              },function(errInfo,error){
                                 console.log('请求失败处理');
                              }
@@ -72,6 +76,10 @@
             },
             _callBackListOwner:function(_ownerId){
                 vc.jumpToPage("/flow/ownerFlow?ownerId="+_ownerId);
+            },
+            _loadOwnerPhoto:function(){
+                vc.component.viewOwnerInfo.ownerPhoto = _fileUrl+"?objId="+
+                               vc.component.viewOwnerInfo.ownerId +"&communityId="+vc.getCurrentCommunity().communityId+"&fileTypeCd=10000&time="+new Date();
             }
 
         }

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/OwnerDto.java

@@ -30,6 +30,7 @@ public class OwnerDto extends PageDto implements Serializable {
     private String roomNum;
     private String psId;
     private String num;
+    private String idCard;
 
     private String bId;
 
@@ -194,4 +195,12 @@ public class OwnerDto extends PageDto implements Serializable {
     public void setbId(String bId) {
         this.bId = bId;
     }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
 }

+ 10 - 0
java110-bean/src/main/java/com/java110/vo/api/ApiOwnerDataVo.java

@@ -35,6 +35,8 @@ public class ApiOwnerDataVo extends Vo {
 
     private String ownerTypeCd;
 
+    private String idCard;
+
     public String getOwnerId() {
         return ownerId;
     }
@@ -114,4 +116,12 @@ public class ApiOwnerDataVo extends Vo {
     public void setOwnerTypeCd(String ownerTypeCd) {
         this.ownerTypeCd = ownerTypeCd;
     }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
 }

+ 41 - 9
java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml

@@ -7,9 +7,9 @@
     <!-- 保存业主信息 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessOwnerInfo" parameterType="Map">
         insert into business_building_owner(
-        operate,sex,name,link,remark,owner_id,b_id,user_id,age,member_id,owner_type_cd,community_id
+        operate,sex,name,link,remark,owner_id,b_id,user_id,age,member_id,owner_type_cd,community_id,id_card
         ) values (
-        #{operate},#{sex},#{name},#{link},#{remark},#{ownerId},#{bId},#{userId},#{age},#{memberId},#{ownerTypeCd},#{communityId}
+        #{operate},#{sex},#{name},#{link},#{remark},#{ownerId},#{bId},#{userId},#{age},#{memberId},#{ownerTypeCd},#{communityId},#{idCard}
         )
     </insert>
 
@@ -17,7 +17,9 @@
     <!-- 查询业主信息(Business) add by wuxw 2018-07-03 -->
     <select id="getBusinessOwnerInfo" parameterType="Map" resultType="Map">
         select t.operate,t.sex,t.name,t.link,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id bId,
-        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd,t.community_id,t.community_id communityId
+        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,
+        t.owner_type_cd ownerTypeCd,t.community_id,t.community_id communityId,
+        t.id_card, t.id_card idCard
         from business_building_owner t
         where 1 =1
         <if test="operate !=null and operate != ''">
@@ -41,6 +43,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card = #{idCard}
+        </if>
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -63,8 +68,9 @@
     <!-- 保存业主信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveOwnerInfoInstance" parameterType="Map">
         insert into building_owner(
-        sex,name,link,status_cd,remark,owner_id,b_id,user_id,age,member_id,owner_type_cd,community_id
-        ) select t.sex,t.name,t.link,'0',t.remark,t.owner_id,t.b_id,t.user_id,t.age,t.member_id,t.owner_type_cd,t.community_id communityId
+        sex,name,link,status_cd,remark,owner_id,b_id,user_id,age,member_id,owner_type_cd,community_id,id_card
+        ) select t.sex,t.name,t.link,'0',t.remark,t.owner_id,t.b_id,t.user_id,t.age,t.member_id,t.owner_type_cd,
+        t.community_id communityId,t.id_card
         from business_building_owner t where 1=1
         and t.operate= 'ADD'
         <if test="sex !=null">
@@ -85,6 +91,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card = #{idCard}
+        </if>
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -108,7 +117,9 @@
     <select id="getOwnerInfo" parameterType="Map" resultType="Map">
         select t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,
         t.owner_id,t.owner_id ownerId,t.b_id,t.b_id bId,
-        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd,t.create_time createTime,t.community_id,t.community_id communityId
+        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,
+        t.owner_type_cd ownerTypeCd,t.create_time createTime,t.community_id,
+        t.community_id communityId,t.id_card, t.id_card idCard
         from building_owner t
         where 1 =1
         <if test="sex !=null">
@@ -132,6 +143,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card = #{idCard}
+        </if>
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -185,6 +199,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card = #{idCard}
+        </if>
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -237,6 +254,9 @@
         <if test="age !=null and age != ''">
             , t.age= #{age}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            , t.id_card = #{idCard}
+        </if>
         where 1=1
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
@@ -276,6 +296,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card = #{idCard}
+        </if>
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -325,6 +348,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card = #{idCard}
+        </if>
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -349,7 +375,9 @@
     <select id="getOwnerInfoByCondition" parameterType="Map" resultType="Map">
         select t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id
         bId,
-        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd,t.community_id,t.community_id communityId
+        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,
+        t.owner_type_cd,t.owner_type_cd ownerTypeCd,t.community_id,
+        t.community_id communityId,t.id_card, t.id_card idCard
         FROM building_owner t , s_community_member cm
         WHERE t.`member_id` = cm.`member_id`
         AND cm.`community_id` = #{communityId}
@@ -376,6 +404,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card = #{idCard}
+        </if>
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -425,7 +456,7 @@
         SELECT t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id
         bId,
         t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd,
-        r.`room_id` roomId,r.`room_num` roomNum,t.community_id,t.community_id communityId
+        r.`room_id` roomId,r.`room_num` roomNum,t.community_id,t.community_id communityId,t.id_card, t.id_card idCard
         FROM building_room r,building_owner_room_rel orr,building_owner t
         WHERE r.`room_id` = orr.`room_id`
         AND orr.`owner_id` = t.`owner_id`
@@ -451,7 +482,8 @@
 
         select ps.num,ps.ps_id psId,t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id
         ownerId,t.b_id,t.b_id bId,
-        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd
+        t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,
+        t.owner_type_cd,t.owner_type_cd ownerTypeCd,t.id_card, t.id_card idCard
         from p_parking_space ps , owner_car oc,building_owner t
         where ps.ps_id = oc.ps_id
         and oc.owner_id = t.owner_id

BIN
java110-front/src/main/resources/static/img/noPhoto.gif


+ 71 - 0
java110-front/src/main/resources/static/js/vc-validate.js

@@ -115,6 +115,73 @@ vc 校验 工具类 -method
         money:function(text){
             var regMoney = /^\d+\.?\d{0,2}$/;
             return regMoney.test(text);
+        },
+        idCard:function(num){
+            num = num.toUpperCase();
+            //身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X。
+            if (!(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(num))) {
+                return false;
+            }
+            //校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
+            //下面分别分析出生日期和校验位
+            var len, re;
+            len = num.length;
+            if (len == 15) {
+                re = new RegExp(/^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/);
+                var arrSplit = num.match(re);
+
+                //检查生日日期是否正确
+                var dtmBirth = new Date('19' + arrSplit[2] + '/' + arrSplit[3] + '/' + arrSplit[4]);
+                var bGoodDay;
+                bGoodDay = (dtmBirth.getYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
+                if (!bGoodDay) {
+                    return false;
+                }
+                else {
+                    //将15位身份证转成18位
+                    //校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
+                    var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
+                    var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
+                    var nTemp = 0, i;
+                    num = num.substr(0, 6) + '19' + num.substr(6, num.length - 6);
+                    for (i = 0; i < 17; i++) {
+                        nTemp += num.substr(i, 1) * arrInt[i];
+                    }
+                    num += arrCh[nTemp % 11];
+                    return true;
+                }
+            }
+            if (len == 18) {
+                re = new RegExp(/^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/);
+                var arrSplit = num.match(re);
+
+                //检查生日日期是否正确
+                var dtmBirth = new Date(arrSplit[2] + "/" + arrSplit[3] + "/" + arrSplit[4]);
+                var bGoodDay;
+                bGoodDay = (dtmBirth.getFullYear() == Number(arrSplit[2])) && ((dtmBirth.getMonth() + 1) == Number(arrSplit[3])) && (dtmBirth.getDate() == Number(arrSplit[4]));
+                if (!bGoodDay) {
+                   // alert(dtmBirth.getYear());
+                  //  alert(arrSplit[2]);
+                    return false;
+                }
+                else {
+                    //检验18位身份证的校验码是否正确。
+                    //校验位按照ISO 7064:1983.MOD 11-2的规定生成,X可以认为是数字10。
+                    var valnum;
+                    var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2);
+                    var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
+                    var nTemp = 0, i;
+                    for (i = 0; i < 17; i++) {
+                        nTemp += num.substr(i, 1) * arrInt[i];
+                    }
+                    valnum = arrCh[nTemp % 11];
+                    if (valnum != num.substr(17, 1)) {
+                        return false;
+                    }
+                    return true;
+                }
+            }
+            return false;
         }
 
     };
@@ -219,6 +286,10 @@ vc 校验 工具类 -method
                     if(configObj.limit == 'money'){
                         validate.setState(validate.money(tmpDataObj),configObj.errInfo);
                     }
+
+                    if(configObj.limit == 'idCard'){
+                        validate.setState(validate.idCard(tmpDataObj),configObj.errInfo);
+                    }
                 });
 
             }