From 6992aaf0587c09f7c511c1afd12e1519d91363d3 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Thu, 14 Dec 2023 15:38:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cjl' into qa

---
 screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
index ff1f734..99cc3d0 100644
--- a/screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
+++ b/screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
@@ -16,9 +16,12 @@
 import com.moral.api.service.AllocationExtensionService;
 import com.moral.api.service.AllocationService;
 import com.moral.api.service.FileTableService;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
 
 /**
  * <p>
@@ -64,7 +67,20 @@
 
     @Override
     public Page<AllocationExtensionPageExt> extPage(AllocationExtensionPageCond allocationExtensionPageCond) {
-        return this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond);
+        List<Integer> unitList = allocationService.unitResult();
+        allocationExtensionPageCond.setUnitList(unitList);
+        Integer codeId =  allocationService.unitAreaCode();
+        Page<AllocationExtensionPageExt> page =  this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond);
+        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
@@ -91,4 +107,10 @@
         }
         return true;
     }
+
+
+
+
 }
+
+

--
Gitblit v1.8.0