Explorar el Código

开发和测试完成 物业基本信息,照片,证件,费用,住户信息修改

wuxw hace 7 años
padre
commit
ed57cc1d5e

+ 5 - 6
PropertyService/doc/savePropertyFee.json

@@ -13,18 +13,17 @@
     }]
   },
   "business": {
-    "serviceCode": "save.property.fee",
+    "serviceCode": "update.property.fee",
     "serviceName": "保存物业费用",
     "remark": "备注",
     "datas": {
       "businessPropertyFee":[{
-        "feeId":"-1",
-        "propertyId":"123213",
-        "feeTypeCd":"T",
+        "feeId":"9420181221000001",
+        "propertyId":"9020181218000001",
         "feeMoney":"10",
         "feeTime":"0.5",
-        "startTime": "2018-01-01",
-        "endTime": "2020-12-31"
+        "startTime": "2018-05-01",
+        "endTime": "2020-11-31"
       }]
     },
     "attrs": [{

+ 34 - 0
PropertyService/doc/updatePropertyCerdentials.json

@@ -0,0 +1,34 @@
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "serviceCode": "update.property.cerdentials",
+    "serviceName": "修改物业证件信息",
+    "remark": "备注",
+    "datas": {
+      "businessPropertyCerdentials":[{
+        "propertyCerdentialsId":"9220181218000002",
+        "propertyId":"9020181218000001",
+        "value":"632126XXXXXXXX2012",
+        "validityPeriod":"3000-2-1",
+        "positivePhoto":"1234567.jpg",
+        "negativePhoto":"11.jpg"
+      }]
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}

+ 35 - 0
PropertyService/doc/updatePropertyFee.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.fee",
+    "serviceName": "保存物业费用",
+    "remark": "备注",
+    "datas": {
+      "businessPropertyFee":[{
+        "feeId":"-1",
+        "propertyId":"123213",
+        "feeTypeCd":"T",
+        "feeMoney":"10",
+        "feeTime":"0.5",
+        "startTime": "2018-01-01",
+        "endTime": "2020-12-31"
+      }]
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}

+ 41 - 0
PropertyService/doc/updatePropertyHouse.json

@@ -0,0 +1,41 @@
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "serviceCode": "update.property.house",
+    "serviceName": "保存物业费用",
+    "remark": "备注",
+    "datas": {
+      "businessPropertyHouse":{
+        "houseId":"9520181222000005",
+        "propertyId":"123213",
+        "houseNum":"123123",
+        "houseName":"吴XX住宅",
+        "housePhone":"17797173943",
+        "houseArea": "01919",
+        "feeTypeCd": "112",
+        "feePrice": "11.09"
+      },
+      "businessPropertyHouseAttr": [{
+        "houseId": "9520181222000005",
+        "attrId":"112018122200000006",
+        "value":"02"
+      }]
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}

+ 10 - 17
PropertyService/doc/updatePropertyInfo.json

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

+ 32 - 0
PropertyService/doc/updatePropertyPhoto.json

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

+ 140 - 4
PropertyService/src/main/java/com/java110/property/listener/AbstractPropertyBusinessServiceDataFlowListener.java

@@ -34,8 +34,6 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
     protected void flushBusinessPropertyInfo(Map businessPropertyInfo,String statusCd){
         businessPropertyInfo.put("newBId",businessPropertyInfo.get("b_id"));
         businessPropertyInfo.put("propertyId",businessPropertyInfo.get("property_id"));
-        businessPropertyInfo.put("userId",businessPropertyInfo.get("user_id"));
-        businessPropertyInfo.put("propertyTypeCd",businessPropertyInfo.get("property_type_cd"));
         businessPropertyInfo.put("nearbyLandmarks",businessPropertyInfo.get("nearby_landmarks"));
         businessPropertyInfo.put("mapX",businessPropertyInfo.get("map_x"));
         businessPropertyInfo.put("mapY",businessPropertyInfo.get("map_y"));
@@ -56,6 +54,38 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
         businessPropertyAttr.put("statusCd",statusCd);
     }
 
+    /**
+     * 刷新 businessPropertyInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     * @param businessPropertyHouse
+     */
+    protected void flushBusinessPropertyHouse(Map businessPropertyHouse,String statusCd){
+        businessPropertyHouse.put("newBId",businessPropertyHouse.get("b_id"));
+        businessPropertyHouse.put("propertyId",businessPropertyHouse.get("property_id"));
+        businessPropertyHouse.put("houseId",businessPropertyHouse.get("house_id"));
+        businessPropertyHouse.put("houseNum",businessPropertyHouse.get("house_num"));
+        businessPropertyHouse.put("houseName",businessPropertyHouse.get("house_name"));
+        businessPropertyHouse.put("housePhone",businessPropertyHouse.get("house_phone"));
+        businessPropertyHouse.put("houseArea",businessPropertyHouse.get("house_area"));
+        businessPropertyHouse.put("feeTypeCd",businessPropertyHouse.get("fee_type_cd"));
+        businessPropertyHouse.put("feePrice",businessPropertyHouse.get("fee_price"));
+        businessPropertyHouse.put("statusCd", statusCd);
+    }
+
+    /**
+     刷新 businessPropertyAttr 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     * @param businessPropertyHouesAttr
+     * @param statusCd
+     */
+    protected void flushBusinessPropertyHouseAttr(Map businessPropertyHouesAttr,String statusCd){
+        businessPropertyHouesAttr.put("attrId",businessPropertyHouesAttr.get("attr_id"));
+        businessPropertyHouesAttr.put("specCd",businessPropertyHouesAttr.get("spec_cd"));
+        businessPropertyHouesAttr.put("houseId",businessPropertyHouesAttr.get("house_id"));
+        businessPropertyHouesAttr.put("newBId",businessPropertyHouesAttr.get("b_id"));
+        businessPropertyHouesAttr.put("statusCd",statusCd);
+    }
+
     /**
      * 刷新 businessPropertyPhoto 数据
      * @param businessPropertyPhoto
@@ -69,6 +99,25 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
         businessPropertyPhoto.put("statusCd",statusCd);
     }
 
+    /**
+     * 刷新 businessPropertyPhoto 数据
+     * @param businessPropertyFee
+     * @param statusCd
+     */
+    protected void flushBusinessPropertyFee(Map businessPropertyFee,String statusCd){
+        businessPropertyFee.put("propertyId",businessPropertyFee.get("property_id"));
+        businessPropertyFee.put("feeId",businessPropertyFee.get("fee_id"));
+        businessPropertyFee.put("propertyId",businessPropertyFee.get("property_id"));
+        businessPropertyFee.put("feeTypeCd",businessPropertyFee.get("fee_type_cd"));
+
+        businessPropertyFee.put("feeMoney",businessPropertyFee.get("fee_money"));
+        businessPropertyFee.put("feeTime",businessPropertyFee.get("fee_time"));
+        businessPropertyFee.put("startTime",businessPropertyFee.get("start_time"));
+        businessPropertyFee.put("endTime",businessPropertyFee.get("end_time"));
+        businessPropertyFee.put("newBId",businessPropertyFee.get("b_id"));
+        businessPropertyFee.put("statusCd",statusCd);
+    }
+
     /**
      * 刷新 businessPropertyCerdentials 数据
      * @param businessPropertyCerdentials
@@ -85,6 +134,8 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
         businessPropertyCerdentials.put("statusCd",statusCd);
     }
 
+
+
     /**
      * 刷新 businessMemberProperty 数据
      * 主要将 数据库 中字段和 接口传递字段建立关系
@@ -113,8 +164,6 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
         }
         currentPropertyInfo.put("bId",business.getbId());
         currentPropertyInfo.put("propertyId",currentPropertyInfo.get("property_id"));
-        currentPropertyInfo.put("userId",currentPropertyInfo.get("user_id"));
-        currentPropertyInfo.put("propertyTypeCd",currentPropertyInfo.get("property_type_cd"));
         currentPropertyInfo.put("nearbyLandmarks",currentPropertyInfo.get("nearby_landmarks"));
         currentPropertyInfo.put("mapX",currentPropertyInfo.get("map_x"));
         currentPropertyInfo.put("mapY",currentPropertyInfo.get("map_y"));
@@ -143,6 +192,59 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
         currentPropertyAttr.put("specCd",currentPropertyAttr.get("spec_cd"));
         currentPropertyAttr.put("operate",StatusConstant.OPERATE_DEL);
         getPropertyServiceDaoImpl().saveBusinessPropertyAttr(currentPropertyAttr);
+        //这个不允许修改,这里直接写入查出来的
+        propertyAttr.put("specCd",currentPropertyAttr.get("spec_cd"));
+    }
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     * @param businessPropertyHouse 物业信息
+     */
+    protected void autoSaveDelBusinessPropertyHouse(Business business, JSONObject businessPropertyHouse){
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("houseId",businessPropertyHouse.getString("houseId"));
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map currentPropertyHouse = getPropertyServiceDaoImpl().getPropertyHouse(info);
+        if(currentPropertyHouse == null || currentPropertyHouse.isEmpty()){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
+        }
+        currentPropertyHouse.put("bId",business.getbId());
+        currentPropertyHouse.put("propertyId",currentPropertyHouse.get("property_id"));
+        currentPropertyHouse.put("houseId",currentPropertyHouse.get("house_id"));
+        currentPropertyHouse.put("houseNum",currentPropertyHouse.get("house_num"));
+        currentPropertyHouse.put("houseName",currentPropertyHouse.get("house_name"));
+        currentPropertyHouse.put("housePhone",currentPropertyHouse.get("house_phone"));
+        currentPropertyHouse.put("houseArea",currentPropertyHouse.get("house_area"));
+        currentPropertyHouse.put("feeTypeCd",currentPropertyHouse.get("fee_type_cd"));
+        currentPropertyHouse.put("feePrice",currentPropertyHouse.get("fee_price"));
+        currentPropertyHouse.put("operate",StatusConstant.OPERATE_DEL);
+        getPropertyServiceDaoImpl().saveBusinessPropertyHouse(currentPropertyHouse);
+    }
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     * @param business 当前业务
+     * @param propertyHouseAttr 物业属性
+     */
+    protected void autoSaveDelBusinessPropertyHouseAttr(Business business, JSONObject propertyHouseAttr){
+        Map info = new HashMap();
+        info.put("attrId",propertyHouseAttr.getString("attrId"));
+        info.put("houseId",propertyHouseAttr.getString("houseId"));
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        List<Map> currentPropertyHouseAttrs = getPropertyServiceDaoImpl().getPropertyHouseAttrs(info);
+        if(currentPropertyHouseAttrs == null || currentPropertyHouseAttrs.size() != 1){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
+        }
+        Map currentPropertyHouseAttr = currentPropertyHouseAttrs.get(0);
+        currentPropertyHouseAttr.put("bId",business.getbId());
+        currentPropertyHouseAttr.put("attrId",currentPropertyHouseAttr.get("attr_id"));
+        currentPropertyHouseAttr.put("houseId",currentPropertyHouseAttr.get("house_id"));
+        currentPropertyHouseAttr.put("specCd",currentPropertyHouseAttr.get("spec_cd"));
+        currentPropertyHouseAttr.put("operate",StatusConstant.OPERATE_DEL);
+        getPropertyServiceDaoImpl().saveBusinessPropertyHouseAttr(currentPropertyHouseAttr);
+        //这个不允许修改,这里直接写入查出来的
+        propertyHouseAttr.put("specCd",currentPropertyHouseAttr.get("spec_cd"));
     }
 
     /**
@@ -168,6 +270,37 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
         getPropertyServiceDaoImpl().saveBusinessPropertyPhoto(currentPropertyPhoto);
     }
 
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     * @param business
+     * @param businessPropertyFee 物业费用
+     */
+    protected void autoSaveDelBusinessPropertyFee(Business business,JSONObject businessPropertyFee){
+        Map info = new HashMap();
+        info.put("feeId",businessPropertyFee.getString("feeId"));
+        info.put("propertyId",businessPropertyFee.getString("propertyId"));
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        List<Map> currentPropertyFees = getPropertyServiceDaoImpl().getPropertyFee(info);
+        if(currentPropertyFees == null || currentPropertyFees.size() != 1){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
+        }
+        Map currentPropertyFee = currentPropertyFees.get(0);
+        currentPropertyFee.put("bId",business.getbId());
+        currentPropertyFee.put("feeId",currentPropertyFee.get("fee_id"));
+        currentPropertyFee.put("propertyId",currentPropertyFee.get("property_id"));
+        currentPropertyFee.put("feeTypeCd",currentPropertyFee.get("fee_type_cd"));
+
+        currentPropertyFee.put("feeMoney",currentPropertyFee.get("fee_money"));
+        currentPropertyFee.put("feeTime",currentPropertyFee.get("fee_time"));
+        currentPropertyFee.put("startTime",currentPropertyFee.get("start_time"));
+        currentPropertyFee.put("endTime",currentPropertyFee.get("end_time"));
+        currentPropertyFee.put("operate",StatusConstant.OPERATE_DEL);
+        getPropertyServiceDaoImpl().saveBusinessPropertyFee(currentPropertyFee);
+
+        businessPropertyFee.put("feeTypeCd",currentPropertyFee.get("fee_type_cd"));
+    }
+
+
     /**
      * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
      * @param business
@@ -193,6 +326,9 @@ public abstract class AbstractPropertyBusinessServiceDataFlowListener extends Ab
         currentPropertyCerdentials.put("negativePhoto",currentPropertyCerdentials.get("negative_photo"));
         currentPropertyCerdentials.put("operate",StatusConstant.OPERATE_DEL);
         getPropertyServiceDaoImpl().saveBusinessPropertyCerdentials(currentPropertyCerdentials);
+
+        //证件类型不让修改
+        businessPropertyCerdentials.put("credentialsCd",currentPropertyCerdentials.get("credentials_cd"));
     }
 
 

+ 1 - 168
PropertyService/src/main/java/com/java110/property/listener/UpdatePropertyCerdentialsListener.java

@@ -24,11 +24,7 @@ import java.util.Map;
  * 修改物业信息 侦听
  *
  * 处理节点
- * 1、businessProperty:{} 物业基本信息节点
- * 2、businessPropertyAttr:[{}] 物业属性信息节点
- * 3、businessPropertyPhoto:[{}] 物业照片信息节点
  * 4、businessPropertyCerdentials:[{}] 物业证件信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
  * Created by wuxw on 2018/5/18.
  */
 @Java110Listener("updatePropertyCerdentialsListener")
@@ -61,23 +57,6 @@ public class UpdatePropertyCerdentialsListener extends AbstractPropertyBusinessS
 
         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);
@@ -98,30 +77,6 @@ public class UpdatePropertyCerdentialsListener extends AbstractPropertyBusinessS
         Map info = new HashMap();
         info.put("bId",business.getbId());
         info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
-        }
-        //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
-        //物业照片
-        List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
-        if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
-            for(Map businessPropertyPhoto : businessPropertyPhotos) {
-                flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
-            }
-        }
         //物业证件
         List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
         if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
