Explorar o código

加入房屋属性

wuxw %!s(int64=7) %!d(string=hai) anos
pai
achega
de501ece0f
Modificáronse 26 ficheiros con 1740 adicións e 87 borrados
  1. 76 0
      CommunityService/src/main/java/com/java110/community/dao/IRoomAttrServiceDao.java
  2. 134 0
      CommunityService/src/main/java/com/java110/community/dao/impl/RoomAttrServiceDaoImpl.java
  3. 53 49
      CommunityService/src/main/java/com/java110/community/listener/SaveCommunityInfoListener.java
  4. 82 0
      CommunityService/src/main/java/com/java110/community/listener/room/AbstractRoomAttrBusinessServiceDataFlowListener.java
  5. 180 0
      CommunityService/src/main/java/com/java110/community/listener/room/DeleteRoomAttrInfoListener.java
  6. 1 1
      CommunityService/src/main/java/com/java110/community/listener/room/DeleteRoomInfoListener.java
  7. 158 0
      CommunityService/src/main/java/com/java110/community/listener/room/SaveRoomAttrInfoListener.java
  8. 22 2
      CommunityService/src/main/java/com/java110/community/listener/room/SaveRoomInfoListener.java
  9. 190 0
      CommunityService/src/main/java/com/java110/community/listener/room/UpdateRoomAttrInfoListener.java
  10. 1 1
      CommunityService/src/main/java/com/java110/community/listener/room/UpdateRoomInfoListener.java
  11. 74 0
      CommunityService/src/main/java/com/java110/community/smo/impl/RoomAttrInnerServiceSMOImpl.java
  12. 114 0
      docs/services/room/DeleteRoomAttrInfo.md
  13. 120 0
      docs/services/room/SaveRoomAttrInfo.md
  14. 120 0
      docs/services/room/UpdateRoomAttrInfo.md
  15. 69 0
      java110-bean/src/main/java/com/java110/dto/RoomAttrDto.java
  16. 86 0
      java110-code-generator/src/main/java/com/java110/RoomAttrGeneratorApplication.java
  17. 2 2
      java110-code-generator/src/main/resources/template/AbstractBusinessServiceDataFlowListener.txt
  18. 9 9
      java110-code-generator/src/main/resources/template/IServiceDao.txt
  19. 9 9
      java110-code-generator/src/main/resources/template/SaveListener.txt
  20. 7 7
      java110-code-generator/src/main/resources/template/ServiceDaoImpl.txt
  21. 4 4
      java110-code-generator/src/main/resources/template/UpdateInfoListener.txt
  22. 3 3
      java110-common/src/main/java/com/java110/common/constant/BusinessTypeConstant.java
  23. 26 0
      java110-config/db/CommunityService/create_room.sql
  24. 156 0
      java110-config/src/main/resources/mapper/room/RoomAttrServiceDaoImplMapper.xml
  25. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  26. 43 0
      java110-core/src/main/java/com/java110/core/smo/room/IRoomAttrInnerServiceSMO.java

+ 76 - 0
CommunityService/src/main/java/com/java110/community/dao/IRoomAttrServiceDao.java

@@ -0,0 +1,76 @@
+
+package com.java110.community.dao;
+
+
+import com.java110.common.exception.DAOException;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 小区房屋属性组件内部之间使用,没有给外围系统提供服务能力
+ * 小区房屋属性服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ * <p>
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IRoomAttrServiceDao {
+
+    /**
+     * 保存 小区房屋属性信息
+     *
+     * @param businessRoomAttrInfo 小区房屋属性信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessRoomAttrInfo(Map businessRoomAttrInfo) throws DAOException;
+
+
+    /**
+     * 查询小区房屋属性信息(business过程)
+     * 根据bId 查询小区房屋属性信息
+     *
+     * @param info bId 信息
+     * @return 小区房屋属性信息
+     * @throws DAOException DAO 异常信息
+     */
+    List<Map> getBusinessRoomAttrInfo(Map info) throws DAOException;
+
+
+    /**
+     * 保存 小区房屋属性信息 Business数据到 Instance中
+     *
+     * @param info  bId 信息
+     * @throws DAOException DAO 异常信息
+     */
+    void saveRoomAttrInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区房屋属性信息(instance过程)
+     * 根据bId 查询小区房屋属性信息
+     *
+     * @param info bId 信息
+     * @return 小区房屋属性信息
+     * @throws DAOException DAO 异常信息
+     */
+    List<Map> getRoomAttrInfo(Map info) throws DAOException;
+
+
+    /**
+     * 修改小区房屋属性信息
+     *
+     * @param info 修改信息
+     * @throws DAOException DAO 异常信息
+     */
+    void updateRoomAttrInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区房屋属性总数
+     *
+     * @param info 小区房屋属性信息
+     * @return 小区房屋属性数量
+     */
+    int queryRoomAttrsCount(Map info);
+
+}

+ 134 - 0
CommunityService/src/main/java/com/java110/community/dao/impl/RoomAttrServiceDaoImpl.java

