Quellcode durchsuchen

加入报修 服务实现类

wuxw vor 7 Jahren
Ursprung
Commit
6800812e6a
31 geänderte Dateien mit 3597 neuen und 0 gelöschten Zeilen
  1. 81 0
      CommunityService/src/main/java/com/java110/community/dao/IRepairServiceDao.java
  2. 81 0
      CommunityService/src/main/java/com/java110/community/dao/IRepairUserServiceDao.java
  3. 129 0
      CommunityService/src/main/java/com/java110/community/dao/impl/RepairServiceDaoImpl.java
  4. 129 0
      CommunityService/src/main/java/com/java110/community/dao/impl/RepairUserServiceDaoImpl.java
  5. 91 0
      CommunityService/src/main/java/com/java110/community/listener/repair/AbstractRepairBusinessServiceDataFlowListener.java
  6. 85 0
      CommunityService/src/main/java/com/java110/community/listener/repair/AbstractRepairUserBusinessServiceDataFlowListener.java
  7. 177 0
      CommunityService/src/main/java/com/java110/community/listener/repair/DeleteRepairInfoListener.java
  8. 177 0
      CommunityService/src/main/java/com/java110/community/listener/repair/DeleteRepairUserInfoListener.java
  9. 175 0
      CommunityService/src/main/java/com/java110/community/listener/repair/SaveRepairInfoListener.java
  10. 175 0
      CommunityService/src/main/java/com/java110/community/listener/repair/SaveRepairUserInfoListener.java
  11. 190 0
      CommunityService/src/main/java/com/java110/community/listener/repair/UpdateRepairInfoListener.java
  12. 190 0
      CommunityService/src/main/java/com/java110/community/listener/repair/UpdateRepairUserInfoListener.java
  13. 74 0
      CommunityService/src/main/java/com/java110/community/smo/impl/RepairInnerServiceSMOImpl.java
  14. 111 0
      CommunityService/src/main/java/com/java110/community/smo/impl/RepairUserInnerServiceSMOImpl.java
  15. 114 0
      docs/document/services/repair/DeleteRepairInfo.md
  16. 114 0
      docs/document/services/repair/DeleteRepairUserInfo.md
  17. 130 0
      docs/document/services/repair/SaveRepairInfo.md
  18. 124 0
      docs/document/services/repair/SaveRepairUserInfo.md
  19. 130 0
      docs/document/services/repair/UpdateRepairInfo.md
  20. 124 0
      docs/document/services/repair/UpdateRepairUserInfo.md
  21. 122 0
      java110-bean/src/main/java/com/java110/dto/repair/RepairDto.java
  22. 95 0
      java110-bean/src/main/java/com/java110/dto/repair/RepairUserDto.java
  23. 95 0
      java110-code-generator/src/main/java/com/java110/RepairGeneratorApplication.java
  24. 92 0
      java110-code-generator/src/main/java/com/java110/RepairUserGeneratorApplication.java
  25. 3 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  26. 42 0
      java110-core/src/main/java/com/java110/core/smo/repair/IRepairInnerServiceSMO.java
  27. 42 0
      java110-core/src/main/java/com/java110/core/smo/repair/IRepairUserInnerServiceSMO.java
  28. 58 0
      java110-db/db/CommunityService/create_repair.sql
  29. 233 0
      java110-db/src/main/resources/mapper/repair/RepairServiceDaoImplMapper.xml
  30. 184 0
      java110-db/src/main/resources/mapper/repair/RepairUserServiceDaoImplMapper.xml
  31. 30 0
      java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

+ 81 - 0
CommunityService/src/main/java/com/java110/community/dao/IRepairServiceDao.java

@@ -0,0 +1,81 @@
+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 IRepairServiceDao {
+
+    /**
+     * 保存 报修信息信息
+     * @param businessRepairInfo 报修信息信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessRepairInfo(Map businessRepairInfo) throws DAOException;
+
+
+
+    /**
+     * 查询报修信息信息(business过程)
+     * 根据bId 查询报修信息信息
+     * @param info bId 信息
+     * @return 报修信息信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessRepairInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 报修信息信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveRepairInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询报修信息信息(instance过程)
+     * 根据bId 查询报修信息信息
+     * @param info bId 信息
+     * @return 报修信息信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRepairInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改报修信息信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateRepairInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询报修信息总数
+     *
+     * @param info 报修信息信息
+     * @return 报修信息数量
+     */
+    int queryRepairsCount(Map info);
+
+}

+ 81 - 0
CommunityService/src/main/java/com/java110/community/dao/IRepairUserServiceDao.java

@@ -0,0 +1,81 @@
+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 IRepairUserServiceDao {
+
+    /**
+     * 保存 报修派单信息
+     * @param businessRepairUserInfo 报修派单信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessRepairUserInfo(Map businessRepairUserInfo) throws DAOException;
+
+
+
+    /**
+     * 查询报修派单信息(business过程)
+     * 根据bId 查询报修派单信息
+     * @param info bId 信息
+     * @return 报修派单信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessRepairUserInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 报修派单信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveRepairUserInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询报修派单信息(instance过程)
+     * 根据bId 查询报修派单信息
+     * @param info bId 信息
+     * @return 报修派单信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRepairUserInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改报修派单信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateRepairUserInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询报修派单总数
+     *
+     * @param info 报修派单信息
+     * @return 报修派单数量
+     */
+    int queryRepairUsersCount(Map info);
+
+}

+ 129 - 0
CommunityService/src/main/java/com/java110/community/dao/impl/RepairServiceDaoImpl.java