@@ -148,51 +103,6 @@ public class UpdatePropertyCerdentialsListener extends AbstractPropertyBusinessS
         Map delInfo = new HashMap();
         delInfo.put("bId",business.getbId());
         delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
-        if(propertyInfo != null && !propertyInfo.isEmpty()){
-
-            //物业信息
-            Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyInfo == null || businessPropertyInfo.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
-            dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
-        }
-
-        //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
-        if(propertyAttrs != null && propertyAttrs.size()>0){
-
-            List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyAttrs == null || businessPropertyAttrs.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_attr),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
-
-        //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyPhotos == null || businessPropertyPhotos.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_photo),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyPhoto : businessPropertyPhotos) {
-                flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
-            }
-        }
-
         //物业属性
         List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
         if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
@@ -208,83 +118,6 @@ public class UpdatePropertyCerdentialsListener extends AbstractPropertyBusinessS
         }
     }
 
-    /**
-     * 保存物业照片
-     * @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("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyPhoto);
-            }
-
-            //自动保存DEL信息
-            autoSaveDelBusinessPropertyPhoto(business,businessPropertyPhoto);
-
-            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("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyId 错误,不能自动生成(必须已经存在的propertyId)"+businessProperty);
-        }
-        //自动保存DEL
-        autoSaveDelBusinessProperty(business,businessProperty);
-
-        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();
-
-
-        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyAttrs.size();propertyAttrIndex ++){
-            JSONObject propertyAttr = businessPropertyAttrs.getJSONObject(propertyAttrIndex);
-            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyAttr 节点下没有包含 attrId 节点");
-            if(propertyAttr.getString("attrId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+propertyAttr);
-            }
-            //自动保存DEL数据
-            autoSaveDelBusinessPropertyAttr(business,propertyAttr);
-
-            propertyAttr.put("bId",business.getbId());
-            propertyAttr.put("propertyId",propertyAttr.getString("propertyId"));
-            propertyAttr.put("operate", StatusConstant.OPERATE_ADD);
-
-            propertyServiceDaoImpl.saveBusinessPropertyAttr(propertyAttr);
-        }
-    }
-
-
     /**
      * 保存 物业证件 信息
      * @param business 当前业务
@@ -297,7 +130,7 @@ public class UpdatePropertyCerdentialsListener extends AbstractPropertyBusinessS
             Assert.jsonObjectHaveKey(businessPropertyCerdentials, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
 
             if (businessPropertyCerdentials.getString("propertyCerdentialsId").startsWith("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyCerdentials);
+                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyCerdentialsId)"+businessPropertyCerdentials);
             }
 
             autoSaveDelBusinessPropertyCerdentials(business,businessPropertyCerdentials);

+ 30 - 189
PropertyService/src/main/java/com/java110/property/listener/UpdatePropertyFeeListener.java

@@ -24,11 +24,7 @@ import java.util.Map;
  * 修改物业信息 侦听
  *
  * 处理节点
- * 1、businessProperty:{} 物业基本信息节点
- * 2、businessPropertyAttr:[{}] 物业属性信息节点
- * 3、businessPropertyPhoto:[{}] 物业照片信息节点
- * 4、businessPropertyCerdentials:[{}] 物业证件信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
+ * 3、businessPropertyFee:[{}] 物业照片信息节点
  * Created by wuxw on 2018/5/18.
  */
 @Java110Listener("updatePropertyFeeListener")
