From 262da4207e549ba8effb0fc2b5a26a5322addaf8 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期二, 11 十月 2022 17:01:23 +0800
Subject: [PATCH] 车俩管理 字典表 文本上传

---
 ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
index 5e32871..2bb3762 100644
--- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
+++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -8,6 +8,7 @@
 import com.ycl.bo.AdminUserDetails;
 import com.ycl.bo.casePool.CasePoolIllegalBuildingDO;
 import com.ycl.bo.casePool.CasePoolViolationDO;
+import com.ycl.common.constant.BaseCaseStatus;
 import com.ycl.common.util.DateUtil;
 import com.ycl.dto.casePool.IllegalBuildingParam;
 import com.ycl.dto.casePool.ViolationParam;
@@ -195,7 +196,7 @@
     }
 
     @Override
-    public Boolean saveViolationCase(ViolationParam violationParam, Integer id) {
+    public Boolean saveViolationCase(ViolationParam violationParam, Long id) {
         Violations violations = new Violations();
         BeanUtils.copyProperties(violationParam, violations);
         violations.setId(id);
@@ -204,9 +205,9 @@
     }
 
     @Override
-    public Boolean saveIllegalBuildingCase(IllegalBuildingParam illegalBuildingParam, Integer id) {
+    public Boolean saveIllegalBuildingCase(IllegalBuildingParam illegalBuildingParam, Long id) {
         IllegalBuilding illegalBuilding = new IllegalBuilding();
-        BeanUtils.copyProperties(illegalBuilding, illegalBuildingParam);
+        BeanUtils.copyProperties(illegalBuildingParam, illegalBuilding);
         illegalBuilding.setBaseCaseId(id);
         Integer value = 1;
         return illegalBuildingMapper.insert(illegalBuilding) == value ? true : false;
@@ -222,7 +223,16 @@
         if (baseCase == null) {
             return null;
         }
+        //鏌ヨ妗堜欢杩濊淇℃伅
+        if (baseCase.getCategory() == 1) {
+            Violations violations = violationsMapper.selectById(baseCase.getId());
+            baseCase.setViolations(violations);
+        } else {
+            IllegalBuilding  illegalBuilding = illegalBuildingMapper.selectById(baseCase.getId());
+            baseCase.setIllegalBuilding(illegalBuilding);
+        }
         bcd.setBaseCase(baseCase);
+        //妗堜欢鐩稿叧淇℃伅
         //2.鏌ヨ鍔炵悊缁忚繃淇℃伅
         //2.1鏌ヨ澶勭疆娴佺▼閰嶇疆
         HandlePassVo handlePassVo = new HandlePassVo();
@@ -241,7 +251,7 @@
         //2.2鏌ヨ澶勭疆娴佺▼鐜妭閰嶇疆
         Map mapWcs = new HashMap();
         mapWcs.put("workflowConfigId", ddlcId);
-        mapWcs.put("baseCaseId", ddlcId);
+        mapWcs.put("baseCaseId", baseCase.getId());
         List<WorkflowConfigStep> listWcs = workflowConfigStepMapper.selectRecordByWorkflowConfigStepId(mapWcs);
         //澶勭悊鐢ㄧ幆鑺傛椂闂�
         for (WorkflowConfigStep step : listWcs) {
@@ -250,10 +260,12 @@
                 continue;
             }
             for (DisposeRecord record : records) {
-                record.setLinkTime(
-                        DateUtil.getDistanceDateTime(
-                                DateUtil.fromLocalDateTime(baseCase.getAlarmTime()),
-                                DateUtil.fromLocalDateTime(record.getCreateTime())));
+                if (record != null&&record.getCreateTime()!=null) {
+                    record.setLinkTime(
+                            DateUtil.getDistanceDateTime(
+                                    DateUtil.fromLocalDateTime(baseCase.getAlarmTime()),
+                                    DateUtil.fromLocalDateTime(record.getCreateTime())));
+                }
             }
             step.setDisposeRecords(records);
         }
@@ -317,13 +329,12 @@
     }
 
     @Override
-    public void endCase(Integer caseId, String result) {
+    public void endCase(Long caseId, String result) {
         AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
-        Integer endCaseState = 6;
-        Integer state = 2;
+        Integer state = 1;
         String endCaseName = "缁撴";
         BaseCase baseCase = new BaseCase();
-        baseCase.setState(endCaseState);
+        baseCase.setState(BaseCaseStatus.CLOSING_REGISTER);
         baseCase.setId(caseId);
         baseCaseMapper.updateById(baseCase);
         DisposeRecord disposeRecord = new DisposeRecord();
@@ -331,7 +342,7 @@
         disposeRecord.setWorkflowConfigStepId(workflowConfigStepMapper
                 .selectOne(new LambdaQueryWrapper<WorkflowConfigStep>().eq(WorkflowConfigStep::getName, endCaseName))
                 .getWorkflowConfigId());
-        disposeRecord.setCreateUser(user.getUserId().intValue());
+        disposeRecord.setCreateUser(user.getUserId().longValue());
         disposeRecord.setResult(result);
         disposeRecord.setState(state);
         disposeRecord.setCreateTime(LocalDateTime.now());

--
Gitblit v1.8.0