@@ -0,0 +1,129 @@
+package com.java110.community.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairServiceDao;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+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("repairServiceDaoImpl")
+//@Transactional
+public class RepairServiceDaoImpl extends BaseServiceDao implements IRepairServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RepairServiceDaoImpl.class);
+
+    /**
+     * 报修信息信息封装
+     * @param businessRepairInfo 报修信息信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessRepairInfo(Map businessRepairInfo) throws DAOException {
+        businessRepairInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存报修信息信息 入参 businessRepairInfo : {}",businessRepairInfo);
+        int saveFlag = sqlSessionTemplate.insert("repairServiceDaoImpl.saveBusinessRepairInfo",businessRepairInfo);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存报修信息数据失败:"+ JSONObject.toJSONString(businessRepairInfo));
+        }
+    }
+
+
+    /**
+     * 查询报修信息信息
+     * @param info bId 信息
+     * @return 报修信息信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessRepairInfo(Map info) throws DAOException {
+
+        logger.debug("查询报修信息信息 入参 info : {}",info);
+
+        List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getBusinessRepairInfo",info);
+
+        return businessRepairInfos;
+    }
+
+
+
+    /**
+     * 保存报修信息信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveRepairInfoInstance(Map info) throws DAOException {
+        logger.debug("保存报修信息信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("repairServiceDaoImpl.saveRepairInfoInstance",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> getRepairInfo(Map info) throws DAOException {
+        logger.debug("查询报修信息信息 入参 info : {}",info);
+
+        List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.getRepairInfo",info);
+
+        return businessRepairInfos;
+    }
+
+
+    /**
+     * 修改报修信息信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateRepairInfoInstance(Map info) throws DAOException {
+        logger.debug("修改报修信息信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("repairServiceDaoImpl.updateRepairInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改报修信息信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询报修信息数量
+     * @param info 报修信息信息
+     * @return 报修信息数量
+     */
+    @Override
+    public int queryRepairsCount(Map info) {
+        logger.debug("查询报修信息数据 入参 info : {}",info);
+
+        List<Map> businessRepairInfos = sqlSessionTemplate.selectList("repairServiceDaoImpl.queryRepairsCount", info);
+        if (businessRepairInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRepairInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 129 - 0
CommunityService/src/main/java/com/java110/community/dao/impl/RepairUserServiceDaoImpl.java

@@ -0,0 +1,129 @@
+package com.java110.community.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairUserServiceDao;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+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("repairUserServiceDaoImpl")
+//@Transactional
+public class RepairUserServiceDaoImpl extends BaseServiceDao implements IRepairUserServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RepairUserServiceDaoImpl.class);
+
+    /**
+     * 报修派单信息封装
+     * @param businessRepairUserInfo 报修派单信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessRepairUserInfo(Map businessRepairUserInfo) throws DAOException {
+        businessRepairUserInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存报修派单信息 入参 businessRepairUserInfo : {}",businessRepairUserInfo);
+        int saveFlag = sqlSessionTemplate.insert("repairUserServiceDaoImpl.saveBusinessRepairUserInfo",businessRepairUserInfo);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存报修派单数据失败:"+ JSONObject.toJSONString(businessRepairUserInfo));
+        }
+    }
+
+
+    /**
+     * 查询报修派单信息
+     * @param info bId 信息
+     * @return 报修派单信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessRepairUserInfo(Map info) throws DAOException {
+
+        logger.debug("查询报修派单信息 入参 info : {}",info);
+
+        List<Map> businessRepairUserInfos = sqlSessionTemplate.selectList("repairUserServiceDaoImpl.getBusinessRepairUserInfo",info);
+
+        return businessRepairUserInfos;
+    }
+
+
+
+    /**
+     * 保存报修派单信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveRepairUserInfoInstance(Map info) throws DAOException {
+        logger.debug("保存报修派单信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("repairUserServiceDaoImpl.saveRepairUserInfoInstance",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> getRepairUserInfo(Map info) throws DAOException {
+        logger.debug("查询报修派单信息 入参 info : {}",info);
+
+        List<Map> businessRepairUserInfos = sqlSessionTemplate.selectList("repairUserServiceDaoImpl.getRepairUserInfo",info);
+
+        return businessRepairUserInfos;
+    }
+
+
+    /**
+     * 修改报修派单信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateRepairUserInfoInstance(Map info) throws DAOException {
+        logger.debug("修改报修派单信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("repairUserServiceDaoImpl.updateRepairUserInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改报修派单信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询报修派单数量
+     * @param info 报修派单信息
+     * @return 报修派单数量
+     */
+    @Override
+    public int queryRepairUsersCount(Map info) {
+        logger.debug("查询报修派单数据 入参 info : {}",info);
+
+        List<Map> businessRepairUserInfos = sqlSessionTemplate.selectList("repairUserServiceDaoImpl.queryRepairUsersCount", info);
+        if (businessRepairUserInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRepairUserInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 91 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/AbstractRepairBusinessServiceDataFlowListener.java

@@ -0,0 +1,91 @@
+package com.java110.community.listener.repair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairServiceDao;
+import com.java110.entity.center.Business;
+import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
+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 AbstractRepairBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractRepairBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     *
+     * @return
+     */
+    public abstract IRepairServiceDao getRepairServiceDaoImpl();
+
+    /**
+     * 刷新 businessRepairInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
+     * @param businessRepairInfo
+     */
+    protected void flushBusinessRepairInfo(Map businessRepairInfo, String statusCd) {
+        businessRepairInfo.put("newBId", businessRepairInfo.get("b_id"));
+        businessRepairInfo.put("operate", businessRepairInfo.get("operate"));
+        businessRepairInfo.put("repairName", businessRepairInfo.get("repair_name"));
+        businessRepairInfo.put("appointmentTime", businessRepairInfo.get("appointment_time"));
+        businessRepairInfo.put("repairType", businessRepairInfo.get("repair_type"));
+        businessRepairInfo.put("context", businessRepairInfo.get("context"));
+        businessRepairInfo.put("repairId", businessRepairInfo.get("repair_id"));
+        businessRepairInfo.put("tel", businessRepairInfo.get("tel"));
+        businessRepairInfo.put("state", businessRepairInfo.get("state"));
+        businessRepairInfo.put("communityId", businessRepairInfo.get("community_id"));
+        businessRepairInfo.put("roomId", businessRepairInfo.get("room_id"));
+        businessRepairInfo.remove("bId");
+        businessRepairInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
+     * @param businessRepair 报修信息信息
+     */
+    protected void autoSaveDelBusinessRepair(Business business, JSONObject businessRepair) {
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("repairId", businessRepair.getString("repairId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentRepairInfos = getRepairServiceDaoImpl().getRepairInfo(info);
+        if (currentRepairInfos == null || currentRepairInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
+        }
+
+        Map currentRepairInfo = currentRepairInfos.get(0);
+
+        currentRepairInfo.put("bId", business.getbId());
+
+        currentRepairInfo.put("operate", currentRepairInfo.get("operate"));
+        currentRepairInfo.put("repairName", currentRepairInfo.get("repair_name"));
+        currentRepairInfo.put("appointmentTime", currentRepairInfo.get("appointment_time"));
+        currentRepairInfo.put("repairType", currentRepairInfo.get("repair_type"));
+        currentRepairInfo.put("context", currentRepairInfo.get("context"));
+        currentRepairInfo.put("repairId", currentRepairInfo.get("repair_id"));
+        currentRepairInfo.put("tel", currentRepairInfo.get("tel"));
+        currentRepairInfo.put("state", currentRepairInfo.get("state"));
+        currentRepairInfo.put("communityId", currentRepairInfo.get("community_id"));
+        currentRepairInfo.put("roomId", currentRepairInfo.get("room_id"));
+
+
+        currentRepairInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getRepairServiceDaoImpl().saveBusinessRepairInfo(currentRepairInfo);
+    }
+
+
+}

+ 85 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/AbstractRepairUserBusinessServiceDataFlowListener.java

@@ -0,0 +1,85 @@
+package com.java110.community.listener.repair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairUserServiceDao;
+import com.java110.entity.center.Business;
+import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
+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 AbstractRepairUserBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractRepairUserBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     *
+     * @return
+     */
+    public abstract IRepairUserServiceDao getRepairUserServiceDaoImpl();
+
+    /**
+     * 刷新 businessRepairUserInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
+     * @param businessRepairUserInfo
+     */
+    protected void flushBusinessRepairUserInfo(Map businessRepairUserInfo, String statusCd) {
+        businessRepairUserInfo.put("newBId", businessRepairUserInfo.get("b_id"));
+        businessRepairUserInfo.put("operate", businessRepairUserInfo.get("operate"));
+        businessRepairUserInfo.put("context", businessRepairUserInfo.get("context"));
+        businessRepairUserInfo.put("repairId", businessRepairUserInfo.get("repair_id"));
+        businessRepairUserInfo.put("ruId", businessRepairUserInfo.get("ru_id"));
+        businessRepairUserInfo.put("state", businessRepairUserInfo.get("state"));
+        businessRepairUserInfo.put("communityId", businessRepairUserInfo.get("community_id"));
+        businessRepairUserInfo.put("userId", businessRepairUserInfo.get("user_id"));
+        businessRepairUserInfo.remove("bId");
+        businessRepairUserInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
+     * @param businessRepairUser 报修派单信息
+     */
+    protected void autoSaveDelBusinessRepairUser(Business business, JSONObject businessRepairUser) {
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("ruId", businessRepairUser.getString("ruId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentRepairUserInfos = getRepairUserServiceDaoImpl().getRepairUserInfo(info);
+        if (currentRepairUserInfos == null || currentRepairUserInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
+        }
+
+        Map currentRepairUserInfo = currentRepairUserInfos.get(0);
+
+        currentRepairUserInfo.put("bId", business.getbId());
+
+        currentRepairUserInfo.put("operate", currentRepairUserInfo.get("operate"));
+        currentRepairUserInfo.put("context", currentRepairUserInfo.get("context"));
+        currentRepairUserInfo.put("repairId", currentRepairUserInfo.get("repair_id"));
+        currentRepairUserInfo.put("ruId", currentRepairUserInfo.get("ru_id"));
+        currentRepairUserInfo.put("state", currentRepairUserInfo.get("state"));
+        currentRepairUserInfo.put("communityId", currentRepairUserInfo.get("community_id"));
+        currentRepairUserInfo.put("userId", currentRepairUserInfo.get("user_id"));
+
+
+        currentRepairUserInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getRepairUserServiceDaoImpl().saveBusinessRepairUserInfo(currentRepairUserInfo);
+    }
+
+
+}

+ 177 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/DeleteRepairInfoListener.java

@@ -0,0 +1,177 @@
+package com.java110.community.listener.repair;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+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;
+
+/**
+ * 删除报修信息信息 侦听
+ *
+ * 处理节点
+ * 1、businessRepair:{} 报修信息基本信息节点
+ * 2、businessRepairAttr:[{}] 报修信息属性信息节点
+ * 3、businessRepairPhoto:[{}] 报修信息照片信息节点
+ * 4、businessRepairCerdentials:[{}] 报修信息证件信息节点
+ * 协议地址 :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("deleteRepairInfoListener")
+@Transactional
+public class DeleteRepairInfoListener extends AbstractRepairBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteRepairInfoListener.class);
+    @Autowired
+    IRepairServiceDao repairServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_REPAIR;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRepair 节点
+        if(data.containsKey("businessRepair")){
+            //处理 businessRepair 节点
+            if(data.containsKey("businessRepair")){
+                Object _obj = data.get("businessRepair");
+                JSONArray businessRepairs = null;
+                if(_obj instanceof JSONObject){
+                    businessRepairs = new JSONArray();
+                    businessRepairs.add(_obj);
+                }else {
+                    businessRepairs = (JSONArray)_obj;
+                }
+                //JSONObject businessRepair = data.getJSONObject("businessRepair");
+                for (int _repairIndex = 0; _repairIndex < businessRepairs.size();_repairIndex++) {
+                    JSONObject businessRepair = businessRepairs.getJSONObject(_repairIndex);
+                    doBusinessRepair(business, businessRepair);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("repairId", businessRepair.getString("repairId"));
+                    }
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * 删除 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> businessRepairInfos = repairServiceDaoImpl.getBusinessRepairInfo(info);
+        if( businessRepairInfos != null && businessRepairInfos.size() >0) {
+            for (int _repairIndex = 0; _repairIndex < businessRepairInfos.size();_repairIndex++) {
+                Map businessRepairInfo = businessRepairInfos.get(_repairIndex);
+                flushBusinessRepairInfo(businessRepairInfo,StatusConstant.STATUS_CD_INVALID);
+                repairServiceDaoImpl.updateRepairInfoInstance(businessRepairInfo);
+                dataFlowContext.addParamOut("repairId",businessRepairInfo.get("repair_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> repairInfo = repairServiceDaoImpl.getRepairInfo(info);
+        if(repairInfo != null && repairInfo.size() > 0){
+
+            //报修信息信息
+            List<Map> businessRepairInfos = repairServiceDaoImpl.getBusinessRepairInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessRepairInfos == null ||  businessRepairInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(repair),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _repairIndex = 0; _repairIndex < businessRepairInfos.size();_repairIndex++) {
+                Map businessRepairInfo = businessRepairInfos.get(_repairIndex);
+                flushBusinessRepairInfo(businessRepairInfo,StatusConstant.STATUS_CD_VALID);
+                repairServiceDaoImpl.updateRepairInfoInstance(businessRepairInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 处理 businessRepair 节点
+     * @param business 总的数据节点
+     * @param businessRepair 报修信息节点
+     */
+    private void doBusinessRepair(Business business,JSONObject businessRepair){
+
+        Assert.jsonObjectHaveKey(businessRepair,"repairId","businessRepair 节点下没有包含 repairId 节点");
+
+        if(businessRepair.getString("repairId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"repairId 错误,不能自动生成(必须已经存在的repairId)"+businessRepair);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessRepair(business,businessRepair);
+    }
+
+    public IRepairServiceDao getRepairServiceDaoImpl() {
+        return repairServiceDaoImpl;
+    }
+
+    public void setRepairServiceDaoImpl(IRepairServiceDao repairServiceDaoImpl) {
+        this.repairServiceDaoImpl = repairServiceDaoImpl;
+    }
+}

+ 177 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/DeleteRepairUserInfoListener.java

@@ -0,0 +1,177 @@
+package com.java110.community.listener.repair;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairUserServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+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;
+
+/**
+ * 删除报修派单信息 侦听
+ *
+ * 处理节点
+ * 1、businessRepairUser:{} 报修派单基本信息节点
+ * 2、businessRepairUserAttr:[{}] 报修派单属性信息节点
+ * 3、businessRepairUserPhoto:[{}] 报修派单照片信息节点
+ * 4、businessRepairUserCerdentials:[{}] 报修派单证件信息节点
+ * 协议地址 :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("deleteRepairUserInfoListener")
+@Transactional
+public class DeleteRepairUserInfoListener extends AbstractRepairUserBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteRepairUserInfoListener.class);
+    @Autowired
+    IRepairUserServiceDao repairUserServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_REPAIR_USER;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRepairUser 节点
+        if(data.containsKey("businessRepairUser")){
+            //处理 businessRepairUser 节点
+            if(data.containsKey("businessRepairUser")){
+                Object _obj = data.get("businessRepairUser");
+                JSONArray businessRepairUsers = null;
+                if(_obj instanceof JSONObject){
+                    businessRepairUsers = new JSONArray();
+                    businessRepairUsers.add(_obj);
+                }else {
+                    businessRepairUsers = (JSONArray)_obj;
+                }
+                //JSONObject businessRepairUser = data.getJSONObject("businessRepairUser");
+                for (int _repairUserIndex = 0; _repairUserIndex < businessRepairUsers.size();_repairUserIndex++) {
+                    JSONObject businessRepairUser = businessRepairUsers.getJSONObject(_repairUserIndex);
+                    doBusinessRepairUser(business, businessRepairUser);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("ruId", businessRepairUser.getString("ruId"));
+                    }
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * 删除 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> businessRepairUserInfos = repairUserServiceDaoImpl.getBusinessRepairUserInfo(info);
+        if( businessRepairUserInfos != null && businessRepairUserInfos.size() >0) {
+            for (int _repairUserIndex = 0; _repairUserIndex < businessRepairUserInfos.size();_repairUserIndex++) {
+                Map businessRepairUserInfo = businessRepairUserInfos.get(_repairUserIndex);
+                flushBusinessRepairUserInfo(businessRepairUserInfo,StatusConstant.STATUS_CD_INVALID);
+                repairUserServiceDaoImpl.updateRepairUserInfoInstance(businessRepairUserInfo);
+                dataFlowContext.addParamOut("ruId",businessRepairUserInfo.get("ru_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> repairUserInfo = repairUserServiceDaoImpl.getRepairUserInfo(info);
+        if(repairUserInfo != null && repairUserInfo.size() > 0){
+
+            //报修派单信息
+            List<Map> businessRepairUserInfos = repairUserServiceDaoImpl.getBusinessRepairUserInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessRepairUserInfos == null ||  businessRepairUserInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(repairUser),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _repairUserIndex = 0; _repairUserIndex < businessRepairUserInfos.size();_repairUserIndex++) {
+                Map businessRepairUserInfo = businessRepairUserInfos.get(_repairUserIndex);
+                flushBusinessRepairUserInfo(businessRepairUserInfo,StatusConstant.STATUS_CD_VALID);
+                repairUserServiceDaoImpl.updateRepairUserInfoInstance(businessRepairUserInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 处理 businessRepairUser 节点
+     * @param business 总的数据节点
+     * @param businessRepairUser 报修派单节点
+     */
+    private void doBusinessRepairUser(Business business,JSONObject businessRepairUser){
+
+        Assert.jsonObjectHaveKey(businessRepairUser,"ruId","businessRepairUser 节点下没有包含 ruId 节点");
+
+        if(businessRepairUser.getString("ruId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"ruId 错误,不能自动生成(必须已经存在的ruId)"+businessRepairUser);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessRepairUser(business,businessRepairUser);
+    }
+
+    public IRepairUserServiceDao getRepairUserServiceDaoImpl() {
+        return repairUserServiceDaoImpl;
+    }
+
+    public void setRepairUserServiceDaoImpl(IRepairUserServiceDao repairUserServiceDaoImpl) {
+        this.repairUserServiceDaoImpl = repairUserServiceDaoImpl;
+    }
+}

+ 175 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/SaveRepairInfoListener.java

@@ -0,0 +1,175 @@
+package com.java110.community.listener.repair;
+
+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.IRepairServiceDao;
+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("saveRepairInfoListener")
+@Transactional
+public class SaveRepairInfoListener extends AbstractRepairBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveRepairInfoListener.class);
+
+    @Autowired
+    private IRepairServiceDao repairServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR;
+    }
+
+    /**
+     * 保存报修信息信息 business 表中
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRepair 节点
+        if(data.containsKey("businessRepair")){
+            Object bObj = data.get("businessRepair");
+            JSONArray businessRepairs = null;
+            if(bObj instanceof JSONObject){
+                businessRepairs = new JSONArray();
+                businessRepairs.add(bObj);
+            }else {
+                businessRepairs = (JSONArray)bObj;
+            }
+            //JSONObject businessRepair = data.getJSONObject("businessRepair");
+            for (int bRepairIndex = 0; bRepairIndex < businessRepairs.size();bRepairIndex++) {
+                JSONObject businessRepair = businessRepairs.getJSONObject(bRepairIndex);
+                doBusinessRepair(business, businessRepair);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("repairId", businessRepair.getString("repairId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessRepairInfo = repairServiceDaoImpl.getBusinessRepairInfo(info);
+        if( businessRepairInfo != null && businessRepairInfo.size() >0) {
+            reFreshShareColumn(info, businessRepairInfo.get(0));
+            repairServiceDaoImpl.saveRepairInfoInstance(info);
+            if(businessRepairInfo.size() == 1) {
+                dataFlowContext.addParamOut("repairId", businessRepairInfo.get(0).get("repair_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> repairInfo = repairServiceDaoImpl.getRepairInfo(info);
+        if(repairInfo != null && repairInfo.size() > 0){
+            reFreshShareColumn(paramIn, repairInfo.get(0));
+            repairServiceDaoImpl.updateRepairInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 处理 businessRepair 节点
+     * @param business 总的数据节点
+     * @param businessRepair 报修信息节点
+     */
+    private void doBusinessRepair(Business business,JSONObject businessRepair){
+
+        Assert.jsonObjectHaveKey(businessRepair,"repairId","businessRepair 节点下没有包含 repairId 节点");
+
+        if(businessRepair.getString("repairId").startsWith("-")){
+            //刷新缓存
+            //flushRepairId(business.getDatas());
+
+            businessRepair.put("repairId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_repairId));
+
+        }
+
+        businessRepair.put("bId",business.getbId());
+        businessRepair.put("operate", StatusConstant.OPERATE_ADD);
+        //保存报修信息信息
+        repairServiceDaoImpl.saveBusinessRepairInfo(businessRepair);
+
+    }
+
+    public IRepairServiceDao getRepairServiceDaoImpl() {
+        return repairServiceDaoImpl;
+    }
+
+    public void setRepairServiceDaoImpl(IRepairServiceDao repairServiceDaoImpl) {
+        this.repairServiceDaoImpl = repairServiceDaoImpl;
+    }
+}

+ 175 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/SaveRepairUserInfoListener.java

@@ -0,0 +1,175 @@
+package com.java110.community.listener.repair;
+
+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.IRepairUserServiceDao;
+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("saveRepairUserInfoListener")
+@Transactional
+public class SaveRepairUserInfoListener extends AbstractRepairUserBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveRepairUserInfoListener.class);
+
+    @Autowired
+    private IRepairUserServiceDao repairUserServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_REPAIR_USER;
+    }
+
+    /**
+     * 保存报修派单信息 business 表中
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRepairUser 节点
+        if(data.containsKey("businessRepairUser")){
+            Object bObj = data.get("businessRepairUser");
+            JSONArray businessRepairUsers = null;
+            if(bObj instanceof JSONObject){
+                businessRepairUsers = new JSONArray();
+                businessRepairUsers.add(bObj);
+            }else {
+                businessRepairUsers = (JSONArray)bObj;
+            }
+            //JSONObject businessRepairUser = data.getJSONObject("businessRepairUser");
+            for (int bRepairUserIndex = 0; bRepairUserIndex < businessRepairUsers.size();bRepairUserIndex++) {
+                JSONObject businessRepairUser = businessRepairUsers.getJSONObject(bRepairUserIndex);
+                doBusinessRepairUser(business, businessRepairUser);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("ruId", businessRepairUser.getString("ruId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessRepairUserInfo = repairUserServiceDaoImpl.getBusinessRepairUserInfo(info);
+        if( businessRepairUserInfo != null && businessRepairUserInfo.size() >0) {
+            reFreshShareColumn(info, businessRepairUserInfo.get(0));
+            repairUserServiceDaoImpl.saveRepairUserInfoInstance(info);
+            if(businessRepairUserInfo.size() == 1) {
+                dataFlowContext.addParamOut("ruId", businessRepairUserInfo.get(0).get("ru_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> repairUserInfo = repairUserServiceDaoImpl.getRepairUserInfo(info);
+        if(repairUserInfo != null && repairUserInfo.size() > 0){
+            reFreshShareColumn(paramIn, repairUserInfo.get(0));
+            repairUserServiceDaoImpl.updateRepairUserInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 处理 businessRepairUser 节点
+     * @param business 总的数据节点
+     * @param businessRepairUser 报修派单节点
+     */
+    private void doBusinessRepairUser(Business business,JSONObject businessRepairUser){
+
+        Assert.jsonObjectHaveKey(businessRepairUser,"ruId","businessRepairUser 节点下没有包含 ruId 节点");
+
+        if(businessRepairUser.getString("ruId").startsWith("-")){
+            //刷新缓存
+            //flushRepairUserId(business.getDatas());
+
+            businessRepairUser.put("ruId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ruId));
+
+        }
+
+        businessRepairUser.put("bId",business.getbId());
+        businessRepairUser.put("operate", StatusConstant.OPERATE_ADD);
+        //保存报修派单信息
+        repairUserServiceDaoImpl.saveBusinessRepairUserInfo(businessRepairUser);
+
+    }
+
+    public IRepairUserServiceDao getRepairUserServiceDaoImpl() {
+        return repairUserServiceDaoImpl;
+    }
+
+    public void setRepairUserServiceDaoImpl(IRepairUserServiceDao repairUserServiceDaoImpl) {
+        this.repairUserServiceDaoImpl = repairUserServiceDaoImpl;
+    }
+}

+ 190 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/UpdateRepairInfoListener.java

@@ -0,0 +1,190 @@
+package com.java110.community.listener.repair;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+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;
+
+/**
+ * 修改报修信息信息 侦听
+ *
+ * 处理节点
+ * 1、businessRepair:{} 报修信息基本信息节点
+ * 2、businessRepairAttr:[{}] 报修信息属性信息节点
+ * 3、businessRepairPhoto:[{}] 报修信息照片信息节点
+ * 4、businessRepairCerdentials:[{}] 报修信息证件信息节点
+ * 协议地址 :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("updateRepairInfoListener")
+@Transactional
+public class UpdateRepairInfoListener extends AbstractRepairBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateRepairInfoListener.class);
+    @Autowired
+    private IRepairServiceDao repairServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR;
+    }
+
+    /**
+     * business过程
+     * @param dataFlowContext 上下文对象
+     * @param business 业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRepair 节点
+        if(data.containsKey("businessRepair")){
+            //处理 businessRepair 节点
+            if(data.containsKey("businessRepair")){
+                Object _obj = data.get("businessRepair");
+                JSONArray businessRepairs = null;
+                if(_obj instanceof JSONObject){
+                    businessRepairs = new JSONArray();
+                    businessRepairs.add(_obj);
+                }else {
+                    businessRepairs = (JSONArray)_obj;
+                }
+                //JSONObject businessRepair = data.getJSONObject("businessRepair");
+                for (int _repairIndex = 0; _repairIndex < businessRepairs.size();_repairIndex++) {
+                    JSONObject businessRepair = businessRepairs.getJSONObject(_repairIndex);
+                    doBusinessRepair(business, businessRepair);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("repairId", businessRepair.getString("repairId"));
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 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> businessRepairInfos = repairServiceDaoImpl.getBusinessRepairInfo(info);
+        if( businessRepairInfos != null && businessRepairInfos.size() >0) {
+            for (int _repairIndex = 0; _repairIndex < businessRepairInfos.size();_repairIndex++) {
+                Map businessRepairInfo = businessRepairInfos.get(_repairIndex);
+                flushBusinessRepairInfo(businessRepairInfo,StatusConstant.STATUS_CD_VALID);
+                repairServiceDaoImpl.updateRepairInfoInstance(businessRepairInfo);
+                if(businessRepairInfo.size() == 1) {
+                    dataFlowContext.addParamOut("repairId", businessRepairInfo.get("repair_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> repairInfo = repairServiceDaoImpl.getRepairInfo(info);
+        if(repairInfo != null && repairInfo.size() > 0){
+
+            //报修信息信息
+            List<Map> businessRepairInfos = repairServiceDaoImpl.getBusinessRepairInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessRepairInfos == null || businessRepairInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(repair),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _repairIndex = 0; _repairIndex < businessRepairInfos.size();_repairIndex++) {
+                Map businessRepairInfo = businessRepairInfos.get(_repairIndex);
+                flushBusinessRepairInfo(businessRepairInfo,StatusConstant.STATUS_CD_VALID);
+                repairServiceDaoImpl.updateRepairInfoInstance(businessRepairInfo);
+            }
+        }
+
+    }
+
+
+
+    /**
+     * 处理 businessRepair 节点
+     * @param business 总的数据节点
+     * @param businessRepair 报修信息节点
+     */
+    private void doBusinessRepair(Business business,JSONObject businessRepair){
+
+        Assert.jsonObjectHaveKey(businessRepair,"repairId","businessRepair 节点下没有包含 repairId 节点");
+
+        if(businessRepair.getString("repairId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"repairId 错误,不能自动生成(必须已经存在的repairId)"+businessRepair);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessRepair(business,businessRepair);
+
+        businessRepair.put("bId",business.getbId());
+        businessRepair.put("operate", StatusConstant.OPERATE_ADD);
+        //保存报修信息信息
+        repairServiceDaoImpl.saveBusinessRepairInfo(businessRepair);
+
+    }
+
+
+
+
+    public IRepairServiceDao getRepairServiceDaoImpl() {
+        return repairServiceDaoImpl;
+    }
+
+    public void setRepairServiceDaoImpl(IRepairServiceDao repairServiceDaoImpl) {
+        this.repairServiceDaoImpl = repairServiceDaoImpl;
+    }
+
+
+
+}

+ 190 - 0
CommunityService/src/main/java/com/java110/community/listener/repair/UpdateRepairUserInfoListener.java

@@ -0,0 +1,190 @@
+package com.java110.community.listener.repair;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IRepairUserServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+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;
+
+/**
+ * 修改报修派单信息 侦听
+ *
+ * 处理节点
+ * 1、businessRepairUser:{} 报修派单基本信息节点
+ * 2、businessRepairUserAttr:[{}] 报修派单属性信息节点
+ * 3、businessRepairUserPhoto:[{}] 报修派单照片信息节点
+ * 4、businessRepairUserCerdentials:[{}] 报修派单证件信息节点
+ * 协议地址 :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("updateRepairUserInfoListener")
+@Transactional
+public class UpdateRepairUserInfoListener extends AbstractRepairUserBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateRepairUserInfoListener.class);
+    @Autowired
+    private IRepairUserServiceDao repairUserServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_REPAIR_USER;
+    }
+
+    /**
+     * business过程
+     * @param dataFlowContext 上下文对象
+     * @param business 业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessRepairUser 节点
+        if(data.containsKey("businessRepairUser")){
+            //处理 businessRepairUser 节点
+            if(data.containsKey("businessRepairUser")){
+                Object _obj = data.get("businessRepairUser");
+                JSONArray businessRepairUsers = null;
+                if(_obj instanceof JSONObject){
+                    businessRepairUsers = new JSONArray();
+                    businessRepairUsers.add(_obj);
+                }else {
+                    businessRepairUsers = (JSONArray)_obj;
+                }
+                //JSONObject businessRepairUser = data.getJSONObject("businessRepairUser");
+                for (int _repairUserIndex = 0; _repairUserIndex < businessRepairUsers.size();_repairUserIndex++) {
+                    JSONObject businessRepairUser = businessRepairUsers.getJSONObject(_repairUserIndex);
+                    doBusinessRepairUser(business, businessRepairUser);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("ruId", businessRepairUser.getString("ruId"));
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 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> businessRepairUserInfos = repairUserServiceDaoImpl.getBusinessRepairUserInfo(info);
+        if( businessRepairUserInfos != null && businessRepairUserInfos.size() >0) {
+            for (int _repairUserIndex = 0; _repairUserIndex < businessRepairUserInfos.size();_repairUserIndex++) {
+                Map businessRepairUserInfo = businessRepairUserInfos.get(_repairUserIndex);
+                flushBusinessRepairUserInfo(businessRepairUserInfo,StatusConstant.STATUS_CD_VALID);
+                repairUserServiceDaoImpl.updateRepairUserInfoInstance(businessRepairUserInfo);
+                if(businessRepairUserInfo.size() == 1) {
+                    dataFlowContext.addParamOut("ruId", businessRepairUserInfo.get("ru_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> repairUserInfo = repairUserServiceDaoImpl.getRepairUserInfo(info);
+        if(repairUserInfo != null && repairUserInfo.size() > 0){
+
+            //报修派单信息
+            List<Map> businessRepairUserInfos = repairUserServiceDaoImpl.getBusinessRepairUserInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessRepairUserInfos == null || businessRepairUserInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(repairUser),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _repairUserIndex = 0; _repairUserIndex < businessRepairUserInfos.size();_repairUserIndex++) {
+                Map businessRepairUserInfo = businessRepairUserInfos.get(_repairUserIndex);
+                flushBusinessRepairUserInfo(businessRepairUserInfo,StatusConstant.STATUS_CD_VALID);
+                repairUserServiceDaoImpl.updateRepairUserInfoInstance(businessRepairUserInfo);
+            }
+        }
+
+    }
+
+
+
+    /**
+     * 处理 businessRepairUser 节点
+     * @param business 总的数据节点
+     * @param businessRepairUser 报修派单节点
+     */
+    private void doBusinessRepairUser(Business business,JSONObject businessRepairUser){
+
+        Assert.jsonObjectHaveKey(businessRepairUser,"ruId","businessRepairUser 节点下没有包含 ruId 节点");
+
+        if(businessRepairUser.getString("ruId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"ruId 错误,不能自动生成(必须已经存在的ruId)"+businessRepairUser);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessRepairUser(business,businessRepairUser);
+
+        businessRepairUser.put("bId",business.getbId());
+        businessRepairUser.put("operate", StatusConstant.OPERATE_ADD);
+        //保存报修派单信息
+        repairUserServiceDaoImpl.saveBusinessRepairUserInfo(businessRepairUser);
+
+    }
+
+
+
+
+    public IRepairUserServiceDao getRepairUserServiceDaoImpl() {
+        return repairUserServiceDaoImpl;
+    }
+
+    public void setRepairUserServiceDaoImpl(IRepairUserServiceDao repairUserServiceDaoImpl) {
+        this.repairUserServiceDaoImpl = repairUserServiceDaoImpl;
+    }
+
+
+
+}

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

@@ -0,0 +1,74 @@
+package com.java110.community.smo.impl;
+
+
+import com.java110.community.dao.IRepairServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.repair.IRepairInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.UserDto;
+import com.java110.dto.repair.RepairDto;
+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 RepairInnerServiceSMOImpl extends BaseServiceSMO implements IRepairInnerServiceSMO {
+
+    @Autowired
+    private IRepairServiceDao repairServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<RepairDto> queryRepairs(@RequestBody RepairDto repairDto) {
+
+        //校验是否传了 分页信息
+
+        int page = repairDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            repairDto.setPage((page - 1) * repairDto.getRow());
+        }
+
+        List<RepairDto> repairs = BeanConvertUtil.covertBeanList(repairServiceDaoImpl.getRepairInfo(BeanConvertUtil.beanCovertMap(repairDto)), RepairDto.class);
+
+
+        return repairs;
+    }
+
+
+    @Override
+    public int queryRepairsCount(@RequestBody RepairDto repairDto) {
+        return repairServiceDaoImpl.queryRepairsCount(BeanConvertUtil.beanCovertMap(repairDto));
+    }
+
+    public IRepairServiceDao getRepairServiceDaoImpl() {
+        return repairServiceDaoImpl;
+    }
+
+    public void setRepairServiceDaoImpl(IRepairServiceDao repairServiceDaoImpl) {
+        this.repairServiceDaoImpl = repairServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 111 - 0
CommunityService/src/main/java/com/java110/community/smo/impl/RepairUserInnerServiceSMOImpl.java

@@ -0,0 +1,111 @@
+package com.java110.community.smo.impl;
+
+
+import com.java110.community.dao.IRepairUserServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.repair.IRepairUserInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.UserDto;
+import com.java110.dto.repair.RepairUserDto;
+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 RepairUserInnerServiceSMOImpl extends BaseServiceSMO implements IRepairUserInnerServiceSMO {
+
+    @Autowired
+    private IRepairUserServiceDao repairUserServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<RepairUserDto> queryRepairUsers(@RequestBody  RepairUserDto repairUserDto) {
+
+        //校验是否传了 分页信息
+
+        int page = repairUserDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            repairUserDto.setPage((page - 1) * repairUserDto.getRow());
+        }
+
+        List<RepairUserDto> repairUsers = BeanConvertUtil.covertBeanList(repairUserServiceDaoImpl.getRepairUserInfo(BeanConvertUtil.beanCovertMap(repairUserDto)), RepairUserDto.class);
+
+        if (repairUsers == null || repairUsers.size() == 0) {
+            return repairUsers;
+        }
+
+        String[] userIds = getUserIds(repairUsers);
+        //根据 userId 查询用户信息
+        List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds);
+
+        for (RepairUserDto repairUser : repairUsers) {
+            refreshRepairUser(repairUser, users);
+        }
+        return repairUsers;
+    }
+
+    /**
+     * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
+     *
+     * @param repairUser 小区报修派单信息
+     * @param users 用户列表
+     */
+    private void refreshRepairUser(RepairUserDto repairUser, List<UserDto> users) {
+        for (UserDto user : users) {
+            if (repairUser.getUserId().equals(user.getUserId())) {
+                BeanConvertUtil.covertBean(user, repairUser);
+            }
+        }
+    }
+
+    /**
+     * 获取批量userId
+     *
+     * @param repairUsers 小区楼信息
+     * @return 批量userIds 信息
+     */
+    private String[] getUserIds(List<RepairUserDto> repairUsers) {
+        List<String> userIds = new ArrayList<String>();
+        for (RepairUserDto repairUser : repairUsers) {
+            userIds.add(repairUser.getUserId());
+        }
+
+        return userIds.toArray(new String[userIds.size()]);
+    }
+
+    @Override
+    public int queryRepairUsersCount(@RequestBody RepairUserDto repairUserDto) {
+        return repairUserServiceDaoImpl.queryRepairUsersCount(BeanConvertUtil.beanCovertMap(repairUserDto));    }
+
+    public IRepairUserServiceDao getRepairUserServiceDaoImpl() {
+        return repairUserServiceDaoImpl;
+    }
+
+    public void setRepairUserServiceDaoImpl(IRepairUserServiceDao repairUserServiceDaoImpl) {
+        this.repairUserServiceDaoImpl = repairUserServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 114 - 0
docs/document/services/repair/DeleteRepairInfo.md

@@ -0,0 +1,114 @@
+
+
+**1\. 删除报修信息**
+###### 接口功能
+> API服务做删除报修信息时调用该接口
+
+###### URL
+> [http://repair-service/repairApi/service](http://repair-service/repairApi/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|businessRepairInfo|1|Object|-|小区成员|小区成员|
+|businessRepairInfo|repairId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://repair-service/repairApi/service](http://repair-service/repairApi/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": "130100050001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRepairInfo": {
+                "repairId":"填写存在的值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 114 - 0
docs/document/services/repair/DeleteRepairUserInfo.md

@@ -0,0 +1,114 @@
+
+
+**1\. 删除报修派单**
+###### 接口功能
+> API服务做删除报修派单时调用该接口
+
+###### URL
+> [http://repairUser-service/repairUserApi/service](http://repairUser-service/repairUserApi/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|businessRepairUserInfo|1|Object|-|小区成员|小区成员|
+|businessRepairUserInfo|ruId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://repairUser-service/repairUserApi/service](http://repairUser-service/repairUserApi/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": "130200050001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRepairUserInfo": {
+                "ruId":"填写存在的值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 130 - 0
docs/document/services/repair/SaveRepairInfo.md

@@ -0,0 +1,130 @@
+
+
+**1\. 保存报修信息**
+###### 接口功能
+> API服务做保存报修信息时调用该接口
+
+###### URL
+> [http://repair-service/repairApi/service](http://repair-service/repairApi/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|businessRepairInfo|1|Object|-|小区成员|小区成员|
+|businessRepairInfo|repairName|1|String|30|-|-|
+|businessRepairInfo|appointmentTime|1|String|30|-|-|
+|businessRepairInfo|repairType|1|String|30|-|-|
+|businessRepairInfo|context|1|String|30|-|-|
+|businessRepairInfo|repairId|1|String|30|-|-|
+|businessRepairInfo|tel|1|String|30|-|-|
+|businessRepairInfo|state|1|String|30|-|-|
+|businessRepairInfo|communityId|1|String|30|-|-|
+|businessRepairInfo|roomId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://repair-service/repairApi/service](http://repair-service/repairApi/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": "130100030001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRepairInfo": {
+                "repairName":"填写具体值",
+        "appointmentTime":"填写具体值",
+        "repairType":"填写具体值",
+        "context":"填写具体值",
+        "repairId":"填写具体值",
+        "tel":"填写具体值",
+        "state":"填写具体值",
+        "communityId":"填写具体值",
+        "roomId":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 124 - 0
docs/document/services/repair/SaveRepairUserInfo.md

@@ -0,0 +1,124 @@
+
+
+**1\. 保存报修派单**
+###### 接口功能
+> API服务做保存报修派单时调用该接口
+
+###### URL
+> [http://repairUser-service/repairUserApi/service](http://repairUser-service/repairUserApi/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|businessRepairUserInfo|1|Object|-|小区成员|小区成员|
+|businessRepairUserInfo|context|1|String|30|-|-|
+|businessRepairUserInfo|repairId|1|String|30|-|-|
+|businessRepairUserInfo|ruId|1|String|30|-|-|
+|businessRepairUserInfo|state|1|String|30|-|-|
+|businessRepairUserInfo|communityId|1|String|30|-|-|
+|businessRepairUserInfo|userId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://repairUser-service/repairUserApi/service](http://repairUser-service/repairUserApi/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": "130200030001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRepairUserInfo": {
+                "context":"填写具体值",
+        "repairId":"填写具体值",
+        "ruId":"填写具体值",
+        "state":"填写具体值",
+        "communityId":"填写具体值",
+        "userId":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 130 - 0
docs/document/services/repair/UpdateRepairInfo.md

@@ -0,0 +1,130 @@
+
+
+**1\. 修改报修信息**
+###### 接口功能
+> API服务做修改报修信息时调用该接口
+
+###### URL
+> [http://repair-service/repairApi/service](http://repair-service/repairApi/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|businessRepairInfo|1|Object|-|小区成员|小区成员|
+|businessRepairInfo|repairName|1|String|30|-|-|
+|businessRepairInfo|appointmentTime|1|String|30|-|-|
+|businessRepairInfo|repairType|1|String|30|-|-|
+|businessRepairInfo|context|1|String|30|-|-|
+|businessRepairInfo|repairId|1|String|30|-|-|
+|businessRepairInfo|tel|1|String|30|-|-|
+|businessRepairInfo|state|1|String|30|-|-|
+|businessRepairInfo|communityId|1|String|30|-|-|
+|businessRepairInfo|roomId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://repair-service/repairApi/service](http://repair-service/repairApi/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": "130100040001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRepairInfo": {
+                "repairName":"填写具体值",
+        "appointmentTime":"填写具体值",
+        "repairType":"填写具体值",
+        "context":"填写具体值",
+        "repairId":"填写具体值",
+        "tel":"填写具体值",
+        "state":"填写具体值",
+        "communityId":"填写具体值",
+        "roomId":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 124 - 0
docs/document/services/repair/UpdateRepairUserInfo.md

@@ -0,0 +1,124 @@
+
+
+**1\. 修改报修派单**
+###### 接口功能
+> API服务做修改报修派单时调用该接口
+
+###### URL
+> [http://repairUser-service/repairUserApi/service](http://repairUser-service/repairUserApi/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|businessRepairUserInfo|1|Object|-|小区成员|小区成员|
+|businessRepairUserInfo|context|1|String|30|-|-|
+|businessRepairUserInfo|repairId|1|String|30|-|-|
+|businessRepairUserInfo|ruId|1|String|30|-|-|
+|businessRepairUserInfo|state|1|String|30|-|-|
+|businessRepairUserInfo|communityId|1|String|30|-|-|
+|businessRepairUserInfo|userId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://repairUser-service/repairUserApi/service](http://repairUser-service/repairUserApi/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": "130200040001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessRepairUserInfo": {
+                "context":"填写具体值",
+        "repairId":"填写具体值",
+        "ruId":"填写具体值",
+        "state":"填写具体值",
+        "communityId":"填写具体值",
+        "userId":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 122 - 0
java110-bean/src/main/java/com/java110/dto/repair/RepairDto.java

@@ -0,0 +1,122 @@
+package com.java110.dto.repair;
+
+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 RepairDto extends PageDto implements Serializable {
+
+    private String repairName;
+    private String appointmentTime;
+    private String repairType;
+    private String context;
+    private String repairId;
+    private String tel;
+    private String state;
+    private String communityId;
+    private String roomId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getRepairName() {
+        return repairName;
+    }
+
+    public void setRepairName(String repairName) {
+        this.repairName = repairName;
+    }
+
+    public String getAppointmentTime() {
+        return appointmentTime;
+    }
+
+    public void setAppointmentTime(String appointmentTime) {
+        this.appointmentTime = appointmentTime;
+    }
+
+    public String getRepairType() {
+        return repairType;
+    }
+
+    public void setRepairType(String repairType) {
+        this.repairType = repairType;
+    }
+
+    public String getContext() {
+        return context;
+    }
+
+    public void setContext(String context) {
+        this.context = context;
+    }
+
+    public String getRepairId() {
+        return repairId;
+    }
+
+    public void setRepairId(String repairId) {
+        this.repairId = repairId;
+    }
+
+    public String getTel() {
+        return tel;
+    }
+
+    public void setTel(String tel) {
+        this.tel = tel;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    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;
+    }
+}

+ 95 - 0
java110-bean/src/main/java/com/java110/dto/repair/RepairUserDto.java

@@ -0,0 +1,95 @@
+package com.java110.dto.repair;
+
+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 RepairUserDto extends PageDto implements Serializable {
+
+    private String context;
+    private String repairId;
+    private String ruId;
+    private String state;
+    private String communityId;
+    private String userId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getContext() {
+        return context;
+    }
+
+    public void setContext(String context) {
+        this.context = context;
+    }
+
+    public String getRepairId() {
+        return repairId;
+    }
+
+    public void setRepairId(String repairId) {
+        this.repairId = repairId;
+    }
+
+    public String getRuId() {
+        return ruId;
+    }
+
+    public void setRuId(String ruId) {
+        this.ruId = ruId;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+
+    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;
+    }
+}

+ 95 - 0
java110-code-generator/src/main/java/com/java110/RepairGeneratorApplication.java

@@ -0,0 +1,95 @@
+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 RepairGeneratorApplication {
+
+    protected RepairGeneratorApplication() {
+        // prevents calls from subclass
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 代码生成器 入口方法
+     *  此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上
+     *   BusinessTypeCd
+     * @param args 参数
+     */
+    public static void main(String[] args) {
+        Data data = new Data();
+        data.setId("repairId");
+        data.setName("repair");
+        data.setDesc("报修信息");
+        data.setShareParam("communityId");
+        data.setShareColumn("community_id");
+        data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_REPAIR");
+        data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_REPAIR");
+        data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_REPAIR");
+        data.setNewBusinessTypeCdValue("130100030001");
+        data.setUpdateBusinessTypeCdValue("130100040001");
+        data.setDeleteBusinessTypeCdValue("130100050001");
+        data.setBusinessTableName("business_repair_pool");
+        data.setTableName("r_repair_pool");
+        Map<String, String> param = new HashMap<String, String>();
+        param.put("repairId", "repair_id");       //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名
+        param.put("repairType", "repair_type");
+        param.put("communityId", "community_id");
+        param.put("repairName", "repair_name");
+        param.put("tel", "tel");
+        param.put("roomId", "room_id");
+        param.put("appointmentTime", "appointment_time");
+        param.put("context", "context");
+        param.put("state", "state");
+        param.put("statusCd", "status_cd");
+        param.put("operate", "operate");
+        param.put("bId", "b_id");
+        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);
+    }
+}

+ 92 - 0
java110-code-generator/src/main/java/com/java110/RepairUserGeneratorApplication.java

@@ -0,0 +1,92 @@
+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 RepairUserGeneratorApplication {
+
+    protected RepairUserGeneratorApplication() {
+        // prevents calls from subclass
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 代码生成器 入口方法
+     *  此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上
+     *   BusinessTypeCd
+     * @param args 参数
+     */
+    public static void main(String[] args) {
+        Data data = new Data();
+        data.setId("ruId");
+        data.setName("repairUser");
+        data.setDesc("报修派单");
+        data.setShareParam("communityId");
+        data.setShareColumn("community_id");
+        data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_REPAIR_USER");
+        data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_REPAIR_USER");
+        data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_REPAIR_USER");
+        data.setNewBusinessTypeCdValue("130200030001");
+        data.setUpdateBusinessTypeCdValue("130200040001");
+        data.setDeleteBusinessTypeCdValue("130200050001");
+        data.setBusinessTableName("business_repair_user");
+        data.setTableName("r_repair_user");
+        Map<String, String> param = new HashMap<String, String>();
+        param.put("repairId", "repair_id");       //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名
+        param.put("ruId", "ru_id");
+        param.put("communityId", "community_id");
+        param.put("userId", "user_id");
+        param.put("context", "context");
+        param.put("state", "state");
+        param.put("statusCd", "status_cd");
+        param.put("operate", "operate");
+        param.put("bId", "b_id");
+        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);
+    }
+}

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

@@ -92,6 +92,9 @@ public class GenerateCodeFactory {
     public static final String BASE_PRIVILEGE = "50";
     public static final String CODE_PREFIX_vId = "11";
     public static final String CODE_PREFIX_file_id = "81";
+    public static final String CODE_PREFIX_repairId = "82";
+    public static final String CODE_PREFIX_ruId = "83";
+
 
 
 

+ 42 - 0
java110-core/src/main/java/com/java110/core/smo/repair/IRepairInnerServiceSMO.java

@@ -0,0 +1,42 @@
+package com.java110.core.smo.repair;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.repair.RepairDto;
+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 IRepairInnerServiceSMO
+ * @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("/repairApi")
+public interface IRepairInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param repairDto 数据对象分享
+     * @return RepairDto 对象数据
+     */
+    @RequestMapping(value = "/queryRepairs", method = RequestMethod.POST)
+    List<RepairDto> queryRepairs(@RequestBody RepairDto repairDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param repairDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRepairsCount", method = RequestMethod.POST)
+    int queryRepairsCount(@RequestBody RepairDto repairDto);
+}

+ 42 - 0
java110-core/src/main/java/com/java110/core/smo/repair/IRepairUserInnerServiceSMO.java

@@ -0,0 +1,42 @@
+package com.java110.core.smo.repair;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.repair.RepairUserDto;
+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 IRepairUserInnerServiceSMO
+ * @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("/repairUserApi")
+public interface IRepairUserInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param repairUserDto 数据对象分享
+     * @return RepairUserDto 对象数据
+     */
+    @RequestMapping(value = "/queryRepairUsers", method = RequestMethod.POST)
+    List<RepairUserDto> queryRepairUsers(@RequestBody RepairUserDto repairUserDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param repairUserDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRepairUsersCount", method = RequestMethod.POST)
+    int queryRepairUsersCount(@RequestBody RepairUserDto repairUserDto);
+}

+ 58 - 0
java110-db/db/CommunityService/create_repair.sql

@@ -0,0 +1,58 @@
+DROP TABLE r_repair_pool;
+CREATE TABLE r_repair_pool(
+	repair_id VARCHAR(30) NOT NULL COMMENT '报修ID',
+	`b_id` VARCHAR(30) NOT NULL COMMENT '业务Id',
+	community_id VARCHAR(30) NOT NULL COMMENT '小区ID',
+	repair_type VARCHAR(8) NOT NULL COMMENT '报修类型',
+	repair_name VARCHAR(12) NOT NULL COMMENT '报修人姓名',
+	tel VARCHAR(11) NOT NULL COMMENT '手机号',
+	room_id VARCHAR(30) NOT NULL COMMENT '房屋ID',
+	appointment_time TIMESTAMP NOT NULL COMMENT '预约时间',
+	context LONGTEXT NOT NULL COMMENT '报修内容',
+	`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+	`state` VARCHAR(4) NOT NULL COMMENT '报修状态,请查看state 表',
+	`status_cd` VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
+	UNIQUE KEY `repair_id` (`repair_id`)
+);
+DROP TABLE business_repair_pool;
+
+CREATE TABLE `business_repair_pool` (
+	repair_id VARCHAR(30) NOT NULL COMMENT '报修ID',
+	`b_id` VARCHAR(30) NOT NULL COMMENT '业务Id',
+	community_id VARCHAR(30) NOT NULL COMMENT '小区ID',
+	repair_type VARCHAR(8) NOT NULL COMMENT '报修类型',
+	repair_name VARCHAR(12) NOT NULL COMMENT '报修人姓名',
+	tel VARCHAR(11) NOT NULL COMMENT '手机号',
+	room_id VARCHAR(30) NOT NULL COMMENT '房屋ID',
+	appointment_time TIMESTAMP NOT NULL COMMENT '预约时间',
+	context LONGTEXT NOT NULL COMMENT '报修内容',
+	`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+	`state` VARCHAR(4) NOT NULL COMMENT '报修状态,请查看state 表',
+	`operate` VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
+);
+DROP TABLE r_repair_user;
+
+CREATE TABLE r_repair_user(
+    ru_id VARCHAR(30) NOT NULL COMMENT '报修派单ID',
+	repair_id VARCHAR(30) NOT NULL COMMENT '报修ID',
+	`b_id` VARCHAR(30) NOT NULL COMMENT '业务Id',
+	user_id VARCHAR(30) NOT NULL COMMENT '员工ID',
+	community_id VARCHAR(30) NOT NULL COMMENT '小区ID',
+	`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+	`state` VARCHAR(4) NOT NULL COMMENT '员工处理状态,请查看state 表',
+	context LONGTEXT NOT NULL COMMENT '报修内容',
+	`status_cd` VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'
+);
+DROP TABLE business_repair_user;
+
+CREATE TABLE `business_repair_user` (
+    ru_id VARCHAR(30) NOT NULL COMMENT '报修派单ID',
+	repair_id VARCHAR(30) NOT NULL COMMENT '报修ID',
+	`b_id` VARCHAR(30) NOT NULL COMMENT '业务Id',
+	user_id VARCHAR(30) NOT NULL COMMENT '员工ID',
+	community_id VARCHAR(30) NOT NULL COMMENT '小区ID',
+	`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+	`state` VARCHAR(4) NOT NULL COMMENT '员工处理状态,请查看state 表',
+	context LONGTEXT NOT NULL COMMENT '报修内容',
+	`operate` VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
+);

+ 233 - 0
java110-db/src/main/resources/mapper/repair/RepairServiceDaoImplMapper.xml

@@ -0,0 +1,233 @@
+<?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="repairServiceDaoImpl">
+
+    <!-- 保存报修信息信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessRepairInfo" parameterType="Map">
+        insert into business_repair_pool(
+        operate,repair_name,appointment_time,repair_type,context,repair_id,tel,state,community_id,b_id,room_id
+        ) values (
+        #{operate},#{repairName},#{appointmentTime},#{repairType},#{context},#{repairId},#{tel},#{state},#{communityId},#{bId},#{roomId}
+        )
+    </insert>
+
+
+    <!-- 查询报修信息信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessRepairInfo" parameterType="Map" resultType="Map">
+        select t.operate,t.repair_name,t.repair_name repairName,t.appointment_time,t.appointment_time
+        appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id
+        repairId,t.tel,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.room_id,t.room_id roomId
+        from business_repair_pool t
+        where 1 =1
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="repairName !=null and repairName != ''">
+            and t.repair_name= #{repairName}
+        </if>
+        <if test="appointmentTime !=null and appointmentTime != ''">
+            and t.appointment_time= #{appointmentTime}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            and t.repair_type= #{repairType}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+
+    </select>
+
+
+    <!-- 保存报修信息信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveRepairInfoInstance" parameterType="Map">
+        insert into r_repair_pool(
+        repair_name,appointment_time,repair_type,context,repair_id,tel,status_cd,state,community_id,b_id,room_id
+        ) select
+        t.repair_name,t.appointment_time,t.repair_type,t.context,t.repair_id,t.tel,'0',t.state,t.community_id,t.b_id,t.room_id
+        from business_repair_pool t where 1=1
+        and t.operate= 'ADD'
+        <if test="repairName !=null and repairName != ''">
+            and t.repair_name= #{repairName}
+        </if>
+        <if test="appointmentTime !=null and appointmentTime != ''">
+            and t.appointment_time= #{appointmentTime}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            and t.repair_type= #{repairType}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+
+    </insert>
+
+
+    <!-- 查询报修信息信息 add by wuxw 2018-07-03 -->
+    <select id="getRepairInfo" parameterType="Map" resultType="Map">
+        select t.repair_name,t.repair_name repairName,t.appointment_time,t.appointment_time
+        appointmentTime,t.repair_type,t.repair_type repairType,t.context,t.repair_id,t.repair_id
+        repairId,t.tel,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id
+        bId,t.room_id,t.room_id roomId
+        from r_repair_pool t
+        where 1 =1
+        <if test="repairName !=null and repairName != ''">
+            and t.repair_name= #{repairName}
+        </if>
+        <if test="appointmentTime !=null and appointmentTime != ''">
+            and t.appointment_time= #{appointmentTime}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            and t.repair_type= #{repairType}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改报修信息信息 add by wuxw 2018-07-03 -->
+    <update id="updateRepairInfoInstance" parameterType="Map">
+        update r_repair_pool t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="repairName !=null and repairName != ''">
+            , t.repair_name= #{repairName}
+        </if>
+        <if test="appointmentTime !=null and appointmentTime != ''">
+            , t.appointment_time= #{appointmentTime}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            , t.repair_type= #{repairType}
+        </if>
+        <if test="context !=null and context != ''">
+            , t.context= #{context}
+        </if>
+        <if test="tel !=null and tel != ''">
+            , t.tel= #{tel}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="roomId !=null and roomId != ''">
+            , t.room_id= #{roomId}
+        </if>
+        where 1=1
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+
+    </update>
+
+    <!-- 查询报修信息数量 add by wuxw 2018-07-03 -->
+    <select id="queryRepairsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from r_repair_pool t
+        where 1 =1
+        <if test="repairName !=null and repairName != ''">
+            and t.repair_name= #{repairName}
+        </if>
+        <if test="appointmentTime !=null and appointmentTime != ''">
+            and t.appointment_time= #{appointmentTime}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            and t.repair_type= #{repairType}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="roomId !=null and roomId != ''">
+            and t.room_id= #{roomId}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 184 - 0
java110-db/src/main/resources/mapper/repair/RepairUserServiceDaoImplMapper.xml

@@ -0,0 +1,184 @@
+<?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="repairUserServiceDaoImpl">
+
+    <!-- 保存报修派单信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessRepairUserInfo" parameterType="Map">
+        insert into business_repair_user(
+        operate,context,repair_id,ru_id,state,community_id,b_id,user_id
+        ) values (
+        #{operate},#{context},#{repairId},#{ruId},#{state},#{communityId},#{bId},#{userId}
+        )
+    </insert>
+
+
+    <!-- 查询报修派单信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessRepairUserInfo" parameterType="Map" resultType="Map">
+        select t.operate,t.context,t.repair_id,t.repair_id repairId,t.ru_id,t.ru_id
+        ruId,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.user_id,t.user_id userId
+        from business_repair_user t
+        where 1 =1
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="ruId !=null and ruId != ''">
+            and t.ru_id= #{ruId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+
+    </select>
+
+
+    <!-- 保存报修派单信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveRepairUserInfoInstance" parameterType="Map">
+        insert into r_repair_user(
+        context,repair_id,status_cd,ru_id,state,community_id,b_id,user_id
+        ) select t.context,t.repair_id,'0',t.ru_id,t.state,t.community_id,t.b_id,t.user_id from business_repair_user t
+        where 1=1
+        and t.operate= 'ADD'
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="ruId !=null and ruId != ''">
+            and t.ru_id= #{ruId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+
+    </insert>
+
+
+    <!-- 查询报修派单信息 add by wuxw 2018-07-03 -->
+    <select id="getRepairUserInfo" parameterType="Map" resultType="Map">
+        select t.context,t.repair_id,t.repair_id repairId,t.status_cd,t.status_cd statusCd,t.ru_id,t.ru_id
+        ruId,t.state,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.user_id,t.user_id userId
+        from r_repair_user t
+        where 1 =1
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="ruId !=null and ruId != ''">
+            and t.ru_id= #{ruId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改报修派单信息 add by wuxw 2018-07-03 -->
+    <update id="updateRepairUserInfoInstance" parameterType="Map">
+        update r_repair_user t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="context !=null and context != ''">
+            , t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            , t.repair_id= #{repairId}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="userId !=null and userId != ''">
+            , t.user_id= #{userId}
+        </if>
+        where 1=1
+        <if test="ruId !=null and ruId != ''">
+            and t.ru_id= #{ruId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+
+    </update>
+
+    <!-- 查询报修派单数量 add by wuxw 2018-07-03 -->
+    <select id="queryRepairUsersCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from r_repair_user t
+        where 1 =1
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="repairId !=null and repairId != ''">
+            and t.repair_id= #{repairId}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="ruId !=null and ruId != ''">
+            and t.ru_id= #{ruId}
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </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="userId !=null and userId != ''">
+            and t.user_id= #{userId}
+        </if>
+
+
+    </select>
+
+</mapper>

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

@@ -451,4 +451,34 @@ public class BusinessTypeConstant {
      */
     public static final String BUSINESS_TYPE_DELETE_VISIT ="120100050001";
 
+
+    /**
+     * 保存报修信息
+     * 11开头  3保存
+     */
+    public static final String BUSINESS_TYPE_SAVE_REPAIR="130100030001";
+    /**
+     *  修改报修信息  11开头  4修改
+     */
+    public static final String BUSINESS_TYPE_UPDATE_REPAIR="130100040001";
+    /**
+     *  删除报修信息  11开头  5修改
+     */
+    public static final String BUSINESS_TYPE_DELETE_REPAIR ="130100050001";
+
+
+    /**
+     * 保存报修信息
+     * 11开头  3保存
+     */
+    public static final String BUSINESS_TYPE_SAVE_REPAIR_USER="130200030001";
+    /**
+     *  修改报修信息  11开头  4修改
+     */
+    public static final String BUSINESS_TYPE_UPDATE_REPAIR_USER="130200040001";
+    /**
+     *  删除报修信息  11开头  5修改
+     */
+    public static final String BUSINESS_TYPE_DELETE_REPAIR_USER ="130200050001";
+
 }