Browse Source

优化代码

java110 5 years ago
parent
commit
92d633d1c4
23 changed files with 2243 additions and 11 deletions
  1. 175 0
      docs/document/services/communityLocationAttr/DeleteCommunityLocationAttrInfo.md
  2. 175 0
      docs/document/services/communityLocationAttr/SaveCommunityLocationAttrInfo.md
  3. 188 0
      docs/document/services/communityLocationAttr/UpdateCommunityLocationAttrInfo.md
  4. 76 0
      java110-bean/src/main/java/com/java110/dto/communityLocationAttr/CommunityLocationAttrDto.java
  5. 46 0
      java110-bean/src/main/java/com/java110/po/communityLocationAttr/CommunityLocationAttrPo.java
  6. 195 0
      java110-db/src/main/resources/mapper/community/CommunityLocationAttrServiceDaoImplMapper.xml
  7. 11 11
      java110-generator/src/main/resources/back/template_1.json
  8. 52 0
      java110-interface/src/main/java/com/java110/intf/community/ICommunityLocationAttrInnerServiceSMO.java
  9. 19 0
      java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
  10. 31 0
      java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeCommunityLocationAttrConstant.java
  11. 38 0
      service-api/src/main/java/com/java110/api/bmo/communityLocationAttr/ICommunityLocationAttrBMO.java
  12. 61 0
      service-api/src/main/java/com/java110/api/bmo/communityLocationAttr/impl/CommunityLocationAttrBMOImpl.java
  13. 49 0
      service-api/src/main/java/com/java110/api/listener/communityLocation/DeleteCommunityLocationAttrListener.java
  14. 82 0
      service-api/src/main/java/com/java110/api/listener/communityLocation/ListCommunityLocationAttrsListener.java
  15. 47 0
      service-api/src/main/java/com/java110/api/listener/communityLocation/SaveCommunityLocationAttrListener.java
  16. 48 0
      service-api/src/main/java/com/java110/api/listener/communityLocation/UpdateCommunityLocationAttrListener.java
  17. 82 0
      service-community/src/main/java/com/java110/community/dao/ICommunityLocationAttrServiceDao.java
  18. 139 0
      service-community/src/main/java/com/java110/community/dao/impl/CommunityLocationAttrServiceDaoImpl.java
  19. 90 0
      service-community/src/main/java/com/java110/community/listener/communityLocationAttr/AbstractCommunityLocationAttrBusinessServiceDataFlowListener.java
  20. 176 0
      service-community/src/main/java/com/java110/community/listener/communityLocationAttr/DeleteCommunityLocationAttrInfoListener.java
  21. 176 0
      service-community/src/main/java/com/java110/community/listener/communityLocationAttr/SaveCommunityLocationAttrInfoListener.java
  22. 190 0
      service-community/src/main/java/com/java110/community/listener/communityLocationAttr/UpdateCommunityLocationAttrInfoListener.java
  23. 97 0
      service-community/src/main/java/com/java110/community/smo/impl/CommunityLocationAttrInnerServiceSMOImpl.java

+ 175 - 0
docs/document/services/communityLocationAttr/DeleteCommunityLocationAttrInfo.md

@@ -0,0 +1,175 @@
+package com.java110.community.listener.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 删除位置属性信息 侦听
+ *
+ * 处理节点
+ * 1、businessCommunityLocationAttr:{} 位置属性基本信息节点
+ * 2、businessCommunityLocationAttrAttr:[{}] 位置属性属性信息节点
+ * 3、businessCommunityLocationAttrPhoto:[{}] 位置属性照片信息节点
+ * 4、businessCommunityLocationAttrCerdentials:[{}] 位置属性证件信息节点
+ * 协议地址 :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
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("deleteCommunityLocationAttrInfoListener")
+@Transactional
+public class DeleteCommunityLocationAttrInfoListener extends AbstractCommunityLocationAttrBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteCommunityLocationAttrInfoListener.class);
+    @Autowired
+    ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_LOCATION_ATTR;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+            //处理 businessCommunityLocationAttr 节点
+            if(data.containsKey(CommunityLocationAttrPo.class.getSimpleName())){
+                Object _obj = data.get(CommunityLocationAttrPo.class.getSimpleName());
+                JSONArray businessCommunityLocationAttrs = null;
+                if(_obj instanceof JSONObject){
+                    businessCommunityLocationAttrs = new JSONArray();
+                    businessCommunityLocationAttrs.add(_obj);
+                }else {
+                    businessCommunityLocationAttrs = (JSONArray)_obj;
+                }
+                //JSONObject businessCommunityLocationAttr = data.getJSONObject(CommunityLocationAttrPo.class.getSimpleName());
+                for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrs.size();_communityLocationAttrIndex++) {
+                    JSONObject businessCommunityLocationAttr = businessCommunityLocationAttrs.getJSONObject(_communityLocationAttrIndex);
+                    doBusinessCommunityLocationAttr(business, businessCommunityLocationAttr);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("attrId", businessCommunityLocationAttr.getString("attrId"));
+                    }
+                }
+
+        }
+
+
+    }
+
+    /**
+     * 删除 instance数据
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+
+        //位置属性信息
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_DEL);
+
+        //位置属性信息
+        List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(info);
+        if( businessCommunityLocationAttrInfos != null && businessCommunityLocationAttrInfos.size() >0) {
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size();_communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo,StatusConstant.STATUS_CD_INVALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+                dataFlowContext.addParamOut("attrId",businessCommunityLocationAttrInfo.get("attr_id"));
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * 从business表中查询到DEL的数据 将instance中的数据更新回来
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+
+        Map delInfo = new HashMap();
+        delInfo.put("bId",business.getbId());
+        delInfo.put("operate",StatusConstant.OPERATE_DEL);
+        //位置属性信息
+        List<Map> communityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo(info);
+        if(communityLocationAttrInfo != null && communityLocationAttrInfo.size() > 0){
+
+            //位置属性信息
+            List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessCommunityLocationAttrInfos == null ||  businessCommunityLocationAttrInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(communityLocationAttr),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size();_communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo,StatusConstant.STATUS_CD_VALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 处理 businessCommunityLocationAttr 节点
+     * @param business 总的数据节点
+     * @param businessCommunityLocationAttr 位置属性节点
+     */
+    private void doBusinessCommunityLocationAttr(Business business,JSONObject businessCommunityLocationAttr){
+
+        Assert.jsonObjectHaveKey(businessCommunityLocationAttr,"attrId","businessCommunityLocationAttr 节点下没有包含 attrId 节点");
+
+        if(businessCommunityLocationAttr.getString("attrId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+businessCommunityLocationAttr);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessCommunityLocationAttr(business,businessCommunityLocationAttr);
+    }
+    @Override
+    public ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl() {
+        return communityLocationAttrServiceDaoImpl;
+    }
+
+    public void setCommunityLocationAttrServiceDaoImpl(ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl) {
+        this.communityLocationAttrServiceDaoImpl = communityLocationAttrServiceDaoImpl;
+    }
+}

+ 175 - 0
docs/document/services/communityLocationAttr/SaveCommunityLocationAttrInfo.md

@@ -0,0 +1,175 @@
+package com.java110.community.listener.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.util.Assert;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.entity.center.Business;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 保存 位置属性信息 侦听
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("saveCommunityLocationAttrInfoListener")
+@Transactional
+public class SaveCommunityLocationAttrInfoListener extends AbstractCommunityLocationAttrBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveCommunityLocationAttrInfoListener.class);
+
+    @Autowired
+    private ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_LOCATION_ATTR;
+    }
+
+    /**
+     * 保存位置属性信息 business 表中
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessCommunityLocationAttr 节点
+        if(data.containsKey(CommunityLocationAttrPo.class.getSimpleName())){
+            Object bObj = data.get(CommunityLocationAttrPo.class.getSimpleName());
+            JSONArray businessCommunityLocationAttrs = null;
+            if(bObj instanceof JSONObject){
+                businessCommunityLocationAttrs = new JSONArray();
+                businessCommunityLocationAttrs.add(bObj);
+            }else {
+                businessCommunityLocationAttrs = (JSONArray)bObj;
+            }
+            //JSONObject businessCommunityLocationAttr = data.getJSONObject(CommunityLocationAttrPo.class.getSimpleName());
+            for (int bCommunityLocationAttrIndex = 0; bCommunityLocationAttrIndex < businessCommunityLocationAttrs.size();bCommunityLocationAttrIndex++) {
+                JSONObject businessCommunityLocationAttr = businessCommunityLocationAttrs.getJSONObject(bCommunityLocationAttrIndex);
+                doBusinessCommunityLocationAttr(business, businessCommunityLocationAttr);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("attrId", businessCommunityLocationAttr.getString("attrId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * business 数据转移到 instance
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_ADD);
+
+        //位置属性信息
+        List<Map> businessCommunityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(info);
+        if( businessCommunityLocationAttrInfo != null && businessCommunityLocationAttrInfo.size() >0) {
+            reFreshShareColumn(info, businessCommunityLocationAttrInfo.get(0));
+            communityLocationAttrServiceDaoImpl.saveCommunityLocationAttrInfoInstance(info);
+            if(businessCommunityLocationAttrInfo.size() == 1) {
+                dataFlowContext.addParamOut("attrId", businessCommunityLocationAttrInfo.get(0).get("attr_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 刷 分片字段
+     *
+     * @param info         查询对象
+     * @param businessInfo 小区ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("communityId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("community_id")) {
+            return;
+        }
+
+        info.put("communityId", businessInfo.get("community_id"));
+    }
+    /**
+     * 撤单
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map paramIn = new HashMap();
+        paramIn.put("bId",bId);
+        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+        //位置属性信息
+        List<Map> communityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo(info);
+        if(communityLocationAttrInfo != null && communityLocationAttrInfo.size() > 0){
+            reFreshShareColumn(paramIn, communityLocationAttrInfo.get(0));
+            communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 处理 businessCommunityLocationAttr 节点
+     * @param business 总的数据节点
+     * @param businessCommunityLocationAttr 位置属性节点
+     */
+    private void doBusinessCommunityLocationAttr(Business business,JSONObject businessCommunityLocationAttr){
+
+        Assert.jsonObjectHaveKey(businessCommunityLocationAttr,"attrId","businessCommunityLocationAttr 节点下没有包含 attrId 节点");
+
+        if(businessCommunityLocationAttr.getString("attrId").startsWith("-")){
+            //刷新缓存
+            //flushCommunityLocationAttrId(business.getDatas());
+
+            businessCommunityLocationAttr.put("attrId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
+
+        }
+
+        businessCommunityLocationAttr.put("bId",business.getbId());
+        businessCommunityLocationAttr.put("operate", StatusConstant.OPERATE_ADD);
+        //保存位置属性信息
+        communityLocationAttrServiceDaoImpl.saveBusinessCommunityLocationAttrInfo(businessCommunityLocationAttr);
+
+    }
+    @Override
+    public ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl() {
+        return communityLocationAttrServiceDaoImpl;
+    }
+
+    public void setCommunityLocationAttrServiceDaoImpl(ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl) {
+        this.communityLocationAttrServiceDaoImpl = communityLocationAttrServiceDaoImpl;
+    }
+}

