From 523c39cfb292a76a28e8a883e583a35a40f1b77b Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Sun, 08 Oct 2023 15:32:48 +0800
Subject: [PATCH] fix:月数据修复补充提交

---
 screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 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 b363f05..7a8b8f9 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
@@ -472,8 +472,19 @@
     @Override
     public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) {
         List<Integer> unitList = unitResult();
+        Integer codeId =  unitAreaCode();
         allocationPageCond.setUnitList(unitList);
-        return this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond);
+        Page<AllocationPageExt> page =  this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond);
+        if(CollectionUtils.isNotEmpty(page.getRecords())){
+            page.getRecords().forEach(it->{
+                if((CollectionUtils.isEmpty(unitList)&&codeId.equals(1))||codeId.equals(2)){
+                    it.setIsApprove(1);
+                }else {
+                    it.setIsApprove(0);
+                }
+            });
+        }
+        return page;
     }
 
     @Override
@@ -591,6 +602,7 @@
         }
         AllocationExtension allocationExtension = allocationExtensionAddCond.convert();
         allocationExtension.setState(AllocationExtensionApproveEnum.APPLYING.value);
+        allocationExtension.setExtensionOldNum(allocationExt.getChangeDay());
         allocationExtensionService.save(allocationExtension);
         fileTableService.upDateResult(allocationExtensionAddCond.getFileList(),allocationExtension.getId(), FileTableEnum.ALLOCATION_EXTENSION.value);
         return true;
@@ -610,4 +622,22 @@
         }
         return Arrays.asList(0);
     }
+
+    @Override
+    public Integer unitAreaCode() {
+        QxUser user = UserHelper.getCurrentUser();
+        List<Integer> userList = responsibilityUnitMapper.selectCodeList("JBD",user.getUserId());
+        if(CollectionUtils.isNotEmpty(userList)){
+            return 1;
+        }
+        if(Objects.nonNull(user.getUnitId())){
+            String code = responsibilityUnitMapper.selectAreaCode(user.getUnitId());
+            if(code.length()>6){
+                return 0;
+            }else {
+                return 2;
+            }
+        }
+        return 1;
+    }
 }

--
Gitblit v1.8.0