From 21f45258cfcdc79127f85ad6e45736cff5acd345 Mon Sep 17 00:00:00 2001
From: liyj <15602261488@163.com>
Date: Mon, 21 Oct 2024 20:58:05 +0800
Subject: [PATCH] 1、数据割接程序,白云区矛盾纠纷多元化解平台 2、纠纷态势报错修改

---
 dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java
index 1595bb1..1870e34 100644
--- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java
+++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java
@@ -23,6 +23,7 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -331,10 +332,10 @@
                 unitSelectTerm.setLabel(ctUnit.getUnitName());
                 unitSelectTerm.setParentId(ctUnit.getParentId());
                 unitSelectTerm.setCheckable(true);
-                if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){
                     szbmList.add(unitSelectTerm);
                 }
-                if (UserBaseConsts.UNIT_TYPE_1 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_101 == ctUnit.getUnitType()){
                     qzzzxList.add(unitSelectTerm);
                 }
             }
@@ -379,10 +380,10 @@
                 unitSelectTerm.setLabel(ctUnit.getUnitName());
                 unitSelectTerm.setParentId(ctUnit.getParentId());
                 unitSelectTerm.setCheckable(true);
-                if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){
                     qzbmList.add(unitSelectTerm);
                 }
-                if (UserBaseConsts.UNIT_TYPE_1 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_101 == ctUnit.getUnitType()){
                     zjzzzxList.add(unitSelectTerm);
                 }
             }
@@ -513,10 +514,10 @@
                 unitSelectTerm.setLabel(ctUnit.getUnitName());
                 unitSelectTerm.setParentId(ctUnit.getParentId());
                 unitSelectTerm.setCheckable(true);
-                if (UserBaseConsts.UNIT_TYPE_1 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_101 == ctUnit.getUnitType()){
                     szbmList.add(unitSelectTerm);
                 }
-                if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){
                     qzzzxList.add(unitSelectTerm);
                 }
             }
@@ -561,10 +562,10 @@
                 unitSelectTerm.setLabel(ctUnit.getUnitName());
                 unitSelectTerm.setParentId(ctUnit.getParentId());
                 unitSelectTerm.setCheckable(true);
-                if (UserBaseConsts.UNIT_TYPE_2 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_102 == ctUnit.getUnitType()){
                     qzbmList.add(unitSelectTerm);
                 }
-                if (UserBaseConsts.UNIT_TYPE_3 == ctUnit.getUnitType()){
+                if (UserBaseConsts.UNIT_TYPE_103 == ctUnit.getUnitType()){
                     zjzzzxList.add(unitSelectTerm);
                 }
             }
@@ -655,10 +656,12 @@
      */
     public CtUnitDTO getParentZzzx(String unitId){
         try{
-            CtUnit loginCtUnit = mapper.selectById(unitId);
             // 查询当前单位的上级综治中心
             QueryWrapper<CtUnit> ctUnitQueryWrapper = new QueryWrapper<>();
-            ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_1);
+            ctUnitQueryWrapper.eq("id", unitId).select("parent_id");
+            CtUnit loginCtUnit = mapper.selectOne(ctUnitQueryWrapper);
+            ctUnitQueryWrapper.clear();
+            ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_101);
             CtUnit zzzxCtUnit = mapper.selectOne(ctUnitQueryWrapper);
             CtUnitDTO ctUnitDTO = new CtUnitDTO();
             BeanUtils.copyProperties(zzzxCtUnit, ctUnitDTO);
@@ -679,12 +682,12 @@
             CtUnitDTO ctUnitDTO = new CtUnitDTO();
             // 查询自己是否是综治中心
             CtUnit loginCtUnit = mapper.selectById(unitId);
-            if (UserBaseConsts.UNIT_TYPE_1 == loginCtUnit.getUnitType()){
+            if (UserBaseConsts.UNIT_TYPE_101 == loginCtUnit.getUnitType()){
                 BeanUtils.copyProperties(loginCtUnit, ctUnitDTO);
             }else {
                 // 查询当前单位的上级综治中心
                 QueryWrapper<CtUnit> ctUnitQueryWrapper = new QueryWrapper<>();
-                ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_1);
+                ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_101);
                 CtUnit zzzxCtUnit = mapper.selectOne(ctUnitQueryWrapper);
                 BeanUtils.copyProperties(zzzxCtUnit, ctUnitDTO);
             }
@@ -694,4 +697,8 @@
             throw new ServiceException("CtUnitService.getParentZzzx", e);
         }
     }
+
+    public CtUnit selectUnitByGridId(String gridUnitId){
+        return mapper.selectUnitByGridId(gridUnitId);
+    }
 }

--
Gitblit v1.8.0