From 2633f776bb8fdb0b1efe3a56293b6a1bb04616a7 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期日, 28 四月 2019 10:48:14 +0800
Subject: [PATCH] Merge branch 'master' of https://github.com/java110/MicroCommunity

---
 CommunityService/src/main/java/com/java110/community/listener/AbstractCommunityBusinessServiceDataFlowListener.java |  162 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 85 insertions(+), 77 deletions(-)

diff --git a/CommunityService/src/main/java/com/java110/community/listener/AbstractCommunityBusinessServiceDataFlowListener.java b/CommunityService/src/main/java/com/java110/community/listener/AbstractCommunityBusinessServiceDataFlowListener.java
index ec16459..7350972 100644
--- a/CommunityService/src/main/java/com/java110/community/listener/AbstractCommunityBusinessServiceDataFlowListener.java
+++ b/CommunityService/src/main/java/com/java110/community/listener/AbstractCommunityBusinessServiceDataFlowListener.java
@@ -15,17 +15,17 @@
 import java.util.Map;
 
 /**
- *
  * 灏忓尯 鏈嶅姟渚﹀惉 鐖剁被
  * Created by wuxw on 2018/7/4.
  */
-public abstract class AbstractCommunityBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener{
+public abstract class AbstractCommunityBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
 
     private final static Logger logger = LoggerFactory.getLogger(AbstractCommunityBusinessServiceDataFlowListener.class);
 
 
     /**
      * 鑾峰彇 DAO宸ュ叿绫�
+     *
      * @return
      */
     public abstract ICommunityServiceDao getCommunityServiceDaoImpl();
@@ -33,151 +33,159 @@
     /**
      * 鍒锋柊 businessCommunityInfo 鏁版嵁
      * 涓昏灏� 鏁版嵁搴� 涓瓧娈靛拰 鎺ュ彛浼犻�掑瓧娈靛缓绔嬪叧绯�
+     *
      * @param businessCommunityInfo
      */
-    protected void flushBusinessCommunityInfo(Map businessCommunityInfo,String statusCd){
-        businessCommunityInfo.put("newBId",businessCommunityInfo.get("b_id"));
-        businessCommunityInfo.put("communityId",businessCommunityInfo.get("community_id"));
-        businessCommunityInfo.put("cityCode",businessCommunityInfo.get("city_code"));
-        businessCommunityInfo.put("nearbyLandmarks",businessCommunityInfo.get("nearby_landmarks"));
-        businessCommunityInfo.put("mapX",businessCommunityInfo.get("map_x"));
-        businessCommunityInfo.put("mapY",businessCommunityInfo.get("map_y"));
+    protected void flushBusinessCommunityInfo(Map businessCommunityInfo, String statusCd) {
+        businessCommunityInfo.put("newBId", businessCommunityInfo.get("b_id"));
+        businessCommunityInfo.put("communityId", businessCommunityInfo.get("community_id"));
+        businessCommunityInfo.put("cityCode", businessCommunityInfo.get("city_code"));
+        businessCommunityInfo.put("nearbyLandmarks", businessCommunityInfo.get("nearby_landmarks"));
+        businessCommunityInfo.put("mapX", businessCommunityInfo.get("map_x"));
+        businessCommunityInfo.put("mapY", businessCommunityInfo.get("map_y"));
         businessCommunityInfo.put("statusCd", statusCd);
     }
 
     /**
-        鍒锋柊 businessCommunityAttr 鏁版嵁
+     * 鍒锋柊 businessCommunityAttr 鏁版嵁
      * 涓昏灏� 鏁版嵁搴� 涓瓧娈靛拰 鎺ュ彛浼犻�掑瓧娈靛缓绔嬪叧绯�
+     *
      * @param businessCommunityAttr
      * @param statusCd
      */
-    protected void flushBusinessCommunityAttr(Map businessCommunityAttr,String statusCd){
-        businessCommunityAttr.put("attrId",businessCommunityAttr.get("attr_id"));
-        businessCommunityAttr.put("specCd",businessCommunityAttr.get("spec_cd"));
-        businessCommunityAttr.put("communityId",businessCommunityAttr.get("community_id"));
-        businessCommunityAttr.put("newBId",businessCommunityAttr.get("b_id"));
-        businessCommunityAttr.put("statusCd",statusCd);
+    protected void flushBusinessCommunityAttr(Map businessCommunityAttr, String statusCd) {
+        businessCommunityAttr.put("attrId", businessCommunityAttr.get("attr_id"));
+        businessCommunityAttr.put("specCd", businessCommunityAttr.get("spec_cd"));
+        businessCommunityAttr.put("communityId", businessCommunityAttr.get("community_id"));
+        businessCommunityAttr.put("newBId", businessCommunityAttr.get("b_id"));
+        businessCommunityAttr.put("statusCd", statusCd);
     }
 
     /**
      * 鍒锋柊 businessCommunityPhoto 鏁版嵁
+     *
      * @param businessCommunityPhoto
      * @param statusCd
      */
-    protected void flushBusinessCommunityPhoto(Map businessCommunityPhoto,String statusCd){
-        businessCommunityPhoto.put("communityId",businessCommunityPhoto.get("community_id"));
-        businessCommunityPhoto.put("communityPhotoId",businessCommunityPhoto.get("community_photo_id"));
-        businessCommunityPhoto.put("communityPhotoTypeCd",businessCommunityPhoto.get("community_photo_type_cd"));
-        businessCommunityPhoto.put("newBId",businessCommunityPhoto.get("b_id"));
-        businessCommunityPhoto.put("statusCd",statusCd);
+    protected void flushBusinessCommunityPhoto(Map businessCommunityPhoto, String statusCd) {
+        businessCommunityPhoto.put("communityId", businessCommunityPhoto.get("community_id"));
+        businessCommunityPhoto.put("communityPhotoId", businessCommunityPhoto.get("community_photo_id"));
+        businessCommunityPhoto.put("communityPhotoTypeCd", businessCommunityPhoto.get("community_photo_type_cd"));
+        businessCommunityPhoto.put("newBId", businessCommunityPhoto.get("b_id"));
+        businessCommunityPhoto.put("statusCd", statusCd);
     }
-
 
 
     /**
      * 鍒锋柊 businessCommunityMember 鏁版嵁
      * 涓昏灏� 鏁版嵁搴� 涓瓧娈靛拰 鎺ュ彛浼犻�掑瓧娈靛缓绔嬪叧绯�
+     *
      * @param businessCommunityMember
      */
-    protected void flushBusinessCommunityMember(Map businessCommunityMember,String statusCd){
-        businessCommunityMember.put("newBId",businessCommunityMember.get("b_id"));
-        businessCommunityMember.put("communityId",businessCommunityMember.get("community_id"));
-        businessCommunityMember.put("communityMemberId",businessCommunityMember.get("community_member_id"));
-        businessCommunityMember.put("memberId",businessCommunityMember.get("member_id"));
-        businessCommunityMember.put("memberTypeCd",businessCommunityMember.get("member_type_cd"));
+    protected void flushBusinessCommunityMember(Map businessCommunityMember, String statusCd) {
+        businessCommunityMember.put("newBId", businessCommunityMember.get("b_id"));
+        businessCommunityMember.put("communityId", businessCommunityMember.get("community_id"));
+        businessCommunityMember.put("communityMemberId", businessCommunityMember.get("community_member_id"));
+        businessCommunityMember.put("memberId", businessCommunityMember.get("member_id"));
+        businessCommunityMember.put("memberTypeCd", businessCommunityMember.get("member_type_cd"));
+        businessCommunityMember.put("auditStatusCd", businessCommunityMember.get("audit_status_cd"));
         businessCommunityMember.put("statusCd", statusCd);
     }
 
     /**
      * 褰撲慨鏀规暟鎹椂锛屾煡璇nstance琛ㄤ腑鐨勬暟鎹� 鑷姩淇濆瓨鍒犻櫎鏁版嵁鍒癰usiness涓�
+     *
      * @param businessCommunity 灏忓尯淇℃伅
      */
-    protected void autoSaveDelBusinessCommunity(Business business, JSONObject businessCommunity){
+    protected void autoSaveDelBusinessCommunity(Business business, JSONObject businessCommunity) {
 //鑷姩鎻掑叆DEL
         Map info = new HashMap();
-        info.put("communityId",businessCommunity.getString("communityId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        info.put("communityId", businessCommunity.getString("communityId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
         Map currentCommunityInfo = getCommunityServiceDaoImpl().getCommunityInfo(info);
-        if(currentCommunityInfo == null || currentCommunityInfo.isEmpty()){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�"+info);
+        if (currentCommunityInfo == null || currentCommunityInfo.isEmpty()) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�" + info);
         }
-        currentCommunityInfo.put("bId",business.getbId());
-        currentCommunityInfo.put("communityId",currentCommunityInfo.get("community_id"));
-        currentCommunityInfo.put("cityCode",currentCommunityInfo.get("city_code"));
-        currentCommunityInfo.put("nearbyLandmarks",currentCommunityInfo.get("nearby_landmarks"));
-        currentCommunityInfo.put("mapX",currentCommunityInfo.get("map_x"));
-        currentCommunityInfo.put("mapY",currentCommunityInfo.get("map_y"));
-        currentCommunityInfo.put("operate",StatusConstant.OPERATE_DEL);
+        currentCommunityInfo.put("bId", business.getbId());
+        currentCommunityInfo.put("communityId", currentCommunityInfo.get("community_id"));
+        currentCommunityInfo.put("cityCode", currentCommunityInfo.get("city_code"));
+        currentCommunityInfo.put("nearbyLandmarks", currentCommunityInfo.get("nearby_landmarks"));
+        currentCommunityInfo.put("mapX", currentCommunityInfo.get("map_x"));
+        currentCommunityInfo.put("mapY", currentCommunityInfo.get("map_y"));
+        currentCommunityInfo.put("operate", StatusConstant.OPERATE_DEL);
         getCommunityServiceDaoImpl().saveBusinessCommunityInfo(currentCommunityInfo);
     }
 
     /**
      * 褰撲慨鏀规暟鎹椂锛屾煡璇nstance琛ㄤ腑鐨勬暟鎹� 鑷姩淇濆瓨鍒犻櫎鏁版嵁鍒癰usiness涓�
-     * @param business 褰撳墠涓氬姟
+     *
+     * @param business      褰撳墠涓氬姟
      * @param communityAttr 灏忓尯灞炴��
      */
-    protected void autoSaveDelBusinessCommunityAttr(Business business, JSONObject communityAttr){
+    protected void autoSaveDelBusinessCommunityAttr(Business business, JSONObject communityAttr) {
         Map info = new HashMap();
-        info.put("attrId",communityAttr.getString("attrId"));
-        info.put("communityId",communityAttr.getString("communityId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        info.put("attrId", communityAttr.getString("attrId"));
+        info.put("communityId", communityAttr.getString("communityId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
         List<Map> currentCommunityAttrs = getCommunityServiceDaoImpl().getCommunityAttrs(info);
-        if(currentCommunityAttrs == null || currentCommunityAttrs.size() != 1){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�"+info);
+        if (currentCommunityAttrs == null || currentCommunityAttrs.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�" + info);
         }
         Map currentCommunityAttr = currentCommunityAttrs.get(0);
-        currentCommunityAttr.put("bId",business.getbId());
-        currentCommunityAttr.put("attrId",currentCommunityAttr.get("attr_id"));
-        currentCommunityAttr.put("communityId",currentCommunityAttr.get("community_id"));
-        currentCommunityAttr.put("specCd",currentCommunityAttr.get("spec_cd"));
-        currentCommunityAttr.put("operate",StatusConstant.OPERATE_DEL);
+        currentCommunityAttr.put("bId", business.getbId());
+        currentCommunityAttr.put("attrId", currentCommunityAttr.get("attr_id"));
+        currentCommunityAttr.put("communityId", currentCommunityAttr.get("community_id"));
+        currentCommunityAttr.put("specCd", currentCommunityAttr.get("spec_cd"));
+        currentCommunityAttr.put("operate", StatusConstant.OPERATE_DEL);
         getCommunityServiceDaoImpl().saveBusinessCommunityAttr(currentCommunityAttr);
     }
 
     /**
      * 褰撲慨鏀规暟鎹椂锛屾煡璇nstance琛ㄤ腑鐨勬暟鎹� 鑷姩淇濆瓨鍒犻櫎鏁版嵁鍒癰usiness涓�
+     *
      * @param business
      * @param businessCommunityPhoto 灏忓尯鐓х墖
      */
-    protected void autoSaveDelBusinessCommunityPhoto(Business business,JSONObject businessCommunityPhoto){
-       Map info = new HashMap();
-        info.put("communityPhotoId",businessCommunityPhoto.getString("communityPhotoId"));
-        info.put("communityId",businessCommunityPhoto.getString("communityId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+    protected void autoSaveDelBusinessCommunityPhoto(Business business, JSONObject businessCommunityPhoto) {
+        Map info = new HashMap();
+        info.put("communityPhotoId", businessCommunityPhoto.getString("communityPhotoId"));
+        info.put("communityId", businessCommunityPhoto.getString("communityId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
         List<Map> currentCommunityPhotos = getCommunityServiceDaoImpl().getCommunityPhoto(info);
-        if(currentCommunityPhotos == null || currentCommunityPhotos.size() != 1){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�"+info);
+        if (currentCommunityPhotos == null || currentCommunityPhotos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�" + info);
         }
         Map currentCommunityPhoto = currentCommunityPhotos.get(0);
-        currentCommunityPhoto.put("bId",business.getbId());
-        currentCommunityPhoto.put("communityPhotoId",currentCommunityPhoto.get("community_photo_id"));
-        currentCommunityPhoto.put("communityId",currentCommunityPhoto.get("community_id"));
-        currentCommunityPhoto.put("communityPhotoTypeCd",currentCommunityPhoto.get("community_photo_type_cd"));
-        currentCommunityPhoto.put("operate",StatusConstant.OPERATE_DEL);
+        currentCommunityPhoto.put("bId", business.getbId());
+        currentCommunityPhoto.put("communityPhotoId", currentCommunityPhoto.get("community_photo_id"));
+        currentCommunityPhoto.put("communityId", currentCommunityPhoto.get("community_id"));
+        currentCommunityPhoto.put("communityPhotoTypeCd", currentCommunityPhoto.get("community_photo_type_cd"));
+        currentCommunityPhoto.put("operate", StatusConstant.OPERATE_DEL);
         getCommunityServiceDaoImpl().saveBusinessCommunityPhoto(currentCommunityPhoto);
     }
 
 
-
     /**
      * 褰撲慨鏀规暟鎹椂锛屾煡璇nstance琛ㄤ腑鐨勬暟鎹� 鑷姩淇濆瓨鍒犻櫎鏁版嵁鍒癰usiness涓�
+     *
      * @param businessCommunityMember 灏忓尯淇℃伅
      */
-    protected void autoSaveDelBusinessCommunityMember(Business business, JSONObject businessCommunityMember){
+    protected void autoSaveDelBusinessCommunityMember(Business business, JSONObject businessCommunityMember) {
 //鑷姩鎻掑叆DEL
         Map info = new HashMap();
-        info.put("communityMemberId",businessCommunityMember.getString("communityMemberId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        info.put("communityMemberId", businessCommunityMember.getString("communityMemberId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
         Map currentCommunityMember = getCommunityServiceDaoImpl().getCommunityMember(info);
-        if(currentCommunityMember == null || currentCommunityMember.isEmpty()){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�"+info);
+        if (currentCommunityMember == null || currentCommunityMember.isEmpty()) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�" + info);
         }
-        currentCommunityMember.put("bId",business.getbId());
-        currentCommunityMember.put("communityId",currentCommunityMember.get("community_id"));
-        currentCommunityMember.put("communityMemberId",currentCommunityMember.get("community_member_id"));
-        currentCommunityMember.put("memberId",currentCommunityMember.get("member_id"));
-        currentCommunityMember.put("memberTypeCd",currentCommunityMember.get("member_type_cd"));
-        currentCommunityMember.put("operate",StatusConstant.OPERATE_DEL);
+        currentCommunityMember.put("bId", business.getbId());
+        currentCommunityMember.put("communityId", currentCommunityMember.get("community_id"));
+        currentCommunityMember.put("communityMemberId", currentCommunityMember.get("community_member_id"));
+        currentCommunityMember.put("memberId", currentCommunityMember.get("member_id"));
+        currentCommunityMember.put("memberTypeCd", currentCommunityMember.get("member_type_cd"));
+        currentCommunityMember.put("auditStatusCd", currentCommunityMember.get("audit_status_cd"));
+        currentCommunityMember.put("operate", StatusConstant.OPERATE_DEL);
         getCommunityServiceDaoImpl().saveBusinessCommunityMember(currentCommunityMember);
     }
 }

--
Gitblit v1.8.0