Просмотр исходного кода

加入巡检计划执行人功能

java110 лет назад: 6
Родитель
Сommit
fff83d0db8
24 измененных файлов с 2091 добавлено и 19 удалено
  1. 38 0
      Api/src/main/java/com/java110/api/bmo/inspectionPlanStaff/IInspectionPlanStaffBMO.java
  2. 99 0
      Api/src/main/java/com/java110/api/bmo/inspectionPlanStaff/impl/InspectionPlanStaffBMOImpl.java
  3. 71 0
      Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/DeleteInspectionPlanStaffListener.java
  4. 88 0
      Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/ListInspectionPlanStaffsListener.java
  5. 75 0
      Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/SaveInspectionPlanStaffListener.java
  6. 74 0
      Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/UpdateInspectionPlanStaffListener.java
  7. 81 0
      CommunityService/src/main/java/com/java110/community/dao/IInspectionPlanStaffServiceDao.java
  8. 134 0
      CommunityService/src/main/java/com/java110/community/dao/impl/InspectionPlanStaffServiceDaoImpl.java
  9. 89 0
      CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/AbstractInspectionPlanStaffBusinessServiceDataFlowListener.java
  10. 180 0
      CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/DeleteInspectionPlanStaffInfoListener.java
  11. 179 0
      CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/SaveInspectionPlanStaffInfoListener.java
  12. 190 0
      CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/UpdateInspectionPlanStaffInfoListener.java
  13. 71 0
      CommunityService/src/main/java/com/java110/community/smo/impl/InspectionPlanStaffInnerServiceSMOImpl.java
  14. 128 0
      docs/document/services/inspectionPlanStaff/SaveInspectionPlanStaffInfo.md
  15. 103 0
      java110-bean/src/main/java/com/java110/dto/inspectionPlanStaff/InspectionPlanStaffDto.java
  16. 88 0
      java110-bean/src/main/java/com/java110/vo/api/inspectionPlanStaff/ApiInspectionPlanStaffDataVo.java
  17. 19 0
      java110-bean/src/main/java/com/java110/vo/api/inspectionPlanStaff/ApiInspectionPlanStaffVo.java
  18. 42 19
      java110-code-generator/src/main/resources/back/template_1.json
  19. 31 0
      java110-code-generator/src/main/resources/back/template_store_attr.json
  20. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  21. 41 0
      java110-core/src/main/java/com/java110/core/smo/inspectionPlanStaff/IInspectionPlanStaffInnerServiceSMO.java
  22. 220 0
      java110-db/src/main/resources/mapper/community/InspectionPlanStaffServiceDaoImplMapper.xml
  23. 18 0
      java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
  24. 31 0
      java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeInspectionPlanStaffConstant.java

+ 38 - 0
Api/src/main/java/com/java110/api/bmo/inspectionPlanStaff/IInspectionPlanStaffBMO.java

