浏览代码

优化 巡检功能

java110 6 年之前
父节点
当前提交
a3168891a0

+ 92 - 0
Api/src/main/java/com/java110/api/listener/inspectionRoute/DeleteInspectionRoutePointListener.java

@@ -0,0 +1,92 @@
+package com.java110.api.listener.inspectionRoute;
+
+import com.alibaba.fastjson.JSONArray;
+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.entity.center.AppService;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.constant.ServiceCodeInspectionRouteConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 保存小区侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("deleteInspectionRouteListener")
+public class DeleteInspectionRoutePointListener extends AbstractServiceApiListener {
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "irmRelId", "路线巡检点关系ID不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+    }
+
+    @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(deleteInspectionRoute(reqJson, context));
+
+        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
+
+        //将 rest header 信息传递到下层服务中去
+        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
+
+        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
+
+        context.setResponseEntity(responseEntity);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeInspectionRouteConstant.DELETE_INSPECTIONROUTE_POINT;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    private JSONObject deleteInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_ROUTE_POINT_REL);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessInspectionRoute = new JSONObject();
+        businessInspectionRoute.putAll(paramInJson);
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoutePointRel", businessInspectionRoute);
+        return business;
+    }
+
+}

+ 95 - 0
Api/src/main/java/com/java110/api/listener/inspectionRoute/ListInspectionRoutePointsListener.java

@@ -0,0 +1,95 @@
+package com.java110.api.listener.inspectionRoute;
+
+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.inspectionRoute.IInspectionRouteInnerServiceSMO;
+import com.java110.core.smo.inspectionRoute.IInspectionRoutePointRelInnerServiceSMO;
+import com.java110.dto.inspectionRoute.InspectionRouteDto;
+import com.java110.dto.inspectionRoute.InspectionRoutePointRelDto;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeInspectionRouteConstant;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.api.inspectionPoint.ApiInspectionPointDataVo;
+import com.java110.vo.api.inspectionPoint.ApiInspectionPointVo;
+import com.java110.vo.api.inspectionRoute.ApiInspectionRouteDataVo;
+import com.java110.vo.api.inspectionRoute.ApiInspectionRouteVo;
+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("listInspectionRoutePointsListener")
+public class ListInspectionRoutePointsListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IInspectionRoutePointRelInnerServiceSMO inspectionRoutePointRelInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeInspectionRouteConstant.LIST_INSPECTIONROUTE_POINTS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IInspectionRoutePointRelInnerServiceSMO getInspectionRoutePointRelInnerServiceSMOImpl() {
+        return inspectionRoutePointRelInnerServiceSMOImpl;
+    }
+
+    public void setInspectionRoutePointRelInnerServiceSMOImpl(IInspectionRoutePointRelInnerServiceSMO inspectionRoutePointRelInnerServiceSMOImpl) {
+        this.inspectionRoutePointRelInnerServiceSMOImpl = inspectionRoutePointRelInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        InspectionRoutePointRelDto inspectionRoutePointRelDto = BeanConvertUtil.covertBean(reqJson, InspectionRoutePointRelDto.class);
+
+        int count = inspectionRoutePointRelInnerServiceSMOImpl.queryInspectionRoutePointRelsCount(inspectionRoutePointRelDto);
+
+        List<ApiInspectionPointDataVo> inspectionPoints = null;
+
+        if (count > 0) {
+            inspectionPoints = BeanConvertUtil.covertBeanList(inspectionRoutePointRelInnerServiceSMOImpl.queryInspectionRoutePointRels(inspectionRoutePointRelDto), ApiInspectionPointDataVo.class);
+        } else {
+            inspectionPoints = new ArrayList<>();
+        }
+
+        ApiInspectionPointVo apiInspectionPointVo = new ApiInspectionPointVo();
+
+        apiInspectionPointVo.setTotal(count);
+        apiInspectionPointVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
+        apiInspectionPointVo.setInspectionPoints(inspectionPoints);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiInspectionPointVo), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 92 - 0
Api/src/main/java/com/java110/api/listener/inspectionRoute/SaveInspectionRoutePointListener.java