@@ -61,26 +57,10 @@ public class UpdatePropertyFeeListener extends AbstractPropertyBusinessServiceDa
 
         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("businessPropertyFee")){
+            JSONArray businessPropertyFees = data.getJSONArray("businessPropertyFee");
+            doBusinessPropertyFee(business,businessPropertyFees);
         }
     }
 
@@ -99,37 +79,16 @@ public class UpdatePropertyFeeListener extends AbstractPropertyBusinessServiceDa
         info.put("bId",business.getbId());
         info.put("operate",StatusConstant.OPERATE_ADD);
 
-        //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
-        }
-        //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
+
         //物业照片
-        List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
-        if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
-            for(Map businessPropertyPhoto : businessPropertyPhotos) {
-                flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
-            }
-        }
-        //物业证件
-        List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
-        if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
-            for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
-                flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
+        List<Map> businessPropertyFees = propertyServiceDaoImpl.getBusinessPropertyFee(info);
+        if(businessPropertyFees != null && businessPropertyFees.size() >0){
+            for(Map businessPropertyFee : businessPropertyFees) {
+                flushBusinessPropertyFee(businessPropertyFee,StatusConstant.STATUS_CD_VALID);
+                propertyServiceDaoImpl.updatePropertyFeeInstance(businessPropertyFee);
             }
         }
