Sfoglia il codice sorgente

项目报验点状态初始化

wangming 5 mesi fa
parent
commit
5b961bd2be

+ 16 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxInsideInspectionDao.java

@@ -82,6 +82,22 @@ public interface ZhcxInsideInspectionDao extends BaseMapper<ZhcxInsideInspection
             " AND zii.INSPECTIONSTATUS IN ('30', '40') and zii.LAUNCHTYPE = 'itp' ORDER by zii.INSPECTIONCODE ASC limit 500")
     List<JSONObject> getInitNodeStateInspection();
 
+    @Select("SELECT " +
+            " zii.*, ziid.INSPECTIONCONCLUSION " +
+            "FROM " +
+            " ZHCX_INSIDE_INSPECTION zii " +
+            "JOIN ZHCX_INSIDE_INSPECTION_DISPATCH ziid ON " +
+            " ziid.INSIDEID = zii.ID " +
+            " AND ziid.DELETED = '0' " +
+            "WHERE " +
+            " zii.DELETED = '0' " +
+            " AND zii.PROJECTID = #{projectId} " +
+            " AND zii.INSPECTIONSTATUS IN ('30', '40') " +
+            " AND zii.LAUNCHTYPE = 'itp' " +
+            "ORDER BY " +
+            " zii.INSPECTIONCODE ASC")
+    List<JSONObject> getInitNodeStateInspectionByPrjId(@Param("projectId") String projectId);
+
 
     /**
      * 获取已经删除报验点的报验单

+ 17 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxOutsideInspectionItpDao.java

@@ -72,6 +72,23 @@ public interface ZhcxOutsideInspectionItpDao extends BaseMapper<ZhcxOutsideInspe
             "AND INSPECTIONSTATUS IN ('30', '40') and itp.LAUNCHTYPE = 'itp' ORDER by itp.INSPECTIONCODE ASC limit 500")
     List<JSONObject> getInitNodeStateInspection();
 
+    @Select("SELECT " +
+            " itp.*, " +
+            " dis.INSPECTIONCONCLUSION " +
+            "FROM " +
+            " ZHCX_OUTSIDE_INSPECTION_ITP itp " +
+            "JOIN ZHCX_OUTSIDE_INSPECTION_ITP_SUPERVISION_DISPATCH dis ON " +
+            " dis.ITPID = itp.ID " +
+            " AND dis.DELETED = '0' " +
+            "WHERE " +
+            " itp.DELETED = '0' " +
+            " AND itp.PROJECTID = #{projectId} " +
+            " AND INSPECTIONSTATUS IN ('30', '40') " +
+            " AND itp.LAUNCHTYPE = 'itp' " +
+            "ORDER BY " +
+            " itp.INSPECTIONCODE ASC")
+    List<JSONObject> getInitNodeStateInspectionByProjectId(@Param("projectId") String projectId);
+
     /**
      * 获取已经删除报验点的报验单
      *

+ 8 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxInsideInspectionService.java

@@ -132,6 +132,14 @@ public interface ZhcxInsideInspectionService extends IService<ZhcxInsideInspecti
      */
     List<JSONObject> getInitNodeStateInspection();
 
+    /**
+     * 获取需要初始化的报验单
+     *
+     * @param projectId
+     * @return
+     */
+    List<JSONObject> getInitNodeStateInspectionByProjectId(String projectId);
+
     /**
      * 获取已经删除报验点的报验单
      *

+ 2 - 2
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxItpProjectNodeStateService.java

@@ -46,10 +46,10 @@ public interface ZhcxItpProjectNodeStateService extends IService<ZhcxItpProjectN
      * 初始化-外部报验单
      *
      */
-    void initRelationOutSide();
+    void initRelationOutSide(String projectId);
 
     /**
      * 初始化-内部报验单
      */
-    void initRelationInSide();
+    void initRelationInSide(String projectId);
 }

+ 8 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxOutsideInspectionItpService.java

@@ -74,6 +74,14 @@ public interface ZhcxOutsideInspectionItpService extends IService<ZhcxOutsideIns
      */
     List<JSONObject> getInitNodeStateInspection();
 
+    /**
+     * 获取需要初始化的报验单
+     *
+     * @param projectId
+     * @return
+     */
+    List<JSONObject> getInitNodeStateInspectionByProjectId(String projectId);
+
     void batchDownloadFile(List<ZhcxOutsideExportVo> list, HttpServletResponse response);
 
     /**

+ 11 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxInsideInspectionServiceImpl.java

@@ -855,6 +855,17 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         return dao.getInitNodeStateInspection();
     }
 
+    /**
+     * 获取需要初始化的报验单
+     *
+     * @param projectId
+     * @return
+     */
+    @Override
+    public List<JSONObject> getInitNodeStateInspectionByProjectId(String projectId) {
+        return dao.getInitNodeStateInspectionByPrjId(projectId);
+    }
+
     /**
      * 获取已经删除报验点的报验单
      *

+ 18 - 8
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxItpProjectNodeStateServiceImpl.java

@@ -204,9 +204,9 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
      *
      */
     @Override