@@ -0,0 +1,92 @@
+package com.java110.api.listener.inspectionRoute;
+
+import com.alibaba.fastjson.JSONArray;
+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.entity.center.AppService;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.constant.ServiceCodeInspectionRouteConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 保存小区侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("saveInspectionRoutePointListener")
+public class SaveInspectionRoutePointListener extends AbstractServiceApiListener {
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+        Assert.hasKeyAndValue(reqJson, "inspectionId", "必填,请填写巡检点");
+        Assert.hasKeyAndValue(reqJson, "inspectionRouteId", "必填,请填写巡检路线");
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+    }
+
+    @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(addInspectionRoute(reqJson, context));
+
+        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
+
+        //将 rest header 信息传递到下层服务中去
+        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
+
+        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
+
+        context.setResponseEntity(responseEntity);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeInspectionRouteConstant.ADD_INSPECTIONROUTE_POINT;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    private JSONObject addInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+
+        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_ROUTE_POINT_REL);
+        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
+        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
+        JSONObject businessInspectionRoute = new JSONObject();
+        businessInspectionRoute.putAll(paramInJson);
+        businessInspectionRoute.put("irmRelId", "-1");
+        //计算 应收金额
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoutePointRel", businessInspectionRoute);
+        return business;
+    }
+
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/inspectionRoute/IAddInspectionRoutePointSMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.inspectionRoute;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加巡检路线接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IAddInspectionRoutePointSMO {
+
+    /**
+     * 添加巡检路线
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> saveInspectionRoutePoint(IPageData pd);
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/inspectionRoute/IDeleteInspectionRoutePointSMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.inspectionRoute;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加巡检路线接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IDeleteInspectionRoutePointSMO {
+
+    /**
+     * 添加巡检路线
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> deleteInspectionRoutePoint(IPageData pd);
+}

+ 21 - 0
WebService/src/main/java/com/java110/web/smo/inspectionRoute/IListInspectionRoutePointsSMO.java

@@ -0,0 +1,21 @@
+package com.java110.web.smo.inspectionRoute;
+
+import com.java110.core.context.IPageData;
+import com.java110.utils.exception.SMOException;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 巡检路线管理服务接口类
+ *
+ * add by wuxw 2019-06-29
+ */
+public interface IListInspectionRoutePointsSMO {
+
+    /**
+     * 查询巡检路线信息
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象数据
+     * @throws SMOException 业务代码层
+     */
+    ResponseEntity<String> listInspectionRoutePoint(IPageData pd) throws SMOException;
+}

+ 64 - 0
WebService/src/main/java/com/java110/web/smo/inspectionRoute/impl/AddInspectionRoutePointSMOImpl.java

@@ -0,0 +1,64 @@
+package com.java110.web.smo.inspectionRoute.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.component.AbstractComponentSMO;
+import com.java110.core.context.IPageData;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.util.Assert;
+import com.java110.web.smo.inspectionRoute.IAddInspectionRoutePointSMO;
+import com.java110.web.smo.inspectionRoute.IAddInspectionRouteSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 添加小区服务实现类
+ * add by wuxw 2019-06-30
+ */
+@Service("addInspectionRoutePointSMOImpl")
+public class AddInspectionRoutePointSMOImpl extends AbstractComponentSMO implements IAddInspectionRoutePointSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+
+        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
+        Assert.hasKeyAndValue(paramIn, "inspectionId", "必填,请填写巡检点");
+        Assert.hasKeyAndValue(paramIn, "inspectionRouteId", "必填,请填写巡检路线");
+        Assert.hasKeyAndValue(paramIn, "communityId", "小区ID不能为空");
+
+
+        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_INSPECTIONROUTE);
+
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ResponseEntity<String> responseEntity = null;
+        super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/inspectionRoute.saveInspectionRoutePoint",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> saveInspectionRoutePoint(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 68 - 0
WebService/src/main/java/com/java110/web/smo/inspectionRoute/impl/ListInspectionRoutePointsSMOImpl.java