+
     }
 
     /**
@@ -148,62 +107,19 @@ public class UpdatePropertyFeeListener extends AbstractPropertyBusinessServiceDa
         Map delInfo = new HashMap();
         delInfo.put("bId",business.getbId());
         delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
-        if(propertyInfo != null && !propertyInfo.isEmpty()){
 
-            //物业信息
-            Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyInfo == null || businessPropertyInfo.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
-            dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
-        }
-
-        //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
-        if(propertyAttrs != null && propertyAttrs.size()>0){
-
-            List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyAttrs == null || businessPropertyAttrs.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_attr),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
 
         //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(delInfo);
+        List<Map> propertyFees = propertyServiceDaoImpl.getPropertyFee(info);
+        if(propertyFees != null && propertyFees.size()>0){
+            List<Map> businessPropertyFees = propertyServiceDaoImpl.getBusinessPropertyFee(delInfo);
             //除非程序出错了,这里不会为空
-            if(businessPropertyPhotos == null || businessPropertyPhotos.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_photo),程序内部异常,请检查! "+delInfo);
+            if(businessPropertyFees == null || businessPropertyFees.size() ==0 ){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_fee),程序内部异常,请检查! "+delInfo);
             }
-            for(Map businessPropertyPhoto : businessPropertyPhotos) {
-                flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
-            }
-        }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyCerdentialses == null || businessPropertyCerdentialses.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_cerdentials),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
-                flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
+            for(Map businessPropertyFee : businessPropertyFees) {
+                flushBusinessPropertyFee(businessPropertyFee,StatusConstant.STATUS_CD_VALID);
+                propertyServiceDaoImpl.updatePropertyFeeInstance(businessPropertyFee);
             }
         }
     }
@@ -211,101 +127,26 @@ public class UpdatePropertyFeeListener extends AbstractPropertyBusinessServiceDa
     /**
      * 保存物业照片
      * @param business 业务对象
-     * @param businessPropertyPhotos 物业照片
+     * @param businessPropertyFees 物业照片
      */
