From b5b6b59de8f5349de1e36875582224f2712e0727 Mon Sep 17 00:00:00 2001
From: jinpengyong <jpy123456>
Date: Tue, 14 Nov 2023 10:13:27 +0800
Subject: [PATCH] chore:补充提交

---
 screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java               |    1 
 screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java      |    3 +
 screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java |    6 +-
 screen-api/src/main/java/com/moral/api/service/AllocationService.java                |    7 +++
 screen-api/src/main/java/com/moral/api/controller/AllocationController.java          |    1 
 screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java    |    4 ++
 screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java       |   66 ++++++++------------------------
 screen-api/src/main/resources/mapper/AllocationMapper.xml                            |   21 +++++++---
 8 files changed, 51 insertions(+), 58 deletions(-)

diff --git a/screen-api/src/main/java/com/moral/api/controller/AllocationController.java b/screen-api/src/main/java/com/moral/api/controller/AllocationController.java
index aa33336..86f968a 100644
--- a/screen-api/src/main/java/com/moral/api/controller/AllocationController.java
+++ b/screen-api/src/main/java/com/moral/api/controller/AllocationController.java
@@ -8,6 +8,7 @@
 import org.apache.commons.collections4.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.moral.api.entity.AllocationLog;
+import com.moral.api.pojo.enums.SysDictTypeEnum;
 import com.moral.api.pojo.ext.allocation.AllocationExt;
 import com.moral.api.pojo.ext.allocation.AllocationPageExt;
 import com.moral.api.pojo.query.allocation.*;
diff --git a/screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java b/screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java
index c98bd8e..6137328 100644
--- a/screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java
+++ b/screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java
@@ -41,6 +41,7 @@
 
     SYS_DEVICE("DEVICE","������������������"),
 
+    SYS_AMEND("AMEND","������������������������"),
 
     ;
 
diff --git a/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java b/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java
index bedf4e4..4be9ac7 100644
--- a/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java
+++ b/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationPageExt.java
@@ -29,6 +29,10 @@
     @ApiModelProperty(value = "������������")
     private String stateName;
 
+    @ApiModelProperty(value = "pc���������������������")
+    private String isCode;
+
+
     //������������������
     private String escalationUnitName;
 }
diff --git a/screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java b/screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java
index 8d759b2..0285bdf 100644
--- a/screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java
+++ b/screen-api/src/main/java/com/moral/api/pojo/query/allocation/AllocationPageCond.java
@@ -25,13 +25,13 @@
 public class AllocationPageCond implements Serializable{
 
     @ApiModelProperty(value = "������������id")
-    private Integer unitId;
+    private List<Integer> unitId;
 
     @ApiModelProperty(value = "������������id")
-    private Integer polluteType;
+    private List<Integer> polluteType;
 
     @ApiModelProperty(value = "������������")
-    private Integer state;
+    private List<Integer> state;
 
     @ApiModelProperty(value = "������������id")
     private Integer investigationType;
diff --git a/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java b/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java
index a8c61e0..845e3a3 100644
--- a/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java
+++ b/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationPageVo.java
@@ -99,6 +99,9 @@
     @ApiModelProperty(value = "������������")
     private Integer isApprove;
 
+    @ApiModelProperty(value = "pc���������������������")
+    private String isCode;
+
     public static AllocationPageVo convert(AllocationPageExt allocationPageExt) {
         AllocationPageVo allocationPageVo = BeanConverts.convert(allocationPageExt, AllocationPageVo.class);
         return allocationPageVo;
diff --git a/screen-api/src/main/java/com/moral/api/service/AllocationService.java b/screen-api/src/main/java/com/moral/api/service/AllocationService.java
index 2f36bcd..0da84e8 100644
--- a/screen-api/src/main/java/com/moral/api/service/AllocationService.java
+++ b/screen-api/src/main/java/com/moral/api/service/AllocationService.java
@@ -153,4 +153,11 @@
      * @return
      */
     List<AllocationLog> getLog(String allocationNum);
+
+    /**
+     * ������������������������������   ���������������������������
+     * @param code
+     * @return
+     */
+    List<Integer> getUnitAuthority(String code);
 }
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..6a2648b 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
@@ -222,32 +222,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 +380,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 +449,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 +461,7 @@
                 }else {
                     it.setIsApprove(0);
                 }
+                it.setIsCode(ObjectUtils.isEmpty(unitAuthority)?"2":"1");
             });
         }
         return page;
@@ -979,6 +934,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();
diff --git a/screen-api/src/main/resources/mapper/AllocationMapper.xml b/screen-api/src/main/resources/mapper/AllocationMapper.xml
index 6753aa6..098ebda 100644
--- a/screen-api/src/main/resources/mapper/AllocationMapper.xml
+++ b/screen-api/src/main/resources/mapper/AllocationMapper.xml
@@ -67,14 +67,23 @@
         left join allocation_extension t1 on t1.allocation_id = allocation.allocation_id and t1.is_del =0 and t1.is_invalid = 0 and t1.state = 30
         <where>
             1 = 1 and allocation.is_del = 0
-            <if test="allocation.unitId != null">
-                and allocation.unit_id = #{allocation.unitId}
+            <if test="allocation.unitId != null and allocation.unitId.size != 0">
+                and allocation.unit_id in
+                <foreach collection="allocation.unitId" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
             </if>
-            <if test="allocation.polluteType != null and allocation.polluteType != 0">
-                and allocation.pollute_type = #{allocation.polluteType}
+            <if test="allocation.polluteType != null and allocation.polluteType.size != 0">
+                and allocation.pollute_type in
+                <foreach collection="allocation.polluteType" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
             </if>
-            <if test="allocation.state != null and allocation.state != 0">
-                and allocation.state = #{allocation.state}
+            <if test="allocation.state != null and allocation.state.size != 0">
+                and allocation.state in
+                <foreach collection="allocation.state" item="id" index="index" open="(" close=")" separator=",">
+                    #{id}
+                </foreach>
             </if>
             <if test="allocation.investigationType != null and allocation.investigationType != 0">
                 and allocation.investigation_type = #{allocation.investigationType}

--
Gitblit v1.8.0