From 4107073950f459e051e5b9e828750ab57be3863b Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Wed, 15 Nov 2023 16:03:53 +0800
Subject: [PATCH] fix:补充提交
---
screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java | 80 +++++++++++++++------------------------
1 files changed, 31 insertions(+), 49 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 6a5a6d9..ec92c53 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
@@ -19,6 +19,7 @@
import com.moral.api.pojo.bean.BaseInvalidEntity;
import com.moral.api.pojo.dto.allocation.AllocationUnitViewDto;
import com.moral.api.pojo.enums.*;
+import com.moral.api.pojo.ext.allocation.AllocationExcelExt;
import com.moral.api.pojo.ext.allocation.AllocationExt;
import com.moral.api.pojo.ext.allocation.AllocationListExt;
import com.moral.api.pojo.ext.allocation.AllocationPageExt;
@@ -31,6 +32,7 @@
import com.moral.api.pojo.vo.app.AppAuthority;
import com.moral.api.pojo.vo.user.QxUser;
import com.moral.api.service.*;
+import com.moral.api.utils.BeanConverts;
import com.moral.constant.Constants;
import com.moral.constant.RedisConstants;
import com.moral.util.DateUtils;
@@ -222,32 +224,7 @@
}
}
-// Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo();
-// Object unitId = userInfo.get("unitId");
-// Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization");
-// Integer orgId = (Integer) orgInfo.get("id");
-// if (!ObjectUtils.isEmpty(map.get("unitId"))){
-// wrapper.in("unit_id",map.get("unitId").toString());
-// }else {
-// if (orgId!=24){
-// if (ObjectUtils.isEmpty(unitId)){
-// return null;
-// }
-// ResponsibilityUnit responsibilityUnit1 = responsibilityUnitMapper.selectById(Integer.parseInt(unitId.toString()));
-// Integer areaCode = responsibilityUnit1.getAreaCode();
-// List<ResponsibilityUnit> responsibilityUnits = responsibilityUnitService.selectUnit(areaCode);
-// if (ObjectUtils.isEmpty(responsibilityUnits)){
-// List<ResponsibilityUnit> responsibilityUnits1 = responsibilityUnitService.selectAreaUnit(areaCode);
-// Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits1.stream().collect(Collectors.groupingBy(o -> o.getUnitId()));
-// List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList());
-// wrapper.in("unit_id",collect1);
-// }else {
-// Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits.stream().collect(Collectors.groupingBy(o -> o.getUnitId()));
-// List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList());
-// wrapper.in("unit_id",collect1);
-// }
-// }
-// }
+
HashMap<String, Object> rsMap = new HashMap<>();
ArrayList<Map<String, Object>> polluteArrayList = new ArrayList<>();
@@ -405,29 +382,7 @@
}
}
}
-// Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo();
-// Object unitId = userInfo.get("unitId");
-// Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization");
-// Integer orgId = (Integer) orgInfo.get("id");
-//
-// if (ObjectUtils.isEmpty(unitId)){
-// return null;
-// }
-// if (orgId!=24){
-// ResponsibilityUnit responsibilityUnit1 = responsibilityUnitMapper.selectById(Integer.parseInt(unitId.toString()));
-// Integer areaCode = responsibilityUnit1.getAreaCode();
-// List<ResponsibilityUnit> responsibilityUnits = responsibilityUnitService.selectUnit(areaCode);
-// if (ObjectUtils.isEmpty(responsibilityUnits)){
-// List<ResponsibilityUnit> responsibilityUnits1 = responsibilityUnitService.selectAreaUnit(areaCode);
-// Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits1.stream().collect(Collectors.groupingBy(o -> o.getUnitId()));
-// List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList());
-// wrapper.in("unit_id",collect1);
-// }else {
-// Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits.stream().collect(Collectors.groupingBy(o -> o.getUnitId()));
-// List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList());
-// wrapper.in("unit_id",collect1);
-// }
-// }
+
ArrayList<Map<String, Object>> rsMap = new ArrayList<>();
Object number1 = map.get("number");
@@ -496,6 +451,7 @@
@Override
public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) {
+ List<Integer> unitAuthority = this.getUnitAuthority(SysDictTypeEnum.SYS_AMEND.value);
List<Integer> unitList = unitResult();
Integer codeId = unitAreaCode();
allocationPageCond.setUnitList(unitList);
@@ -507,6 +463,7 @@
}else {
it.setIsApprove(0);
}
+ it.setIsCode(ObjectUtils.isEmpty(unitAuthority)?"2":"1");
});
}
return page;
@@ -979,6 +936,19 @@
return allocationLogs;
}
+ /**
+ * ������������������������������
+ *
+ * @param code
+ * @return
+ */
+ @Override
+ public List<Integer> getUnitAuthority(String code) {
+ QxUser user = UserHelper.getCurrentUser();
+ List<Integer> userList = responsibilityUnitMapper.selectCodeList(code,user.getUserId());
+ return userList;
+ }
+
@Override
public List<Integer> unitResult() {
QxUser user = UserHelper.getCurrentUser();
@@ -1026,4 +996,16 @@
return responsibilityUnit;
}
+ @Override
+ public List<AllocationExcelExt> listExcel(List<Integer> id) {
+ List<AllocationExcelExt> list = new ArrayList<>();
+ for(Integer i : id){
+ AllocationExt allocationExt = oneAllocation(i);
+ AllocationExcelExt allocationExcelExt = BeanConverts.convert(allocationExt,AllocationExcelExt.class);
+ allocationExcelExt.setFileBaseList(fileTableService.list(i,FileTableEnum.ALLOCATION_FOUNDATION.value,FileType.PICTURE.getValue()));
+ allocationExcelExt.setFileChangeList(fileTableService.list(i,FileTableEnum.ALLOCATION_RECTIFICATION.value,FileType.PICTURE.getValue()));
+ list.add(allocationExcelExt);
+ }
+ return list;
+ }
}
--
Gitblit v1.8.0