-    private void doBusinessPropertyPhoto(Business business, JSONArray businessPropertyPhotos) {
+    private void doBusinessPropertyFee(Business business, JSONArray businessPropertyFees) {
 
 
-        for(int businessPropertyPhotoIndex = 0 ;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-            JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-            Assert.jsonObjectHaveKey(businessPropertyPhoto, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
+        for(int businessPropertyFeeIndex = 0 ;businessPropertyFeeIndex < businessPropertyFees.size();businessPropertyFeeIndex++) {
+            JSONObject businessPropertyFee = businessPropertyFees.getJSONObject(businessPropertyFeeIndex);
+            Assert.jsonObjectHaveKey(businessPropertyFee, "propertyId", "businessPropertyFee 节点下没有包含 propertyId 节点");
 
-            if (businessPropertyPhoto.getString("propertyPhotoId").startsWith("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyPhoto);
+            if (businessPropertyFee.getString("feeId").startsWith("-")) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"feeId 错误,不能自动生成(必须已经存在的feeId)"+businessPropertyFee);
             }
 
             //自动保存DEL信息
-            autoSaveDelBusinessPropertyPhoto(business,businessPropertyPhoto);
-
-            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("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyId 错误,不能自动生成(必须已经存在的propertyId)"+businessProperty);
-        }
-        //自动保存DEL
-        autoSaveDelBusinessProperty(business,businessProperty);
-
-        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();
-
-
-        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyAttrs.size();propertyAttrIndex ++){
-            JSONObject propertyAttr = businessPropertyAttrs.getJSONObject(propertyAttrIndex);
-            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyAttr 节点下没有包含 attrId 节点");
-            if(propertyAttr.getString("attrId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+propertyAttr);
-            }
-            //自动保存DEL数据
-            autoSaveDelBusinessPropertyAttr(business,propertyAttr);
-
-            propertyAttr.put("bId",business.getbId());
-            propertyAttr.put("propertyId",propertyAttr.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("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyCerdentials);
-            }
-
-            autoSaveDelBusinessPropertyCerdentials(business,businessPropertyCerdentials);
+            autoSaveDelBusinessPropertyFee(business,businessPropertyFee);
 
-            businessPropertyCerdentials.put("bId", business.getbId());
-            businessPropertyCerdentials.put("operate", StatusConstant.OPERATE_ADD);
+            businessPropertyFee.put("bId", business.getbId());
+            businessPropertyFee.put("operate", StatusConstant.OPERATE_ADD);
             //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyCerdentials(businessPropertyCerdentials);
+            propertyServiceDaoImpl.saveBusinessPropertyFee(businessPropertyFee);
         }
     }
 

+ 55 - 156
PropertyService/src/main/java/com/java110/property/listener/UpdatePropertyHouseListener.java

@@ -24,14 +24,11 @@ import java.util.Map;
  * 修改物业信息 侦听
  *
  * 处理节点
- * 1、businessProperty:{} 物业基本信息节点
- * 2、businessPropertyAttr:[{}] 物业属性信息节点
- * 3、businessPropertyPhoto:[{}] 物业照片信息节点
- * 4、businessPropertyCerdentials:[{}] 物业证件信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
+ * 1、businessPropertyHouse:{} 物业基本信息节点
+ * 2、businessPropertyHouseAttr:[{}] 物业属性信息节点
  * Created by wuxw on 2018/5/18.
  */
-@Java110Listener("updatePropertyHouseListener")
+@Java110Listener("updatePropertyHouseHouseListener")
 @Transactional
 public class UpdatePropertyHouseListener extends AbstractPropertyBusinessServiceDataFlowListener {
 
@@ -61,26 +58,16 @@ public class UpdatePropertyHouseListener extends AbstractPropertyBusinessService
 
         Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
 
-        //处理 businessProperty 节点
-        if(data.containsKey("businessProperty")){
-            JSONObject businessProperty = data.getJSONObject("businessProperty");
-            doBusinessProperty(business,businessProperty);
-            dataFlowContext.addParamOut("propertyId",businessProperty.getString("propertyId"));
+        //处理 businessPropertyHouse 节点
+        if(data.containsKey("businessPropertyHouse")){
+            JSONObject businessPropertyHouse = data.getJSONObject("businessPropertyHouse");
+            doBusinessPropertyHouse(business,businessPropertyHouse);
+            dataFlowContext.addParamOut("propertyId",businessPropertyHouse.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("businessPropertyHouseAttr")){
+            JSONArray businessPropertyHouseAttrs = data.getJSONArray("businessPropertyHouseAttr");
+            doSaveBusinessPropertyHouseAttrs(business,businessPropertyHouseAttrs);
         }
     }
 
@@ -100,34 +87,18 @@ public class UpdatePropertyHouseListener extends AbstractPropertyBusinessService
         info.put("operate",StatusConstant.OPERATE_ADD);
 
         //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
+        Map businessPropertyHouseInfo = propertyServiceDaoImpl.getBusinessPropertyHouse(info);
+        if( businessPropertyHouseInfo != null && !businessPropertyHouseInfo.isEmpty()) {
+            flushBusinessPropertyHouse(businessPropertyHouseInfo,StatusConstant.STATUS_CD_VALID);
+            propertyServiceDaoImpl.updatePropertyHouseInstance(businessPropertyHouseInfo);
+            dataFlowContext.addParamOut("houseId",businessPropertyHouseInfo.get("house_id"));
         }
         //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
-        //物业照片
-        List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
-        if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
-            for(Map businessPropertyPhoto : businessPropertyPhotos) {
-                flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
-            }
-        }
-        //物业证件
-        List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
-        if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
-            for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
-                flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
+        List<Map> businessPropertyHouseAttrs = propertyServiceDaoImpl.getBusinessPropertyHouseAttrs(info);
+        if(businessPropertyHouseAttrs != null && businessPropertyHouseAttrs.size() > 0) {
+            for(Map businessPropertyHouseAttr : businessPropertyHouseAttrs) {
+                flushBusinessPropertyHouseAttr(businessPropertyHouseAttr,StatusConstant.STATUS_CD_VALID);
+                propertyServiceDaoImpl.updatePropertyHouseAttrInstance(businessPropertyHouseAttr);
             }
         }
     }
@@ -149,110 +120,62 @@ public class UpdatePropertyHouseListener extends AbstractPropertyBusinessService
         delInfo.put("bId",business.getbId());
         delInfo.put("operate",StatusConstant.OPERATE_DEL);
         //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
+        Map propertyInfo = propertyServiceDaoImpl.getPropertyHouse(info);
         if(propertyInfo != null && !propertyInfo.isEmpty()){
 
             //物业信息
-            Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(delInfo);
+            Map businessPropertyHouseInfo = propertyServiceDaoImpl.getBusinessPropertyHouse(delInfo);
             //除非程序出错了,这里不会为空
-            if(businessPropertyInfo == null || businessPropertyInfo.isEmpty()){
+            if(businessPropertyHouseInfo == null || businessPropertyHouseInfo.isEmpty()){
                 throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property),程序内部异常,请检查! "+delInfo);
             }
 
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
+            flushBusinessPropertyHouse(businessPropertyHouseInfo,StatusConstant.STATUS_CD_VALID);
+            propertyServiceDaoImpl.updatePropertyHouseInstance(businessPropertyHouseInfo);
             dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
         }
 
         //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
+        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyHouseAttrs(info);
         if(propertyAttrs != null && propertyAttrs.size()>0){
 
-            List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(delInfo);
+            List<Map> businessPropertyHouseAttrs = propertyServiceDaoImpl.getBusinessPropertyHouseAttrs(delInfo);
             //除非程序出错了,这里不会为空
-            if(businessPropertyAttrs == null || businessPropertyAttrs.size() ==0 ){
+            if(businessPropertyHouseAttrs == null || businessPropertyHouseAttrs.size() ==0 ){
                 throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_attr),程序内部异常,请检查! "+delInfo);
             }
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
-
-        //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyPhotos == null || businessPropertyPhotos.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_photo),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyPhoto : businessPropertyPhotos) {
-                flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
-            }
-        }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyCerdentialses == null || businessPropertyCerdentialses.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_cerdentials),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
-                flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
+            for(Map businessPropertyHouseAttr : businessPropertyHouseAttrs) {
+                flushBusinessPropertyHouseAttr(businessPropertyHouseAttr,StatusConstant.STATUS_CD_VALID);
+                propertyServiceDaoImpl.updatePropertyHouseAttrInstance(businessPropertyHouseAttr);
             }
         }
     }
 