+ 188 - 0
docs/document/services/communityLocationAttr/UpdateCommunityLocationAttrInfo.md

@@ -0,0 +1,188 @@
+package com.java110.community.listener.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 修改位置属性信息 侦听
+ *
+ * 处理节点
+ * 1、businessCommunityLocationAttr:{} 位置属性基本信息节点
+ * 2、businessCommunityLocationAttrAttr:[{}] 位置属性属性信息节点
+ * 3、businessCommunityLocationAttrPhoto:[{}] 位置属性照片信息节点
+ * 4、businessCommunityLocationAttrCerdentials:[{}] 位置属性证件信息节点
+ * 协议地址 :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("updateCommunityLocationAttrInfoListener")
+@Transactional
+public class UpdateCommunityLocationAttrInfoListener extends AbstractCommunityLocationAttrBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateCommunityLocationAttrInfoListener.class);
+    @Autowired
+    private ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_LOCATION_ATTR;
+    }
+
+    /**
+     * business过程
+     * @param dataFlowContext 上下文对象
+     * @param business 业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+
+            //处理 businessCommunityLocationAttr 节点
+            if(data.containsKey(CommunityLocationAttrPo.class.getSimpleName())){
+                Object _obj = data.get(CommunityLocationAttrPo.class.getSimpleName());
+                JSONArray businessCommunityLocationAttrs = null;
+                if(_obj instanceof JSONObject){
+                    businessCommunityLocationAttrs = new JSONArray();
+                    businessCommunityLocationAttrs.add(_obj);
+                }else {
+                    businessCommunityLocationAttrs = (JSONArray)_obj;
+                }
+                //JSONObject businessCommunityLocationAttr = data.getJSONObject(CommunityLocationAttrPo.class.getSimpleName());
+                for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrs.size();_communityLocationAttrIndex++) {
+                    JSONObject businessCommunityLocationAttr = businessCommunityLocationAttrs.getJSONObject(_communityLocationAttrIndex);
+                    doBusinessCommunityLocationAttr(business, businessCommunityLocationAttr);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("attrId", businessCommunityLocationAttr.getString("attrId"));
+                    }
+                }
+            }
+    }
+
+
+    /**
+     * business to instance 过程
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_ADD);
+
+        //位置属性信息
+        List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(info);
+        if( businessCommunityLocationAttrInfos != null && businessCommunityLocationAttrInfos.size() >0) {
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size();_communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo,StatusConstant.STATUS_CD_VALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+                if(businessCommunityLocationAttrInfo.size() == 1) {
+                    dataFlowContext.addParamOut("attrId", businessCommunityLocationAttrInfo.get("attr_id"));
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map delInfo = new HashMap();
+        delInfo.put("bId",business.getbId());
+        delInfo.put("operate",StatusConstant.OPERATE_DEL);
+        //位置属性信息
+        List<Map> communityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo(info);
+        if(communityLocationAttrInfo != null && communityLocationAttrInfo.size() > 0){
+
+            //位置属性信息
+            List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessCommunityLocationAttrInfos == null || businessCommunityLocationAttrInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(communityLocationAttr),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size();_communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo,StatusConstant.STATUS_CD_VALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+            }
+        }
+
+    }
+
+
+
+    /**
+     * 处理 businessCommunityLocationAttr 节点
+     * @param business 总的数据节点
+     * @param businessCommunityLocationAttr 位置属性节点
+     */
+    private void doBusinessCommunityLocationAttr(Business business,JSONObject businessCommunityLocationAttr){
+
+        Assert.jsonObjectHaveKey(businessCommunityLocationAttr,"attrId","businessCommunityLocationAttr 节点下没有包含 attrId 节点");
+
+        if(businessCommunityLocationAttr.getString("attrId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+businessCommunityLocationAttr);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessCommunityLocationAttr(business,businessCommunityLocationAttr);
+
+        businessCommunityLocationAttr.put("bId",business.getbId());
+        businessCommunityLocationAttr.put("operate", StatusConstant.OPERATE_ADD);
+        //保存位置属性信息
+        communityLocationAttrServiceDaoImpl.saveBusinessCommunityLocationAttrInfo(businessCommunityLocationAttr);
+
+    }
+
+
+
+    @Override
+    public ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl() {
+        return communityLocationAttrServiceDaoImpl;
+    }
+
+    public void setCommunityLocationAttrServiceDaoImpl(ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl) {
+        this.communityLocationAttrServiceDaoImpl = communityLocationAttrServiceDaoImpl;
+    }
+
+
+
+}

+ 76 - 0
java110-bean/src/main/java/com/java110/dto/communityLocationAttr/CommunityLocationAttrDto.java

@@ -0,0 +1,76 @@
+package com.java110.dto.communityLocationAttr;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 位置属性数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class CommunityLocationAttrDto extends PageDto implements Serializable {
+
+    private String attrId;
+private String locationId;
+private String specCd;
+private String communityId;
+private String value;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getAttrId() {
+        return attrId;
+    }
+public void setAttrId(String attrId) {
+        this.attrId = attrId;
+    }
+public String getLocationId() {
+        return locationId;
+    }
+public void setLocationId(String locationId) {
+        this.locationId = locationId;
+    }
+public String getSpecCd() {
+        return specCd;
+    }
+public void setSpecCd(String specCd) {
+        this.specCd = specCd;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getValue() {
+        return value;
+    }
+public void setValue(String value) {
+        this.value = value;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 46 - 0
java110-bean/src/main/java/com/java110/po/communityLocationAttr/CommunityLocationAttrPo.java

@@ -0,0 +1,46 @@
+package com.java110.po.communityLocationAttr;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class CommunityLocationAttrPo implements Serializable {
+
+    private String attrId;
+private String locationId;
+private String specCd;
+private String communityId;
+private String value;
+public String getAttrId() {
+        return attrId;
+    }
+public void setAttrId(String attrId) {
+        this.attrId = attrId;
+    }
+public String getLocationId() {
+        return locationId;
+    }
+public void setLocationId(String locationId) {
+        this.locationId = locationId;
+    }
+public String getSpecCd() {
+        return specCd;
+    }
+public void setSpecCd(String specCd) {
+        this.specCd = specCd;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getValue() {
+        return value;
+    }
+public void setValue(String value) {
+        this.value = value;
+    }
+
+
+
+}

+ 195 - 0
java110-db/src/main/resources/mapper/community/CommunityLocationAttrServiceDaoImplMapper.xml

@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="communityLocationAttrServiceDaoImpl">
+
+    <!-- 保存位置属性信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessCommunityLocationAttrInfo" parameterType="Map">
+        insert into business_community_location_attr(
+        attr_id,operate,create_time,location_id,spec_cd,community_id,b_id,value
+        ) values (
+        #{attrId},#{operate},#{createTime},#{locationId},#{specCd},#{communityId},#{bId},#{value}
+        )
+    </insert>
+
+
+    <insert id="saveCommunityLocationAttr" parameterType="Map">
+        insert into community_location_attr(
+        attr_id,location_id,spec_cd,community_id,b_id,value
+        ) values (
+        #{attrId},#{locationId},#{specCd},#{communityId},'-1',#{value}
+        )
+    </insert>
+
+
+    <!-- 查询位置属性信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessCommunityLocationAttrInfo" parameterType="Map" resultType="Map">
+        select t.attr_id,t.attr_id attrId,t.operate,t.create_time,t.create_time createTime,t.location_id,t.location_id
+        locationId,t.spec_cd,t.spec_cd specCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.value
+        from business_community_location_attr t
+        where 1 =1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="locationId !=null and locationId != ''">
+            and t.location_id= #{locationId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="value !=null and value != ''">
+            and t.value= #{value}
+        </if>
+
+    </select>
+
+
+    <!-- 保存位置属性信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveCommunityLocationAttrInfoInstance" parameterType="Map">
+        insert into community_location_attr(
+        attr_id,create_time,location_id,spec_cd,status_cd,community_id,b_id,value
+        ) select t.attr_id,t.create_time,t.location_id,t.spec_cd,'0',t.community_id,t.b_id,t.value from
+        business_community_location_attr t where 1=1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+        and t.operate= 'ADD'
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="locationId !=null and locationId != ''">
+            and t.location_id= #{locationId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="value !=null and value != ''">
+            and t.value= #{value}
+        </if>
+
+    </insert>
+
+
+    <!-- 查询位置属性信息 add by wuxw 2018-07-03 -->
+    <select id="getCommunityLocationAttrInfo" parameterType="Map" resultType="Map">
+        select t.attr_id,t.attr_id attrId,t.create_time,t.create_time createTime,t.location_id,t.location_id
+        locationId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id
+        communityId,t.b_id,t.b_id bId,t.value
+        from community_location_attr t
+        where 1 =1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="locationId !=null and locationId != ''">
+            and t.location_id= #{locationId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="value !=null and value != ''">
+            and t.value= #{value}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改位置属性信息 add by wuxw 2018-07-03 -->
+    <update id="updateCommunityLocationAttrInfoInstance" parameterType="Map">
+        update community_location_attr t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            , t.create_time= #{createTime}
+        </if>
+        <if test="locationId !=null and locationId != ''">
+            , t.location_id= #{locationId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            , t.spec_cd= #{specCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="value !=null and value != ''">
+            , t.value= #{value}
+        </if>
+        where 1=1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+
+    </update>
+
+    <!-- 查询位置属性数量 add by wuxw 2018-07-03 -->
+    <select id="queryCommunityLocationAttrsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from community_location_attr t
+        where 1 =1
+        <if test="attrId !=null and attrId != ''">
+            and t.attr_id= #{attrId}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="locationId !=null and locationId != ''">
+            and t.location_id= #{locationId}
+        </if>
+        <if test="specCd !=null and specCd != ''">
+            and t.spec_cd= #{specCd}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="value !=null and value != ''">
+            and t.value= #{value}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 11 - 11
java110-generator/src/main/resources/back/template_1.json

@@ -1,22 +1,22 @@
 {
   "autoMove": true,
   "id": "attrId",
-  "name": "parkingSpaceAttr",
-  "desc": "位属性",
+  "name": "communityLocationAttr",
+  "desc": "位属性",
   "shareParam": "communityId",
   "shareColumn": "community_id",
   "shareName": "community",
-  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_PARKING_SPACE_ATTR",
-  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_PARKING_SPACE_ATTR",
-  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_PARKING_SPACE_ATTR",
-  "newBusinessTypeCdValue": "540100030002",
-  "updateBusinessTypeCdValue": "540100040002",
-  "deleteBusinessTypeCdValue": "540100050002",
-  "businessTableName": "business_parking_space_attr",
-  "tableName": "parking_space_attr",
+  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_LOCATION_ATTR",
+  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_LOCATION_ATTR",
+  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_LOCATION_ATTR",
+  "newBusinessTypeCdValue": "570100030002",
+  "updateBusinessTypeCdValue": "570100040002",
+  "deleteBusinessTypeCdValue": "570100050002",
+  "businessTableName": "business_community_location_attr",
+  "tableName": "community_location_attr",
   "param": {
     "communityId": "community_id",
-    "psId": "ps_id",
+    "locationId": "location_id",
     "bId": "b_id",
     "attrId": "attr_id",
     "specCd": "spec_cd",

+ 52 - 0
java110-interface/src/main/java/com/java110/intf/community/ICommunityLocationAttrInnerServiceSMO.java

@@ -0,0 +1,52 @@
+package com.java110.intf.community;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.communityLocationAttr.CommunityLocationAttrDto;
+import com.java110.po.communityLocationAttr.CommunityLocationAttrPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * @ClassName ICommunityLocationAttrInnerServiceSMO
+ * @Description 位置属性接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/communityLocationAttrApi")
+public interface ICommunityLocationAttrInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param communityLocationAttrDto 数据对象分享
+     * @return CommunityLocationAttrDto 对象数据
+     */
+    @RequestMapping(value = "/queryCommunityLocationAttrs", method = RequestMethod.POST)
+    List<CommunityLocationAttrDto> queryCommunityLocationAttrs(@RequestBody CommunityLocationAttrDto communityLocationAttrDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param communityLocationAttrDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryCommunityLocationAttrsCount", method = RequestMethod.POST)
+    int queryCommunityLocationAttrsCount(@RequestBody CommunityLocationAttrDto communityLocationAttrDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param communityLocationAttrPo 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/saveCommunityLocationAttr", method = RequestMethod.POST)
+    int saveCommunityLocationAttr(@RequestBody CommunityLocationAttrPo communityLocationAttrPo);
+}

+ 19 - 0
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

@@ -1246,6 +1246,25 @@ public class BusinessTypeConstant {
      */
     public static final String BUSINESS_TYPE_DELETE_LOCATION="570100050001";
 
+    /**
+     *  保存任务
+     *  3保存
+     */
+    public static final String BUSINESS_TYPE_SAVE_LOCATION_ATTR="570100030002";
+
+
+    /**
+     *  修改任务
+     *  3保存
+     */
+    public static final String BUSINESS_TYPE_UPDATE_LOCATION_ATTR="570100040002";
+
+    /**
+     * 删除任务
+     */
+    public static final String BUSINESS_TYPE_DELETE_LOCATION_ATTR="570100050002";
+
+
     /**
      *  保存工作流
      *  3保存

+ 31 - 0
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeCommunityLocationAttrConstant.java

@@ -0,0 +1,31 @@
+package com.java110.utils.constant;
+
+/**
+ * 位置属性常量类
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeCommunityLocationAttrConstant {
+
+    /**
+     * 添加 位置属性
+     */
+    public static final String ADD_COMMUNITYLOCATIONATTR = "communityLocation.saveCommunityLocationAttr";
+
+
+    /**
+     * 修改 位置属性
+     */
+    public static final String UPDATE_COMMUNITYLOCATIONATTR = "communityLocation.updateCommunityLocationAttr";
+    /**
+     * 删除 位置属性
+     */
+    public static final String DELETE_COMMUNITYLOCATIONATTR = "communityLocation.deleteCommunityLocationAttr";
+
+
+    /**
+     * 查询 位置属性
+     */
+    public static final String LIST_COMMUNITYLOCATIONATTRS = "communityLocation.listCommunityLocationAttrs";
+
+
+}

+ 38 - 0
service-api/src/main/java/com/java110/api/bmo/communityLocationAttr/ICommunityLocationAttrBMO.java

@@ -0,0 +1,38 @@
+package com.java110.api.bmo.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.IApiBaseBMO;
+import com.java110.core.context.DataFlowContext;
+
+public interface ICommunityLocationAttrBMO extends IApiBaseBMO {
+
+
+    /**
+     * 添加位置属性
+     * @param paramInJson
+     * @param dataFlowContext
+     * @return
+     */
+     void addCommunityLocationAttr(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 添加位置属性信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+     void updateCommunityLocationAttr(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 删除位置属性
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+     void deleteCommunityLocationAttr(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+
+
+}

+ 61 - 0
service-api/src/main/java/com/java110/api/bmo/communityLocationAttr/impl/CommunityLocationAttrBMOImpl.java

@@ -0,0 +1,61 @@
+package com.java110.api.bmo.communityLocationAttr.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.ApiBaseBMO;
+import com.java110.api.bmo.communityLocationAttr.ICommunityLocationAttrBMO;
+import com.java110.core.context.DataFlowContext;
+import com.java110.intf.community.ICommunityLocationAttrInnerServiceSMO;
+import com.java110.po.communityLocationAttr.CommunityLocationAttrPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service("communityLocationAttrBMOImpl")
+public class CommunityLocationAttrBMOImpl extends ApiBaseBMO implements ICommunityLocationAttrBMO {
+
+    @Autowired
+    private ICommunityLocationAttrInnerServiceSMO communityLocationAttrInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public void addCommunityLocationAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+        paramInJson.put("attrId", "-1");
+        CommunityLocationAttrPo communityLocationAttrPo = BeanConvertUtil.covertBean(paramInJson, CommunityLocationAttrPo.class);
+        super.insert(dataFlowContext, communityLocationAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_LOCATION_ATTR);
+    }
+
+
+    /**
+     * 添加活动信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public void updateCommunityLocationAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+        CommunityLocationAttrPo communityLocationAttrPo = BeanConvertUtil.covertBean(paramInJson, CommunityLocationAttrPo.class);
+        super.update(dataFlowContext, communityLocationAttrPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_LOCATION_ATTR);
+    }
+
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public void deleteCommunityLocationAttr(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+        CommunityLocationAttrPo communityLocationAttrPo = BeanConvertUtil.covertBean(paramInJson, CommunityLocationAttrPo.class);
+        super.update(dataFlowContext, communityLocationAttrPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_LOCATION_ATTR);
+    }
+
+}

+ 49 - 0
service-api/src/main/java/com/java110/api/listener/communityLocation/DeleteCommunityLocationAttrListener.java

@@ -0,0 +1,49 @@
+package com.java110.api.listener.communityLocation;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.communityLocationAttr.ICommunityLocationAttrBMO;
+import com.java110.api.listener.AbstractServiceApiPlusListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeCommunityLocationAttrConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+
+/**
+ * 保存小区侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("deleteCommunityLocationAttrListener")
+public class DeleteCommunityLocationAttrListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private ICommunityLocationAttrBMO communityLocationAttrBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        communityLocationAttrBMOImpl.deleteCommunityLocationAttr(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeCommunityLocationAttrConstant.DELETE_COMMUNITYLOCATIONATTR;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+}

+ 82 - 0
service-api/src/main/java/com/java110/api/listener/communityLocation/ListCommunityLocationAttrsListener.java

@@ -0,0 +1,82 @@
+package com.java110.api.listener.communityLocation;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.dto.communityLocationAttr.CommunityLocationAttrDto;
+import com.java110.intf.community.ICommunityLocationAttrInnerServiceSMO;
+import com.java110.utils.constant.ServiceCodeCommunityLocationAttrConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 查询小区侦听类
+ */
+@Java110Listener("listCommunityLocationAttrsListener")
+public class ListCommunityLocationAttrsListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private ICommunityLocationAttrInnerServiceSMO communityLocationAttrInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeCommunityLocationAttrConstant.LIST_COMMUNITYLOCATIONATTRS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public ICommunityLocationAttrInnerServiceSMO getCommunityLocationAttrInnerServiceSMOImpl() {
+        return communityLocationAttrInnerServiceSMOImpl;
+    }
+
+    public void setCommunityLocationAttrInnerServiceSMOImpl(ICommunityLocationAttrInnerServiceSMO communityLocationAttrInnerServiceSMOImpl) {
+        this.communityLocationAttrInnerServiceSMOImpl = communityLocationAttrInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        CommunityLocationAttrDto communityLocationAttrDto = BeanConvertUtil.covertBean(reqJson, CommunityLocationAttrDto.class);
+
+        int count = communityLocationAttrInnerServiceSMOImpl.queryCommunityLocationAttrsCount(communityLocationAttrDto);
+
+        List<CommunityLocationAttrDto> communityLocationAttrDtos = null;
+
+        if (count > 0) {
+            communityLocationAttrDtos = communityLocationAttrInnerServiceSMOImpl.queryCommunityLocationAttrs(communityLocationAttrDto);
+        } else {
+            communityLocationAttrDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, communityLocationAttrDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 47 - 0
service-api/src/main/java/com/java110/api/listener/communityLocation/SaveCommunityLocationAttrListener.java

@@ -0,0 +1,47 @@
+package com.java110.api.listener.communityLocation;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.communityLocationAttr.ICommunityLocationAttrBMO;
+import com.java110.api.listener.AbstractServiceApiPlusListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeCommunityLocationAttrConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+/**
+ * 保存商户侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("saveCommunityLocationAttrListener")
+public class SaveCommunityLocationAttrListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private ICommunityLocationAttrBMO communityLocationAttrBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+        communityLocationAttrBMOImpl.addCommunityLocationAttr(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeCommunityLocationAttrConstant.ADD_COMMUNITYLOCATIONATTR;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+}

+ 48 - 0
service-api/src/main/java/com/java110/api/listener/communityLocation/UpdateCommunityLocationAttrListener.java

@@ -0,0 +1,48 @@
+package com.java110.api.listener.communityLocation;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.communityLocationAttr.ICommunityLocationAttrBMO;
+import com.java110.api.listener.AbstractServiceApiPlusListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeCommunityLocationAttrConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+/**
+ * 保存位置属性侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("updateCommunityLocationAttrListener")
+public class UpdateCommunityLocationAttrListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private ICommunityLocationAttrBMO communityLocationAttrBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
+        Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        communityLocationAttrBMOImpl.updateCommunityLocationAttr(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeCommunityLocationAttrConstant.UPDATE_COMMUNITYLOCATIONATTR;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+}

+ 82 - 0
service-community/src/main/java/com/java110/community/dao/ICommunityLocationAttrServiceDao.java

@@ -0,0 +1,82 @@
+package com.java110.community.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 位置属性组件内部之间使用,没有给外围系统提供服务能力
+ * 位置属性服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ *
+ * Created by wuxw on 2016/12/27.
+ */
+public interface ICommunityLocationAttrServiceDao {
+
+    /**
+     * 保存 位置属性信息
+     * @param businessCommunityLocationAttrInfo 位置属性信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessCommunityLocationAttrInfo(Map businessCommunityLocationAttrInfo) throws DAOException;
+
+
+
+    /**
+     * 查询位置属性信息(business过程)
+     * 根据bId 查询位置属性信息
+     * @param info bId 信息
+     * @return 位置属性信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessCommunityLocationAttrInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 位置属性信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveCommunityLocationAttrInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询位置属性信息(instance过程)
+     * 根据bId 查询位置属性信息
+     * @param info bId 信息
+     * @return 位置属性信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getCommunityLocationAttrInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改位置属性信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateCommunityLocationAttrInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询位置属性总数
+     *
+     * @param info 位置属性信息
+     * @return 位置属性数量
+     */
+    int queryCommunityLocationAttrsCount(Map info);
+
+    int saveCommunityLocationAttr(Map beanCovertMap);
+}

+ 139 - 0
service-community/src/main/java/com/java110/community/dao/impl/CommunityLocationAttrServiceDaoImpl.java

@@ -0,0 +1,139 @@
+package com.java110.community.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 位置属性服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("communityLocationAttrServiceDaoImpl")
+//@Transactional
+public class CommunityLocationAttrServiceDaoImpl extends BaseServiceDao implements ICommunityLocationAttrServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(CommunityLocationAttrServiceDaoImpl.class);
+
+    /**
+     * 位置属性信息封装
+     * @param businessCommunityLocationAttrInfo 位置属性信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessCommunityLocationAttrInfo(Map businessCommunityLocationAttrInfo) throws DAOException {
+        businessCommunityLocationAttrInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存位置属性信息 入参 businessCommunityLocationAttrInfo : {}",businessCommunityLocationAttrInfo);
+        int saveFlag = sqlSessionTemplate.insert("communityLocationAttrServiceDaoImpl.saveBusinessCommunityLocationAttrInfo",businessCommunityLocationAttrInfo);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存位置属性数据失败:"+ JSONObject.toJSONString(businessCommunityLocationAttrInfo));
+        }
+    }
+
+
+    /**
+     * 查询位置属性信息
+     * @param info bId 信息
+     * @return 位置属性信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessCommunityLocationAttrInfo(Map info) throws DAOException {
+
+        logger.debug("查询位置属性信息 入参 info : {}",info);
+
+        List<Map> businessCommunityLocationAttrInfos = sqlSessionTemplate.selectList("communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo",info);
+
+        return businessCommunityLocationAttrInfos;
+    }
+
+
+
+    /**
+     * 保存位置属性信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveCommunityLocationAttrInfoInstance(Map info) throws DAOException {
+        logger.debug("保存位置属性信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("communityLocationAttrServiceDaoImpl.saveCommunityLocationAttrInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存位置属性信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询位置属性信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getCommunityLocationAttrInfo(Map info) throws DAOException {
+        logger.debug("查询位置属性信息 入参 info : {}",info);
+
+        List<Map> businessCommunityLocationAttrInfos = sqlSessionTemplate.selectList("communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo",info);
+
+        return businessCommunityLocationAttrInfos;
+    }
+
+
+    /**
+     * 修改位置属性信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateCommunityLocationAttrInfoInstance(Map info) throws DAOException {
+        logger.debug("修改位置属性信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改位置属性信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询位置属性数量
+     * @param info 位置属性信息
+     * @return 位置属性数量
+     */
+    @Override
+    public int queryCommunityLocationAttrsCount(Map info) {
+        logger.debug("查询位置属性数据 入参 info : {}",info);
+
+        List<Map> businessCommunityLocationAttrInfos = sqlSessionTemplate.selectList("communityLocationAttrServiceDaoImpl.queryCommunityLocationAttrsCount", info);
+        if (businessCommunityLocationAttrInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessCommunityLocationAttrInfos.get(0).get("count").toString());
+    }
+
+    @Override
+    public int saveCommunityLocationAttr(Map info) {
+        logger.debug("修改位置属性信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("communityLocationAttrServiceDaoImpl.saveCommunityLocationAttr",info);
+
+        return saveFlag;
+    }
+
+
+}

+ 90 - 0
service-community/src/main/java/com/java110/community/listener/communityLocationAttr/AbstractCommunityLocationAttrBusinessServiceDataFlowListener.java

@@ -0,0 +1,90 @@
+package com.java110.community.listener.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import com.java110.core.event.service.AbstractBusinessServiceDataFlowListener;
+import com.java110.entity.center.Business;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 位置属性 服务侦听 父类
+ * Created by wuxw on 2018/7/4.
+ */
+public abstract class AbstractCommunityLocationAttrBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractCommunityLocationAttrBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     *
+     * @return
+     */
+    public abstract ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl();
+
+    /**
+     * 刷新 businessCommunityLocationAttrInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
+     * @param businessCommunityLocationAttrInfo
+     */
+    protected void flushBusinessCommunityLocationAttrInfo(Map businessCommunityLocationAttrInfo, String statusCd) {
+        businessCommunityLocationAttrInfo.put("newBId", businessCommunityLocationAttrInfo.get("b_id"));
+        businessCommunityLocationAttrInfo.put("attrId", businessCommunityLocationAttrInfo.get("attr_id"));
+        businessCommunityLocationAttrInfo.put("operate", businessCommunityLocationAttrInfo.get("operate"));
+        businessCommunityLocationAttrInfo.put("createTime", businessCommunityLocationAttrInfo.get("create_time"));
+        businessCommunityLocationAttrInfo.put("locationId", businessCommunityLocationAttrInfo.get("location_id"));
+        businessCommunityLocationAttrInfo.put("specCd", businessCommunityLocationAttrInfo.get("spec_cd"));
+        businessCommunityLocationAttrInfo.put("communityId", businessCommunityLocationAttrInfo.get("community_id"));
+        businessCommunityLocationAttrInfo.put("value", businessCommunityLocationAttrInfo.get("value"));
+        businessCommunityLocationAttrInfo.remove("bId");
+        businessCommunityLocationAttrInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
+     * @param businessCommunityLocationAttr 位置属性信息
+     */
+    protected void autoSaveDelBusinessCommunityLocationAttr(Business business, JSONObject businessCommunityLocationAttr) {
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("attrId", businessCommunityLocationAttr.getString("attrId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentCommunityLocationAttrInfos = getCommunityLocationAttrServiceDaoImpl().getCommunityLocationAttrInfo(info);
+        if (currentCommunityLocationAttrInfos == null || currentCommunityLocationAttrInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
+        }
+
+        Map currentCommunityLocationAttrInfo = currentCommunityLocationAttrInfos.get(0);
+
+        currentCommunityLocationAttrInfo.put("bId", business.getbId());
+
+        currentCommunityLocationAttrInfo.put("attrId", currentCommunityLocationAttrInfo.get("attr_id"));
+        currentCommunityLocationAttrInfo.put("operate", currentCommunityLocationAttrInfo.get("operate"));
+        currentCommunityLocationAttrInfo.put("createTime", currentCommunityLocationAttrInfo.get("create_time"));
+        currentCommunityLocationAttrInfo.put("locationId", currentCommunityLocationAttrInfo.get("location_id"));
+        currentCommunityLocationAttrInfo.put("specCd", currentCommunityLocationAttrInfo.get("spec_cd"));
+        currentCommunityLocationAttrInfo.put("communityId", currentCommunityLocationAttrInfo.get("community_id"));
+        currentCommunityLocationAttrInfo.put("value", currentCommunityLocationAttrInfo.get("value"));
+
+
+        currentCommunityLocationAttrInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getCommunityLocationAttrServiceDaoImpl().saveBusinessCommunityLocationAttrInfo(currentCommunityLocationAttrInfo);
+        for (Object key : currentCommunityLocationAttrInfo.keySet()) {
+            if (businessCommunityLocationAttr.get(key) == null) {
+                businessCommunityLocationAttr.put(key.toString(), currentCommunityLocationAttrInfo.get(key));
+            }
+        }
+    }
+
+
+}

+ 176 - 0
service-community/src/main/java/com/java110/community/listener/communityLocationAttr/DeleteCommunityLocationAttrInfoListener.java

@@ -0,0 +1,176 @@
+package com.java110.community.listener.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.po.communityLocationAttr.CommunityLocationAttrPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 删除位置属性信息 侦听
+ *
+ * 处理节点
+ * 1、businessCommunityLocationAttr:{} 位置属性基本信息节点
+ * 2、businessCommunityLocationAttrAttr:[{}] 位置属性属性信息节点
+ * 3、businessCommunityLocationAttrPhoto:[{}] 位置属性照片信息节点
+ * 4、businessCommunityLocationAttrCerdentials:[{}] 位置属性证件信息节点
+ * 协议地址 :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
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("deleteCommunityLocationAttrInfoListener")
+@Transactional
+public class DeleteCommunityLocationAttrInfoListener extends AbstractCommunityLocationAttrBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteCommunityLocationAttrInfoListener.class);
+    @Autowired
+    ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_LOCATION_ATTR;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+            //处理 businessCommunityLocationAttr 节点
+            if(data.containsKey(CommunityLocationAttrPo.class.getSimpleName())){
+                Object _obj = data.get(CommunityLocationAttrPo.class.getSimpleName());
+                JSONArray businessCommunityLocationAttrs = null;
+                if(_obj instanceof JSONObject){
+                    businessCommunityLocationAttrs = new JSONArray();
+                    businessCommunityLocationAttrs.add(_obj);
+                }else {
+                    businessCommunityLocationAttrs = (JSONArray)_obj;
+                }
+                //JSONObject businessCommunityLocationAttr = data.getJSONObject(CommunityLocationAttrPo.class.getSimpleName());
+                for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrs.size();_communityLocationAttrIndex++) {
+                    JSONObject businessCommunityLocationAttr = businessCommunityLocationAttrs.getJSONObject(_communityLocationAttrIndex);
+                    doBusinessCommunityLocationAttr(business, businessCommunityLocationAttr);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("attrId", businessCommunityLocationAttr.getString("attrId"));
+                    }
+                }
+
+        }
+
+
+    }
+
+    /**
+     * 删除 instance数据
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+
+        //位置属性信息
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_DEL);
+
+        //位置属性信息
+        List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(info);
+        if( businessCommunityLocationAttrInfos != null && businessCommunityLocationAttrInfos.size() >0) {
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size();_communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo,StatusConstant.STATUS_CD_INVALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+                dataFlowContext.addParamOut("attrId",businessCommunityLocationAttrInfo.get("attr_id"));
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * 从business表中查询到DEL的数据 将instance中的数据更新回来
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+
+        Map delInfo = new HashMap();
+        delInfo.put("bId",business.getbId());
+        delInfo.put("operate",StatusConstant.OPERATE_DEL);
+        //位置属性信息
+        List<Map> communityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo(info);
+        if(communityLocationAttrInfo != null && communityLocationAttrInfo.size() > 0){
+
+            //位置属性信息
+            List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessCommunityLocationAttrInfos == null ||  businessCommunityLocationAttrInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(communityLocationAttr),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size();_communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo,StatusConstant.STATUS_CD_VALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 处理 businessCommunityLocationAttr 节点
+     * @param business 总的数据节点
+     * @param businessCommunityLocationAttr 位置属性节点
+     */
+    private void doBusinessCommunityLocationAttr(Business business,JSONObject businessCommunityLocationAttr){
+
+        Assert.jsonObjectHaveKey(businessCommunityLocationAttr,"attrId","businessCommunityLocationAttr 节点下没有包含 attrId 节点");
+
+        if(businessCommunityLocationAttr.getString("attrId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+businessCommunityLocationAttr);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessCommunityLocationAttr(business,businessCommunityLocationAttr);
+    }
+    @Override
+    public ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl() {
+        return communityLocationAttrServiceDaoImpl;
+    }
+
+    public void setCommunityLocationAttrServiceDaoImpl(ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl) {
+        this.communityLocationAttrServiceDaoImpl = communityLocationAttrServiceDaoImpl;
+    }
+}

+ 176 - 0
service-community/src/main/java/com/java110/community/listener/communityLocationAttr/SaveCommunityLocationAttrInfoListener.java

@@ -0,0 +1,176 @@
+package com.java110.community.listener.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.po.communityLocationAttr.CommunityLocationAttrPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.util.Assert;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.entity.center.Business;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 保存 位置属性信息 侦听
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("saveCommunityLocationAttrInfoListener")
+@Transactional
+public class SaveCommunityLocationAttrInfoListener extends AbstractCommunityLocationAttrBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveCommunityLocationAttrInfoListener.class);
+
+    @Autowired
+    private ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_LOCATION_ATTR;
+    }
+
+    /**
+     * 保存位置属性信息 business 表中
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessCommunityLocationAttr 节点
+        if(data.containsKey(CommunityLocationAttrPo.class.getSimpleName())){
+            Object bObj = data.get(CommunityLocationAttrPo.class.getSimpleName());
+            JSONArray businessCommunityLocationAttrs = null;
+            if(bObj instanceof JSONObject){
+                businessCommunityLocationAttrs = new JSONArray();
+                businessCommunityLocationAttrs.add(bObj);
+            }else {
+                businessCommunityLocationAttrs = (JSONArray)bObj;
+            }
+            //JSONObject businessCommunityLocationAttr = data.getJSONObject(CommunityLocationAttrPo.class.getSimpleName());
+            for (int bCommunityLocationAttrIndex = 0; bCommunityLocationAttrIndex < businessCommunityLocationAttrs.size();bCommunityLocationAttrIndex++) {
+                JSONObject businessCommunityLocationAttr = businessCommunityLocationAttrs.getJSONObject(bCommunityLocationAttrIndex);
+                doBusinessCommunityLocationAttr(business, businessCommunityLocationAttr);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("attrId", businessCommunityLocationAttr.getString("attrId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * business 数据转移到 instance
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_ADD);
+
+        //位置属性信息
+        List<Map> businessCommunityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(info);
+        if( businessCommunityLocationAttrInfo != null && businessCommunityLocationAttrInfo.size() >0) {
+            reFreshShareColumn(info, businessCommunityLocationAttrInfo.get(0));
+            communityLocationAttrServiceDaoImpl.saveCommunityLocationAttrInfoInstance(info);
+            if(businessCommunityLocationAttrInfo.size() == 1) {
+                dataFlowContext.addParamOut("attrId", businessCommunityLocationAttrInfo.get(0).get("attr_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 刷 分片字段
+     *
+     * @param info         查询对象
+     * @param businessInfo 小区ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("communityId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("community_id")) {
+            return;
+        }
+
+        info.put("communityId", businessInfo.get("community_id"));
+    }
+    /**
+     * 撤单
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map paramIn = new HashMap();
+        paramIn.put("bId",bId);
+        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+        //位置属性信息
+        List<Map> communityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo(info);
+        if(communityLocationAttrInfo != null && communityLocationAttrInfo.size() > 0){
+            reFreshShareColumn(paramIn, communityLocationAttrInfo.get(0));
+            communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 处理 businessCommunityLocationAttr 节点
+     * @param business 总的数据节点
+     * @param businessCommunityLocationAttr 位置属性节点
+     */
+    private void doBusinessCommunityLocationAttr(Business business,JSONObject businessCommunityLocationAttr){
+
+        Assert.jsonObjectHaveKey(businessCommunityLocationAttr,"attrId","businessCommunityLocationAttr 节点下没有包含 attrId 节点");
+
+        if(businessCommunityLocationAttr.getString("attrId").startsWith("-")){
+            //刷新缓存
+            //flushCommunityLocationAttrId(business.getDatas());
+
+            businessCommunityLocationAttr.put("attrId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
+
+        }
+
+        businessCommunityLocationAttr.put("bId",business.getbId());
+        businessCommunityLocationAttr.put("operate", StatusConstant.OPERATE_ADD);
+        //保存位置属性信息
+        communityLocationAttrServiceDaoImpl.saveBusinessCommunityLocationAttrInfo(businessCommunityLocationAttr);
+
+    }
+    @Override
+    public ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl() {
+        return communityLocationAttrServiceDaoImpl;
+    }
+
+    public void setCommunityLocationAttrServiceDaoImpl(ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl) {
+        this.communityLocationAttrServiceDaoImpl = communityLocationAttrServiceDaoImpl;
+    }
+}

+ 190 - 0
service-community/src/main/java/com/java110/community/listener/communityLocationAttr/UpdateCommunityLocationAttrInfoListener.java

@@ -0,0 +1,190 @@
+package com.java110.community.listener.communityLocationAttr;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.po.communityLocationAttr.CommunityLocationAttrPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 修改位置属性信息 侦听
+ * <p>
+ * 处理节点
+ * 1、businessCommunityLocationAttr:{} 位置属性基本信息节点
+ * 2、businessCommunityLocationAttrAttr:[{}] 位置属性属性信息节点
+ * 3、businessCommunityLocationAttrPhoto:[{}] 位置属性照片信息节点
+ * 4、businessCommunityLocationAttrCerdentials:[{}] 位置属性证件信息节点
+ * 协议地址 :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("updateCommunityLocationAttrInfoListener")
+@Transactional
+public class UpdateCommunityLocationAttrInfoListener extends AbstractCommunityLocationAttrBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateCommunityLocationAttrInfoListener.class);
+    @Autowired
+    private ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_LOCATION_ATTR;
+    }
+
+    /**
+     * business过程
+     *
+     * @param dataFlowContext 上下文对象
+     * @param business        业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+
+        //处理 businessCommunityLocationAttr 节点
+        if (data.containsKey(CommunityLocationAttrPo.class.getSimpleName())) {
+            Object _obj = data.get(CommunityLocationAttrPo.class.getSimpleName());
+            JSONArray businessCommunityLocationAttrs = null;
+            if (_obj instanceof JSONObject) {
+                businessCommunityLocationAttrs = new JSONArray();
+                businessCommunityLocationAttrs.add(_obj);
+            } else {
+                businessCommunityLocationAttrs = (JSONArray) _obj;
+            }
+            //JSONObject businessCommunityLocationAttr = data.getJSONObject(CommunityLocationAttrPo.class.getSimpleName());
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrs.size(); _communityLocationAttrIndex++) {
+                JSONObject businessCommunityLocationAttr = businessCommunityLocationAttrs.getJSONObject(_communityLocationAttrIndex);
+                doBusinessCommunityLocationAttr(business, businessCommunityLocationAttr);
+                if (_obj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("attrId", businessCommunityLocationAttr.getString("attrId"));
+                }
+            }
+        }
+    }
+
+
+    /**
+     * business to instance 过程
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId", business.getbId());
+        info.put("operate", StatusConstant.OPERATE_ADD);
+
+        //位置属性信息
+        List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(info);
+        if (businessCommunityLocationAttrInfos != null && businessCommunityLocationAttrInfos.size() > 0) {
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size(); _communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo, StatusConstant.STATUS_CD_VALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+                if (businessCommunityLocationAttrInfo.size() == 1) {
+                    dataFlowContext.addParamOut("attrId", businessCommunityLocationAttrInfo.get("attr_id"));
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId", bId);
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        Map delInfo = new HashMap();
+        delInfo.put("bId", business.getbId());
+        delInfo.put("operate", StatusConstant.OPERATE_DEL);
+        //位置属性信息
+        List<Map> communityLocationAttrInfo = communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo(info);
+        if (communityLocationAttrInfo != null && communityLocationAttrInfo.size() > 0) {
+
+            //位置属性信息
+            List<Map> businessCommunityLocationAttrInfos = communityLocationAttrServiceDaoImpl.getBusinessCommunityLocationAttrInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessCommunityLocationAttrInfos == null || businessCommunityLocationAttrInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(communityLocationAttr),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _communityLocationAttrIndex = 0; _communityLocationAttrIndex < businessCommunityLocationAttrInfos.size(); _communityLocationAttrIndex++) {
+                Map businessCommunityLocationAttrInfo = businessCommunityLocationAttrInfos.get(_communityLocationAttrIndex);
+                flushBusinessCommunityLocationAttrInfo(businessCommunityLocationAttrInfo, StatusConstant.STATUS_CD_VALID);
+                communityLocationAttrServiceDaoImpl.updateCommunityLocationAttrInfoInstance(businessCommunityLocationAttrInfo);
+            }
+        }
+
+    }
+
+
+    /**
+     * 处理 businessCommunityLocationAttr 节点
+     *
+     * @param business                      总的数据节点
+     * @param businessCommunityLocationAttr 位置属性节点
+     */
+    private void doBusinessCommunityLocationAttr(Business business, JSONObject businessCommunityLocationAttr) {
+
+        Assert.jsonObjectHaveKey(businessCommunityLocationAttr, "attrId", "businessCommunityLocationAttr 节点下没有包含 attrId 节点");
+
+        if (businessCommunityLocationAttr.getString("attrId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "attrId 错误,不能自动生成(必须已经存在的attrId)" + businessCommunityLocationAttr);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessCommunityLocationAttr(business, businessCommunityLocationAttr);
+
+        businessCommunityLocationAttr.put("bId", business.getbId());
+        businessCommunityLocationAttr.put("operate", StatusConstant.OPERATE_ADD);
+        //保存位置属性信息
+        communityLocationAttrServiceDaoImpl.saveBusinessCommunityLocationAttrInfo(businessCommunityLocationAttr);
+
+    }
+
+
+    @Override
+    public ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl() {
+        return communityLocationAttrServiceDaoImpl;
+    }
+
+    public void setCommunityLocationAttrServiceDaoImpl(ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl) {
+        this.communityLocationAttrServiceDaoImpl = communityLocationAttrServiceDaoImpl;
+    }
+
+
+}

+ 97 - 0
service-community/src/main/java/com/java110/community/smo/impl/CommunityLocationAttrInnerServiceSMOImpl.java

@@ -0,0 +1,97 @@
+package com.java110.community.smo.impl;
+
+
+import com.java110.community.dao.ICommunityLocationAttrServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.communityLocationAttr.CommunityLocationAttrDto;
+import com.java110.dto.user.UserDto;
+import com.java110.intf.community.ICommunityLocationAttrInnerServiceSMO;
+import com.java110.po.communityLocationAttr.CommunityLocationAttrPo;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 位置属性内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class CommunityLocationAttrInnerServiceSMOImpl extends BaseServiceSMO implements ICommunityLocationAttrInnerServiceSMO {
+
+    @Autowired
+    private ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl;
+
+
+    @Override
+    public List<CommunityLocationAttrDto> queryCommunityLocationAttrs(@RequestBody CommunityLocationAttrDto communityLocationAttrDto) {
+
+        //校验是否传了 分页信息
+
+        int page = communityLocationAttrDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            communityLocationAttrDto.setPage((page - 1) * communityLocationAttrDto.getRow());
+        }
+
+        List<CommunityLocationAttrDto> communityLocationAttrs = BeanConvertUtil.covertBeanList(communityLocationAttrServiceDaoImpl.getCommunityLocationAttrInfo(BeanConvertUtil.beanCovertMap(communityLocationAttrDto)), CommunityLocationAttrDto.class);
+
+        return communityLocationAttrs;
+    }
+
+    /**
+     * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
+     *
+     * @param communityLocationAttr 小区位置属性信息
+     * @param users                 用户列表
+     */
+    private void refreshCommunityLocationAttr(CommunityLocationAttrDto communityLocationAttr, List<UserDto> users) {
+        for (UserDto user : users) {
+            if (communityLocationAttr.getAttrId().equals(user.getUserId())) {
+                BeanConvertUtil.covertBean(user, communityLocationAttr);
+            }
+        }
+    }
+
+    /**
+     * 获取批量userId
+     *
+     * @param communityLocationAttrs 小区楼信息
+     * @return 批量userIds 信息
+     */
+    private String[] getUserIds(List<CommunityLocationAttrDto> communityLocationAttrs) {
+        List<String> userIds = new ArrayList<String>();
+        for (CommunityLocationAttrDto communityLocationAttr : communityLocationAttrs) {
+            userIds.add(communityLocationAttr.getAttrId());
+        }
+
+        return userIds.toArray(new String[userIds.size()]);
+    }
+
+    @Override
+    public int queryCommunityLocationAttrsCount(@RequestBody CommunityLocationAttrDto communityLocationAttrDto) {
+        return communityLocationAttrServiceDaoImpl.queryCommunityLocationAttrsCount(BeanConvertUtil.beanCovertMap(communityLocationAttrDto));
+    }
+
+    @Override
+    public int saveCommunityLocationAttr(CommunityLocationAttrPo communityLocationAttrPo) {
+        return communityLocationAttrServiceDaoImpl.saveCommunityLocationAttr(BeanConvertUtil.beanCovertMap(communityLocationAttrPo));
+    }
+
+    public ICommunityLocationAttrServiceDao getCommunityLocationAttrServiceDaoImpl() {
+        return communityLocationAttrServiceDaoImpl;
+    }
+
+    public void setCommunityLocationAttrServiceDaoImpl(ICommunityLocationAttrServiceDao communityLocationAttrServiceDaoImpl) {
+        this.communityLocationAttrServiceDaoImpl = communityLocationAttrServiceDaoImpl;
+    }
+
+}