@@ -0,0 +1,68 @@
+package com.java110.web.smo.inspectionRoute.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.component.AbstractComponentSMO;
+import com.java110.core.context.IPageData;
+import com.java110.entity.component.ComponentValidateResult;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.exception.SMOException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.web.smo.inspectionRoute.IListInspectionRoutePointsSMO;
+import com.java110.web.smo.inspectionRoute.IListInspectionRoutesSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Map;
+
+/**
+ * 查询inspectionRoute服务类
+ */
+@Service("listInspectionRoutesSMOImpl")
+public class ListInspectionRoutePointsSMOImpl extends AbstractComponentSMO implements IListInspectionRoutePointsSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    public ResponseEntity<String> listInspectionRoutePoint(IPageData pd) throws SMOException {
+        return businessProcess(pd);
+    }
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        super.validatePageInfo(pd);
+        Assert.hasKeyAndValue(paramIn, "communityId", "小区ID不能为空");
+
+        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_INSPECTIONROUTE);
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        Map paramMap = BeanConvertUtil.beanCovertMap(result);
+        paramIn.putAll(paramMap);
+
+        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/inspectionRoute.listInspectionRoutePoints" + mapToUrlParam(paramIn);
+
+
+        ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "",
+                apiUrl,
+                HttpMethod.GET);
+
+        return responseEntity;
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 9 - 0
java110-bean/src/main/java/com/java110/vo/api/inspectionPoint/ApiInspectionPointDataVo.java