-    /**
-     * 保存物业照片
-     * @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("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyPhoto);
-            }
-
-            //自动保存DEL信息
-            autoSaveDelBusinessPropertyPhoto(business,businessPropertyPhoto);
-
-            businessPropertyPhoto.put("bId", business.getbId());
-            businessPropertyPhoto.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyPhoto(businessPropertyPhoto);
-        }
-    }
 
     /**
-     * 处理 businessProperty 节点
+     * 处理 businessPropertyHouse 节点
      * @param business 总的数据节点
-     * @param businessProperty 物业节点
+     * @param businessPropertyHouse 物业节点
      */
-    private void doBusinessProperty(Business business,JSONObject businessProperty){
+    private void doBusinessPropertyHouse(Business business,JSONObject businessPropertyHouse){
+
+        Assert.jsonObjectHaveKey(businessPropertyHouse,"propertyId","businessPropertyHouse 节点下没有包含 propertyId 节点");
+        Assert.jsonObjectHaveKey(businessPropertyHouse,"houseId","businessPropertyHouse 节点下没有包含 houseId 节点");
 
-        Assert.jsonObjectHaveKey(businessProperty,"propertyId","businessProperty 节点下没有包含 propertyId 节点");
+        if(businessPropertyHouse.getString("propertyId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyId 错误,不能自动生成(必须已经存在的propertyId)"+businessPropertyHouse);
+        }
 
-        if(businessProperty.getString("propertyId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyId 错误,不能自动生成(必须已经存在的propertyId)"+businessProperty);
+        if(businessPropertyHouse.getString("houseId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"houseId 错误,不能自动生成(必须已经存在的houseId)"+businessPropertyHouse);
         }
         //自动保存DEL
-        autoSaveDelBusinessProperty(business,businessProperty);
+        autoSaveDelBusinessPropertyHouse(business,businessPropertyHouse);
 
-        businessProperty.put("bId",business.getbId());
-        businessProperty.put("operate", StatusConstant.OPERATE_ADD);
+        businessPropertyHouse.put("bId",business.getbId());
+        businessPropertyHouse.put("operate", StatusConstant.OPERATE_ADD);
         //保存物业信息
-        propertyServiceDaoImpl.saveBusinessPropertyInfo(businessProperty);
+        propertyServiceDaoImpl.saveBusinessPropertyHouse(businessPropertyHouse);
 
     }
 
@@ -261,53 +184,29 @@ public class UpdatePropertyHouseListener extends AbstractPropertyBusinessService
     /**
      * 保存物业属性信息
      * @param business 当前业务
-     * @param businessPropertyAttrs 物业属性
+     * @param businessPropertyHouseAttrs 物业属性
      */
-    private void doSaveBusinessPropertyAttrs(Business business,JSONArray businessPropertyAttrs){
+    private void doSaveBusinessPropertyHouseAttrs(Business business,JSONArray businessPropertyHouseAttrs){
         JSONObject data = business.getDatas();
 
 
-        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyAttrs.size();propertyAttrIndex ++){
-            JSONObject propertyAttr = businessPropertyAttrs.getJSONObject(propertyAttrIndex);
-            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyAttr 节点下没有包含 attrId 节点");
+        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyHouseAttrs.size();propertyAttrIndex ++){
+            JSONObject propertyAttr = businessPropertyHouseAttrs.getJSONObject(propertyAttrIndex);
+            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyHouseAttr 节点下没有包含 attrId 节点");
             if(propertyAttr.getString("attrId").startsWith("-")){
                 throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+propertyAttr);
             }
             //自动保存DEL数据
-            autoSaveDelBusinessPropertyAttr(business,propertyAttr);
+            autoSaveDelBusinessPropertyHouseAttr(business,propertyAttr);
 
             propertyAttr.put("bId",business.getbId());
             propertyAttr.put("propertyId",propertyAttr.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("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyCerdentials);
-            }
-
-            autoSaveDelBusinessPropertyCerdentials(business,businessPropertyCerdentials);
-
-            businessPropertyCerdentials.put("bId", business.getbId());
-            businessPropertyCerdentials.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyCerdentials(businessPropertyCerdentials);
+            propertyServiceDaoImpl.saveBusinessPropertyHouseAttr(propertyAttr);
         }
     }
+    
 
     public IPropertyServiceDao getPropertyServiceDaoImpl() {
         return propertyServiceDaoImpl;

+ 1 - 92
PropertyService/src/main/java/com/java110/property/listener/UpdatePropertyInfoListener.java

@@ -24,11 +24,8 @@ import java.util.Map;
  * 修改物业信息 侦听
  *
  * 处理节点
- * 1、businessProperty:{} 物业基本信息节点
+ * 1、businessPropertyInfo:{} 物业基本信息节点
  * 2、businessPropertyAttr:[{}] 物业属性信息节点
- * 3、businessPropertyPhoto:[{}] 物业照片信息节点
- * 4、businessPropertyCerdentials:[{}] 物业证件信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
  * Created by wuxw on 2018/5/18.
  */
 @Java110Listener("updatePropertyInfoListener")
@@ -72,16 +69,6 @@ public class UpdatePropertyInfoListener extends AbstractPropertyBusinessServiceD
             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);
-        }
     }
 
 
@@ -178,60 +165,6 @@ public class UpdatePropertyInfoListener extends AbstractPropertyBusinessServiceD
                 propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
             }
         }