-    public void initRelationOutSide() {
+    public void initRelationOutSide(String projectId) {
         //外部报验单
-        List<RelactionNodeStateBo> nodeStaeList = initNodeStatusOutside();
+        List<RelactionNodeStateBo> nodeStaeList = initNodeStatusOutside(projectId);
 
         SysUserVo user = zhcxCommon.getCurrentUser();
         OperDto oper = new OperDto();
@@ -222,9 +222,9 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
      * 初始化-内部报验单
      */
     @Override
-    public void initRelationInSide() {
+    public void initRelationInSide(String projectId) {
         //内部报验单
-        List<RelactionNodeStateBo> nodeStateInsideList = initNodeStatusInside();
+        List<RelactionNodeStateBo> nodeStateInsideList = initNodeStatusInside(projectId);
 
         SysUserVo user = zhcxCommon.getCurrentUser();
         OperDto oper = new OperDto();
@@ -238,8 +238,13 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
     /**
      * 保存外部报验单
      */
-    private List<RelactionNodeStateBo> initNodeStatusInside() {
-        List<JSONObject> inspectionList = insideInspectionService.getInitNodeStateInspection();
+    private List<RelactionNodeStateBo> initNodeStatusInside(String projectId) {
+        List<JSONObject> inspectionList;
+        if(ObjectUtil.isEmpty(projectId)) {
+            inspectionList = insideInspectionService.getInitNodeStateInspection();
+        } else {
+            inspectionList = insideInspectionService.getInitNodeStateInspectionByProjectId(projectId);
+        }
 
         return assembleInitNodeStatusList(inspectionList, "inside");
     }
@@ -247,8 +252,13 @@ public class ZhcxItpProjectNodeStateServiceImpl extends ServiceImpl<ZhcxItpProje
     /**
      * 保存外部报验单
      */
-    private List<RelactionNodeStateBo> initNodeStatusOutside() {
-        List<JSONObject> inspectionList = outsideInspectionItpService.getInitNodeStateInspection();
+    private List<RelactionNodeStateBo> initNodeStatusOutside(String projectId) {
+        List<JSONObject> inspectionList;
+        if(ObjectUtil.isEmpty(projectId)) {
+            inspectionList = outsideInspectionItpService.getInitNodeStateInspection();
+        } else {
+            inspectionList = outsideInspectionItpService.getInitNodeStateInspectionByProjectId(projectId);
+        }
 
         return assembleInitNodeStatusList(inspectionList, "outside");
     }

+ 11 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxOutsideInspectionItpServiceImpl.java

@@ -1304,6 +1304,17 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
         return dao.getInitNodeStateInspection();
     }
 
+    /**
+     * 获取需要初始化的报验单
+     *
+     * @param projectId
+     * @return
+     */
+    @Override
+    public List<JSONObject> getInitNodeStateInspectionByProjectId(String projectId) {
+        return dao.getInitNodeStateInspectionByProjectId(projectId);
+    }
+
     @Override
     public void batchDownloadFile(List<ZhcxOutsideExportVo> ExportVos, HttpServletResponse response) {
         if (!isWithinAllowedTime()) {

+ 8 - 4
business-server/src/main/java/com/rongwei/bsserver/controller/ZhcxItpProjectNodeStateController.java

@@ -1,5 +1,6 @@
 package com.rongwei.bsserver.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.rongwei.bscommon.sys.service.ZhcxItpProjectNodeStateService;
 import com.rongwei.bsentity.dto.project.node.RelationInspectionRequest;
 import com.rongwei.rwcommon.base.R;
@@ -11,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Map;
+
 @RestController
 @RequestMapping("/project/node/state")
 @Api(tags = "itp地图项目报验点状态")
@@ -39,8 +42,9 @@ public class ZhcxItpProjectNodeStateController {
      */
     @ApiOperation("初始化报验点下的报验单")
     @PostMapping("/init/relationOutSide")
-    public R initRelationOutSide(){
-        service.initRelationOutSide();
+    public R initRelationOutSide(@RequestBody JSONObject json){
+
+        service.initRelationOutSide(json.getString("projectId"));
         return R.ok();
     }
 
@@ -51,8 +55,8 @@ public class ZhcxItpProjectNodeStateController {
      */
     @ApiOperation("初始化报验点下的报验单")
     @PostMapping("/init/relationInSide")
-    public R initRelationInSide(){
-        service.initRelationInSide();
+    public R initRelationInSide(@RequestBody JSONObject json){
+        service.initRelationInSide(json.getString("projectId"));
         return R.ok();
     }
 }