@@ -0,0 +1,134 @@
+package com.java110.community.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.exception.DAOException;
+import com.java110.common.util.DateUtil;
+import com.java110.community.dao.IRoomAttrServiceDao;
+import com.java110.core.base.dao.BaseServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 小区房屋属性服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("roomAttrServiceDaoImpl")
+//@Transactional
+public class RoomAttrServiceDaoImpl extends BaseServiceDao implements IRoomAttrServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RoomAttrServiceDaoImpl.class);
+
+    /**
+     * 小区房屋属性信息封装
+     *
+     * @param businessRoomAttrInfo 小区房屋属性信息 封装
+     * @throws DAOException
+     */
+    @Override
+    public void saveBusinessRoomAttrInfo(Map businessRoomAttrInfo) throws DAOException {
+        businessRoomAttrInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存小区房屋属性信息 入参 businessRoomAttrInfo : {}", businessRoomAttrInfo);
+        int saveFlag = sqlSessionTemplate.insert("roomAttrServiceDaoImpl.saveBusinessRoomAttrInfo", businessRoomAttrInfo);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区房屋属性数据失败:" + JSONObject.toJSONString(businessRoomAttrInfo));
+        }
+    }
+
+
+    /**
+     * 查询小区房屋属性信息
+     *
+     * @param info bId 信息
+     * @return 小区房屋属性信息
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getBusinessRoomAttrInfo(Map info) throws DAOException {
+
+        logger.debug("查询小区房屋属性信息 入参 info : {}", info);
+
+        List<Map> businessRoomAttrInfos = sqlSessionTemplate.selectList("roomAttrServiceDaoImpl.getBusinessRoomAttrInfo", info);
+
+        return businessRoomAttrInfos;
+    }
+
+
+    /**
+     * 保存小区房屋属性信息 到 instance
+     *
+     * @param info bId 信息
+     * @throws DAOException
+     */
+    @Override
+    public void saveRoomAttrInfoInstance(Map info) throws DAOException {
+        logger.debug("保存小区房屋属性信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("roomAttrServiceDaoImpl.saveRoomAttrInfoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区房屋属性信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询小区房屋属性信息(instance)
+     *
+     * @param info bId 信息
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getRoomAttrInfo(Map info) throws DAOException {
+        logger.debug("查询小区房屋属性信息 入参 info : {}", info);
+
+        List<Map> businessRoomAttrInfos = sqlSessionTemplate.selectList("roomAttrServiceDaoImpl.getRoomAttrInfo", info);
+
+        return businessRoomAttrInfos;
+    }
+
+
+    /**
+     * 修改小区房屋属性信息
+     *
+     * @param info 修改信息
+     * @throws DAOException
+     */
+    @Override
+    public void updateRoomAttrInfoInstance(Map info) throws DAOException {
+        logger.debug("修改小区房屋属性信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("roomAttrServiceDaoImpl.updateRoomAttrInfoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改小区房屋属性信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 查询小区房屋属性数量
+     *
+     * @param info 小区房屋属性信息
+     * @return 小区房屋属性数量
+     */
+    @Override
+    public int queryRoomAttrsCount(Map info) {
+        logger.debug("查询小区房屋属性数据 入参 info : {}", info);
+
+        List<Map> businessRoomAttrInfos = sqlSessionTemplate.selectList("roomAttrServiceDaoImpl.queryRoomAttrsCount", info);
+        if (businessRoomAttrInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRoomAttrInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 53 - 49
CommunityService/src/main/java/com/java110/community/listener/SaveCommunityInfoListener.java

@@ -44,29 +44,30 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
 
     /**
      * 保存小区信息 business 表中
+     *
      * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
+     * @param business        当前业务对象
      */
     @Override
     protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
         JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
 
         //处理 businessCommunity 节点
-        if(data.containsKey("businessCommunity")){
+        if (data.containsKey("businessCommunity")) {
             JSONObject businessCommunity = data.getJSONObject("businessCommunity");
-            doBusinessCommunity(business,businessCommunity);
-            dataFlowContext.addParamOut("communityId",businessCommunity.getString("communityId"));
+            doBusinessCommunity(business, businessCommunity);
+            dataFlowContext.addParamOut("communityId", businessCommunity.getString("communityId"));
         }
 
-        if(data.containsKey("businessCommunityAttr")){
+        if (data.containsKey("businessCommunityAttr")) {
             JSONArray businessCommunityAttrs = data.getJSONArray("businessCommunityAttr");
-            doSaveBusinessCommunityAttrs(business,businessCommunityAttrs);
+            doSaveBusinessCommunityAttrs(business, businessCommunityAttrs);
         }
 
-        if(data.containsKey("businessCommunityPhoto")){
+        if (data.containsKey("businessCommunityPhoto")) {
             JSONArray businessCommunityPhotos = data.getJSONArray("businessCommunityPhoto");
-            doBusinessCommunityPhoto(business,businessCommunityPhotos);
+            doBusinessCommunityPhoto(business, businessCommunityPhotos);
         }
 
 
@@ -74,31 +75,32 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
 
     /**
      * business 数据转移到 instance
+     *
      * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
+     * @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);
+        info.put("bId", business.getbId());
+        info.put("operate", StatusConstant.OPERATE_ADD);
 
         //小区信息
         Map businessCommunityInfo = communityServiceDaoImpl.getBusinessCommunityInfo(info);
-        if( businessCommunityInfo != null && !businessCommunityInfo.isEmpty()) {
+        if (businessCommunityInfo != null && !businessCommunityInfo.isEmpty()) {
             communityServiceDaoImpl.saveCommunityInfoInstance(info);
-            dataFlowContext.addParamOut("communityId",businessCommunityInfo.get("community_id"));
+            dataFlowContext.addParamOut("communityId", businessCommunityInfo.get("community_id"));
         }
         //小区属性
         List<Map> businessCommunityAttrs = communityServiceDaoImpl.getBusinessCommunityAttrs(info);
-        if(businessCommunityAttrs != null && businessCommunityAttrs.size() > 0) {
+        if (businessCommunityAttrs != null && businessCommunityAttrs.size() > 0) {
             communityServiceDaoImpl.saveCommunityAttrsInstance(info);
         }
         //小区照片
         List<Map> businessCommunityPhotos = communityServiceDaoImpl.getBusinessCommunityPhoto(info);
-        if(businessCommunityPhotos != null && businessCommunityPhotos.size() >0){
+        if (businessCommunityPhotos != null && businessCommunityPhotos.size() > 0) {
             communityServiceDaoImpl.saveCommunityPhotoInstance(info);
         }
 
@@ -106,36 +108,37 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
 
     /**
      * 撤单
+     *
      * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
+     * @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);
+        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);
+        paramIn.put("bId", bId);
+        paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID);
         //小区信息
         Map communityInfo = communityServiceDaoImpl.getCommunityInfo(info);
-        if(communityInfo != null && !communityInfo.isEmpty()){
-            paramIn.put("communityId",communityInfo.get("community_id").toString());
+        if (communityInfo != null && !communityInfo.isEmpty()) {
+            paramIn.put("communityId", communityInfo.get("community_id").toString());
             communityServiceDaoImpl.updateCommunityInfoInstance(paramIn);
-            dataFlowContext.addParamOut("communityId",communityInfo.get("community_id"));
+            dataFlowContext.addParamOut("communityId", communityInfo.get("community_id"));
         }
 
         //小区属性
         List<Map> communityAttrs = communityServiceDaoImpl.getCommunityAttrs(info);
-        if(communityAttrs != null && communityAttrs.size()>0){
+        if (communityAttrs != null && communityAttrs.size() > 0) {
             communityServiceDaoImpl.updateCommunityAttrInstance(paramIn);
         }
 
         //小区照片
         List<Map> communityPhotos = communityServiceDaoImpl.getCommunityPhoto(info);
-        if(communityPhotos != null && communityPhotos.size()>0){
+        if (communityPhotos != null && communityPhotos.size() > 0) {
             communityServiceDaoImpl.updateCommunityPhotoInstance(paramIn);
         }
 
@@ -144,12 +147,13 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
 
     /**
      * 保存小区照片
-     * @param business 业务对象
+     *
+     * @param business                业务对象
      * @param businessCommunityPhotos 小区照片
      */
     private void doBusinessCommunityPhoto(Business business, JSONArray businessCommunityPhotos) {
 
-        for(int businessCommunityPhotoIndex = 0 ;businessCommunityPhotoIndex < businessCommunityPhotos.size();businessCommunityPhotoIndex++) {
+        for (int businessCommunityPhotoIndex = 0; businessCommunityPhotoIndex < businessCommunityPhotos.size(); businessCommunityPhotoIndex++) {
             JSONObject businessCommunityPhoto = businessCommunityPhotos.getJSONObject(businessCommunityPhotoIndex);
             Assert.jsonObjectHaveKey(businessCommunityPhoto, "communityId", "businessCommunityPhoto 节点下没有包含 communityId 节点");
 
@@ -166,19 +170,20 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
 
     /**
      * 处理 businessCommunity 节点
-     * @param business 总的数据节点
+     *
+     * @param business          总的数据节点
      * @param businessCommunity 小区节点
      */
-    private void doBusinessCommunity(Business business,JSONObject businessCommunity){
+    private void doBusinessCommunity(Business business, JSONObject businessCommunity) {
 
-        Assert.jsonObjectHaveKey(businessCommunity,"communityId","businessCommunity 节点下没有包含 communityId 节点");
+        Assert.jsonObjectHaveKey(businessCommunity, "communityId", "businessCommunity 节点下没有包含 communityId 节点");
 
-        if(businessCommunity.getString("communityId").startsWith("-")){
+        if (businessCommunity.getString("communityId").startsWith("-")) {
             //刷新缓存
             flushCommunityId(business.getDatas());
         }
 
-        businessCommunity.put("bId",business.getbId());
+        businessCommunity.put("bId", business.getbId());
         businessCommunity.put("operate", StatusConstant.OPERATE_ADD);
         //保存小区信息
         communityServiceDaoImpl.saveBusinessCommunityInfo(businessCommunity);
@@ -186,26 +191,26 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
     }
 
 
-
     /**
      * 保存小区属性信息
-     * @param business 当前业务
+     *
+     * @param business               当前业务
      * @param businessCommunityAttrs 小区属性
      */
-    private void doSaveBusinessCommunityAttrs(Business business,JSONArray businessCommunityAttrs){
+    private void doSaveBusinessCommunityAttrs(Business business, JSONArray businessCommunityAttrs) {
         JSONObject data = business.getDatas();
         JSONObject businessCommunity = data.getJSONObject("businessCommunity");
-        for(int communityAttrIndex = 0 ; communityAttrIndex < businessCommunityAttrs.size();communityAttrIndex ++){
+        for (int communityAttrIndex = 0; communityAttrIndex < businessCommunityAttrs.size(); communityAttrIndex++) {
             JSONObject communityAttr = businessCommunityAttrs.getJSONObject(communityAttrIndex);
-            Assert.jsonObjectHaveKey(communityAttr,"attrId","businessCommunityAttr 节点下没有包含 attrId 节点");
+            Assert.jsonObjectHaveKey(communityAttr, "attrId", "businessCommunityAttr 节点下没有包含 attrId 节点");
 
-            if(communityAttr.getString("attrId").startsWith("-")){
+            if (communityAttr.getString("attrId").startsWith("-")) {
                 String attrId = GenerateCodeFactory.getAttrId();
-                communityAttr.put("attrId",attrId);
+                communityAttr.put("attrId", attrId);
             }
 
-            communityAttr.put("bId",business.getbId());
-            communityAttr.put("communityId",businessCommunity.getString("communityId"));
+            communityAttr.put("bId", business.getbId());
+            communityAttr.put("communityId", businessCommunity.getString("communityId"));
             communityAttr.put("operate", StatusConstant.OPERATE_ADD);
 
             communityServiceDaoImpl.saveBusinessCommunityAttr(communityAttr);
@@ -213,29 +218,28 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
     }
 
 
-
-
     /**
      * 刷新 小区ID
+     *
      * @param data
      */
     private void flushCommunityId(JSONObject data) {
 
         String communityId = GenerateCodeFactory.getCommunityId();
         JSONObject businessCommunity = data.getJSONObject("businessCommunity");
-        businessCommunity.put("communityId",communityId);
+        businessCommunity.put("communityId", communityId);
         //刷小区属性
-        if(data.containsKey("businessCommunityAttr")) {
+        if (data.containsKey("businessCommunityAttr")) {
             JSONArray businessCommunityAttrs = data.getJSONArray("businessCommunityAttr");
-            for(int businessCommunityAttrIndex = 0;businessCommunityAttrIndex < businessCommunityAttrs.size();businessCommunityAttrIndex++) {
+            for (int businessCommunityAttrIndex = 0; businessCommunityAttrIndex < businessCommunityAttrs.size(); businessCommunityAttrIndex++) {
                 JSONObject businessCommunityAttr = businessCommunityAttrs.getJSONObject(businessCommunityAttrIndex);
                 businessCommunityAttr.put("communityId", communityId);
             }
         }
         //刷 是小区照片 的 communityId
-        if(data.containsKey("businessCommunityPhoto")) {
+        if (data.containsKey("businessCommunityPhoto")) {
             JSONArray businessCommunityPhotos = data.getJSONArray("businessCommunityPhoto");
-            for(int businessCommunityPhotoIndex = 0;businessCommunityPhotoIndex < businessCommunityPhotos.size();businessCommunityPhotoIndex++) {
+            for (int businessCommunityPhotoIndex = 0; businessCommunityPhotoIndex < businessCommunityPhotos.size(); businessCommunityPhotoIndex++) {
                 JSONObject businessCommunityPhoto = businessCommunityPhotos.getJSONObject(businessCommunityPhotoIndex);
                 businessCommunityPhoto.put("communityId", communityId);
             }

+ 82 - 0
CommunityService/src/main/java/com/java110/community/listener/room/AbstractRoomAttrBusinessServiceDataFlowListener.java

@@ -0,0 +1,82 @@
+package com.java110.community.listener.room;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.constant.StatusConstant;
+import com.java110.common.exception.ListenerExecuteException;
+import com.java110.community.dao.IRoomAttrServiceDao;
+import com.java110.entity.center.Business;
+import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
+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 AbstractRoomAttrBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractRoomAttrBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     *
+     * @return
+     */
+    public abstract IRoomAttrServiceDao getRoomAttrServiceDaoImpl();
+
+    /**
+     * 刷新 businessRoomAttrInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
+     * @param businessRoomAttrInfo 房屋属性信息
+     * @param statusCd             状态信息
+     */
+    protected void flushBusinessRoomAttrInfo(Map businessRoomAttrInfo, String statusCd) {
+        businessRoomAttrInfo.put("newBId", businessRoomAttrInfo.get("b_id"));
+        businessRoomAttrInfo.put("attrId", businessRoomAttrInfo.get("attr_id"));
+        businessRoomAttrInfo.put("operate", businessRoomAttrInfo.get("operate"));
+        businessRoomAttrInfo.put("specCd", businessRoomAttrInfo.get("spec_cd"));
+        businessRoomAttrInfo.put("value", businessRoomAttrInfo.get("value"));
+        businessRoomAttrInfo.put("roomId", businessRoomAttrInfo.get("room_id"));
+        businessRoomAttrInfo.remove("bId");
+        businessRoomAttrInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
+     * @param businessRoomAttr 小区房屋属性信息
+     */
+    protected void autoSaveDelBusinessRoomAttr(Business business, JSONObject businessRoomAttr) {
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("roomAttrId", businessRoomAttr.getString("roomAttrId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentRoomAttrInfos = getRoomAttrServiceDaoImpl().getRoomAttrInfo(info);
+        if (currentRoomAttrInfos == null || currentRoomAttrInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
+        }
+
+        Map currentRoomAttrInfo = currentRoomAttrInfos.get(0);
+
+        currentRoomAttrInfo.put("bId", business.getbId());
+
+        currentRoomAttrInfo.put("attrId", currentRoomAttrInfo.get("attr_id"));
+        currentRoomAttrInfo.put("operate", currentRoomAttrInfo.get("operate"));
+        currentRoomAttrInfo.put("specCd", currentRoomAttrInfo.get("spec_cd"));
+        currentRoomAttrInfo.put("value", currentRoomAttrInfo.get("value"));
+        currentRoomAttrInfo.put("roomId", currentRoomAttrInfo.get("room_id"));
+
+
+        currentRoomAttrInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getRoomAttrServiceDaoImpl().saveBusinessRoomAttrInfo(currentRoomAttrInfo);
+    }
+
+
+}

+ 180 - 0
CommunityService/src/main/java/com/java110/community/listener/room/DeleteRoomAttrInfoListener.java

@@ -0,0 +1,180 @@
+package com.java110.community.listener.room;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.BusinessTypeConstant;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.constant.StatusConstant;
+import com.java110.common.exception.ListenerExecuteException;
+import com.java110.common.util.Assert;
+import com.java110.community.dao.IRoomAttrServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+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;
+
+/**
+ * 删除小区房屋属性信息 侦听
+ * <p>
+ * 处理节点
+ * 1、businessRoomAttr:{} 小区房屋属性基本信息节点
+ * 2、businessRoomAttrAttr:[{}] 小区房屋属性属性信息节点
+ * 3、businessRoomAttrPhoto:[{}] 小区房屋属性照片信息节点
+ * 4、businessRoomAttrCerdentials:[{}] 小区房屋属性证件信息节点
+ * 协议地址 :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("deleteRoomAttrInfoListener")
+@Transactional
+public class DeleteRoomAttrInfoListener extends AbstractRoomAttrBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(DeleteRoomAttrInfoListener.class);
+    @Autowired
+    IRoomAttrServiceDao roomAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 4;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_ROOM_INFO;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRoomAttr 节点
+        if (data.containsKey("businessRoomAttr")) {
+            //处理 businessRoomAttr 节点
+            if (data.containsKey("businessRoomAttr")) {
+                Object _obj = data.get("businessRoomAttr");
+                JSONArray businessRoomAttrs = null;
+                if (_obj instanceof JSONObject) {
+                    businessRoomAttrs = new JSONArray();
+                    businessRoomAttrs.add(_obj);
+                } else {
+                    businessRoomAttrs = (JSONArray) _obj;
+                }
+                //JSONObject businessRoomAttr = data.getJSONObject("businessRoomAttr");
+                for (int _roomAttrIndex = 0; _roomAttrIndex < businessRoomAttrs.size(); _roomAttrIndex++) {
+                    JSONObject businessRoomAttr = businessRoomAttrs.getJSONObject(_roomAttrIndex);
+                    doBusinessRoomAttr(business, businessRoomAttr);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("roomAttrId", businessRoomAttr.getString("roomAttrId"));
+                    }
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * 删除 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> businessRoomAttrInfos = roomAttrServiceDaoImpl.getBusinessRoomAttrInfo(info);
+        if (businessRoomAttrInfos != null && businessRoomAttrInfos.size() > 0) {
+            for (int _roomAttrIndex = 0; _roomAttrIndex < businessRoomAttrInfos.size(); _roomAttrIndex++) {
+                Map businessRoomAttrInfo = businessRoomAttrInfos.get(_roomAttrIndex);
+                flushBusinessRoomAttrInfo(businessRoomAttrInfo, StatusConstant.STATUS_CD_INVALID);
+                roomAttrServiceDaoImpl.updateRoomAttrInfoInstance(businessRoomAttrInfo);
+                dataFlowContext.addParamOut("roomAttrId", businessRoomAttrInfo.get("roomAttr_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> roomAttrInfo = roomAttrServiceDaoImpl.getRoomAttrInfo(info);
+        if (roomAttrInfo != null && roomAttrInfo.size() > 0) {
+
+            //小区房屋属性信息
+            List<Map> businessRoomAttrInfos = roomAttrServiceDaoImpl.getBusinessRoomAttrInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessRoomAttrInfos == null || businessRoomAttrInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(roomAttr),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _roomAttrIndex = 0; _roomAttrIndex < businessRoomAttrInfos.size(); _roomAttrIndex++) {
+                Map businessRoomAttrInfo = businessRoomAttrInfos.get(_roomAttrIndex);
+                flushBusinessRoomAttrInfo(businessRoomAttrInfo, StatusConstant.STATUS_CD_VALID);
+                roomAttrServiceDaoImpl.updateRoomAttrInfoInstance(businessRoomAttrInfo);
+            }
+        }
+    }
+
+
+    /**
+     * 处理 businessRoomAttr 节点
+     *
+     * @param business         总的数据节点
+     * @param businessRoomAttr 小区房屋属性节点
+     */
+    private void doBusinessRoomAttr(Business business, JSONObject businessRoomAttr) {
+
+        Assert.jsonObjectHaveKey(businessRoomAttr, "roomAttrId", "businessRoomAttr 节点下没有包含 roomAttrId 节点");
+
+        if (businessRoomAttr.getString("roomAttrId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "roomAttrId 错误,不能自动生成(必须已经存在的roomAttrId)" + businessRoomAttr);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessRoomAttr(business, businessRoomAttr);
+    }
+
+    public IRoomAttrServiceDao getRoomAttrServiceDaoImpl() {
+        return roomAttrServiceDaoImpl;
+    }
+
+    public void setRoomAttrServiceDaoImpl(IRoomAttrServiceDao roomAttrServiceDaoImpl) {
+        this.roomAttrServiceDaoImpl = roomAttrServiceDaoImpl;
+    }
+}

+ 1 - 1
CommunityService/src/main/java/com/java110/community/listener/room/DeleteRoomInfoListener.java

@@ -35,7 +35,7 @@ import java.util.Map;
 @Transactional
 public class DeleteRoomInfoListener extends AbstractRoomBusinessServiceDataFlowListener {
 
-    private final static Logger logger = LoggerFactory.getLogger(DeleteRoomInfoListener.class);
+    private static Logger logger = LoggerFactory.getLogger(DeleteRoomInfoListener.class);
     @Autowired
     IRoomServiceDao roomServiceDaoImpl;
 

+ 158 - 0
CommunityService/src/main/java/com/java110/community/listener/room/SaveRoomAttrInfoListener.java

@@ -0,0 +1,158 @@
+
+package com.java110.community.listener.room;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.BusinessTypeConstant;
+import com.java110.common.constant.StatusConstant;
+import com.java110.common.util.Assert;
+import com.java110.community.dao.IRoomAttrServiceDao;
+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("saveRoomAttrInfoListener")
+@Transactional
+public class SaveRoomAttrInfoListener extends AbstractRoomAttrBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveRoomAttrInfoListener.class);
+
+    @Autowired
+    IRoomAttrServiceDao roomAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 1;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_ROOM_INFO;
+    }
+
+    /**
+     * 保存小区房屋属性信息 business 表中
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRoomAttr 节点
+        if (data.containsKey("businessRoomAttr")) {
+            Object _obj = data.get("businessRoomAttr");
+            JSONArray businessRoomAttrs = null;
+            if (_obj instanceof JSONObject) {
+                businessRoomAttrs = new JSONArray();
+                businessRoomAttrs.add(_obj);
+            } else {
+                businessRoomAttrs = (JSONArray) _obj;
+            }
+            //JSONObject businessRoomAttr = data.getJSONObject("businessRoomAttr");
+            for (int _roomAttrIndex = 0; _roomAttrIndex < businessRoomAttrs.size(); _roomAttrIndex++) {
+                JSONObject businessRoomAttr = businessRoomAttrs.getJSONObject(_roomAttrIndex);
+                doBusinessRoomAttr(business, businessRoomAttr);
+                if (_obj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("roomAttrId", businessRoomAttr.getString("roomAttrId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessRoomAttrInfo = roomAttrServiceDaoImpl.getBusinessRoomAttrInfo(info);
+        if (businessRoomAttrInfo != null && businessRoomAttrInfo.size() > 0) {
+            roomAttrServiceDaoImpl.saveRoomAttrInfoInstance(info);
+            if (businessRoomAttrInfo.size() == 1) {
+                dataFlowContext.addParamOut("roomAttrId", businessRoomAttrInfo.get(0).get("roomAttr_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> roomAttrInfo = roomAttrServiceDaoImpl.getRoomAttrInfo(info);
+        if (roomAttrInfo != null && roomAttrInfo.size() > 0) {
+            roomAttrServiceDaoImpl.updateRoomAttrInfoInstance(paramIn);
+        }
+    }
+
+
+    /**
+     * 处理 businessRoomAttr 节点
+     *
+     * @param business         总的数据节点
+     * @param businessRoomAttr 小区房屋属性节点
+     */
+    private void doBusinessRoomAttr(Business business, JSONObject businessRoomAttr) {
+
+        Assert.jsonObjectHaveKey(businessRoomAttr, "roomAttrId", "businessRoomAttr 节点下没有包含 roomAttrId 节点");
+
+        if (businessRoomAttr.getString("roomAttrId").startsWith("-")) {
+            //刷新缓存
+            //flushRoomAttrId(business.getDatas());
+
+            businessRoomAttr.put("roomAttrId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomAttrId));
+
+        }
+
+        businessRoomAttr.put("bId", business.getbId());
+        businessRoomAttr.put("operate", StatusConstant.OPERATE_ADD);
+        //保存小区房屋属性信息
+        roomAttrServiceDaoImpl.saveBusinessRoomAttrInfo(businessRoomAttr);
+
+    }
+
+    public IRoomAttrServiceDao getRoomAttrServiceDaoImpl() {
+        return roomAttrServiceDaoImpl;
+    }
+
+    public void setRoomAttrServiceDaoImpl(IRoomAttrServiceDao roomAttrServiceDaoImpl) {
+        this.roomAttrServiceDaoImpl = roomAttrServiceDaoImpl;
+    }
+}

+ 22 - 2
CommunityService/src/main/java/com/java110/community/listener/room/SaveRoomInfoListener.java

@@ -134,9 +134,9 @@ public class SaveRoomInfoListener extends AbstractRoomBusinessServiceDataFlowLis
 
         if (businessRoom.getString("roomId").startsWith("-")) {
             //刷新缓存
-            //flushRoomId(business.getDatas());
+            flushRoomId(business.getDatas());
 
-            businessRoom.put("roomId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId));
+            //businessRoom.put("roomId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId));
 
         }
 
@@ -147,6 +147,26 @@ public class SaveRoomInfoListener extends AbstractRoomBusinessServiceDataFlowLis
 
     }
 
+    /**
+     * 刷新 小区ID
+     *
+     * @param data 数据
+     */
+    private void flushRoomId(JSONObject data) {
+
+        String roomId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId);
+        JSONObject businessRoom = data.getJSONObject("businessRoom");
+        businessRoom.put("roomId", roomId);
+        //刷小区属性
+        if (data.containsKey("businessRoomAttr")) {
+            JSONArray businessRoomAttrs = data.getJSONArray("businessRoomAttr");
+            for (int businessRoomAttrIndex = 0; businessRoomAttrIndex < businessRoomAttrs.size(); businessRoomAttrIndex++) {
+                JSONObject businessRoomAttr = businessRoomAttrs.getJSONObject(businessRoomAttrIndex);
+                businessRoomAttr.put("roomId", roomId);
+            }
+        }
+    }
+
     public IRoomServiceDao getRoomServiceDaoImpl() {
         return roomServiceDaoImpl;
     }

+ 190 - 0
CommunityService/src/main/java/com/java110/community/listener/room/UpdateRoomAttrInfoListener.java

@@ -0,0 +1,190 @@
+package com.java110.community.listener.room;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.BusinessTypeConstant;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.constant.StatusConstant;
+import com.java110.common.exception.ListenerExecuteException;
+import com.java110.common.util.Assert;
+import com.java110.community.dao.IRoomAttrServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+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;
+
+/**
+ * 修改小区房屋属性信息 侦听
+ * <p>
+ * 处理节点
+ * 1、businessRoomAttr:{} 小区房屋属性基本信息节点
+ * 2、businessRoomAttrAttr:[{}] 小区房屋属性属性信息节点
+ * 3、businessRoomAttrPhoto:[{}] 小区房屋属性照片信息节点
+ * 4、businessRoomAttrCerdentials:[{}] 小区房屋属性证件信息节点
+ * 协议地址 :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("updateRoomAttrInfoListener")
+@Transactional
+public class UpdateRoomAttrInfoListener extends AbstractRoomAttrBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateRoomAttrInfoListener.class);
+    @Autowired
+    IRoomAttrServiceDao roomAttrServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ROOM_INFO;
+    }
+
+    /**
+     * business过程
+     *
+     * @param dataFlowContext
+     * @param business
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRoomAttr 节点
+        if (data.containsKey("businessRoomAttr")) {
+            //处理 businessRoomAttr 节点
+            if (data.containsKey("businessRoomAttr")) {
+                Object _obj = data.get("businessRoomAttr");
+                JSONArray businessRoomAttrs = null;
+                if (_obj instanceof JSONObject) {
+                    businessRoomAttrs = new JSONArray();
+                    businessRoomAttrs.add(_obj);
+                } else {
+                    businessRoomAttrs = (JSONArray) _obj;
+                }
+                //JSONObject businessRoomAttr = data.getJSONObject("businessRoomAttr");
+                for (int _roomAttrIndex = 0; _roomAttrIndex < businessRoomAttrs.size(); _roomAttrIndex++) {
+                    JSONObject businessRoomAttr = businessRoomAttrs.getJSONObject(_roomAttrIndex);
+                    doBusinessRoomAttr(business, businessRoomAttr);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("roomAttrId", businessRoomAttr.getString("roomAttrId"));
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 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> businessRoomAttrInfos = roomAttrServiceDaoImpl.getBusinessRoomAttrInfo(info);
+        if (businessRoomAttrInfos != null && businessRoomAttrInfos.size() > 0) {
+            for (int _roomAttrIndex = 0; _roomAttrIndex < businessRoomAttrInfos.size(); _roomAttrIndex++) {
+                Map businessRoomAttrInfo = businessRoomAttrInfos.get(_roomAttrIndex);
+                flushBusinessRoomAttrInfo(businessRoomAttrInfo, StatusConstant.STATUS_CD_VALID);
+                roomAttrServiceDaoImpl.updateRoomAttrInfoInstance(businessRoomAttrInfo);
+                if (businessRoomAttrInfo.size() == 1) {
+                    dataFlowContext.addParamOut("roomAttrId", businessRoomAttrInfo.get("roomAttr_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> roomAttrInfo = roomAttrServiceDaoImpl.getRoomAttrInfo(info);
+        if (roomAttrInfo != null && roomAttrInfo.size() > 0) {
+
+            //小区房屋属性信息
+            List<Map> businessRoomAttrInfos = roomAttrServiceDaoImpl.getBusinessRoomAttrInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessRoomAttrInfos == null || businessRoomAttrInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(roomAttr),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _roomAttrIndex = 0; _roomAttrIndex < businessRoomAttrInfos.size(); _roomAttrIndex++) {
+                Map businessRoomAttrInfo = businessRoomAttrInfos.get(_roomAttrIndex);
+                flushBusinessRoomAttrInfo(businessRoomAttrInfo, StatusConstant.STATUS_CD_VALID);
+                roomAttrServiceDaoImpl.updateRoomAttrInfoInstance(businessRoomAttrInfo);
+            }
+        }
+
+    }
+
+
+    /**
+     * 处理 businessRoomAttr 节点
+     *
+     * @param business         总的数据节点
+     * @param businessRoomAttr 小区房屋属性节点
+     */
+    private void doBusinessRoomAttr(Business business, JSONObject businessRoomAttr) {
+
+        Assert.jsonObjectHaveKey(businessRoomAttr, "roomAttrId", "businessRoomAttr 节点下没有包含 roomAttrId 节点");
+
+        if (businessRoomAttr.getString("roomAttrId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "roomAttrId 错误,不能自动生成(必须已经存在的roomAttrId)" + businessRoomAttr);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessRoomAttr(business, businessRoomAttr);
+
+        businessRoomAttr.put("bId", business.getbId());
+        businessRoomAttr.put("operate", StatusConstant.OPERATE_ADD);
+        //保存小区房屋属性信息
+        roomAttrServiceDaoImpl.saveBusinessRoomAttrInfo(businessRoomAttr);
+
+    }
+
+
+    public IRoomAttrServiceDao getRoomAttrServiceDaoImpl() {
+        return roomAttrServiceDaoImpl;
+    }
+
+    public void setRoomAttrServiceDaoImpl(IRoomAttrServiceDao roomAttrServiceDaoImpl) {
+        this.roomAttrServiceDaoImpl = roomAttrServiceDaoImpl;
+    }
+
+
+}

+ 1 - 1
CommunityService/src/main/java/com/java110/community/listener/room/UpdateRoomInfoListener.java

@@ -35,7 +35,7 @@ import java.util.Map;
 @Transactional
 public class UpdateRoomInfoListener extends AbstractRoomBusinessServiceDataFlowListener {
 
-    private final static Logger logger = LoggerFactory.getLogger(UpdateRoomInfoListener.class);
+    private  static Logger logger = LoggerFactory.getLogger(UpdateRoomInfoListener.class);
     @Autowired
     IRoomServiceDao roomServiceDaoImpl;
 

+ 74 - 0
CommunityService/src/main/java/com/java110/community/smo/impl/RoomAttrInnerServiceSMOImpl.java

@@ -0,0 +1,74 @@
+
+package com.java110.community.smo.impl;
+
+
+import com.java110.common.util.BeanConvertUtil;
+import com.java110.community.dao.IRoomAttrServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.room.IRoomAttrInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.RoomAttrDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+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 RoomAttrInnerServiceSMOImpl extends BaseServiceSMO implements IRoomAttrInnerServiceSMO {
+
+    @Autowired
+    private IRoomAttrServiceDao roomAttrServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<RoomAttrDto> queryRoomAttrs(@RequestBody RoomAttrDto roomAttrDto) {
+
+        //校验是否传了 分页信息
+
+        int page = roomAttrDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            roomAttrDto.setPage((page - 1) * roomAttrDto.getRow());
+            roomAttrDto.setRow(page * roomAttrDto.getRow());
+        }
+
+        List<RoomAttrDto> roomAttrs = BeanConvertUtil.covertBeanList(roomAttrServiceDaoImpl.getRoomAttrInfo(BeanConvertUtil.beanCovertMap(roomAttrDto)), RoomAttrDto.class);
+
+        return roomAttrs;
+    }
+
+
+
+    @Override
+    public int queryRoomAttrsCount(@RequestBody RoomAttrDto roomAttrDto) {
+        return roomAttrServiceDaoImpl.queryRoomAttrsCount(BeanConvertUtil.beanCovertMap(roomAttrDto));
+    }
+
+    public IRoomAttrServiceDao getRoomAttrServiceDaoImpl() {
+        return roomAttrServiceDaoImpl;
+    }
+
+    public void setRoomAttrServiceDaoImpl(IRoomAttrServiceDao roomAttrServiceDaoImpl) {
+        this.roomAttrServiceDaoImpl = roomAttrServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 114 - 0
docs/services/room/DeleteRoomAttrInfo.md

@@ -0,0 +1,114 @@
+
+
+**1\. 删除小区房屋属性**
+###### 接口功能
+> API服务做删除小区房屋属性时调用该接口
+
+###### URL
+> [http://roomAttr-service/roomAttrApi/service](http://roomAttr-service/roomAttrApi/service)
+
+###### 支持格式
+> JSON
+
+###### HTTP请求方式
+> POST
+
+###### 协议接口
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
+|-|orders|1|Object|-|订单节点|-|
+|-|business|1|Array|-|业务节点|-|
+
+###### orders
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
+|-|orders|1|Object|-|订单节点|-|
+|orders|appId|1|String|10|系统ID|由中心服务提供|
+|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
+|orders|userId|1|String|30|用户ID|已有用户ID|
+|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
+|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
+|orders|remark|1|String|200|备注|备注|
+|orders|sign|?|String|64|签名|查看加密说明|
+|orders|attrs|?|Array|-|订单属性|-|
+|attrs|specCd|1|String|12|规格编码|由中心服务提供|
+|attrs|value|1|String|50|属性值|-|
+|orders|response|1|Object|-|返回结果节点|-|
+|response|code|1|String|4|返回状态|查看状态说明|
+|response|message|1|String|200|返回状态描述|-|
+
+###### business
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
+|-|business|?|Array|-|业务节点|-|
+|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
+|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
+|datas|businessRoomAttrInfo|1|Object|-|小区成员|小区成员|
+|businessRoomAttrInfo|attrId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://roomAttr-service/roomAttrApi/service](http://roomAttr-service/roomAttrApi/service)
+
+``` javascript
+请求头信息:
+Content-Type:application/json
+
+请求报文:
+
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "businessType":"I",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "businessTypeCd": "530100050001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRoomAttrInfo": {
+                "attrId":"填写存在的值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 120 - 0
docs/services/room/SaveRoomAttrInfo.md

@@ -0,0 +1,120 @@
+
+
+**1\. 保存小区房屋属性**
+###### 接口功能
+> API服务做保存小区房屋属性时调用该接口
+
+###### URL
+> [http://roomAttr-service/roomAttrApi/service](http://roomAttr-service/roomAttrApi/service)
+
+###### 支持格式
+> JSON
+
+###### HTTP请求方式
+> POST
+
+###### 协议接口
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
+|-|orders|1|Object|-|订单节点|-|
+|-|business|1|Array|-|业务节点|-|
+
+###### orders
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
+|-|orders|1|Object|-|订单节点|-|
+|orders|appId|1|String|10|系统ID|由中心服务提供|
+|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
+|orders|userId|1|String|30|用户ID|已有用户ID|
+|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
+|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
+|orders|remark|1|String|200|备注|备注|
+|orders|sign|?|String|64|签名|查看加密说明|
+|orders|attrs|?|Array|-|订单属性|-|
+|attrs|specCd|1|String|12|规格编码|由中心服务提供|
+|attrs|value|1|String|50|属性值|-|
+|orders|response|1|Object|-|返回结果节点|-|
+|response|code|1|String|4|返回状态|查看状态说明|
+|response|message|1|String|200|返回状态描述|-|
+
+###### business
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
+|-|business|?|Array|-|业务节点|-|
+|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
+|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
+|datas|businessRoomAttrInfo|1|Object|-|小区成员|小区成员|
+|businessRoomAttrInfo|attrId|1|String|30|-|-|
+|businessRoomAttrInfo|specCd|1|String|30|-|-|
+|businessRoomAttrInfo|value|1|String|30|-|-|
+|businessRoomAttrInfo|roomId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://roomAttr-service/roomAttrApi/service](http://roomAttr-service/roomAttrApi/service)
+
+``` javascript
+请求头信息:
+Content-Type:application/json
+
+请求报文:
+
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "businessType":"I",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "businessTypeCd": "530100030001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRoomAttrInfo": {
+                "attrId":"填写具体值",
+        "specCd":"填写具体值",
+        "value":"填写具体值",
+        "roomId":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 120 - 0
docs/services/room/UpdateRoomAttrInfo.md

@@ -0,0 +1,120 @@
+
+
+**1\. 修改小区房屋属性**
+###### 接口功能
+> API服务做修改小区房屋属性时调用该接口
+
+###### URL
+> [http://roomAttr-service/roomAttrApi/service](http://roomAttr-service/roomAttrApi/service)
+
+###### 支持格式
+> JSON
+
+###### HTTP请求方式
+> POST
+
+###### 协议接口
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
+|-|orders|1|Object|-|订单节点|-|
+|-|business|1|Array|-|业务节点|-|
+
+###### orders
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
+|-|orders|1|Object|-|订单节点|-|
+|orders|appId|1|String|10|系统ID|由中心服务提供|
+|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
+|orders|userId|1|String|30|用户ID|已有用户ID|
+|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
+|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
+|orders|remark|1|String|200|备注|备注|
+|orders|sign|?|String|64|签名|查看加密说明|
+|orders|attrs|?|Array|-|订单属性|-|
+|attrs|specCd|1|String|12|规格编码|由中心服务提供|
+|attrs|value|1|String|50|属性值|-|
+|orders|response|1|Object|-|返回结果节点|-|
+|response|code|1|String|4|返回状态|查看状态说明|
+|response|message|1|String|200|返回状态描述|-|
+
+###### business
+|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
+| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
+|-|business|?|Array|-|业务节点|-|
+|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
+|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
+|datas|businessRoomAttrInfo|1|Object|-|小区成员|小区成员|
+|businessRoomAttrInfo|attrId|1|String|30|-|-|
+|businessRoomAttrInfo|specCd|1|String|30|-|-|
+|businessRoomAttrInfo|value|1|String|30|-|-|
+|businessRoomAttrInfo|roomId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://roomAttr-service/roomAttrApi/service](http://roomAttr-service/roomAttrApi/service)
+
+``` javascript
+请求头信息:
+Content-Type:application/json
+
+请求报文:
+
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "businessType":"I",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "businessTypeCd": "530100040001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRoomAttrInfo": {
+                "attrId":"填写具体值",
+        "specCd":"填写具体值",
+        "value":"填写具体值",
+        "roomId":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 69 - 0
java110-bean/src/main/java/com/java110/dto/RoomAttrDto.java

@@ -0,0 +1,69 @@
+
+package com.java110.dto;
+
+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 RoomAttrDto extends PageDto implements Serializable {
+
+    private String attrId;
+private String specCd;
+private String value;
+private String roomId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getAttrId() {
+        return attrId;
+    }
+public void setAttrId(String attrId) {
+        this.attrId = attrId;
+    }
+public String getSpecCd() {
+        return specCd;
+    }
+public void setSpecCd(String specCd) {
+        this.specCd = specCd;
+    }
+public String getValue() {
+        return value;
+    }
+public void setValue(String value) {
+        this.value = value;
+    }
+public String getRoomId() {
+        return roomId;
+    }
+public void setRoomId(String roomId) {
+        this.roomId = roomId;
+    }
+
+
+    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;
+    }
+}

+ 86 - 0
java110-code-generator/src/main/java/com/java110/RoomAttrGeneratorApplication.java

@@ -0,0 +1,86 @@
+package com.java110;
+
+
+import com.java110.code.Data;
+import com.java110.code.GeneratorAbstractBussiness;
+import com.java110.code.GeneratorDeleteInfoListener;
+import com.java110.code.GeneratorDtoBean;
+import com.java110.code.GeneratorIInnerServiceSMO;
+import com.java110.code.GeneratorIServiceDaoListener;
+import com.java110.code.GeneratorInnerServiceSMOImpl;
+import com.java110.code.GeneratorSaveInfoListener;
+import com.java110.code.GeneratorServiceDaoImplListener;
+import com.java110.code.GeneratorServiceDaoImplMapperListener;
+import com.java110.code.GeneratorUpdateInfoListener;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Hello world!
+ *
+ */
+public class RoomAttrGeneratorApplication {
+
+    protected RoomAttrGeneratorApplication() {
+        // prevents calls from subclass
+        throw new UnsupportedOperationException();
+    }
+    /**
+     *  代码生成器 入口方法
+     * @param args 参数
+     */
+    public static void main(String[] args) {
+        Data data = new Data();
+        data.setId("attrId");
+        data.setName("roomAttr");
+        data.setDesc("小区房屋属性");
+        data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_ROOM_INFO");
+        data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_ROOM_INFO");
+        data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_ROOM_INFO");
+        data.setNewBusinessTypeCdValue("530100030001");
+        data.setUpdateBusinessTypeCdValue("530100040001");
+        data.setDeleteBusinessTypeCdValue("530100050001");
+        data.setBusinessTableName("business_building_room_attr");
+        data.setTableName("building_room_attr");
+        Map<String, String> param = new HashMap<String, String>();
+        param.put("roomId", "room_id");
+        param.put("bId", "b_id");
+        param.put("attrId", "attr_id");
+        param.put("specCd", "spec_cd");
+        param.put("value", "value");
+        param.put("statusCd", "status_cd");
+        param.put("operate", "operate");
+        data.setParams(param);
+        GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener();
+        generatorSaveInfoListener.generator(data);
+
+        GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness();
+        generatorAbstractBussiness.generator(data);
+
+        GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener();
+        generatorIServiceDaoListener.generator(data);
+
+        GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener();
+        generatorServiceDaoImplListener.generator(data);
+
+        GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null;
+        generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener();
+        generatorServiceDaoImplMapperListener.generator(data);
+
+        GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener();
+        generatorUpdateInfoListener.generator(data);
+
+        GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener();
+        generatorDeleteInfoListener.generator(data);
+
+        GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl();
+        generatorInnerServiceSMOImpl.generator(data);
+
+        GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean();
+        generatorDtoBean.generator(data);
+
+        GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO();
+        generatorIInnerServiceSMO.generator(data);
+    }
+}

+ 2 - 2
java110-code-generator/src/main/resources/template/AbstractBusinessServiceDataFlowListener.txt

@@ -21,7 +21,7 @@ import java.util.Map;
  * Created by wuxw on 2018/7/4.
  */
 public abstract class AbstractStoreBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener{
-    private final static Logger logger = LoggerFactory.getLogger(AbstractStoreBusinessServiceDataFlowListener.class);
+    private static Logger logger = LoggerFactory.getLogger(AbstractStoreBusinessServiceDataFlowListener.class);
 
 
     /**
@@ -36,7 +36,7 @@ public abstract class AbstractStoreBusinessServiceDataFlowListener extends Abstr
      * @param businessStoreInfo
      */
     protected void flushBusinessStoreInfo(Map businessStoreInfo,String statusCd){
-        businessStoreInfo.put("newBId",businessStoreInfo.get("b_id"));
+        businessStoreInfo.put("newBId", businessStoreInfo.get("b_id"));
         $flushBusinessInfo$
         businessStoreInfo.put("statusCd", statusCd);
     }

+ 9 - 9
java110-code-generator/src/main/resources/template/IServiceDao.txt

@@ -25,7 +25,7 @@ public interface IStoreServiceDao {
      * @param businessStoreInfo 商户信息 封装
      * @throws DAOException 操作数据库异常
      */
-    public void saveBusinessStoreInfo(Map businessStoreInfo) throws DAOException;
+    void saveBusinessStoreInfo(Map businessStoreInfo) throws DAOException;
 
 
 
@@ -34,9 +34,9 @@ public interface IStoreServiceDao {
      * 根据bId 查询商户信息
      * @param info bId 信息
      * @return 商户信息
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
-    public List<Map> getBusinessStoreInfo(Map info) throws DAOException;
+    List<Map> getBusinessStoreInfo(Map info) throws DAOException;
 
 
 
@@ -44,9 +44,9 @@ public interface IStoreServiceDao {
     /**
      * 保存 商户信息 Business数据到 Instance中
      * @param info
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
-    public void saveStoreInfoInstance(Map info) throws DAOException;
+    void saveStoreInfoInstance(Map info) throws DAOException;
 
 
 
@@ -56,18 +56,18 @@ public interface IStoreServiceDao {
      * 根据bId 查询商户信息
      * @param info bId 信息
      * @return 商户信息
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
-    public List<Map> getStoreInfo(Map info) throws DAOException;
+    List<Map> getStoreInfo(Map info) throws DAOException;
 
 
 
     /**
      * 修改商户信息
      * @param info 修改信息
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
-    public void updateStoreInfoInstance(Map info) throws DAOException;
+    void updateStoreInfoInstance(Map info) throws DAOException;
 
 
     /**

+ 9 - 9
java110-code-generator/src/main/resources/template/SaveListener.txt

@@ -27,10 +27,10 @@ import java.util.Map;
 @Transactional
 public class SaveStoreInfoListener extends AbstractStoreBusinessServiceDataFlowListener{
 
-    private final static Logger logger = LoggerFactory.getLogger(SaveStoreInfoListener.class);
+    private static Logger logger = LoggerFactory.getLogger(SaveStoreInfoListener.class);
 
     @Autowired
-    IStoreServiceDao storeServiceDaoImpl;
+    private IStoreServiceDao storeServiceDaoImpl;
 
     @Override
     public int getOrder() {
@@ -54,19 +54,19 @@ public class SaveStoreInfoListener extends AbstractStoreBusinessServiceDataFlowL
 
         //处理 businessStore 节点
         if(data.containsKey("businessStore")){
-            Object _obj = data.get("businessStore");
+            Object bObj = data.get("businessStore");
             JSONArray businessStores = null;
-            if(_obj instanceof JSONObject){
+            if(bObj instanceof JSONObject){
                 businessStores = new JSONArray();
-                businessStores.add(_obj);
+                businessStores.add(bObj);
             }else {
-                businessStores = (JSONArray)_obj;
+                businessStores = (JSONArray)bObj;
             }
             //JSONObject businessStore = data.getJSONObject("businessStore");
-            for (int _storeIndex = 0; _storeIndex < businessStores.size();_storeIndex++) {
-                JSONObject businessStore = businessStores.getJSONObject(_storeIndex);
+            for (int bStoreIndex = 0; bStoreIndex < businessStores.size();bStoreIndex++) {
+                JSONObject businessStore = businessStores.getJSONObject(bStoreIndex);
                 doBusinessStore(business, businessStore);
-                if(_obj instanceof JSONObject) {
+                if(bObj instanceof JSONObject) {
                     dataFlowContext.addParamOut("storeId", businessStore.getString("storeId"));
                 }
             }

+ 7 - 7
java110-code-generator/src/main/resources/template/ServiceDaoImpl.txt

@@ -22,12 +22,12 @@ import java.util.Map;
 //@Transactional
 public class StoreServiceDaoImpl extends BaseServiceDao implements IStoreServiceDao {
 
-    private final static Logger logger = LoggerFactory.getLogger(StoreServiceDaoImpl.class);
+    private static Logger logger = LoggerFactory.getLogger(StoreServiceDaoImpl.class);
 
     /**
      * 商户信息封装
      * @param businessStoreInfo 商户信息 封装
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
     @Override
     public void saveBusinessStoreInfo(Map businessStoreInfo) throws DAOException {
@@ -46,7 +46,7 @@ public class StoreServiceDaoImpl extends BaseServiceDao implements IStoreService
      * 查询商户信息
      * @param info bId 信息
      * @return 商户信息
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
     @Override
     public List<Map> getBusinessStoreInfo(Map info) throws DAOException {
@@ -63,7 +63,7 @@ public class StoreServiceDaoImpl extends BaseServiceDao implements IStoreService
     /**
      * 保存商户信息 到 instance
      * @param info   bId 信息
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
     @Override
     public void saveStoreInfoInstance(Map info) throws DAOException {
@@ -80,8 +80,8 @@ public class StoreServiceDaoImpl extends BaseServiceDao implements IStoreService
     /**
      * 查询商户信息(instance)
      * @param info bId 信息
-     * @return
-     * @throws DAOException
+     * @return List<Map>
+     * @throws DAOException DAO异常
      */
     @Override
     public List<Map> getStoreInfo(Map info) throws DAOException {
@@ -96,7 +96,7 @@ public class StoreServiceDaoImpl extends BaseServiceDao implements IStoreService
     /**
      * 修改商户信息
      * @param info 修改信息
-     * @throws DAOException
+     * @throws DAOException DAO异常
      */
     @Override
     public void updateStoreInfoInstance(Map info) throws DAOException {

+ 4 - 4
java110-code-generator/src/main/resources/template/UpdateInfoListener.txt

@@ -35,9 +35,9 @@ import java.util.Map;
 @Transactional
 public class UpdateStoreInfoListener extends AbstractStoreBusinessServiceDataFlowListener {
 
-    private final static Logger logger = LoggerFactory.getLogger(UpdateStoreInfoListener.class);
+    private static Logger logger = LoggerFactory.getLogger(UpdateStoreInfoListener.class);
     @Autowired
-    IStoreServiceDao storeServiceDaoImpl;
+    private IStoreServiceDao storeServiceDaoImpl;
 
     @Override
     public int getOrder() {
@@ -51,8 +51,8 @@ public class UpdateStoreInfoListener extends AbstractStoreBusinessServiceDataFlo
 
     /**
      * business过程
-     * @param dataFlowContext
-     * @param business
+     * @param dataFlowContext 上下文对象
+     * @param business 业务对象
      */
     @Override
     protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {

+ 3 - 3
java110-common/src/main/java/com/java110/common/constant/BusinessTypeConstant.java

@@ -208,18 +208,18 @@ public class BusinessTypeConstant {
     public static final String BUSINESS_TYPE_DELETE_UNIT_INFO = "520100050001";
 
     /**
-     * 增加小区单元
+     * 增加房屋
      */
     public static final String BUSINESS_TYPE_SAVE_ROOM_INFO = "530100030001";
 
     /**
-     * 修改小区单元
+     * 修改房屋
      */
     public static final String BUSINESS_TYPE_UPDATE_ROOM_INFO = "530100040001";
 
 
     /**
-     * 删除小区单元
+     * 删除房屋
      */
     public static final String BUSINESS_TYPE_DELETE_ROOM_INFO = "530100050001";
 

+ 26 - 0
java110-config/db/CommunityService/create_room.sql

@@ -108,3 +108,29 @@ CREATE TABLE building_room(
 CREATE INDEX idx_room_b_id ON building_room(b_id);
 CREATE UNIQUE INDEX idx_room_id ON building_room(room_id);
 
+create table business_building_room_attr(
+    b_id VARCHAR(30) NOT NULL COMMENT '订单ID',
+    attr_id VARCHAR(30) NOT NULL COMMENT '属性id',
+    room_id VARCHAR(30) NOT NULL COMMENT '用户ID',
+    spec_cd VARCHAR(12) NOT NULL COMMENT '规格id,参考spec表',
+    `value` VARCHAR(50) NOT NULL COMMENT '属性值',
+    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    operate VARCHAR(3) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
+);
+
+CREATE INDEX idx_business_b_room_attr ON business_building_room_attr(room_id);
+CREATE INDEX idx_business_b_room_attr_b_id ON business_building_room_attr(b_id);
+
+
+CREATE TABLE building_room_attr(
+    b_id VARCHAR(30) NOT NULL COMMENT '订单ID',
+    attr_id VARCHAR(30) NOT NULL COMMENT '属性id',
+    room_id VARCHAR(30) NOT NULL COMMENT '房屋ID',
+    spec_cd VARCHAR(12) NOT NULL COMMENT '规格id,参考spec表',
+    `value` VARCHAR(50) NOT NULL COMMENT '属性值',
+    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
+    UNIQUE KEY (attr_id)
+);
+CREATE INDEX idx_b_attr_b_id ON building_room_attr(b_id);
+CREATE INDEX idx_attr_room_id ON building_room_attr(room_id);

+ 156 - 0
java110-config/src/main/resources/mapper/room/RoomAttrServiceDaoImplMapper.xml

@@ -0,0 +1,156 @@
+<?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="roomAttrServiceDaoImpl">
+
+    <!-- 保存小区房屋属性信息 add by wuxw 2018-07-03 -->
+       <insert id="saveBusinessRoomAttrInfo" parameterType="Map">
+           insert into business_building_room_attr(
+attr_id,operate,spec_cd,b_id,value,room_id
+) values (
+#{attrId},#{operate},#{specCd},#{bId},#{value},#{roomId}
+)
+       </insert>
+
+
+       <!-- 查询小区房屋属性信息(Business) add by wuxw 2018-07-03 -->
+       <select id="getBusinessRoomAttrInfo" parameterType="Map" resultType="Map">
+           select  t.attr_id,t.attr_id attrId,t.operate,t.spec_cd,t.spec_cd specCd,t.b_id,t.b_id bId,t.value,t.room_id,t.room_id roomId 
+from business_building_room_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="specCd !=null and specCd != ''">
+   and t.spec_cd= #{specCd}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+
+       </select>
+
+
+
+
+
+    <!-- 保存小区房屋属性信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveRoomAttrInfoInstance" parameterType="Map">
+        insert into building_room_attr(
+attr_id,spec_cd,status_cd,b_id,value,room_id
+) select t.attr_id,t.spec_cd,'0',t.b_id,t.value,t.room_id from business_building_room_attr t where 1=1
+<if test="attrId !=null and attrId != ''">
+   and t.attr_id= #{attrId}
+</if> 
+   and t.operate= 'ADD'
+<if test="specCd !=null and specCd != ''">
+   and t.spec_cd= #{specCd}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+
+    </insert>
+
+
+
+    <!-- 查询小区房屋属性信息 add by wuxw 2018-07-03 -->
+    <select id="getRoomAttrInfo" parameterType="Map" resultType="Map">
+        select  t.attr_id,t.attr_id attrId,t.spec_cd,t.spec_cd specCd,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.value,t.room_id,t.room_id roomId 
+from building_room_attr t 
+where 1 =1 
+<if test="attrId !=null and attrId != ''">
+   and t.attr_id= #{attrId}
+</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="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+<if test="page != -1 and page != null and page != ''">
+   limit page,row
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改小区房屋属性信息 add by wuxw 2018-07-03 -->
+    <update id="updateRoomAttrInfoInstance" parameterType="Map">
+        update  building_room_attr t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="specCd !=null and specCd != ''">
+, t.spec_cd= #{specCd}
+</if> 
+<if test="value !=null and value != ''">
+, t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+, t.room_id= #{roomId}
+</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="queryRoomAttrsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from building_room_attr t 
+where 1 =1 
+<if test="attrId !=null and attrId != ''">
+   and t.attr_id= #{attrId}
+</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="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="roomId !=null and roomId != ''">
+   and t.room_id= #{roomId}
+</if> 
+
+
+     </select>
+
+</mapper>

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

@@ -77,6 +77,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_floorId = "73";
     public static final String CODE_PREFIX_unitId = "74";
     public static final String CODE_PREFIX_roomId = "75";
+    public static final String CODE_PREFIX_roomAttrId = "76";
 
     /**
      * 只有在不调用服务生成ID时有用

+ 43 - 0
java110-core/src/main/java/com/java110/core/smo/room/IRoomAttrInnerServiceSMO.java

@@ -0,0 +1,43 @@
+
+package com.java110.core.smo.room;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.RoomAttrDto;
+import org.springframework.cloud.netflix.feign.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 IRoomAttrInnerServiceSMO
+ * @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("/roomAttrApi")
+public interface IRoomAttrInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param roomAttrDto 数据对象分享
+     * @return RoomAttrDto 对象数据
+     */
+    @RequestMapping(value = "/queryRoomAttrs", method = RequestMethod.POST)
+    List<RoomAttrDto> queryRoomAttrs(@RequestBody RoomAttrDto roomAttrDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param roomAttrDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRoomAttrsCount", method = RequestMethod.POST)
+    int queryRoomAttrsCount(@RequestBody RoomAttrDto roomAttrDto);
+}