@@ -0,0 +1,38 @@
+package com.java110.api.bmo.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.IApiBaseBMO;
+import com.java110.core.context.DataFlowContext;
+
+public interface IInspectionPlanStaffBMO extends IApiBaseBMO {
+
+
+    /**
+     * 添加执行计划人
+     * @param paramInJson
+     * @param dataFlowContext
+     * @return
+     */
+     JSONObject addInspectionPlanStaff(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 添加执行计划人信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+     JSONObject updateInspectionPlanStaff(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 删除执行计划人
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+     JSONObject deleteInspectionPlanStaff(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+
+
+}

+ 99 - 0
Api/src/main/java/com/java110/api/bmo/inspectionPlanStaff/impl/InspectionPlanStaffBMOImpl.java

@@ -0,0 +1,99 @@
+package com.java110.api.bmo.inspectionPlanStaff.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.ApiBaseBMO;
+import com.java110.api.bmo.inspectionPlanStaff.IInspectionPlanStaffBMO;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.smo.inspectionPlanStaff.IInspectionPlanStaffInnerServiceSMO;
+import com.java110.dto.inspectionPlanStaff.InspectionPlanStaffDto;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service("inspectionPlanStaffBMOImpl")
+public class InspectionPlanStaffBMOImpl extends ApiBaseBMO implements IInspectionPlanStaffBMO {
+
+    @Autowired
+    private IInspectionPlanStaffInnerServiceSMO inspectionPlanStaffInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public JSONObject addInspectionPlanStaff(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_PLAN_STAFF);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessInspectionPlanStaff = new JSONObject();
+        businessInspectionPlanStaff.putAll(paramInJson);
+        businessInspectionPlanStaff.put("ipStaffId", "-1");
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPlanStaff", businessInspectionPlanStaff);
+        return business;
+    }
+
+
+    /**
+     * 添加活动信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public JSONObject updateInspectionPlanStaff(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+        InspectionPlanStaffDto inspectionPlanStaffDto = new InspectionPlanStaffDto();
+        inspectionPlanStaffDto.setIpStaffId(paramInJson.getString("ipStaffId"));
+        inspectionPlanStaffDto.setCommunityId(paramInJson.getString("communityId"));
+        List<InspectionPlanStaffDto> inspectionPlanStaffDtos = inspectionPlanStaffInnerServiceSMOImpl.queryInspectionPlanStaffs(inspectionPlanStaffDto);
+
+        Assert.listOnlyOne(inspectionPlanStaffDtos, "未找到需要修改的活动 或多条数据");
+
+
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_PLAN_STAFF);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessInspectionPlanStaff = new JSONObject();
+        businessInspectionPlanStaff.putAll(BeanConvertUtil.beanCovertMap(inspectionPlanStaffDtos.get(0)));
+        businessInspectionPlanStaff.putAll(paramInJson);
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPlanStaff", businessInspectionPlanStaff);
+        return business;
+    }
+
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public JSONObject deleteInspectionPlanStaff(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_PLAN_STAFF);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessInspectionPlanStaff = new JSONObject();
+        businessInspectionPlanStaff.putAll(paramInJson);
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionPlanStaff", businessInspectionPlanStaff);
+        return business;
+    }
+
+}

+ 71 - 0
Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/DeleteInspectionPlanStaffListener.java

@@ -0,0 +1,71 @@
+package com.java110.api.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.inspectionPlanStaff.IInspectionPlanStaffBMO;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.AppService;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.constant.ServiceCodeInspectionPlanStaffConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+
+/**
+ * 保存小区侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("deleteInspectionPlanStaffListener")
+public class DeleteInspectionPlanStaffListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IInspectionPlanStaffBMO inspectionPlanStaffBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "ipStaffId", "ipStaffId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区信息不能为空");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        HttpHeaders header = new HttpHeaders();
+        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
+        JSONArray businesses = new JSONArray();
+
+        AppService service = event.getAppService();
+
+        //添加单元信息
+        businesses.add(inspectionPlanStaffBMOImpl.deleteInspectionPlanStaff(reqJson, context));
+
+        ResponseEntity<String> responseEntity = inspectionPlanStaffBMOImpl.callService(context, service.getServiceCode(), businesses);
+
+        context.setResponseEntity(responseEntity);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeInspectionPlanStaffConstant.DELETE_INSPECTIONPLANSTAFF;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+}

+ 88 - 0
Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/ListInspectionPlanStaffsListener.java

@@ -0,0 +1,88 @@
+package com.java110.api.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.smo.inspectionPlanStaff.IInspectionPlanStaffInnerServiceSMO;
+import com.java110.dto.inspectionPlanStaff.InspectionPlanStaffDto;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeInspectionPlanStaffConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.api.inspectionPlanStaff.ApiInspectionPlanStaffDataVo;
+import com.java110.vo.api.inspectionPlanStaff.ApiInspectionPlanStaffVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 查询小区侦听类
+ */
+@Java110Listener("listInspectionPlanStaffsListener")
+public class ListInspectionPlanStaffsListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IInspectionPlanStaffInnerServiceSMO inspectionPlanStaffInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeInspectionPlanStaffConstant.LIST_INSPECTIONPLANSTAFFS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IInspectionPlanStaffInnerServiceSMO getInspectionPlanStaffInnerServiceSMOImpl() {
+        return inspectionPlanStaffInnerServiceSMOImpl;
+    }
+
+    public void setInspectionPlanStaffInnerServiceSMOImpl(IInspectionPlanStaffInnerServiceSMO inspectionPlanStaffInnerServiceSMOImpl) {
+        this.inspectionPlanStaffInnerServiceSMOImpl = inspectionPlanStaffInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        InspectionPlanStaffDto inspectionPlanStaffDto = BeanConvertUtil.covertBean(reqJson, InspectionPlanStaffDto.class);
+
+        int count = inspectionPlanStaffInnerServiceSMOImpl.queryInspectionPlanStaffsCount(inspectionPlanStaffDto);
+
+        List<ApiInspectionPlanStaffDataVo> inspectionPlanStaffs = null;
+
+        if (count > 0) {
+            inspectionPlanStaffs = BeanConvertUtil.covertBeanList(inspectionPlanStaffInnerServiceSMOImpl.queryInspectionPlanStaffs(inspectionPlanStaffDto), ApiInspectionPlanStaffDataVo.class);
+        } else {
+            inspectionPlanStaffs = new ArrayList<>();
+        }
+
+        ApiInspectionPlanStaffVo apiInspectionPlanStaffVo = new ApiInspectionPlanStaffVo();
+
+        apiInspectionPlanStaffVo.setTotal(count);
+        apiInspectionPlanStaffVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
+        apiInspectionPlanStaffVo.setInspectionPlanStaffs(inspectionPlanStaffs);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiInspectionPlanStaffVo), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 75 - 0
Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/SaveInspectionPlanStaffListener.java

@@ -0,0 +1,75 @@
+package com.java110.api.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.inspectionPlanStaff.IInspectionPlanStaffBMO;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.AppService;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.constant.ServiceCodeInspectionPlanStaffConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+
+/**
+ * 保存小区侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("saveInspectionPlanStaffListener")
+public class SaveInspectionPlanStaffListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IInspectionPlanStaffBMO inspectionPlanStaffBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
+        Assert.hasKeyAndValue(reqJson, "staffName", "请求报文中未包含staffName");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
+        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
+        Assert.hasKeyAndValue(reqJson, "inspectionPlanId", "请求报文中未包含inspectionPlanId");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        HttpHeaders header = new HttpHeaders();
+        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
+        JSONArray businesses = new JSONArray();
+
+        AppService service = event.getAppService();
+
+        //添加单元信息
+        businesses.add(inspectionPlanStaffBMOImpl.addInspectionPlanStaff(reqJson, context));
+
+        ResponseEntity<String> responseEntity = inspectionPlanStaffBMOImpl.callService(context, service.getServiceCode(), businesses);
+
+        context.setResponseEntity(responseEntity);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeInspectionPlanStaffConstant.ADD_INSPECTIONPLANSTAFF;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+}

+ 74 - 0
Api/src/main/java/com/java110/api/listener/inspectionPlanStaff/UpdateInspectionPlanStaffListener.java

@@ -0,0 +1,74 @@
+package com.java110.api.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.inspectionPlanStaff.IInspectionPlanStaffBMO;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.AppService;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.constant.ServiceCodeInspectionPlanStaffConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+
+/**
+ * 保存执行计划人侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("updateInspectionPlanStaffListener")
+public class UpdateInspectionPlanStaffListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IInspectionPlanStaffBMO inspectionPlanStaffBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "ipStaffId", "ipStaffId不能为空");
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
+        Assert.hasKeyAndValue(reqJson, "staffName", "请求报文中未包含staffName");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
+        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
+        Assert.hasKeyAndValue(reqJson, "inspectionPlanId", "请求报文中未包含inspectionPlanId");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        HttpHeaders header = new HttpHeaders();
+        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
+        JSONArray businesses = new JSONArray();
+
+        AppService service = event.getAppService();
+
+        //添加单元信息
+        businesses.add(inspectionPlanStaffBMOImpl.updateInspectionPlanStaff(reqJson, context));
+
+        ResponseEntity<String> responseEntity = inspectionPlanStaffBMOImpl.callService(context, service.getServiceCode(), businesses);
+
+        context.setResponseEntity(responseEntity);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeInspectionPlanStaffConstant.UPDATE_INSPECTIONPLANSTAFF;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+}

+ 81 - 0
CommunityService/src/main/java/com/java110/community/dao/IInspectionPlanStaffServiceDao.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 IInspectionPlanStaffServiceDao {
+
+    /**
+     * 保存 执行计划人信息
+     * @param businessInspectionPlanStaffInfo 执行计划人信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessInspectionPlanStaffInfo(Map businessInspectionPlanStaffInfo) throws DAOException;
+
+
+
+    /**
+     * 查询执行计划人信息(business过程)
+     * 根据bId 查询执行计划人信息
+     * @param info bId 信息
+     * @return 执行计划人信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessInspectionPlanStaffInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 执行计划人信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveInspectionPlanStaffInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询执行计划人信息(instance过程)
+     * 根据bId 查询执行计划人信息
+     * @param info bId 信息
+     * @return 执行计划人信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getInspectionPlanStaffInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改执行计划人信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateInspectionPlanStaffInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询执行计划人总数
+     *
+     * @param info 执行计划人信息
+     * @return 执行计划人数量
+     */
+    int queryInspectionPlanStaffsCount(Map info);
+
+}

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

@@ -0,0 +1,134 @@
+package com.java110.community.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IInspectionPlanStaffServiceDao;
+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("inspectionPlanStaffServiceDaoImpl")
+//@Transactional
+public class InspectionPlanStaffServiceDaoImpl extends BaseServiceDao implements IInspectionPlanStaffServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(InspectionPlanStaffServiceDaoImpl.class);
+
+    /**
+     * 执行计划人信息封装
+     *
+     * @param businessInspectionPlanStaffInfo 执行计划人信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessInspectionPlanStaffInfo(Map businessInspectionPlanStaffInfo) throws DAOException {
+        businessInspectionPlanStaffInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存执行计划人信息 入参 businessInspectionPlanStaffInfo : {}", businessInspectionPlanStaffInfo);
+        int saveFlag = sqlSessionTemplate.insert("inspectionPlanStaffServiceDaoImpl.saveBusinessInspectionPlanStaffInfo", businessInspectionPlanStaffInfo);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存执行计划人数据失败:" + JSONObject.toJSONString(businessInspectionPlanStaffInfo));
+        }
+    }
+
+
+    /**
+     * 查询执行计划人信息
+     *
+     * @param info bId 信息
+     * @return 执行计划人信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessInspectionPlanStaffInfo(Map info) throws DAOException {
+
+        logger.debug("查询执行计划人信息 入参 info : {}", info);
+
+        List<Map> businessInspectionPlanStaffInfos = sqlSessionTemplate.selectList("inspectionPlanStaffServiceDaoImpl.getBusinessInspectionPlanStaffInfo", info);
+
+        return businessInspectionPlanStaffInfos;
+    }
+
+
+    /**
+     * 保存执行计划人信息 到 instance
+     *
+     * @param info bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveInspectionPlanStaffInfoInstance(Map info) throws DAOException {
+        logger.debug("保存执行计划人信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("inspectionPlanStaffServiceDaoImpl.saveInspectionPlanStaffInfoInstance", 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> getInspectionPlanStaffInfo(Map info) throws DAOException {
+        logger.debug("查询执行计划人信息 入参 info : {}", info);
+
+        List<Map> businessInspectionPlanStaffInfos = sqlSessionTemplate.selectList("inspectionPlanStaffServiceDaoImpl.getInspectionPlanStaffInfo", info);
+
+        return businessInspectionPlanStaffInfos;
+    }
+
+
+    /**
+     * 修改执行计划人信息
+     *
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateInspectionPlanStaffInfoInstance(Map info) throws DAOException {
+        logger.debug("修改执行计划人信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("inspectionPlanStaffServiceDaoImpl.updateInspectionPlanStaffInfoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改执行计划人信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 查询执行计划人数量
+     *
+     * @param info 执行计划人信息
+     * @return 执行计划人数量
+     */
+    @Override
+    public int queryInspectionPlanStaffsCount(Map info) {
+        logger.debug("查询执行计划人数据 入参 info : {}", info);
+
+        List<Map> businessInspectionPlanStaffInfos = sqlSessionTemplate.selectList("inspectionPlanStaffServiceDaoImpl.queryInspectionPlanStaffsCount", info);
+        if (businessInspectionPlanStaffInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessInspectionPlanStaffInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/AbstractInspectionPlanStaffBusinessServiceDataFlowListener.java

@@ -0,0 +1,89 @@
+package com.java110.community.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IInspectionPlanStaffServiceDao;
+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 AbstractInspectionPlanStaffBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractInspectionPlanStaffBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     *
+     * @return
+     */
+    public abstract IInspectionPlanStaffServiceDao getInspectionPlanStaffServiceDaoImpl();
+
+    /**
+     * 刷新 businessInspectionPlanStaffInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
+     * @param businessInspectionPlanStaffInfo
+     */
+    protected void flushBusinessInspectionPlanStaffInfo(Map businessInspectionPlanStaffInfo, String statusCd) {
+        businessInspectionPlanStaffInfo.put("newBId", businessInspectionPlanStaffInfo.get("b_id"));
+        businessInspectionPlanStaffInfo.put("operate", businessInspectionPlanStaffInfo.get("operate"));
+        businessInspectionPlanStaffInfo.put("createTime", businessInspectionPlanStaffInfo.get("create_time"));
+        businessInspectionPlanStaffInfo.put("ipStaffId", businessInspectionPlanStaffInfo.get("ip_staff_id"));
+        businessInspectionPlanStaffInfo.put("staffName", businessInspectionPlanStaffInfo.get("staff_name"));
+        businessInspectionPlanStaffInfo.put("startTime", businessInspectionPlanStaffInfo.get("start_time"));
+        businessInspectionPlanStaffInfo.put("inspectionPlanId", businessInspectionPlanStaffInfo.get("inspection_plan_id"));
+        businessInspectionPlanStaffInfo.put("endTime", businessInspectionPlanStaffInfo.get("end_time"));
+        businessInspectionPlanStaffInfo.put("communityId", businessInspectionPlanStaffInfo.get("community_id"));
+        businessInspectionPlanStaffInfo.put("staffId", businessInspectionPlanStaffInfo.get("staff_id"));
+        businessInspectionPlanStaffInfo.remove("bId");
+        businessInspectionPlanStaffInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
+     * @param businessInspectionPlanStaff 执行计划人信息
+     */
+    protected void autoSaveDelBusinessInspectionPlanStaff(Business business, JSONObject businessInspectionPlanStaff) {
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("ipStaffId", businessInspectionPlanStaff.getString("ipStaffId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentInspectionPlanStaffInfos = getInspectionPlanStaffServiceDaoImpl().getInspectionPlanStaffInfo(info);
+        if (currentInspectionPlanStaffInfos == null || currentInspectionPlanStaffInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
+        }
+
+        Map currentInspectionPlanStaffInfo = currentInspectionPlanStaffInfos.get(0);
+
+        currentInspectionPlanStaffInfo.put("bId", business.getbId());
+
+        currentInspectionPlanStaffInfo.put("operate", currentInspectionPlanStaffInfo.get("operate"));
+        currentInspectionPlanStaffInfo.put("createTime", currentInspectionPlanStaffInfo.get("create_time"));
+        currentInspectionPlanStaffInfo.put("ipStaffId", currentInspectionPlanStaffInfo.get("ip_staff_id"));
+        currentInspectionPlanStaffInfo.put("staffName", currentInspectionPlanStaffInfo.get("staff_name"));
+        currentInspectionPlanStaffInfo.put("startTime", currentInspectionPlanStaffInfo.get("start_time"));
+        currentInspectionPlanStaffInfo.put("inspectionPlanId", currentInspectionPlanStaffInfo.get("inspection_plan_id"));
+        currentInspectionPlanStaffInfo.put("endTime", currentInspectionPlanStaffInfo.get("end_time"));
+        currentInspectionPlanStaffInfo.put("communityId", currentInspectionPlanStaffInfo.get("community_id"));
+        currentInspectionPlanStaffInfo.put("staffId", currentInspectionPlanStaffInfo.get("staff_id"));
+
+
+        currentInspectionPlanStaffInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getInspectionPlanStaffServiceDaoImpl().saveBusinessInspectionPlanStaffInfo(currentInspectionPlanStaffInfo);
+    }
+
+
+}

+ 180 - 0
CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/DeleteInspectionPlanStaffInfoListener.java

@@ -0,0 +1,180 @@
+package com.java110.community.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IInspectionPlanStaffServiceDao;
+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;
+
+/**
+ * 删除执行计划人信息 侦听
+ * <p>
+ * 处理节点
+ * 1、businessInspectionPlanStaff:{} 执行计划人基本信息节点
+ * 2、businessInspectionPlanStaffAttr:[{}] 执行计划人属性信息节点
+ * 3、businessInspectionPlanStaffPhoto:[{}] 执行计划人照片信息节点
+ * 4、businessInspectionPlanStaffCerdentials:[{}] 执行计划人证件信息节点
+ * 协议地址 :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("deleteInspectionPlanStaffInfoListener")
+@Transactional
+public class DeleteInspectionPlanStaffInfoListener extends AbstractInspectionPlanStaffBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteInspectionPlanStaffInfoListener.class);
+    @Autowired
+    IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_PLAN_STAFF;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessInspectionPlanStaff 节点
+        if (data.containsKey("businessInspectionPlanStaff")) {
+            //处理 businessInspectionPlanStaff 节点
+            if (data.containsKey("businessInspectionPlanStaff")) {
+                Object _obj = data.get("businessInspectionPlanStaff");
+                JSONArray businessInspectionPlanStaffs = null;
+                if (_obj instanceof JSONObject) {
+                    businessInspectionPlanStaffs = new JSONArray();
+                    businessInspectionPlanStaffs.add(_obj);
+                } else {
+                    businessInspectionPlanStaffs = (JSONArray) _obj;
+                }
+                //JSONObject businessInspectionPlanStaff = data.getJSONObject("businessInspectionPlanStaff");
+                for (int _inspectionPlanStaffIndex = 0; _inspectionPlanStaffIndex < businessInspectionPlanStaffs.size(); _inspectionPlanStaffIndex++) {
+                    JSONObject businessInspectionPlanStaff = businessInspectionPlanStaffs.getJSONObject(_inspectionPlanStaffIndex);
+                    doBusinessInspectionPlanStaff(business, businessInspectionPlanStaff);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("ipStaffId", businessInspectionPlanStaff.getString("ipStaffId"));
+                    }
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * 删除 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> businessInspectionPlanStaffInfos = inspectionPlanStaffServiceDaoImpl.getBusinessInspectionPlanStaffInfo(info);
+        if (businessInspectionPlanStaffInfos != null && businessInspectionPlanStaffInfos.size() > 0) {
+            for (int _inspectionPlanStaffIndex = 0; _inspectionPlanStaffIndex < businessInspectionPlanStaffInfos.size(); _inspectionPlanStaffIndex++) {
+                Map businessInspectionPlanStaffInfo = businessInspectionPlanStaffInfos.get(_inspectionPlanStaffIndex);
+                flushBusinessInspectionPlanStaffInfo(businessInspectionPlanStaffInfo, StatusConstant.STATUS_CD_INVALID);
+                inspectionPlanStaffServiceDaoImpl.updateInspectionPlanStaffInfoInstance(businessInspectionPlanStaffInfo);
+                dataFlowContext.addParamOut("ipStaffId", businessInspectionPlanStaffInfo.get("ip_staff_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> inspectionPlanStaffInfo = inspectionPlanStaffServiceDaoImpl.getInspectionPlanStaffInfo(info);
+        if (inspectionPlanStaffInfo != null && inspectionPlanStaffInfo.size() > 0) {
+
+            //执行计划人信息
+            List<Map> businessInspectionPlanStaffInfos = inspectionPlanStaffServiceDaoImpl.getBusinessInspectionPlanStaffInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessInspectionPlanStaffInfos == null || businessInspectionPlanStaffInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(inspectionPlanStaff),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _inspectionPlanStaffIndex = 0; _inspectionPlanStaffIndex < businessInspectionPlanStaffInfos.size(); _inspectionPlanStaffIndex++) {
+                Map businessInspectionPlanStaffInfo = businessInspectionPlanStaffInfos.get(_inspectionPlanStaffIndex);
+                flushBusinessInspectionPlanStaffInfo(businessInspectionPlanStaffInfo, StatusConstant.STATUS_CD_VALID);
+                inspectionPlanStaffServiceDaoImpl.updateInspectionPlanStaffInfoInstance(businessInspectionPlanStaffInfo);
+            }
+        }
+    }
+
+
+    /**
+     * 处理 businessInspectionPlanStaff 节点
+     *
+     * @param business                    总的数据节点
+     * @param businessInspectionPlanStaff 执行计划人节点
+     */
+    private void doBusinessInspectionPlanStaff(Business business, JSONObject businessInspectionPlanStaff) {
+
+        Assert.jsonObjectHaveKey(businessInspectionPlanStaff, "ipStaffId", "businessInspectionPlanStaff 节点下没有包含 ipStaffId 节点");
+
+        if (businessInspectionPlanStaff.getString("ipStaffId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "ipStaffId 错误,不能自动生成(必须已经存在的ipStaffId)" + businessInspectionPlanStaff);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessInspectionPlanStaff(business, businessInspectionPlanStaff);
+    }
+
+    public IInspectionPlanStaffServiceDao getInspectionPlanStaffServiceDaoImpl() {
+        return inspectionPlanStaffServiceDaoImpl;
+    }
+
+    public void setInspectionPlanStaffServiceDaoImpl(IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl) {
+        this.inspectionPlanStaffServiceDaoImpl = inspectionPlanStaffServiceDaoImpl;
+    }
+}

+ 179 - 0
CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/SaveInspectionPlanStaffInfoListener.java

@@ -0,0 +1,179 @@
+package com.java110.community.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IInspectionPlanStaffServiceDao;
+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 com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.StatusConstant;
+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;
+
+/**
+ * 保存 执行计划人信息 侦听
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("saveInspectionPlanStaffInfoListener")
+@Transactional
+public class SaveInspectionPlanStaffInfoListener extends AbstractInspectionPlanStaffBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveInspectionPlanStaffInfoListener.class);
+
+    @Autowired
+    private IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_PLAN_STAFF;
+    }
+
+    /**
+     * 保存执行计划人信息 business 表中
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessInspectionPlanStaff 节点
+        if (data.containsKey("businessInspectionPlanStaff")) {
+            Object bObj = data.get("businessInspectionPlanStaff");
+            JSONArray businessInspectionPlanStaffs = null;
+            if (bObj instanceof JSONObject) {
+                businessInspectionPlanStaffs = new JSONArray();
+                businessInspectionPlanStaffs.add(bObj);
+            } else {
+                businessInspectionPlanStaffs = (JSONArray) bObj;
+            }
+            //JSONObject businessInspectionPlanStaff = data.getJSONObject("businessInspectionPlanStaff");
+            for (int bInspectionPlanStaffIndex = 0; bInspectionPlanStaffIndex < businessInspectionPlanStaffs.size(); bInspectionPlanStaffIndex++) {
+                JSONObject businessInspectionPlanStaff = businessInspectionPlanStaffs.getJSONObject(bInspectionPlanStaffIndex);
+                doBusinessInspectionPlanStaff(business, businessInspectionPlanStaff);
+                if (bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("ipStaffId", businessInspectionPlanStaff.getString("ipStaffId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessInspectionPlanStaffInfo = inspectionPlanStaffServiceDaoImpl.getBusinessInspectionPlanStaffInfo(info);
+        if (businessInspectionPlanStaffInfo != null && businessInspectionPlanStaffInfo.size() > 0) {
+            reFreshShareColumn(info, businessInspectionPlanStaffInfo.get(0));
+            inspectionPlanStaffServiceDaoImpl.saveInspectionPlanStaffInfoInstance(info);
+            if (businessInspectionPlanStaffInfo.size() == 1) {
+                dataFlowContext.addParamOut("ipStaffId", businessInspectionPlanStaffInfo.get(0).get("ip_staff_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> inspectionPlanStaffInfo = inspectionPlanStaffServiceDaoImpl.getInspectionPlanStaffInfo(info);
+        if (inspectionPlanStaffInfo != null && inspectionPlanStaffInfo.size() > 0) {
+            reFreshShareColumn(paramIn, inspectionPlanStaffInfo.get(0));
+            inspectionPlanStaffServiceDaoImpl.updateInspectionPlanStaffInfoInstance(paramIn);
+        }
+    }
+
+
+    /**
+     * 处理 businessInspectionPlanStaff 节点
+     *
+     * @param business                    总的数据节点
+     * @param businessInspectionPlanStaff 执行计划人节点
+     */
+    private void doBusinessInspectionPlanStaff(Business business, JSONObject businessInspectionPlanStaff) {
+
+        Assert.jsonObjectHaveKey(businessInspectionPlanStaff, "ipStaffId", "businessInspectionPlanStaff 节点下没有包含 ipStaffId 节点");
+
+        if (businessInspectionPlanStaff.getString("ipStaffId").startsWith("-")) {
+            //刷新缓存
+            //flushInspectionPlanStaffId(business.getDatas());
+
+            businessInspectionPlanStaff.put("ipStaffId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ipStaffId));
+
+        }
+
+        businessInspectionPlanStaff.put("bId", business.getbId());
+        businessInspectionPlanStaff.put("operate", StatusConstant.OPERATE_ADD);
+        //保存执行计划人信息
+        inspectionPlanStaffServiceDaoImpl.saveBusinessInspectionPlanStaffInfo(businessInspectionPlanStaff);
+
+    }
+
+    public IInspectionPlanStaffServiceDao getInspectionPlanStaffServiceDaoImpl() {
+        return inspectionPlanStaffServiceDaoImpl;
+    }
+
+    public void setInspectionPlanStaffServiceDaoImpl(IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl) {
+        this.inspectionPlanStaffServiceDaoImpl = inspectionPlanStaffServiceDaoImpl;
+    }
+}

+ 190 - 0
CommunityService/src/main/java/com/java110/community/listener/inspectionPlanStaff/UpdateInspectionPlanStaffInfoListener.java

@@ -0,0 +1,190 @@
+package com.java110.community.listener.inspectionPlanStaff;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.community.dao.IInspectionPlanStaffServiceDao;
+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;
+
+/**
+ * 修改执行计划人信息 侦听
+ * <p>
+ * 处理节点
+ * 1、businessInspectionPlanStaff:{} 执行计划人基本信息节点
+ * 2、businessInspectionPlanStaffAttr:[{}] 执行计划人属性信息节点
+ * 3、businessInspectionPlanStaffPhoto:[{}] 执行计划人照片信息节点
+ * 4、businessInspectionPlanStaffCerdentials:[{}] 执行计划人证件信息节点
+ * 协议地址 :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("updateInspectionPlanStaffInfoListener")
+@Transactional
+public class UpdateInspectionPlanStaffInfoListener extends AbstractInspectionPlanStaffBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateInspectionPlanStaffInfoListener.class);
+    @Autowired
+    private IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_PLAN_STAFF;
+    }
+
+    /**
+     * business过程
+     *
+     * @param dataFlowContext 上下文对象
+     * @param business        业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessInspectionPlanStaff 节点
+        if (data.containsKey("businessInspectionPlanStaff")) {
+            //处理 businessInspectionPlanStaff 节点
+            if (data.containsKey("businessInspectionPlanStaff")) {
+                Object _obj = data.get("businessInspectionPlanStaff");
+                JSONArray businessInspectionPlanStaffs = null;
+                if (_obj instanceof JSONObject) {
+                    businessInspectionPlanStaffs = new JSONArray();
+                    businessInspectionPlanStaffs.add(_obj);
+                } else {
+                    businessInspectionPlanStaffs = (JSONArray) _obj;
+                }
+                //JSONObject businessInspectionPlanStaff = data.getJSONObject("businessInspectionPlanStaff");
+                for (int _inspectionPlanStaffIndex = 0; _inspectionPlanStaffIndex < businessInspectionPlanStaffs.size(); _inspectionPlanStaffIndex++) {
+                    JSONObject businessInspectionPlanStaff = businessInspectionPlanStaffs.getJSONObject(_inspectionPlanStaffIndex);
+                    doBusinessInspectionPlanStaff(business, businessInspectionPlanStaff);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("ipStaffId", businessInspectionPlanStaff.getString("ipStaffId"));
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 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> businessInspectionPlanStaffInfos = inspectionPlanStaffServiceDaoImpl.getBusinessInspectionPlanStaffInfo(info);
+        if (businessInspectionPlanStaffInfos != null && businessInspectionPlanStaffInfos.size() > 0) {
+            for (int _inspectionPlanStaffIndex = 0; _inspectionPlanStaffIndex < businessInspectionPlanStaffInfos.size(); _inspectionPlanStaffIndex++) {
+                Map businessInspectionPlanStaffInfo = businessInspectionPlanStaffInfos.get(_inspectionPlanStaffIndex);
+                flushBusinessInspectionPlanStaffInfo(businessInspectionPlanStaffInfo, StatusConstant.STATUS_CD_VALID);
+                inspectionPlanStaffServiceDaoImpl.updateInspectionPlanStaffInfoInstance(businessInspectionPlanStaffInfo);
+                if (businessInspectionPlanStaffInfo.size() == 1) {
+                    dataFlowContext.addParamOut("ipStaffId", businessInspectionPlanStaffInfo.get("ip_staff_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> inspectionPlanStaffInfo = inspectionPlanStaffServiceDaoImpl.getInspectionPlanStaffInfo(info);
+        if (inspectionPlanStaffInfo != null && inspectionPlanStaffInfo.size() > 0) {
+
+            //执行计划人信息
+            List<Map> businessInspectionPlanStaffInfos = inspectionPlanStaffServiceDaoImpl.getBusinessInspectionPlanStaffInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessInspectionPlanStaffInfos == null || businessInspectionPlanStaffInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(inspectionPlanStaff),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _inspectionPlanStaffIndex = 0; _inspectionPlanStaffIndex < businessInspectionPlanStaffInfos.size(); _inspectionPlanStaffIndex++) {
+                Map businessInspectionPlanStaffInfo = businessInspectionPlanStaffInfos.get(_inspectionPlanStaffIndex);
+                flushBusinessInspectionPlanStaffInfo(businessInspectionPlanStaffInfo, StatusConstant.STATUS_CD_VALID);
+                inspectionPlanStaffServiceDaoImpl.updateInspectionPlanStaffInfoInstance(businessInspectionPlanStaffInfo);
+            }
+        }
+
+    }
+
+
+    /**
+     * 处理 businessInspectionPlanStaff 节点
+     *
+     * @param business                    总的数据节点
+     * @param businessInspectionPlanStaff 执行计划人节点
+     */
+    private void doBusinessInspectionPlanStaff(Business business, JSONObject businessInspectionPlanStaff) {
+
+        Assert.jsonObjectHaveKey(businessInspectionPlanStaff, "ipStaffId", "businessInspectionPlanStaff 节点下没有包含 ipStaffId 节点");
+
+        if (businessInspectionPlanStaff.getString("ipStaffId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "ipStaffId 错误,不能自动生成(必须已经存在的ipStaffId)" + businessInspectionPlanStaff);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessInspectionPlanStaff(business, businessInspectionPlanStaff);
+
+        businessInspectionPlanStaff.put("bId", business.getbId());
+        businessInspectionPlanStaff.put("operate", StatusConstant.OPERATE_ADD);
+        //保存执行计划人信息
+        inspectionPlanStaffServiceDaoImpl.saveBusinessInspectionPlanStaffInfo(businessInspectionPlanStaff);
+
+    }
+
+
+    public IInspectionPlanStaffServiceDao getInspectionPlanStaffServiceDaoImpl() {
+        return inspectionPlanStaffServiceDaoImpl;
+    }
+
+    public void setInspectionPlanStaffServiceDaoImpl(IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl) {
+        this.inspectionPlanStaffServiceDaoImpl = inspectionPlanStaffServiceDaoImpl;
+    }
+
+
+}

+ 71 - 0
CommunityService/src/main/java/com/java110/community/smo/impl/InspectionPlanStaffInnerServiceSMOImpl.java

@@ -0,0 +1,71 @@
+package com.java110.community.smo.impl;
+
+
+import com.java110.community.dao.IInspectionPlanStaffServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.inspectionPlanStaff.IInspectionPlanStaffInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.inspectionPlanStaff.InspectionPlanStaffDto;
+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.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 执行计划人内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class InspectionPlanStaffInnerServiceSMOImpl extends BaseServiceSMO implements IInspectionPlanStaffInnerServiceSMO {
+
+    @Autowired
+    private IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<InspectionPlanStaffDto> queryInspectionPlanStaffs(@RequestBody InspectionPlanStaffDto inspectionPlanStaffDto) {
+
+        //校验是否传了 分页信息
+
+        int page = inspectionPlanStaffDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            inspectionPlanStaffDto.setPage((page - 1) * inspectionPlanStaffDto.getRow());
+        }
+
+        List<InspectionPlanStaffDto> inspectionPlanStaffs = BeanConvertUtil.covertBeanList(inspectionPlanStaffServiceDaoImpl.getInspectionPlanStaffInfo(BeanConvertUtil.beanCovertMap(inspectionPlanStaffDto)), InspectionPlanStaffDto.class);
+
+        return inspectionPlanStaffs;
+    }
+
+
+    @Override
+    public int queryInspectionPlanStaffsCount(@RequestBody InspectionPlanStaffDto inspectionPlanStaffDto) {
+        return inspectionPlanStaffServiceDaoImpl.queryInspectionPlanStaffsCount(BeanConvertUtil.beanCovertMap(inspectionPlanStaffDto));
+    }
+
+    public IInspectionPlanStaffServiceDao getInspectionPlanStaffServiceDaoImpl() {
+        return inspectionPlanStaffServiceDaoImpl;
+    }
+
+    public void setInspectionPlanStaffServiceDaoImpl(IInspectionPlanStaffServiceDao inspectionPlanStaffServiceDaoImpl) {
+        this.inspectionPlanStaffServiceDaoImpl = inspectionPlanStaffServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 128 - 0
docs/document/services/inspectionPlanStaff/SaveInspectionPlanStaffInfo.md

@@ -0,0 +1,128 @@
+
+
+**1\. 保存执行计划人**
+###### 接口功能
+> API服务做保存执行计划人时调用该接口
+
+###### URL
+> [http://inspectionPlanStaff-service/inspectionPlanStaffApi/service](http://inspectionPlanStaff-service/inspectionPlanStaffApi/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|businessInspectionPlanStaffInfo|1|Object|-|小区成员|小区成员|
+|businessInspectionPlanStaffInfo|createTime|1|String|30|-|-|
+|businessInspectionPlanStaffInfo|ipStaffId|1|String|30|-|-|
+|businessInspectionPlanStaffInfo|staffName|1|String|30|-|-|
+|businessInspectionPlanStaffInfo|startTime|1|String|30|-|-|
+|businessInspectionPlanStaffInfo|inspectionPlanId|1|String|30|-|-|
+|businessInspectionPlanStaffInfo|endTime|1|String|30|-|-|
+|businessInspectionPlanStaffInfo|communityId|1|String|30|-|-|
+|businessInspectionPlanStaffInfo|staffId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://inspectionPlanStaff-service/inspectionPlanStaffApi/service](http://inspectionPlanStaff-service/inspectionPlanStaffApi/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": "520300030001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessInspectionPlanStaffInfo": {
+                "createTime":"填写具体值",
+        "ipStaffId":"填写具体值",
+        "staffName":"填写具体值",
+        "startTime":"填写具体值",
+        "inspectionPlanId":"填写具体值",
+        "endTime":"填写具体值",
+        "communityId":"填写具体值",
+        "staffId":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 103 - 0
java110-bean/src/main/java/com/java110/dto/inspectionPlanStaff/InspectionPlanStaffDto.java

@@ -0,0 +1,103 @@
+package com.java110.dto.inspectionPlanStaff;
+
+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 InspectionPlanStaffDto extends PageDto implements Serializable {
+
+    private String ipStaffId;
+    private String staffName;
+    private String startTime;
+    private String inspectionPlanId;
+    private String endTime;
+    private String communityId;
+    private String staffId;
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getIpStaffId() {
+        return ipStaffId;
+    }
+
+    public void setIpStaffId(String ipStaffId) {
+        this.ipStaffId = ipStaffId;
+    }
+
+    public String getStaffName() {
+        return staffName;
+    }
+
+    public void setStaffName(String staffName) {
+        this.staffName = staffName;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getInspectionPlanId() {
+        return inspectionPlanId;
+    }
+
+    public void setInspectionPlanId(String inspectionPlanId) {
+        this.inspectionPlanId = inspectionPlanId;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
+
+
+    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;
+    }
+}

+ 88 - 0
java110-bean/src/main/java/com/java110/vo/api/inspectionPlanStaff/ApiInspectionPlanStaffDataVo.java

@@ -0,0 +1,88 @@
+package com.java110.vo.api.inspectionPlanStaff;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class ApiInspectionPlanStaffDataVo implements Serializable {
+
+    private String operate;
+private String createTime;
+private String ipStaffId;
+private String staffName;
+private String startTime;
+private String statusCd;
+private String inspectionPlanId;
+private String endTime;
+private String bId;
+private String communityId;
+private String staffId;
+public String getOperate() {
+        return operate;
+    }
+public void setOperate(String operate) {
+        this.operate = operate;
+    }
+public String getCreateTime() {
+        return createTime;
+    }
+public void setCreateTime(String createTime) {
+        this.createTime = createTime;
+    }
+public String getIpStaffId() {
+        return ipStaffId;
+    }
+public void setIpStaffId(String ipStaffId) {
+        this.ipStaffId = ipStaffId;
+    }
+public String getStaffName() {
+        return staffName;
+    }
+public void setStaffName(String staffName) {
+        this.staffName = staffName;
+    }
+public String getStartTime() {
+        return startTime;
+    }
+public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getInspectionPlanId() {
+        return inspectionPlanId;
+    }
+public void setInspectionPlanId(String inspectionPlanId) {
+        this.inspectionPlanId = inspectionPlanId;
+    }
+public String getEndTime() {
+        return endTime;
+    }
+public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+public String getBId() {
+        return bId;
+    }
+public void setBId(String bId) {
+        this.bId = bId;
+    }
+public String getCommunityId() {
+        return communityId;
+    }
+public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+public String getStaffId() {
+        return staffId;
+    }
+public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
+
+
+
+}

+ 19 - 0
java110-bean/src/main/java/com/java110/vo/api/inspectionPlanStaff/ApiInspectionPlanStaffVo.java

@@ -0,0 +1,19 @@
+package com.java110.vo.api.inspectionPlanStaff;
+
+import com.java110.vo.MorePageVo;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class ApiInspectionPlanStaffVo extends MorePageVo implements Serializable {
+    List<ApiInspectionPlanStaffDataVo> inspectionPlanStaffs;
+
+
+    public List<ApiInspectionPlanStaffDataVo> getInspectionPlanStaffs() {
+        return inspectionPlanStaffs;
+    }
+
+    public void setInspectionPlanStaffs(List<ApiInspectionPlanStaffDataVo> inspectionPlanStaffs) {
+        this.inspectionPlanStaffs = inspectionPlanStaffs;
+    }
+}

+ 42 - 19
java110-code-generator/src/main/resources/back/template_1.json

@@ -1,31 +1,54 @@
 {
-  "id": "attrId",
-  "name": "storeAttr",
-  "desc": "商户属性",
-  "shareParam": "storeId",
-  "shareColumn": "store_id",
-  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_JUNK_REQUIREMENT",
-  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_STORE_ATTR",
-  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_COMMUNITY",
-  "newBusinessTypeCdValue": "550200030001",
-  "updateBusinessTypeCdValue": "200100040003",
-  "deleteBusinessTypeCdValue": "500100050011",
-  "businessTableName": "business_store_attr",
-  "tableName": "s_store_attr",
+  "id": "ipStaffId",
+  "name": "inspectionPlanStaff",
+  "desc": "执行计划人",
+  "shareParam": "communityId",
+  "shareColumn": "community_id",
+  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_PLAN_STAFF",
+  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_PLAN_STAFF",
+  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_PLAN_STAFF",
+  "newBusinessTypeCdValue": "520300030001",
+  "updateBusinessTypeCdValue": "520300040001",
+  "deleteBusinessTypeCdValue": "520300050001",
+  "businessTableName": "business_inspection_plan_staff",
+  "tableName": "inspection_plan_staff",
   "param": {
-    "storeId": "store_id",
+    "ipStaffId": "ip_staff_id",
     "bId": "bId",
-    "attrId": "attr_id",
-    "specCd": "spec_cd",
-    "value": "value",
+    "inspectionPlanId": "inspection_plan_id",
+    "communityId": "community_id",
+    "staffId": "staff_id",
+    "staffName": "staff_name",
+    "startTime": "start_time",
+    "endTime": "end_time",
     "createTime": "create_time",
     "statusCd": "status_cd",
     "operate": "operate"
   },
   "required": [
     {
-      "code": "attrId",
-      "msg": "attrId不能为空"
+      "code": "staffId",
+      "msg": "巡检执行人不能为空"
+    },
+    {
+      "code": "staffName",
+      "msg": "巡检执行人名称不能为空"
+    },
+    {
+      "code": "communityId",
+      "msg": "小区不能为空"
+    },
+    {
+      "code": "startTime",
+      "msg": "开始时间不能为空"
+    },
+    {
+      "code": "endTime",
+      "msg": "结束时间不能为空"
+    },
+    {
+      "code": "inspectionPlanId",
+      "msg": "巡检计划不能为空"
     }
   ]
 }

+ 31 - 0
java110-code-generator/src/main/resources/back/template_store_attr.json

@@ -0,0 +1,31 @@
+{
+  "id": "attrId",
+  "name": "storeAttr",
+  "desc": "商户属性",
+  "shareParam": "storeId",
+  "shareColumn": "store_id",
+  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_JUNK_REQUIREMENT",
+  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_STORE_ATTR",
+  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_COMMUNITY",
+  "newBusinessTypeCdValue": "550200030001",
+  "updateBusinessTypeCdValue": "200100040003",
+  "deleteBusinessTypeCdValue": "500100050011",
+  "businessTableName": "business_store_attr",
+  "tableName": "s_store_attr",
+  "param": {
+    "storeId": "store_id",
+    "bId": "bId",
+    "attrId": "attr_id",
+    "specCd": "spec_cd",
+    "value": "value",
+    "createTime": "create_time",
+    "statusCd": "status_cd",
+    "operate": "operate"
+  },
+  "required": [
+    {
+      "code": "attrId",
+      "msg": "attrId不能为空"
+    }
+  ]
+}

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

@@ -119,6 +119,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_inspectionRouteId = "50";
     public static final String CODE_PREFIX_irpRelId = "51";
     public static final String CODE_PREFIX_inspectionPlanId = "14";
+    public static final String CODE_PREFIX_ipStaffId = "15";
     public static final String CODE_PREFIX_taskId = "52";
     public static final String CODE_PREFIX_taskDetailId = "53";
     public static final String CODE_PREFIX_applyOrderId = "15";

+ 41 - 0
java110-core/src/main/java/com/java110/core/smo/inspectionPlanStaff/IInspectionPlanStaffInnerServiceSMO.java

@@ -0,0 +1,41 @@
+package com.java110.core.smo.inspectionPlanStaff;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.inspectionPlanStaff.InspectionPlanStaffDto;
+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 IInspectionPlanStaffInnerServiceSMO
+ * @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("/inspectionPlanStaffApi")
+public interface IInspectionPlanStaffInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     * @param inspectionPlanStaffDto 数据对象分享
+     * @return InspectionPlanStaffDto 对象数据
+     */
+    @RequestMapping(value = "/queryInspectionPlanStaffs", method = RequestMethod.POST)
+    List<InspectionPlanStaffDto> queryInspectionPlanStaffs(@RequestBody InspectionPlanStaffDto inspectionPlanStaffDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param inspectionPlanStaffDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryInspectionPlanStaffsCount", method = RequestMethod.POST)
+    int queryInspectionPlanStaffsCount(@RequestBody InspectionPlanStaffDto inspectionPlanStaffDto);
+}

+ 220 - 0
java110-db/src/main/resources/mapper/community/InspectionPlanStaffServiceDaoImplMapper.xml

@@ -0,0 +1,220 @@
+<?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="inspectionPlanStaffServiceDaoImpl">
+
+    <!-- 保存执行计划人信息 add by wuxw 2018-07-03 -->
+    <insert id="saveBusinessInspectionPlanStaffInfo" parameterType="Map">
+        insert into business_inspection_plan_staff(
+        operate,create_time,ip_staff_id,staff_name,start_time,inspection_plan_id,end_time,bId,community_id,staff_id
+        ) values (
+        #{operate},#{createTime},#{ipStaffId},#{staffName},#{startTime},#{inspectionPlanId},#{endTime},#{bId},#{communityId},#{staffId}
+        )
+    </insert>
+
+
+    <!-- 查询执行计划人信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessInspectionPlanStaffInfo" parameterType="Map" resultType="Map">
+        select t.operate,t.create_time,t.create_time createTime,t.ip_staff_id,t.ip_staff_id
+        ipStaffId,t.staff_name,t.staff_name staffName,t.start_time,t.start_time
+        startTime,t.inspection_plan_id,t.inspection_plan_id inspectionPlanId,t.end_time,t.end_time
+        endTime,t.bId,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId
+        from business_inspection_plan_staff t
+        where 1 =1
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            and t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            and t.staff_name= #{staffName}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            and t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.bId= #{bId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
+
+    </select>
+
+
+    <!-- 保存执行计划人信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveInspectionPlanStaffInfoInstance" parameterType="Map">
+        insert into inspection_plan_staff(
+        create_time,ip_staff_id,staff_name,start_time,status_cd,inspection_plan_id,end_time,bId,community_id,staff_id
+        ) select
+        t.create_time,t.ip_staff_id,t.staff_name,t.start_time,'0',t.inspection_plan_id,t.end_time,t.bId,t.community_id,t.staff_id
+        from business_inspection_plan_staff t where 1=1
+        and t.operate= 'ADD'
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            and t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            and t.staff_name= #{staffName}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            and t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.bId= #{bId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
+
+    </insert>
+
+
+    <!-- 查询执行计划人信息 add by wuxw 2018-07-03 -->
+    <select id="getInspectionPlanStaffInfo" parameterType="Map" resultType="Map">
+        select t.create_time,t.create_time createTime,t.ip_staff_id,t.ip_staff_id ipStaffId,t.staff_name,t.staff_name
+        staffName,t.start_time,t.start_time startTime,t.status_cd,t.status_cd
+        statusCd,t.inspection_plan_id,t.inspection_plan_id inspectionPlanId,t.end_time,t.end_time
+        endTime,t.bId,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId
+        from inspection_plan_staff t
+        where 1 =1
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            and t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            and t.staff_name= #{staffName}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            and t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.bId= #{bId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改执行计划人信息 add by wuxw 2018-07-03 -->
+    <update id="updateInspectionPlanStaffInfoInstance" parameterType="Map">
+        update inspection_plan_staff t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="createTime !=null and createTime != ''">
+            , t.create_time= #{createTime}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            , t.staff_name= #{staffName}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            , t.start_time= #{startTime}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            , t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            , t.end_time= #{endTime}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            , t.staff_id= #{staffId}
+        </if>
+        where 1=1
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            and t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.bId= #{bId}
+        </if>
+
+    </update>
+
+    <!-- 查询执行计划人数量 add by wuxw 2018-07-03 -->
+    <select id="queryInspectionPlanStaffsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from inspection_plan_staff t
+        where 1 =1
+        <if test="createTime !=null and createTime != ''">
+            and t.create_time= #{createTime}
+        </if>
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            and t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="staffName !=null and staffName != ''">
+            and t.staff_name= #{staffName}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            and t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.bId= #{bId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="staffId !=null and staffId != ''">
+            and t.staff_id= #{staffId}
+        </if>
+
+
+    </select>
+
+</mapper>

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

@@ -923,6 +923,24 @@ public class BusinessTypeConstant {
      */
     public static final String BUSINESS_TYPE_DELETE_INSPECTION_PLAN ="520200050001";
 
+    /**
+     *  保存巡检计划
+     *  3保存
+     */
+    public static final String BUSINESS_TYPE_SAVE_PLAN_STAFF="520300030001";
+
+    /**
+     * 修改巡检计划
+     * 4 修改
+     */
+    public static final String BUSINESS_TYPE_UPDATE_PLAN_STAFF="520300040001";
+
+    /**
+     *  删除巡计划
+     *  5 删除
+     */
+    public static final String BUSINESS_TYPE_DELETE_PLAN_STAFF ="520300050001";
+
 
     /**
      *  保存用户标题测试

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

@@ -0,0 +1,31 @@
+package com.java110.utils.constant;
+
+/**
+ * 执行计划人常量类
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeInspectionPlanStaffConstant {
+
+    /**
+     * 添加 执行计划人
+     */
+    public static final String ADD_INSPECTIONPLANSTAFF = "inspectionPlanStaff.saveInspectionPlanStaff";
+
+
+    /**
+     * 修改 执行计划人
+     */
+    public static final String UPDATE_INSPECTIONPLANSTAFF = "inspectionPlanStaff.updateInspectionPlanStaff";
+    /**
+     * 删除 执行计划人
+     */
+    public static final String DELETE_INSPECTIONPLANSTAFF = "inspectionPlanStaff.deleteInspectionPlanStaff";
+
+
+    /**
+     * 查询 执行计划人
+     */
+    public static final String LIST_INSPECTIONPLANSTAFFS = "inspectionPlanStaff.listInspectionPlanStaffs";
+
+
+}