From cbdb9ea8d17e07dda2362d1c61e867afe8395ef2 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 20 Oct 2023 18:17:42 +0800
Subject: [PATCH] Merge branch 'cjl' into qa

---
 screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
index 5b7eecd..003041c 100644
--- a/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
+++ b/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -118,7 +118,7 @@
         //������
         String allocationNum = "JBD-" + dateString + String.format("%04d", i);
         allocation.setAllocationNum(allocationNum);
-        if(Objects.nonNull(allocationCond.getEscalationUnitId())&&allocationCond.getEscalationUnitId().toString().length()==6) {
+        if(Objects.nonNull(allocationCond.getEscalationUnitId())&& escalationType(allocationCond.getEscalationUnitId())) {
             allocation.setEscalationType(AllocationEscalationTypeEnum.CHECK.getValue());
         }
         if(NEW_BUILT.equals(allocationCond.getState())) {
@@ -154,7 +154,7 @@
         }
         //������������������
         Allocation allocation = allocationUpdateCond.convert();
-        if(Objects.nonNull(allocationUpdateCond.getEscalationUnitId())&&allocationUpdateCond.getEscalationUnitId().toString().length()==6) {
+        if(Objects.nonNull(allocationUpdateCond.getEscalationUnitId())&& escalationType(allocationUpdateCond.getEscalationUnitId())) {
             allocation.setEscalationType(AllocationEscalationTypeEnum.CHECK.getValue());
         }
         if(NEW_BUILT.equals(allocationUpdateCond.getState())) {
@@ -286,7 +286,7 @@
             HashMap<String, Object> typeMap = new HashMap<>();
             List<Allocation> allocations1 = polluteTypeMap.get(polluteType);
             QueryWrapper<SysDictData> sysDictDataQueryWrapper = new QueryWrapper<>();
-            sysDictDataQueryWrapper.eq("dict_type_id",31);
+            sysDictDataQueryWrapper.eq("dict_type_id",32);
             sysDictDataQueryWrapper.eq("dataKey",polluteType);
             SysDictData sysDictData = sysDictDataMapper.selectOne(sysDictDataQueryWrapper);
             typeMap.put("name",sysDictData.getDataValue());
@@ -782,4 +782,12 @@
         }
         return 1;
     }
+    private boolean escalationType(Integer id){
+        boolean f = false;
+        String code = responsibilityUnitMapper.selectAreaCode(id);
+        if(code.length() == 6){
+            return true;
+        }
+        return f;
+    }
 }

--
Gitblit v1.8.0