@@ -5,6 +5,7 @@ import java.util.Date;
 
 public class ApiInspectionPointDataVo implements Serializable {
 
+    private String inspectionRouteId;
     private String inspectionId;
     private String inspectionName;
     private String remark;
@@ -104,4 +105,12 @@ public class ApiInspectionPointDataVo implements Serializable {
     public void setLocationTypeName(String locationTypeName) {
         this.locationTypeName = locationTypeName;
     }
+
+    public String getInspectionRouteId() {
+        return inspectionRouteId;
+    }
+
+    public void setInspectionRouteId(String inspectionRouteId) {
+        this.inspectionRouteId = inspectionRouteId;
+    }
 }

+ 147 - 139
java110-db/src/main/resources/mapper/community/InspectionRoutePointRelServiceDaoImplMapper.xml

@@ -5,168 +5,176 @@
 <mapper namespace="inspectionRoutePointRelServiceDaoImpl">
 
     <!-- 保存巡检路线巡检点关系信息 add by wuxw 2018-07-03 -->
-       <insert id="saveBusinessInspectionRoutePointRelInfo" parameterType="Map">
-           insert into business_inspection_route_point_rel(
-inspection_id,operate,inspection_route_id,irm_rel_id,remark,community_id,b_id
-) values (
-#{inspectionId},#{operate},#{inspectionRouteId},#{irmRelId},#{remark},#{communityId},#{bId}
-)
-       </insert>
-
-
-       <!-- 查询巡检路线巡检点关系信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessInspectionRoutePointRelInfo" parameterType="Map" resultType="Map">
-           select  t.inspection_id,t.inspection_id inspectionId,t.operate,t.inspection_route_id,t.inspection_route_id inspectionRouteId,t.irm_rel_id,t.irm_rel_id irmRelId,t.remark,t.community_id,t.community_id communityId,t.b_id,t.b_id bId 
-from business_inspection_route_point_rel t 
-where 1 =1 
-<if test="inspectionId !=null and inspectionId != ''">
-   and t.inspection_id= #{inspectionId}
-</if> 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="inspectionRouteId !=null and inspectionRouteId != ''">
-   and t.inspection_route_id= #{inspectionRouteId}
-</if> 
-<if test="irmRelId !=null and irmRelId != ''">
-   and t.irm_rel_id= #{irmRelId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</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> 
-
-       </select>
+    <insert id="saveBusinessInspectionRoutePointRelInfo" parameterType="Map">
+        insert into business_inspection_route_point_rel(
+        inspection_id,operate,inspection_route_id,irm_rel_id,remark,community_id,b_id
+        ) values (
+        #{inspectionId},#{operate},#{inspectionRouteId},#{irmRelId},#{remark},#{communityId},#{bId}
+        )
+    </insert>
 
 
+    <!-- 查询巡检路线巡检点关系信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessInspectionRoutePointRelInfo" parameterType="Map" resultType="Map">
+        select t.inspection_id,t.inspection_id inspectionId,t.operate,t.inspection_route_id,t.inspection_route_id
+        inspectionRouteId,t.irm_rel_id,t.irm_rel_id irmRelId,t.remark,t.community_id,t.community_id
+        communityId,t.b_id,t.b_id bId
+        from business_inspection_route_point_rel t
+        where 1 =1
+        <if test="inspectionId !=null and inspectionId != ''">
+            and t.inspection_id= #{inspectionId}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="inspectionRouteId !=null and inspectionRouteId != ''">
+            and t.inspection_route_id= #{inspectionRouteId}
+        </if>
+        <if test="irmRelId !=null and irmRelId != ''">
+            and t.irm_rel_id= #{irmRelId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </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>
 
+    </select>
 
 
     <!-- 保存巡检路线巡检点关系信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveInspectionRoutePointRelInfoInstance" parameterType="Map">
         insert into inspection_route_point_rel(
-inspection_id,inspection_route_id,irm_rel_id,remark,status_cd,community_id,b_id
-) select t.inspection_id,t.inspection_route_id,t.irm_rel_id,t.remark,'0',t.community_id,t.b_id from business_inspection_route_point_rel t where 1=1
-<if test="inspectionId !=null and inspectionId != ''">
-   and t.inspection_id= #{inspectionId}
-</if> 
-   and t.operate= 'ADD'
-<if test="inspectionRouteId !=null and inspectionRouteId != ''">
-   and t.inspection_route_id= #{inspectionRouteId}
-</if> 
-<if test="irmRelId !=null and irmRelId != ''">
-   and t.irm_rel_id= #{irmRelId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</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> 
+        inspection_id,inspection_route_id,irm_rel_id,remark,status_cd,community_id,b_id
+        ) select t.inspection_id,t.inspection_route_id,t.irm_rel_id,t.remark,'0',t.community_id,t.b_id from
+        business_inspection_route_point_rel t where 1=1
+        <if test="inspectionId !=null and inspectionId != ''">
+            and t.inspection_id= #{inspectionId}
+        </if>
+        and t.operate= 'ADD'
+        <if test="inspectionRouteId !=null and inspectionRouteId != ''">
+            and t.inspection_route_id= #{inspectionRouteId}
+        </if>
+        <if test="irmRelId !=null and irmRelId != ''">
+            and t.irm_rel_id= #{irmRelId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </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>
 
     </insert>
 
 
-
     <!-- 查询巡检路线巡检点关系信息 add by wuxw 2018-07-03 -->
     <select id="getInspectionRoutePointRelInfo" parameterType="Map" resultType="Map">