-
-        //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyPhotos == null || businessPropertyPhotos.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_photo),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyPhoto : businessPropertyPhotos) {
-                flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
-            }
-        }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyCerdentialses == null || businessPropertyCerdentialses.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_cerdentials),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
-                flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
-            }
-        }
-    }
-
-    /**
-     * 保存物业照片
-     * @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("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyPhoto);
-            }
-
-            //自动保存DEL信息
-            autoSaveDelBusinessPropertyPhoto(business,businessPropertyPhoto);
-
-            businessPropertyPhoto.put("bId", business.getbId());
-            businessPropertyPhoto.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyPhoto(businessPropertyPhoto);
-        }
     }
 
     /**
@@ -285,30 +218,6 @@ public class UpdatePropertyInfoListener extends AbstractPropertyBusinessServiceD
     }
 
 
-    /**
-     * 保存 物业证件 信息
-     * @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("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyCerdentials);
-            }
-
-            autoSaveDelBusinessPropertyCerdentials(business,businessPropertyCerdentials);
-
-            businessPropertyCerdentials.put("bId", business.getbId());
-            businessPropertyCerdentials.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyCerdentials(businessPropertyCerdentials);
-        }
-    }
-
     public IPropertyServiceDao getPropertyServiceDaoImpl() {
         return propertyServiceDaoImpl;
     }

+ 2 - 163
PropertyService/src/main/java/com/java110/property/listener/UpdatePropertyPhotoListener.java

@@ -24,11 +24,7 @@ import java.util.Map;
  * 修改物业信息 侦听
  *
  * 处理节点
- * 1、businessProperty:{} 物业基本信息节点
- * 2、businessPropertyAttr:[{}] 物业属性信息节点
- * 3、businessPropertyPhoto:[{}] 物业照片信息节点
- * 4、businessPropertyCerdentials:[{}] 物业证件信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
+ * 1、businessPropertyPhoto:{} 物业照片节点
  * Created by wuxw on 2018/5/18.
  */
 @Java110Listener("updatePropertyPhotoListener")
