|
@@ -24,11 +24,8 @@ import java.util.Map;
|
|
|
* 删除物业信息 侦听
|
|
* 删除物业信息 侦听
|
|
|
*
|
|
*
|
|
|
* 处理节点
|
|
* 处理节点
|
|
|
- * 1、businessProperty:{} 物业基本信息节点
|
|
|
|
|
- * 2、businessPropertyAttr:[{}] 物业属性信息节点
|
|
|
|
|
- * 3、businessPropertyPhoto:[{}] 物业照片信息节点
|
|
|
|
|
- * 4、businessPropertyCerdentials:[{}] 物业证件信息节点
|
|
|
|
|
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%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.
|
|
* Created by wuxw on 2018/5/18.
|
|
|
*/
|
|
*/
|
|
|
@Java110Listener("deletePropertyHouseListener")
|
|
@Java110Listener("deletePropertyHouseListener")
|
|
@@ -60,26 +57,16 @@ public class DeletePropertyHouseListener extends AbstractPropertyBusinessService
|
|
|
|
|
|
|
|
Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
|
|
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("houseId",businessPropertyHouse.getString("houseId"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- 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);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -99,34 +86,18 @@ public class DeletePropertyHouseListener extends AbstractPropertyBusinessService
|
|
|
info.put("operate",StatusConstant.OPERATE_DEL);
|
|
info.put("operate",StatusConstant.OPERATE_DEL);
|
|
|
|
|
|
|
|
//物业信息
|
|
//物业信息
|
|
|
- Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
|
|
|
|
|
- if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
|
|
|
|
|
- flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_INVALID);
|
|
|
|
|
- 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_INVALID);
|
|
|
|
|
+ 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_INVALID);
|
|
|
|
|
- propertyServiceDaoImpl.updatePropertyAttrInstance(businessPropertyAttr);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- //物业照片
|
|
|
|
|
- List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
|
|
|
|
|
- if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
|
|
|
|
|
- for(Map businessPropertyPhoto : businessPropertyPhotos) {
|
|
|
|
|
- flushBusinessPropertyPhoto(businessPropertyPhoto,StatusConstant.STATUS_CD_INVALID);
|
|
|
|
|
- propertyServiceDaoImpl.updatePropertyPhotoInstance(businessPropertyPhoto);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- //物业证件
|
|
|
|
|
- List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
|
|
|
|
|
- if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
|
|
|
|
|
- for(Map businessPropertyCerdentials : businessPropertyCerdentialses) {
|
|
|
|
|
- flushBusinessPropertyCredentials(businessPropertyCerdentials,StatusConstant.STATUS_CD_INVALID);
|
|
|
|
|
- propertyServiceDaoImpl.updatePropertyCerdentailsInstance(businessPropertyCerdentials);
|
|
|
|
|
|
|
+ List<Map> businessPropertyHouseAttrs = propertyServiceDaoImpl.getBusinessPropertyHouseAttrs(info);
|
|
|
|
|
+ if(businessPropertyHouseAttrs != null && businessPropertyHouseAttrs.size() > 0) {
|
|
|
|
|
+ for(Map businessPropertyHouseAttr : businessPropertyHouseAttrs) {
|
|
|
|
|
+ flushBusinessPropertyHouseAttr(businessPropertyHouseAttr,StatusConstant.STATUS_CD_INVALID);
|
|
|
|
|
+ propertyServiceDaoImpl.updatePropertyHouseAttrInstance(businessPropertyHouseAttr);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -153,94 +124,47 @@ public class DeletePropertyHouseListener extends AbstractPropertyBusinessService
|
|
|
if(propertyInfo != null && !propertyInfo.isEmpty()){
|
|
if(propertyInfo != null && !propertyInfo.isEmpty()){
|
|
|
|
|
|
|
|
//物业信息
|
|
//物业信息
|
|
|
- Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(delInfo);
|
|
|
|
|
|
|
+ Map businessPropertyHouseInfo = propertyServiceDaoImpl.getBusinessPropertyHouse(delInfo);
|
|
|
//除非程序出错了,这里不会为空
|
|
//除非程序出错了,这里不会为空
|
|
|
- if(businessPropertyInfo == null || businessPropertyInfo.isEmpty()){
|
|
|
|
|
- throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(property),程序内部异常,请检查! "+delInfo);
|
|
|
|
|
|
|
+ if(businessPropertyHouseInfo == null || businessPropertyHouseInfo.isEmpty()){
|
|
|
|
|
+ throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(house),程序内部异常,请检查! "+delInfo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- flushBusinessPropertyInfo(businessPropertyInfo,StatusConstant.STATUS_CD_VALID);
|
|
|
|
|
- propertyServiceDaoImpl.updatePropertyInfoInstance(businessPropertyInfo);
|
|
|
|
|
- dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
|
|
|
|
|
|
|
+ flushBusinessPropertyHouse(businessPropertyHouseInfo,StatusConstant.STATUS_CD_VALID);
|
|
|
|
|
+ propertyServiceDaoImpl.updatePropertyHouseInstance(businessPropertyHouseInfo);
|
|
|
|
|
+ dataFlowContext.addParamOut("houseId",propertyInfo.get("house_id"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//物业属性
|
|
//物业属性
|
|
|
- List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
|
|
|
|
|
|
|
+ List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyHouseAttrs(info);
|
|
|
if(propertyAttrs != null && propertyAttrs.size()>0){
|
|
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);
|
|
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);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- autoSaveDelBusinessPropertyPhoto(business,businessPropertyPhoto);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 处理 businessProperty 节点
|
|
|
|
|
|
|
+ * 处理 businessPropertyHouse 节点
|
|
|
* @param business 总的数据节点
|
|
* @param business 总的数据节点
|
|
|
- * @param businessProperty 物业节点
|
|
|
|
|
|
|
+ * @param businessPropertyHouse 物业节点
|
|
|
*/
|
|
*/
|
|
|
- private void doBusinessProperty(Business business,JSONObject businessProperty){
|
|
|
|
|
|
|
+ private void doBusinessPropertyHouse(Business business,JSONObject businessPropertyHouse){
|
|
|
|
|
|
|
|
- Assert.jsonObjectHaveKey(businessProperty,"propertyId","businessProperty 节点下没有包含 propertyId 节点");
|
|
|
|
|
|
|
+ Assert.jsonObjectHaveKey(businessPropertyHouse,"houseId","businessPropertyHouse 节点下没有包含 houseId 节点");
|
|
|
|
|
|
|
|
- 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
|
|
//自动插入DEL
|
|
|
- autoSaveDelBusinessProperty(business,businessProperty);
|
|
|
|
|
|
|
+ autoSaveDelBusinessPropertyHouse(business,businessPropertyHouse);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -248,41 +172,19 @@ public class DeletePropertyHouseListener extends AbstractPropertyBusinessService
|
|
|
/**
|
|
/**
|
|
|
* 保存物业属性信息
|
|
* 保存物业属性信息
|
|
|
* @param business 当前业务
|
|
* @param business 当前业务
|
|
|
- * @param businessPropertyAttrs 物业属性
|
|
|
|
|
|
|
+ * @param businessPropertyHouseAttrs 物业属性
|
|
|
*/
|
|
*/
|
|
|
- private void doSaveBusinessPropertyAttrs(Business business,JSONArray businessPropertyAttrs){
|
|
|
|
|
|
|
+ private void doSaveBusinessPropertyHouseAttrs(Business business,JSONArray businessPropertyHouseAttrs){
|
|
|
JSONObject data = business.getDatas();
|
|
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("-")){
|
|
if(propertyAttr.getString("attrId").startsWith("-")){
|
|
|
throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+propertyAttr);
|
|
throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+propertyAttr);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- autoSaveDelBusinessPropertyAttr(business,propertyAttr);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 保存 物业证件 信息
|
|
|
|
|
- * @param business 当前业务
|
|
|
|
|
- * @param businessPropertyCerdentialses 物业证件
|
|
|
|
|
- */
|
|
|
|
|
- private void doBusinessPropertyCerdentials(Business business, JSONArray businessPropertyCerdentialses) {
|
|
|
|
|
-
|
|
|
|
|
- Map info = null;
|
|
|
|
|
- Map currentPropertyCerdentials = null;
|
|
|
|
|
- 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);
|
|
|
|
|
|
|
+ autoSaveDelBusinessPropertyHouseAttr(business,propertyAttr);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|