-        select  t.inspection_id,t.inspection_id inspectionId,t.inspection_route_id,t.inspection_route_id inspectionRouteId,t.irm_rel_id,t.irm_rel_id irmRelId,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId 
-from inspection_route_point_rel t 
-where 1 =1 
-<if test="inspectionId !=null and inspectionId != ''">
-   and t.inspection_id= #{inspectionId}
-</if> 
-<if test="inspectionRouteId !=null and inspectionRouteId != ''">
-   and t.inspection_route_id= #{inspectionRouteId}
-</if> 
-<if test="irmRelId !=null and irmRelId != ''">
-   and t.irm_rel_id= #{irmRelId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.inspection_id,t.inspection_id inspectionId,t.inspection_route_id,t.inspection_route_id
+        inspectionRouteId,t.irm_rel_id,t.irm_rel_id irmRelId,t.remark,t.status_cd,t.status_cd
+        statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,
+        ip.inspection_id inspectionId,ip.machine_id machineId,ip.remark,
+        ip.inspection_name inspectionName
+        from inspection_route_point_rel t,inspection_point ip
+        where 1 =1
+        and t.inspection_id = ip.inspection_id
+        and ip.status_cd = '0'
+        <if test="inspectionId !=null and inspectionId != ''">
+            and t.inspection_id= #{inspectionId}
+        </if>
+        <if test="inspectionRouteId !=null and inspectionRouteId != ''">
+            and t.inspection_route_id= #{inspectionRouteId}
+        </if>
+        <if test="irmRelId !=null and irmRelId != ''">
+            and t.irm_rel_id= #{irmRelId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+            and ip.community_id = #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </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="updateInspectionRoutePointRelInfoInstance" parameterType="Map">
-        update  inspection_route_point_rel t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="inspectionId !=null and inspectionId != ''">
-, t.inspection_id= #{inspectionId}
-</if> 
-<if test="inspectionRouteId !=null and inspectionRouteId != ''">
-, t.inspection_route_id= #{inspectionRouteId}
-</if> 
-<if test="remark !=null and remark != ''">
-, t.remark= #{remark}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
- where 1=1 <if test="irmRelId !=null and irmRelId != ''">
-and t.irm_rel_id= #{irmRelId}
-</if> 
-<if test="bId !=null and bId != ''">
-and t.b_id= #{bId}
-</if> 
+        update inspection_route_point_rel t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="inspectionId !=null and inspectionId != ''">
+            , t.inspection_id= #{inspectionId}
+        </if>
+        <if test="inspectionRouteId !=null and inspectionRouteId != ''">
+            , t.inspection_route_id= #{inspectionRouteId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            , t.remark= #{remark}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        where 1=1
+        <if test="irmRelId !=null and irmRelId != ''">
+            and t.irm_rel_id= #{irmRelId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
 
     </update>
 
     <!-- 查询巡检路线巡检点关系数量 add by wuxw 2018-07-03 -->
-     <select id="queryInspectionRoutePointRelsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from inspection_route_point_rel t 
-where 1 =1 
-<if test="inspectionId !=null and inspectionId != ''">
-   and t.inspection_id= #{inspectionId}
-</if> 
-<if test="inspectionRouteId !=null and inspectionRouteId != ''">
-   and t.inspection_route_id= #{inspectionRouteId}
-</if> 
-<if test="irmRelId !=null and irmRelId != ''">
-   and t.irm_rel_id= #{irmRelId}
-</if> 
-<if test="remark !=null and remark != ''">
-   and t.remark= #{remark}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-
-
-     </select>
+    <select id="queryInspectionRoutePointRelsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from inspection_route_point_rel t,inspection_point ip
+        where 1 =1
+        and t.inspection_id = ip.inspection_id
+        and ip.status_cd = '0'
+        <if test="inspectionId !=null and inspectionId != ''">
+            and t.inspection_id= #{inspectionId}
+        </if>
+        <if test="inspectionRouteId !=null and inspectionRouteId != ''">
+            and t.inspection_route_id= #{inspectionRouteId}
+        </if>
+        <if test="irmRelId !=null and irmRelId != ''">
+            and t.irm_rel_id= #{irmRelId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+            and ip.community_id = #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+
+
+    </select>
 
 </mapper>

+ 17 - 0
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeInspectionRouteConstant.java

@@ -27,5 +27,22 @@ public class ServiceCodeInspectionRouteConstant {
      */
     public static final String LIST_INSPECTIONROUTES = "inspectionRoute.listInspectionRoutes";
 
+    /**
+     * 查询 巡检路线
+     */
+    public static final String LIST_INSPECTIONROUTE_POINTS = "inspectionRoute.listInspectionRoutePoints";
+
+    /**
+     * 添加 巡检路线
+     */
+    public static final String ADD_INSPECTIONROUTE_POINT = "inspectionRoute.saveInspectionRoutePoint";
+
+
+    /**
+     * 删除 巡检路线
+     */
+    public static final String DELETE_INSPECTIONROUTE_POINT = "inspectionRoute.deleteInspectionRoutePoint";
+
+
 
 }