@@ -61,27 +57,10 @@ public class UpdatePropertyPhotoListener extends AbstractPropertyBusinessService
 
         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);
-        }
     }
 
 
@@ -99,21 +78,6 @@ public class UpdatePropertyPhotoListener extends AbstractPropertyBusinessService
         info.put("bId",business.getbId());
         info.put("operate",StatusConstant.OPERATE_ADD);
 
-        //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
-        }
-        //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
         //物业照片
         List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
         if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
@@ -122,14 +86,7 @@ public class UpdatePropertyPhotoListener extends AbstractPropertyBusinessService
                 propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
             }
         }
-        //物业证件
-        List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
-        if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
-            for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
-                flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
-            }
-        }
+
     }
 
     /**
@@ -148,36 +105,6 @@ public class UpdatePropertyPhotoListener extends AbstractPropertyBusinessService
         Map delInfo = new HashMap();
         delInfo.put("bId",business.getbId());
         delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
-        if(propertyInfo != null && !propertyInfo.isEmpty()){
-
-            //物业信息
-            Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyInfo == null || businessPropertyInfo.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
-            propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
-            dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
-        }
-
-        //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
-        if(propertyAttrs != null && propertyAttrs.size()>0){
-
-            List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyAttrs == null || businessPropertyAttrs.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_attr),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyAttr : businessPropertyAttrs) {
-                flushBusinessPropertyAttr(businessPropertyAttr,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
-            }
-        }
 
         //物业照片
         List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
@@ -192,20 +119,6 @@ public class UpdatePropertyPhotoListener extends AbstractPropertyBusinessService
                 propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
             }
         }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessPropertyCerdentialses == null || businessPropertyCerdentialses.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property_cerdentials),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
-                flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_VALID);
-                propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
-            }
-        }
     }
 
     /**
@@ -234,80 +147,6 @@ public class UpdatePropertyPhotoListener extends AbstractPropertyBusinessService
         }
     }
 
-    /**
-     * 处理 businessProperty 节点
-     * @param business 总的数据节点
-     * @param businessProperty 物业节点
-     */
-    private void doBusinessProperty(Business business,JSONObject businessProperty){
-
-        Assert.jsonObjectHaveKey(businessProperty,"propertyId","businessProperty 节点下没有包含 propertyId 节点");
-
-        if(businessProperty.getString("propertyId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyId 错误,不能自动生成(必须已经存在的propertyId)"+businessProperty);
-        }
-        //自动保存DEL
-        autoSaveDelBusinessProperty(business,businessProperty);
-
-        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();
-
-
-        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyAttrs.size();propertyAttrIndex ++){
-            JSONObject propertyAttr = businessPropertyAttrs.getJSONObject(propertyAttrIndex);
-            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyAttr 节点下没有包含 attrId 节点");
-            if(propertyAttr.getString("attrId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+propertyAttr);
-            }
-            //自动保存DEL数据
-            autoSaveDelBusinessPropertyAttr(business,propertyAttr);
-
-            propertyAttr.put("bId",business.getbId());
-            propertyAttr.put("propertyId",propertyAttr.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("-")) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"propertyPhotoId 错误,不能自动生成(必须已经存在的propertyPhotoId)"+businessPropertyCerdentials);
-            }
-
-            autoSaveDelBusinessPropertyCerdentials(business,businessPropertyCerdentials);
-
-            businessPropertyCerdentials.put("bId", business.getbId());
-            businessPropertyCerdentials.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyCerdentials(businessPropertyCerdentials);
-        }
-    }
 
     public IPropertyServiceDao getPropertyServiceDaoImpl() {
         return propertyServiceDaoImpl;

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

@@ -596,10 +596,10 @@
         <if test="feeTime != null and feeTime != ''">
             ,sc.fee_time = #{feeTime}
         </if>
-        <if test="startTime != null and startTime != ''">
+        <if test="startTime != null">
             ,sc.start_time = #{startTime}
         </if>
-        <if test="endTime != null and endTime != ''">
+        <if test="endTime != null">
             ,sc.end_time = #{endTime}
         </if>
         where 1=1