Просмотр исходного кода

增加物业基本信息,证件信息,照片信息,物业用户信息 开发测试完成

wuxw лет назад: 7
Родитель
Сommit
54f9805c52

+ 35 - 0
PropertyService/doc/savePropertyCerdentials.json

@@ -0,0 +1,35 @@
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "serviceCode": "save.property.cerdentials",
+    "serviceName": "保存商户信息",
+    "remark": "备注",
+    "datas": {
+      "businessPropertyCerdentials":[{
+        "propertyCerdentialsId":"-1",
+        "propertyId":"9020181218000001",
+        "credentialsCd":"1",
+        "value":"632126XXXXXXXX2011",
+        "validityPeriod":"有效期,长期有效请写3000/01/01",
+        "positivePhoto":"正面照片地址,1234567.jpg",
+        "negativePhoto":"反面照片地址,没有不填写"
+      }]
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}

+ 9 - 15
PropertyService/doc/savePropertyInfo.json

@@ -12,36 +12,30 @@
       "value": "具体值"
     }]
   },
-  "business": [{
-    "serviceCode": "save.community.info",
-    "serviceName": "保存小区信息",
+  "business": {
+    "serviceCode": "save.property.info",
+    "serviceName": "保存物业信息",
     "remark": "备注",
     "datas": {
-      "businessCommunity": {
-        "communityId": "-1",
+      "businessProperty": {
+        "propertyId": "-1",
         "name": "方博家园",
         "address": "青海省西宁市城中区129号",
-        "cityCode": "100010",
+        "tel": "17797173942",
         "nearbyLandmarks": "王府井旁30米",
         "mapX": "101.801909",
         "mapY": "36.597263"
       },
-      "businessCommunityAttr": [{
-        "communityId": "-1",
+      "businessPropertyAttr": [{
+        "propertyId": "-1",
         "attrId":"-1",
         "specCd":"1001",
         "value":"01"
-      }],
-      "businessCommunityPhoto":[{
-        "communityPhotoId":"-1",
-        "communityId":"-1",
-        "communityPhotoTypeCd":"T",
-        "photo":"12345678.jpg"
       }]
     },
     "attrs": [{
       "specCd": "配置的字段ID",
       "value": "具体值"
     }]
-  }]
+  }
 }

+ 32 - 0
PropertyService/doc/savePropertyPhoto.json

@@ -0,0 +1,32 @@
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "serviceCode": "save.property.photo",
+    "serviceName": "保存小区信息",
+    "remark": "备注",
+    "datas": {
+      "businessPropertyPhoto":[{
+        "propertyPhotoId":"-1",
+        "propertyId":"123213",
+        "propertyPhotoTypeCd":"T",
+        "photo":"12345678.jpg"
+      }]
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}

+ 32 - 0
PropertyService/doc/savePropertyUser.json

@@ -0,0 +1,32 @@
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "serviceCode": "save.property.user",
+    "serviceName": "保存商户信息",
+    "remark": "备注",
+    "datas": {
+      "businessPropertyUser":[{
+        "propertyUserId":"-1",
+        "propertyId":"9020181218000001",
+        "relCd":"600311000001",
+        "userId":"123"
+      }]
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}

+ 34 - 33
PropertyService/src/main/java/com/java110/property/dao/IPropertyServiceDao.java

@@ -44,6 +44,14 @@ public interface IPropertyServiceDao {
      */
     public void saveBusinessPropertyCerdentials(Map businessPropertyCerdentials) throws DAOException;
 
+
+    /**
+     * 保存物业用户信息
+     * @param info
+     * @throws DAOException
+     */
+    public void saveBusinessPropertyUser(Map info) throws DAOException;
+
     /**
      * 查询物业信息(business过程)
      * 根据bId 查询物业信息
@@ -80,6 +88,13 @@ public interface IPropertyServiceDao {
      */
     public List<Map> getBusinessPropertyCerdentials(Map info) throws DAOException;
 
+    /**
+     * 查询物业用户信息
+     * @param info bId 信息
+     * @return 物业照片
+     * @throws DAOException
+     */
+    public List<Map> getBusinessPropertyUser(Map info) throws DAOException;
     /**
      * 保存 物业信息 Business数据到 Instance中
      * @param info
@@ -111,6 +126,14 @@ public interface IPropertyServiceDao {
     public void savePropertyCerdentialsInstance(Map info) throws DAOException;
 
 
+    /**
+     * 保存 物业用户信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException
+     */
+    public void savePropertyUserInstance(Map info) throws DAOException;
+
+
 
     /**
      * 查询物业信息(instance过程)
@@ -147,6 +170,14 @@ public interface IPropertyServiceDao {
      */
     public List<Map> getPropertyCerdentials(Map info) throws DAOException;
 
+    /**
+     * 查询物业用户信息(instance 过程)
+     * @param info bId 信息
+     * @return 物业照片
+     * @throws DAOException
+     */
+    public List<Map> getPropertyUser(Map info) throws DAOException;
+
     /**
      * 修改物业信息
      * @param info 修改信息
@@ -179,42 +210,12 @@ public interface IPropertyServiceDao {
 
 
     /**
-     * 物业成员加入信息
-     * @param businessMemberProperty 物业成员信息 封装
-     * @throws DAOException 操作数据库异常
-     */
-    public void saveBusinessMemberProperty(Map businessMemberProperty) throws DAOException;
-
-    /**
-     * 成员加入 保存信息至instance
-     * @param info
-     * @throws DAOException
-     */
-    public void saveMemberPropertyInstance(Map info) throws DAOException;
-
-    /**
-     * 查询物业成员加入信息(business过程)
-     * 根据bId 查询物业信息
-     * @param info bId 信息
-     * @return 物业信息
+     * 修改物业用户信息
+     * @param info 修改信息
      * @throws DAOException
      */
-    public Map getBusinessMemberProperty(Map info) throws DAOException;
+    public void updatePropertyUserInstance(Map info) throws DAOException;
 
-    /**
-     * 查询物业成员加入信息(instance过程)
-     * 根据bId 查询物业信息
-     * @param info bId 信息
-     * @return 物业信息
-     * @throws DAOException
-     */
-    public Map getMemberProperty(Map info) throws DAOException;
 
-    /**
-     * 修改物业成员加入信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateMemberPropertyInstance(Map info) throws DAOException;
 
 }

+ 69 - 77
PropertyService/src/main/java/com/java110/property/dao/impl/PropertyServiceDaoImpl.java

@@ -92,6 +92,22 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         }
     }
 
+    /**
+     * 保存物业用户信息
+     * @param info
+     * @throws DAOException
+     */
+    public void saveBusinessPropertyUser(Map info) throws DAOException{
+        info.put("month", DateUtil.getCurrentMonth());
+        logger.debug("保存物业用户信息入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("propertyServiceDaoImpl.saveBusinessPropertyUser",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存物业用户信息数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
     /**
      * 查询物业信息
      * @param info bId 信息
@@ -159,6 +175,22 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         return businessPropertyCerdentialses;
     }
 
+    /**
+     * 查询物业用户信息
+     * @param info bId 信息
+     * @return 物业照片
+     * @throws DAOException
+     */
+    public List<Map> getBusinessPropertyUser(Map info) throws DAOException{
+        logger.debug("查询物业用户信息 入参 info : {}",info);
+
+        List<Map> businessPropertyUsers = sqlSessionTemplate.selectList("propertyServiceDaoImpl.getBusinessPropertyUser",info);
+
+        return businessPropertyUsers;
+    }
+
+
+
     /**
      * 保存物业信息 到 instance
      * @param info   bId 信息
@@ -208,6 +240,23 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         }
     }
 
+    /**
+     * 保存 物业用户信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException
+     */
+    public void savePropertyUserInstance(Map info) throws DAOException{
+        logger.debug("保存物业用户信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("propertyServiceDaoImpl.savePropertyUserInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存物业用户信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+
     /**
      * 查询物业信息(instance)
      * @param info bId 信息
@@ -274,6 +323,20 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         return propertyCerdentialses;
     }
 
+    /**
+     * 查询物业用户信息(instance 过程)
+     * @param info bId 信息
+     * @return 物业照片
+     * @throws DAOException
+     */
+    public List<Map> getPropertyUser(Map info) throws DAOException{
+        logger.debug("查询物业用户信息 入参 info : {}",info);
+
+        List<Map> propertyUsers = sqlSessionTemplate.selectList("propertyServiceDaoImpl.getPropertyUser",info);
+
+        return propertyUsers;
+    }
+
     /**
      * 修改物业信息
      * @param info 修改信息
@@ -339,89 +402,18 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
     }
 
     /**
-     * 物业成员加入信息
-     * @param businessMemberProperty 物业成员信息 封装
-     * @throws DAOException 操作数据库异常
-     */
-    public void saveBusinessMemberProperty(Map businessMemberProperty) throws DAOException{
-        logger.debug("物业成员加入 入参 businessMemberProperty : {}",businessMemberProperty);
-
-        int saveFlag = sqlSessionTemplate.insert("propertyServiceDaoImpl.saveBusinessMemberProperty",businessMemberProperty);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"物业成员加入失败:"+ JSONObject.toJSONString(businessMemberProperty));
-        }
-    }
-
-    /**
-     * 成员加入 保存信息至instance
-     * @param info
-     * @throws DAOException
-     */
-    @Override
-    public void saveMemberPropertyInstance(Map info) throws DAOException {
-        logger.debug("物业成员加入Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("propertyServiceDaoImpl.saveMemberPropertyInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存物业照片信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 查询物业成员加入信息(business过程)
-     * 根据bId 查询物业信息
-     * @param info bId 信息
-     * @return 物业信息
-     * @throws DAOException
-     */
-    public Map getBusinessMemberProperty(Map info) throws DAOException{
-        logger.debug("查询物业成员加入信息 入参 info : {}",info);
-
-        List<Map> businessMemberPropertys = sqlSessionTemplate.selectList("propertyServiceDaoImpl.getBusinessMemberProperty",info);
-        if(businessMemberPropertys == null || businessMemberPropertys.size() == 0){
-            return null;
-        }
-        if(businessMemberPropertys.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:businessMemberProperty,"+ JSONObject.toJSONString(info));
-        }
-
-        return businessMemberPropertys.get(0);
-    }
-
-    /**
-     * 查询物业成员加入信息(instance过程)
-     * 根据bId 查询物业信息
-     * @param info bId 信息
-     * @return 物业信息
-     * @throws DAOException
-     */
-    public Map getMemberProperty(Map info) throws DAOException{
-        logger.debug("查询物业成员加入信息 入参 info : {}",info);
-
-        List<Map> memberPropertys = sqlSessionTemplate.selectList("propertyServiceDaoImpl.getMemberProperty",info);
-        if(memberPropertys == null || memberPropertys.size() == 0){
-            return null;
-        }
-        if(memberPropertys.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:getMemberProperty,"+ JSONObject.toJSONString(info));
-        }
-
-        return memberPropertys.get(0);
-    }
-    /**
-     * 修改物业成员加入信息
+     * 修改物业用户信息
      * @param info 修改信息
      * @throws DAOException
      */
-    public void updateMemberPropertyInstance(Map info) throws DAOException{
-        logger.debug("修改物业成员加入信息Instance 入参 info : {}",info);
+    public void updatePropertyUserInstance(Map info) throws DAOException{
+        logger.debug("修改物业用户信息Instance 入参 info : {}",info);
 
-        int saveFlag = sqlSessionTemplate.update("propertyServiceDaoImpl.updateMemberPropertyInstance",info);
+        int saveFlag = sqlSessionTemplate.update("propertyServiceDaoImpl.updatePropertyUserInstance",info);
 
         if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改物业成员加入信息Instance数据失败:"+ JSONObject.toJSONString(info));
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改物业用户信息Instance数据失败:"+ JSONObject.toJSONString(info));
         }
     }
+
 }

+ 1 - 20
PropertyService/src/main/java/com/java110/property/listener/AbstractPropertyBusinessServiceDataFlowListener.java

@@ -196,24 +196,5 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
     }
 
 
-    /**
-     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
-     * @param businessMemberProperty 物业信息
-     */
-    protected void autoSaveDelBusinessMemberProperty(Business business, JSONObject businessMemberProperty){
-//自动插入DEL
-        Map info = new HashMap();
-        info.put("memberPropertyId",businessMemberProperty.getString("memberPropertyId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map currentMemberProperty = getPropertyServiceDaoImpl().getMemberProperty(info);
-        if(currentMemberProperty == null || currentMemberProperty.isEmpty()){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-        currentMemberProperty.put("bId",business.getbId());
-        currentMemberProperty.put("propertyId",currentMemberProperty.get("property_id"));
-        currentMemberProperty.put("memberPropertyId",currentMemberProperty.get("member_property_id"));
-        currentMemberProperty.put("memberId",currentMemberProperty.get("member_id"));
-        currentMemberProperty.put("operate",StatusConstant.OPERATE_DEL);
-        getPropertyServiceDaoImpl().saveBusinessPropertyInfo(currentMemberProperty);
-    }
+
 }

+ 6 - 165
PropertyService/src/main/java/com/java110/property/listener/SavePropertyCerdentialsListener.java

@@ -58,27 +58,11 @@ public class SavePropertyCerdentialsListener extends AbstractPropertyBusinessSer
         JSONObject data = business.getDatas();
         Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
 
-        //处理 businessProperty 节点
-        if(data.containsKey("businessProperty")){
-            JSONObject businessProperty = data.getJSONObject("businessProperty");
-            doBusinessProperty(business,businessProperty);
-            dataFlowContext.addParamOut("propertyId",businessProperty.getString("propertyId"));
-        }
-
-        if(data.containsKey("businessPropertyAttr")){
-            JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
-            doSaveBusinessPropertyAttrs(business,businessPropertyAttrs);
-        }
-
-        if(data.containsKey("businessPropertyPhoto")){
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            doBusinessPropertyPhoto(business,businessPropertyPhotos);
-        }
-
-        if(data.containsKey("businessPropertyCerdentials")){
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            doBusinessPropertyCerdentials(business,businessPropertyCerdentialses);
+        if(!data.containsKey("businessPropertyCerdentials")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"没有businessPropertyCerdentials节点");
         }
+        JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
+        doBusinessPropertyCerdentials(business,businessPropertyCerdentialses);
     }
 
     /**
@@ -94,22 +78,6 @@ public class SavePropertyCerdentialsListener extends AbstractPropertyBusinessSer
         info.put("bId",business.getbId());
         info.put("operate",StatusConstant.OPERATE_ADD);
 
-        //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            propertyServiceDaoImpl.savePropertyInfoInstance(info);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
-        }
-        //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            propertyServiceDaoImpl.savePropertyAttrsInstance(info);
-        }
-        //物业照片
-        List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
-        if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
-            propertyServiceDaoImpl.savePropertyPhotoInstance(info);
-        }
         //物业证件
         List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
         if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
@@ -132,26 +100,6 @@ public class SavePropertyCerdentialsListener extends AbstractPropertyBusinessSer
         Map paramIn = new HashMap();
         paramIn.put("bId",bId);
         paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
-        if(propertyInfo != null && !propertyInfo.isEmpty()){
-            paramIn.put("propertyId",propertyInfo.get("property_id").toString());
-            propertyServiceDaoImpl.updatePropertyInfoInstance(paramIn);
-            dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
-        }
-
-        //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
-        if(propertyAttrs != null && propertyAttrs.size()>0){
-            propertyServiceDaoImpl.updatePropertyAttrInstance(paramIn);
-        }
-
-        //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            propertyServiceDaoImpl.updatePropertyPhotoInstance(paramIn);
-        }
-
         //物业属性
         List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
         if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
@@ -159,76 +107,6 @@ public class SavePropertyCerdentialsListener extends AbstractPropertyBusinessSer
         }
     }
 
-    /**
-     * 保存物业照片
-     * @param business 业务对象
-     * @param businessPropertyPhotos 物业照片
-     */
-    private void doBusinessPropertyPhoto(Business business, JSONArray businessPropertyPhotos) {
-
-        for(int businessPropertyPhotoIndex = 0 ;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-            JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-            Assert.jsonObjectHaveKey(businessPropertyPhoto, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
-
-            if (businessPropertyPhoto.getString("propertyPhotoId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyPhotoId();
-                businessPropertyPhoto.put("propertyPhotoId", propertyPhotoId);
-            }
-            businessPropertyPhoto.put("bId", business.getbId());
-            businessPropertyPhoto.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyPhoto(businessPropertyPhoto);
-        }
-    }
-
-    /**
-     * 处理 businessProperty 节点
-     * @param business 总的数据节点
-     * @param businessProperty 物业节点
-     */
-    private void doBusinessProperty(Business business,JSONObject businessProperty){
-
-        Assert.jsonObjectHaveKey(businessProperty,"propertyId","businessProperty 节点下没有包含 propertyId 节点");
-
-        if(businessProperty.getString("propertyId").startsWith("-")){
-            //刷新缓存
-            flushPropertyId(business.getDatas());
-        }
-
-        businessProperty.put("bId",business.getbId());
-        businessProperty.put("operate", StatusConstant.OPERATE_ADD);
-        //保存物业信息
-        propertyServiceDaoImpl.saveBusinessPropertyInfo(businessProperty);
-
-    }
-
-
-
-    /**
-     * 保存物业属性信息
-     * @param business 当前业务
-     * @param businessPropertyAttrs 物业属性
-     */
-    private void doSaveBusinessPropertyAttrs(Business business,JSONArray businessPropertyAttrs){
-        JSONObject data = business.getDatas();
-        JSONObject businessProperty = data.getJSONObject("businessProperty");
-        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyAttrs.size();propertyAttrIndex ++){
-            JSONObject propertyAttr = businessPropertyAttrs.getJSONObject(propertyAttrIndex);
-            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyAttr 节点下没有包含 attrId 节点");
-
-            if(propertyAttr.getString("attrId").startsWith("-")){
-                String attrId = GenerateCodeFactory.getAttrId();
-                propertyAttr.put("attrId",attrId);
-            }
-
-            propertyAttr.put("bId",business.getbId());
-            propertyAttr.put("propertyId",businessProperty.getString("propertyId"));
-            propertyAttr.put("operate", StatusConstant.OPERATE_ADD);
-
-            propertyServiceDaoImpl.saveBusinessPropertyAttr(propertyAttr);
-        }
-    }
-
 
     /**
      * 保存 物业证件 信息
@@ -241,8 +119,8 @@ public class SavePropertyCerdentialsListener extends AbstractPropertyBusinessSer
             Assert.jsonObjectHaveKey(businessPropertyCerdentials, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
 
             if (businessPropertyCerdentials.getString("propertyCerdentialsId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyCerdentialsId();
-                businessPropertyCerdentials.put("propertyCerdentialsId", propertyPhotoId);
+                String propertyPropertyId = GenerateCodeFactory.getPropertyCerdentialsId();
+                businessPropertyCerdentials.put("propertyCerdentialsId", propertyPropertyId);
             }
             Date validityPeriod = null;
             try {
@@ -263,43 +141,6 @@ public class SavePropertyCerdentialsListener extends AbstractPropertyBusinessSer
     }
 
 
-
-    /**
-     * 刷新 物业ID
-     * @param data
-     */
-    private void flushPropertyId(JSONObject data) {
-
-        String propertyId = GenerateCodeFactory.getPropertyId();
-        JSONObject businessProperty = data.getJSONObject("businessProperty");
-        businessProperty.put("propertyId",propertyId);
-        //刷物业属性
-        if(data.containsKey("businessPropertyAttr")) {
-            JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
-            for(int businessPropertyAttrIndex = 0;businessPropertyAttrIndex < businessPropertyAttrs.size();businessPropertyAttrIndex++) {
-                JSONObject businessPropertyAttr = businessPropertyAttrs.getJSONObject(businessPropertyAttrIndex);
-                businessPropertyAttr.put("propertyId", propertyId);
-            }
-        }
-        //刷 是物业照片 的 propertyId
-        if(data.containsKey("businessPropertyPhoto")) {
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            for(int businessPropertyPhotoIndex = 0;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-                JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-                businessPropertyPhoto.put("propertyId", propertyId);
-            }
-        }
-        //刷 物业证件 的propertyId
-        if(data.containsKey("businessPropertyCerdentials")) {
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            for(int businessPropertyCerdentialsIndex = 0;businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size();businessPropertyCerdentialsIndex++) {
-                JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
-                businessPropertyCerdentials.put("propertyId", propertyId);
-            }
-        }
-    }
-
-
     public IPropertyServiceDao getPropertyServiceDaoImpl() {
         return propertyServiceDaoImpl;
     }

+ 17 - 102
PropertyService/src/main/java/com/java110/property/listener/SavePropertyInfoListener.java

@@ -26,7 +26,7 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * 保存 用户信息 侦听
+ * 保存 物业信息 侦听
  * Created by wuxw on 2018/5/18.
  */
 @Java110Listener("savePropertyInfoListener")
@@ -69,16 +69,6 @@ public class SavePropertyInfoListener extends AbstractPropertyBusinessServiceDat
             JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
             doSaveBusinessPropertyAttrs(business,businessPropertyAttrs);
         }
-
-        if(data.containsKey("businessPropertyPhoto")){
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            doBusinessPropertyPhoto(business,businessPropertyPhotos);
-        }
-
-        if(data.containsKey("businessPropertyCerdentials")){
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            doBusinessPropertyCerdentials(business,businessPropertyCerdentialses);
-        }
     }
 
     /**
@@ -105,16 +95,6 @@ public class SavePropertyInfoListener extends AbstractPropertyBusinessServiceDat
         if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
             propertyServiceDaoImpl.savePropertyAttrsInstance(info);
         }
-        //物业照片
-        List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
-        if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
-            propertyServiceDaoImpl.savePropertyPhotoInstance(info);
-        }
-        //物业证件
-        List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
-        if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.savePropertyCerdentialsInstance(info);
-        }
     }
 
     /**
@@ -145,41 +125,9 @@ public class SavePropertyInfoListener extends AbstractPropertyBusinessServiceDat
         if(propertyAttrs != null && propertyAttrs.size()>0){
             propertyServiceDaoImpl.updatePropertyAttrInstance(paramIn);
         }
-
-        //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            propertyServiceDaoImpl.updatePropertyPhotoInstance(paramIn);
-        }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.updatePropertyCerdentailsInstance(paramIn);
-        }
     }
 
-    /**
-     * 保存物业照片
-     * @param business 业务对象
-     * @param businessPropertyPhotos 物业照片
-     */
-    private void doBusinessPropertyPhoto(Business business, JSONArray businessPropertyPhotos) {
-
-        for(int businessPropertyPhotoIndex = 0 ;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-            JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-            Assert.jsonObjectHaveKey(businessPropertyPhoto, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
 
-            if (businessPropertyPhoto.getString("propertyPhotoId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyPhotoId();
-                businessPropertyPhoto.put("propertyPhotoId", propertyPhotoId);
-            }
-            businessPropertyPhoto.put("bId", business.getbId());
-            businessPropertyPhoto.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyPhoto(businessPropertyPhoto);
-        }
-    }
 
     /**
      * 处理 businessProperty 节点
@@ -230,39 +178,6 @@ public class SavePropertyInfoListener extends AbstractPropertyBusinessServiceDat
     }
 
 
-    /**
-     * 保存 物业证件 信息
-     * @param business 当前业务
-     * @param businessPropertyCerdentialses 物业证件
-     */
-    private void doBusinessPropertyCerdentials(Business business, JSONArray businessPropertyCerdentialses) {
-        for(int businessPropertyCerdentialsIndex = 0 ; businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size() ; businessPropertyCerdentialsIndex ++) {
-            JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
-            Assert.jsonObjectHaveKey(businessPropertyCerdentials, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
-
-            if (businessPropertyCerdentials.getString("propertyCerdentialsId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyCerdentialsId();
-                businessPropertyCerdentials.put("propertyCerdentialsId", propertyPhotoId);
-            }
-            Date validityPeriod = null;
-            try {
-                if(StringUtil.isNullOrNone(businessPropertyCerdentials.getString("validityPeriod"))){
-                    validityPeriod = DateUtil.getLastDate();
-                }else {
-                    validityPeriod = DateUtil.getDateFromString(businessPropertyCerdentials.getString("validityPeriod"), DateUtil.DATE_FORMATE_STRING_B);
-                }
-            } catch (ParseException e) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 validityPeriod 格式不正确,请填写 "+DateUtil.DATE_FORMATE_STRING_B +" 格式,"+businessPropertyCerdentials);
-            }
-            businessPropertyCerdentials.put("validityPeriod",validityPeriod);
-            businessPropertyCerdentials.put("bId", business.getbId());
-            businessPropertyCerdentials.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyCerdentials(businessPropertyCerdentials);
-        }
-    }
-
-
 
     /**
      * 刷新 物业ID
@@ -281,22 +196,22 @@ public class SavePropertyInfoListener extends AbstractPropertyBusinessServiceDat
                 businessPropertyAttr.put("propertyId", propertyId);
             }
         }
-        //刷 是物业照片 的 propertyId
-        if(data.containsKey("businessPropertyPhoto")) {
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            for(int businessPropertyPhotoIndex = 0;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-                JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-                businessPropertyPhoto.put("propertyId", propertyId);
-            }
-        }
-        //刷 物业证件 的propertyId
-        if(data.containsKey("businessPropertyCerdentials")) {
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            for(int businessPropertyCerdentialsIndex = 0;businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size();businessPropertyCerdentialsIndex++) {
-                JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
-                businessPropertyCerdentials.put("propertyId", propertyId);
-            }
-        }
+//        //刷 是物业照片 的 propertyId
+//        if(data.containsKey("businessPropertyPhoto")) {
+//            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
+//            for(int businessPropertyPhotoIndex = 0;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
+//                JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
+//                businessPropertyPhoto.put("propertyId", propertyId);
+//            }
+//        }
+//        //刷 物业证件 的propertyId
+//        if(data.containsKey("businessPropertyCerdentials")) {
+//            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
+//            for(int businessPropertyCerdentialsIndex = 0;businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size();businessPropertyCerdentialsIndex++) {
+//                JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
+//                businessPropertyCerdentials.put("propertyId", propertyId);
+//            }
+//        }
     }
 
 

+ 4 - 171
PropertyService/src/main/java/com/java110/property/listener/SavePropertyPhotoListener.java

@@ -58,27 +58,12 @@ public class SavePropertyPhotoListener extends AbstractPropertyBusinessServiceDa
         JSONObject data = business.getDatas();
         Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
 
-        //处理 businessProperty 节点
-        if(data.containsKey("businessProperty")){
-            JSONObject businessProperty = data.getJSONObject("businessProperty");
-            doBusinessProperty(business,businessProperty);
-            dataFlowContext.addParamOut("propertyId",businessProperty.getString("propertyId"));
+        if(!data.containsKey("businessPropertyPhoto")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"没有businessPropertyPhoto节点");
         }
 
-        if(data.containsKey("businessPropertyAttr")){
-            JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
-            doSaveBusinessPropertyAttrs(business,businessPropertyAttrs);
-        }
-
-        if(data.containsKey("businessPropertyPhoto")){
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            doBusinessPropertyPhoto(business,businessPropertyPhotos);
-        }
-
-        if(data.containsKey("businessPropertyCerdentials")){
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            doBusinessPropertyCerdentials(business,businessPropertyCerdentialses);
-        }
+        JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
+        doBusinessPropertyPhoto(business,businessPropertyPhotos);
     }
 
     /**
@@ -94,27 +79,11 @@ public class SavePropertyPhotoListener extends AbstractPropertyBusinessServiceDa
         info.put("bId",business.getbId());
         info.put("operate",StatusConstant.OPERATE_ADD);
 
-        //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            propertyServiceDaoImpl.savePropertyInfoInstance(info);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
-        }
-        //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            propertyServiceDaoImpl.savePropertyAttrsInstance(info);
-        }
         //物业照片
         List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
         if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
             propertyServiceDaoImpl.savePropertyPhotoInstance(info);
         }
-        //物业证件
-        List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
-        if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.savePropertyCerdentialsInstance(info);
-        }
     }
 
     /**
@@ -132,31 +101,12 @@ public class SavePropertyPhotoListener extends AbstractPropertyBusinessServiceDa
         Map paramIn = new HashMap();
         paramIn.put("bId",bId);
         paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
-        if(propertyInfo != null && !propertyInfo.isEmpty()){
-            paramIn.put("propertyId",propertyInfo.get("property_id").toString());
-            propertyServiceDaoImpl.updatePropertyInfoInstance(paramIn);
-            dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
-        }
-
-        //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
-        if(propertyAttrs != null && propertyAttrs.size()>0){
-            propertyServiceDaoImpl.updatePropertyAttrInstance(paramIn);
-        }
 
         //物业照片
         List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
         if(propertyPhotos != null && propertyPhotos.size()>0){
             propertyServiceDaoImpl.updatePropertyPhotoInstance(paramIn);
         }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.updatePropertyCerdentailsInstance(paramIn);
-        }
     }
 
     /**
@@ -181,123 +131,6 @@ public class SavePropertyPhotoListener extends AbstractPropertyBusinessServiceDa
         }
     }
 
-    /**
-     * 处理 businessProperty 节点
-     * @param business 总的数据节点
-     * @param businessProperty 物业节点
-     */
-    private void doBusinessProperty(Business business,JSONObject businessProperty){
-
-        Assert.jsonObjectHaveKey(businessProperty,"propertyId","businessProperty 节点下没有包含 propertyId 节点");
-
-        if(businessProperty.getString("propertyId").startsWith("-")){
-            //刷新缓存
-            flushPropertyId(business.getDatas());
-        }
-
-        businessProperty.put("bId",business.getbId());
-        businessProperty.put("operate", StatusConstant.OPERATE_ADD);
-        //保存物业信息
-        propertyServiceDaoImpl.saveBusinessPropertyInfo(businessProperty);
-
-    }
-
-
-
-    /**
-     * 保存物业属性信息
-     * @param business 当前业务
-     * @param businessPropertyAttrs 物业属性
-     */
-    private void doSaveBusinessPropertyAttrs(Business business,JSONArray businessPropertyAttrs){
-        JSONObject data = business.getDatas();
-        JSONObject businessProperty = data.getJSONObject("businessProperty");
-        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyAttrs.size();propertyAttrIndex ++){
-            JSONObject propertyAttr = businessPropertyAttrs.getJSONObject(propertyAttrIndex);
-            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyAttr 节点下没有包含 attrId 节点");
-
-            if(propertyAttr.getString("attrId").startsWith("-")){
-                String attrId = GenerateCodeFactory.getAttrId();
-                propertyAttr.put("attrId",attrId);
-            }
-
-            propertyAttr.put("bId",business.getbId());
-            propertyAttr.put("propertyId",businessProperty.getString("propertyId"));
-            propertyAttr.put("operate", StatusConstant.OPERATE_ADD);
-
-            propertyServiceDaoImpl.saveBusinessPropertyAttr(propertyAttr);
-        }
-    }
-
-
-    /**
-     * 保存 物业证件 信息
-     * @param business 当前业务
-     * @param businessPropertyCerdentialses 物业证件
-     */
-    private void doBusinessPropertyCerdentials(Business business, JSONArray businessPropertyCerdentialses) {
-        for(int businessPropertyCerdentialsIndex = 0 ; businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size() ; businessPropertyCerdentialsIndex ++) {
-            JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
-            Assert.jsonObjectHaveKey(businessPropertyCerdentials, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
-
-            if (businessPropertyCerdentials.getString("propertyCerdentialsId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyCerdentialsId();
-                businessPropertyCerdentials.put("propertyCerdentialsId", propertyPhotoId);
-            }
-            Date validityPeriod = null;
-            try {
-                if(StringUtil.isNullOrNone(businessPropertyCerdentials.getString("validityPeriod"))){
-                    validityPeriod = DateUtil.getLastDate();
-                }else {
-                    validityPeriod = DateUtil.getDateFromString(businessPropertyCerdentials.getString("validityPeriod"), DateUtil.DATE_FORMATE_STRING_B);
-                }
-            } catch (ParseException e) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 validityPeriod 格式不正确,请填写 "+DateUtil.DATE_FORMATE_STRING_B +" 格式,"+businessPropertyCerdentials);
-            }
-            businessPropertyCerdentials.put("validityPeriod",validityPeriod);
-            businessPropertyCerdentials.put("bId", business.getbId());
-            businessPropertyCerdentials.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyCerdentials(businessPropertyCerdentials);
-        }
-    }
-
-
-
-    /**
-     * 刷新 物业ID
-     * @param data
-     */
-    private void flushPropertyId(JSONObject data) {
-
-        String propertyId = GenerateCodeFactory.getPropertyId();
-        JSONObject businessProperty = data.getJSONObject("businessProperty");
-        businessProperty.put("propertyId",propertyId);
-        //刷物业属性
-        if(data.containsKey("businessPropertyAttr")) {
-            JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
-            for(int businessPropertyAttrIndex = 0;businessPropertyAttrIndex < businessPropertyAttrs.size();businessPropertyAttrIndex++) {
-                JSONObject businessPropertyAttr = businessPropertyAttrs.getJSONObject(businessPropertyAttrIndex);
-                businessPropertyAttr.put("propertyId", propertyId);
-            }
-        }
-        //刷 是物业照片 的 propertyId
-        if(data.containsKey("businessPropertyPhoto")) {
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            for(int businessPropertyPhotoIndex = 0;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-                JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-                businessPropertyPhoto.put("propertyId", propertyId);
-            }
-        }
-        //刷 物业证件 的propertyId
-        if(data.containsKey("businessPropertyCerdentials")) {
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            for(int businessPropertyCerdentialsIndex = 0;businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size();businessPropertyCerdentialsIndex++) {
-                JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
-                businessPropertyCerdentials.put("propertyId", propertyId);
-            }
-        }
-    }
 
 
     public IPropertyServiceDao getPropertyServiceDaoImpl() {

+ 26 - 92
PropertyService/src/main/java/com/java110/property/listener/SavePropertyUserListener.java

@@ -59,26 +59,13 @@ public class SavePropertyUserListener extends AbstractPropertyBusinessServiceDat
         Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
 
         //处理 businessProperty 节点
-        if(data.containsKey("businessProperty")){
-            JSONObject businessProperty = data.getJSONObject("businessProperty");
-            doBusinessProperty(business,businessProperty);
-            dataFlowContext.addParamOut("propertyId",businessProperty.getString("propertyId"));
+        if(!data.containsKey("businessPropertyUser")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"没有businessPropertyUser节点");
         }
 
-        if(data.containsKey("businessPropertyAttr")){
-            JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
-            doSaveBusinessPropertyAttrs(business,businessPropertyAttrs);
-        }
-
-        if(data.containsKey("businessPropertyPhoto")){
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            doBusinessPropertyPhoto(business,businessPropertyPhotos);
-        }
 
-        if(data.containsKey("businessPropertyCerdentials")){
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            doBusinessPropertyCerdentials(business,businessPropertyCerdentialses);
-        }
+        JSONArray businessPropertyUsers = data.getJSONArray("businessPropertyUser");
+        doBusinessPropertyUser(business,businessPropertyUsers);
     }
 
     /**
@@ -94,26 +81,10 @@ public class SavePropertyUserListener extends AbstractPropertyBusinessServiceDat
         info.put("bId",business.getbId());
         info.put("operate",StatusConstant.OPERATE_ADD);
 
-        //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            propertyServiceDaoImpl.savePropertyInfoInstance(info);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
-        }
-        //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            propertyServiceDaoImpl.savePropertyAttrsInstance(info);
-        }
-        //物业照片
-        List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
-        if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
-            propertyServiceDaoImpl.savePropertyPhotoInstance(info);
-        }
-        //物业证件
-        List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
-        if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.savePropertyCerdentialsInstance(info);
+        //物业用户
+        List<Map> businessPropertyUsers = propertyServiceDaoImpl.getBusinessPropertyUser(info);
+        if(businessPropertyUsers != null && businessPropertyUsers.size() >0){
+            propertyServiceDaoImpl.savePropertyUserInstance(info);
         }
     }
 
@@ -132,73 +103,36 @@ public class SavePropertyUserListener extends AbstractPropertyBusinessServiceDat
         Map paramIn = new HashMap();
         paramIn.put("bId",bId);
         paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
-        if(propertyInfo != null && !propertyInfo.isEmpty()){
-            paramIn.put("propertyId",propertyInfo.get("property_id").toString());
-            propertyServiceDaoImpl.updatePropertyInfoInstance(paramIn);
-            dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
-        }
-
-        //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
-        if(propertyAttrs != null && propertyAttrs.size()>0){
-            propertyServiceDaoImpl.updatePropertyAttrInstance(paramIn);
-        }
-
         //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            propertyServiceDaoImpl.updatePropertyPhotoInstance(paramIn);
-        }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.updatePropertyCerdentailsInstance(paramIn);
+        List<Map> propertyUsers = propertyServiceDaoImpl.getPropertyUser(info);
+        if(propertyUsers != null && propertyUsers.size()>0){
+            propertyServiceDaoImpl.updatePropertyUserInstance(paramIn);
         }
     }
 
-    /**
-     * 保存物业照片
-     * @param business 业务对象
-     * @param businessPropertyPhotos 物业照片
-     */
-    private void doBusinessPropertyPhoto(Business business, JSONArray businessPropertyPhotos) {
-
-        for(int businessPropertyPhotoIndex = 0 ;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-            JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-            Assert.jsonObjectHaveKey(businessPropertyPhoto, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
-
-            if (businessPropertyPhoto.getString("propertyPhotoId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyPhotoId();
-                businessPropertyPhoto.put("propertyPhotoId", propertyPhotoId);
-            }
-            businessPropertyPhoto.put("bId", business.getbId());
-            businessPropertyPhoto.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyPhoto(businessPropertyPhoto);
-        }
-    }
 
     /**
      * 处理 businessProperty 节点
      * @param business 总的数据节点
-     * @param businessProperty 物业节点
+     * @param businessPropertyUsers 物业用户节点
      */
-    private void doBusinessProperty(Business business,JSONObject businessProperty){
+    private void doBusinessPropertyUser(Business business,JSONArray businessPropertyUsers){
 
-        Assert.jsonObjectHaveKey(businessProperty,"propertyId","businessProperty 节点下没有包含 propertyId 节点");
 
-        if(businessProperty.getString("propertyId").startsWith("-")){
-            //刷新缓存
-            flushPropertyId(business.getDatas());
-        }
+        for(int businessPropertyUserIndex = 0 ;businessPropertyUserIndex < businessPropertyUsers.size();businessPropertyUserIndex++) {
+            JSONObject businessPropertyUser = businessPropertyUsers.getJSONObject(businessPropertyUserIndex);
+            Assert.jsonObjectHaveKey(businessPropertyUser,"propertyId","businessPropertyUser 节点下没有包含 propertyId 节点");
+            Assert.jsonObjectHaveKey(businessPropertyUser,"userId","businessPropertyUser 节点下没有包含 userId 节点");
 
-        businessProperty.put("bId",business.getbId());
-        businessProperty.put("operate", StatusConstant.OPERATE_ADD);
-        //保存物业信息
-        propertyServiceDaoImpl.saveBusinessPropertyInfo(businessProperty);
+            if(businessPropertyUser.getString("propertyUserId").startsWith("-")){
+                String propertyUserId = GenerateCodeFactory.getPropertyUserId();
+                businessPropertyUser.put("propertyUserId", propertyUserId);
+            }
+            businessPropertyUser.put("bId",business.getbId());
+            businessPropertyUser.put("operate", StatusConstant.OPERATE_ADD);
+            //保存物业信息
+            propertyServiceDaoImpl.saveBusinessPropertyUser(businessPropertyUser);
+        }
 
     }
 

+ 1 - 1
PropertyService/src/main/resources/application-dev.yml

@@ -18,7 +18,7 @@ eureka:
       defaultZone: http://dev.java110.com:8761/eureka/
       #defaultZone: http://localhost:8761/eureka/
 server:
-  port: 80101
+  port: 8011
   tomcat:
     uri-encoding: UTF-8
 

+ 12 - 1
java110-config/db/PropertyService/create_table.sql

@@ -121,6 +121,7 @@ CREATE TABLE business_property_user(
     property_id VARCHAR(30) NOT NULL COMMENT '物业ID',
     b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
     user_id VARCHAR(30) NOT NULL COMMENT '用户ID',
+    rel_cd varchar(30) not null comment '用户和物业关系 详情查看 property_user_rel表',
     `month` INT NOT NULL COMMENT '月份',
     create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
     operate VARCHAR(3) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
@@ -238,7 +239,7 @@ CREATE TABLE p_property_user(
     property_id VARCHAR(30) NOT NULL COMMENT '物业ID',
     b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
     user_id VARCHAR(30) NOT NULL COMMENT '用户ID',
-    `month` INT NOT NULL COMMENT '月份',
+    rel_cd varchar(30) not null comment '用户和物业关系 详情查看 property_user_rel表',
     create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
         status_cd VARCHAR(2) NOT NULL default '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
         unique KEY (property_user_id)
@@ -298,6 +299,16 @@ CREATE TABLE property_fee_type(
     UNIQUE KEY (fee_type_cd)
 );
 
+CREATE TABLE property_user_rel(
+    id INT NOT NULL AUTO_INCREMENT KEY COMMENT 'id',
+    rel_cd VARCHAR(12) NOT NULL COMMENT '物业用户关系编码',
+    `name` VARCHAR(50) NOT NULL COMMENT '物业用户关系编码名称',
+    description VARCHAR(200) COMMENT '描述',
+    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    UNIQUE KEY (fee_type_cd)
+);
+
+
 -- 收费周期表
 CREATE TABLE property_fee_time(
     id INT NOT NULL AUTO_INCREMENT KEY COMMENT 'id',

+ 374 - 0
java110-config/src/main/resources/mapper/property/PropertyServiceDaoImplMapper.xml

@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="propertyServiceDaoImpl">
+    
+    <!-- 保存商户信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessPropertyInfo" parameterType="Map">
+        insert into business_property(property_id,b_id,name,address,tel,nearby_landmarks,map_x,map_y,month,operate)
+        values(#{propertyId},#{bId},#{name},#{address},#{tel},#{nearbyLandmarks},#{mapX},#{mapY},#{month},#{operate})
+    </insert>
+    <!-- 保存商户属性信息  add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessPropertyAttr" parameterType="Map">
+        insert into business_property_attr(b_id,attr_id,property_id,spec_cd,value,month,operate)
+        values(#{bId},#{attrId},#{propertyId},#{specCd},#{value},#{month},#{operate})
+    </insert>
+    <!-- 保存商户照片信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessPropertyPhoto" parameterType="Map">
+        insert into business_property_photo(property_photo_id,b_id,property_id,property_photo_type_cd,photo,month,operate)
+        values(#{propertyPhotoId},#{bId},#{propertyId},#{propertyPhotoTypeCd},#{photo},#{month},#{operate})
+    </insert>
+    <!-- 保存商户证件信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessPropertyCerdentials" parameterType="Map">
+        insert into business_property_cerdentials(property_cerdentials_id,b_id,property_id,credentials_cd,value,validity_period,positive_photo,negative_photo,month,operate)
+        values(#{propertyCerdentialsId},#{bId},#{propertyId},#{credentialsCd},#{value},#{validityPeriod},#{positivePhoto},#{negativePhoto},#{month},#{operate})
+    </insert>
+
+    <!-- 保存物业用户信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessPropertyUser" parameterType="Map">
+        insert into business_property_user(property_user_id,b_id,property_id,user_id,rel_cd,month,operate)
+        values(#{propertyUserId},#{bId},#{propertyId},#{userId},#{relCd},#{month},#{operate})
+    </insert>
+
+    <!-- 查询商户信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessPropertyInfo" parameterType="Map" resultType="Map">
+        select s.property_id,s.b_id,s.name,s.address,s.tel,s.nearby_landmarks,s.map_x,s.map_y,s.operate
+        from business_property s where 1 = 1
+        <if test="operate != null and operate != ''">
+            and s.operate = #{operate}
+        </if>
+        <if test="bId != null and bId !=''">
+            and s.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId != ''">
+            and s.property_id = #{propertyId}
+        </if>
+    </select>
+
+
+    <!-- 查询商户属性信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessPropertyAttrs" parameterType="Map" resultType="Map">
+        select sa.b_id,sa.attr_id,sa.property_id,sa.spec_cd,sa.value,sa.operate
+        from business_property_attr sa where 1=1
+        <if test="operate != null and operate != ''">
+            and sa.operate = #{operate}
+        </if>
+        <if test="bId != null and bId !=''">
+            and sa.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId != ''">
+            and sa.property_id = #{propertyId}
+        </if>
+        <if test="attrId != null and attrId != ''">
+            and sa.attr_id = #{attrId}
+        </if>
+    </select>
+
+    <!-- 查询商户照片信息 add by wuxw 2018-07-03 -->
+    <select id="getBusinessPropertyPhoto" parameterType="Map" resultType="Map">
+        select sp.property_photo_id,sp.b_id,sp.property_id,sp.property_photo_type_cd,sp.photo,sp.operate
+        from business_property_photo sp where 1=1
+        <if test="bId != null and bId !=''">
+            and sp.b_id = #{bId}
+        </if>
+        <if test="operate != null and operate != ''">
+            and sp.operate = #{operate}
+        </if>
+        <if test="propertyId != null and propertyId != ''">
+            and sp.property_id = #{propertyId}
+        </if>
+    </select>
+
+    <!-- 查询商户 证件信息 add by wuxw 2018-07-03 -->
+    <select id="getBusinessPropertyCerdentials" parameterType="Map" resultType="Map">
+        select sc.property_cerdentials_id,sc.b_id,sc.property_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,sc.operate
+        from business_property_cerdentials sc where 1 = 1
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="operate != null and operate != ''">
+            and sc.operate = #{operate}
+        </if>
+        <if test="propertyId != null and propertyId != ''">
+            and sc.property_id = #{propertyId}
+        </if>
+    </select>
+
+    <!-- 查询物业 用户信息 add by wuxw 2018-07-03 -->
+    <select id="getBusinessPropertyUser" parameterType="Map" resultType="Map">
+        select sc.property_user_id,sc.b_id,sc.property_id,sc.user_id,sc.rel_cd,sc.operate
+        from business_property_user sc where 1 = 1
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="operate != null and operate != ''">
+            and sc.operate = #{operate}
+        </if>
+        <if test="propertyId != null and propertyId != ''">
+            and sc.property_id = #{propertyId}
+        </if>
+    </select>
+
+    <!-- 保存商户信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="savePropertyInfoInstance" parameterType="Map">
+        insert into p_property(property_id,b_id,name,address,tel,nearby_landmarks,map_x,map_y,status_cd)
+        select s.property_id,s.b_id,s.name,s.address,s.tel,s.nearby_landmarks,s.map_x,s.map_y,'0'
+        from business_property s where 
+        s.operate = 'ADD' and s.b_id=#{bId}
+    </insert>
+
+    <!-- 保存商户属性信息到 instance add by wuxw 2018-07-03 -->
+    <insert id="savePropertyAttrsInstance" parameterType="Map">
+        insert into p_property_attr(b_id,attr_id,property_id,spec_cd,value,status_cd)
+        select sa.b_id,sa.attr_id,sa.property_id,sa.spec_cd,sa.value,'0'
+        from business_property_attr sa
+        where sa.operate = 'ADD' and sa.b_id=#{bId}
+    </insert>
+    
+    <!-- 保存 商户照片信息 instance add by wuxw 2018-07-03 -->
+    <insert id="savePropertyPhotoInstance" parameterType="Map">
+        insert into p_property_photo(property_photo_id,b_id,property_id,property_photo_type_cd,photo,status_cd)
+        select sp.property_photo_id,sp.b_id,sp.property_id,sp.property_photo_type_cd,sp.photo,'0'
+        from business_property_photo sp
+        where  sp.operate = 'ADD' and sp.b_id=#{bId}
+    </insert>
+    <!-- 保存 商户证件信息 instance add by wuxw 2018-07-03 -->
+    <insert id="savePropertyCerdentialsInstance" parameterType="Map">
+        insert into p_property_cerdentials(property_cerdentials_id,b_id,property_id,credentials_cd,value,validity_period,positive_photo,negative_photo,status_cd)
+        select sc.property_cerdentials_id,sc.b_id,sc.property_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,'0'
+        from business_property_cerdentials sc
+        where sc.operate = 'ADD' and sc.b_id=#{bId}
+    </insert>
+
+    <!-- 保存 商户用户信息 instance add by wuxw 2018-07-03 -->
+    <insert id="savePropertyUserInstance" parameterType="Map">
+        insert into p_property_user(property_user_id,b_id,property_id,user_id,rel_cd,status_cd)
+        select sc.property_user_id,sc.b_id,sc.property_id,sc.user_id,sc.rel_cd,'0'
+        from business_property_user sc
+        where sc.operate = 'ADD' and sc.b_id=#{bId}
+    </insert>
+
+    <!-- 查询商户信息 add by wuxw 2018-07-03 -->
+    <select id="getPropertyInfo" parameterType="Map" resultType="Map">
+        select s.property_id,s.b_id,s.name,s.address,s.tel,s.nearby_landmarks,s.map_x,s.map_y,s.status_cd
+        from p_property s
+        where 1=1
+        <if test="statusCd != null and statusCd != ''">
+            and s.status_cd = #{statusCd}
+        </if>
+
+        <if test="bId != null and bId !=''">
+            and s.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and s.property_id = #{propertyId}
+        </if>
+    </select>
+
+    <!-- 查询商户属性信息 add by wuxw 2018-07-03 -->
+    <select id="getPropertyAttrs" parameterType="Map" resultType="Map">
+        select sa.b_id,sa.attr_id,sa.property_id,sa.spec_cd,sa.value,sa.status_cd
+        from p_property_attr sa
+        where
+        1=1
+        <if test="statusCd != null and statusCd != ''">
+            and sa.status_cd = #{statusCd}
+        </if>
+        <if test="bId != null and bId !=''">
+            and sa.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sa.property_id = #{propertyId}
+        </if>
+        <if test="attrId != null and attrId != ''">
+            and sa.attr_id = #{attrId}
+        </if>
+    </select>
+
+    <!-- 查询商户照片信息 add by wuxw 2018-07-03 -->
+    <select id="getPropertyPhoto" parameterType="Map" resultType="Map">
+        select sp.property_photo_id,sp.b_id,sp.property_id,sp.property_photo_type_cd,sp.photo,sp.status_cd
+        from p_property_photo sp
+        where 1=1
+        <if test="statusCd != null and statusCd != ''">
+            and sp.status_cd = #{statusCd}
+        </if>
+        <if test="bId != null and bId !=''">
+            and sp.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sp.property_id = #{propertyId}
+        </if>
+    </select>
+
+    <!-- 查询商户证件信息 add by wuxw 2018-07-03 -->
+    <select id="getPropertyCerdentials" parameterType="Map" resultType="Map">
+        select sc.property_cerdentials_id,sc.b_id,sc.property_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,sc.status_cd
+        from p_property_cerdentials sc
+        where 1=1
+        <if test="statusCd != null and statusCd != ''">
+            and sc.status_cd = #{statusCd}
+        </if>
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sc.property_id = #{propertyId}
+        </if>
+    </select>
+
+    <!-- 查询商户证件信息 add by wuxw 2018-07-03 -->
+    <select id="getPropertyUser" parameterType="Map" resultType="Map">
+        select sc.property_user_id,sc.b_id,sc.property_id,sc.user_id,sc.rel_cd,sc.status_cd
+        from p_property_user sc
+        where 1=1
+        <if test="statusCd != null and statusCd != ''">
+            and sc.status_cd = #{statusCd}
+        </if>
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sc.property_id = #{propertyId}
+        </if>
+    </select>
+
+
+    <!-- 修改商户信息 add by wuxw 2018-07-03 -->
+    <update id="updatePropertyInfoInstance" parameterType="Map">
+        update p_property s set s.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,s.b_id = #{newBId}
+        </if>
+        <if test="name != null and name != ''">
+            ,s.name = #{name}
+        </if>
+        <if test="address != null and address != ''">
+            ,s.address = #{address}
+        </if>
+        <if test="tel != null and tel != ''">
+            ,s.tel = #{tel}
+        </if>
+        <if test="nearbyLandmarks != null and nearbyLandmarks != ''">
+            ,s.nearby_landmarks = #{nearbyLandmarks}
+        </if>
+        <if test="mapX != null and mapX != ''">
+            ,s.map_x = #{mapX}
+        </if>
+        <if test="mapY != null and mapY != ''">
+            ,s.map_y = #{mapY}
+        </if>
+        where 1=1
+        <if test="bId != null and bId !=''">
+            and s.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and s.property_id = #{propertyId}
+        </if>
+    </update>
+
+    <!-- 修改商户属性信息 add by wuxw 2018-07-03 -->
+    <update id="updatePropertyAttrInstance" parameterType="Map">
+        update p_property_attr sa set sa.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,sa.b_id = #{newBId}
+        </if>
+        <if test="value != null and value != ''">
+            ,sa.value = #{value}
+        </if>
+        where 1=1
+        <if test="bId != null and bId !=''">
+            and sa.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sa.property_id = #{propertyId}
+        </if>
+        <if test="specCd != null and specCd !=''">
+            and sa.spec_cd = #{specCd}
+        </if>
+        <if test="attrId != null and attrId !=''">
+            and sa.attr_id = #{attrId}
+        </if>
+    </update>
+
+    <!-- 修改商户照片信息 add by wuxw 2018-07-03 -->
+    <update id="updatePropertyPhotoInstance" parameterType="Map">
+        update p_property_photo sp set sp.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,sp.b_id = #{newBId}
+        </if>
+        <if test="propertyPhotoTypeCd != null and propertyPhotoTypeCd != ''">
+            ,sp.property_photo_type_cd = #{propertyPhotoTypeCd}
+        </if>
+        <if test="photo != null and photo != ''">
+            ,sp.photo = #{photo}
+        </if>
+        where 1=1
+        <if test="bId != null and bId !=''">
+            and sp.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sp.property_id = #{propertyId}
+        </if>
+        <if test="propertyPhotoId != null and propertyPhotoId !=''">
+            and sp.property_photo_id = #{propertyPhotoId}
+        </if>
+    </update>
+
+    <!-- 修改商户证件信息 add by wuxw 2018-07-03 -->
+    <update id="updatePropertyCerdentailsInstance" parameterType="Map">
+        update p_property_cerdentials sc set sc.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,sc.b_id = #{newBId}
+        </if>
+        <if test="credentialsCd != null and credentialsCd != ''">
+            ,sc.credentials_cd = #{credentialsCd}
+        </if>
+        <if test="value != null and value != ''">
+            ,sc.value = #{value}
+        </if>
+        <if test="validityPeriod != null">
+            ,sc.validity_period = #{validityPeriod}
+        </if>
+        <if test="positivePhoto != null and positivePhoto != ''">
+            ,sc.positive_photo = #{positivePhoto}
+        </if>
+        <if test="negativePhoto != null and negativePhoto != ''">
+            ,sc.negative_photo = #{negativePhoto}
+        </if>
+        where 1=1
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sc.property_id = #{propertyId}
+        </if>
+        <if test="propertyCerdentialsId != null and propertyCerdentialsId !=''">
+            and sc.property_cerdentials_id = #{propertyCerdentialsId}
+        </if>
+    </update>
+
+
+    <!-- 修改商户用户信息 add by wuxw 2018-07-03 -->
+    <update id="updatePropertyUserInstance" parameterType="Map">
+        update p_property_user sc set sc.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,sc.b_id = #{newBId}
+        </if>
+        <if test="relCd != null and relCd != ''">
+            ,sc.rel_cd = #{relCd}
+        </if>
+        where 1=1
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sc.property_id = #{propertyId}
+        </if>
+        <if test="propertyUserId != null and propertyUserId !=''">
+            and sc.property_user_id = #{propertyUserId}
+        </if>
+    </update>
+
+</mapper>

+ 16 - 1
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -76,8 +76,9 @@ public class GenerateCodeFactory {
         prefixMap.put("agentIdPhotoId","81");
         prefixMap.put("agentCerdentialsId","82");
         prefixMap.put("propertyId","90");
-        prefixMap.put("propertyIdPhotoId","91");
+        prefixMap.put("propertyPhotoId","91");
         prefixMap.put("propertyCerdentialsId","92");
+        prefixMap.put("propertyUserId","93");
     }
 
     private static String PLATFORM_CODE = "0001";
@@ -371,6 +372,20 @@ public class GenerateCodeFactory {
     }
 
 
+    /**
+     *
+     * @return
+     * @throws GenerateCodeException
+     */
+    public static String getPropertyUserId()  throws GenerateCodeException{
+        if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){
+            return prefixMap.get("propertyUserId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d");
+        }
+        //调用服务
+        return getCode(prefixMap.get("propertyUserId"));
+    }
+
+
     /**
      * 商品ID生成
      * @return