Эх сурвалжийг харах

增加只显示到行社的机构树

jiawuxian 2 жил өмнө
parent
commit
4d42c3d650

+ 0 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SysArea.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.xunmei.common.core.web.domain.BaseEntity;
-import com.xunmei.system.api.enums.OrgType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;

+ 56 - 56
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/enums/OrgType.java

@@ -1,56 +1,56 @@
-package com.xunmei.system.api.enums;
-
-/**
- * @author :LuoWei
- * @date : 2023/8/14
- */
-
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.EnumSerializer;
-import com.xunmei.common.core.utils.StringUtils;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * 机构类型
- */
-@Slf4j
-@JsonSerialize(using = EnumSerializer.class)
-public enum OrgType {
-    YJFX("一级分行", "5a6a1ca2-c55b-4473-abb7-44ae302caf8c"),
-    EJFX("二级分行", "e226dd02-cb0d-45aa-9034-59fa6566239e"),
-    YJZX("一级支行", "87a6b4a5-cd72-4beb-b136-2299d6a85add"),
-    WD("营业网点", "28f4be66-af08-4064-9407-b5b8346bb5af"),
-    ZZ("离行式自助nh", ""),
-    JK("金库", ""),
-    BGDL("办公大楼", ""),
-    JKZX("视频监控中心", ""),
-    YQ("园区", ""),
-    OTHER("其他", ""),
-    XJZX("现金中心","");
-    @Getter
-    private final String text;
-
-    private final String guid;
-
-    OrgType(final String text, final String guid) {
-        this.text = text;
-        this.guid = guid;
-    }
-
-    public static OrgType findByGuid(final String guid) {
-        if (StringUtils.isBlank(guid)) {
-            return null;
-        }
-        for (final OrgType orgType : OrgType.values()) {
-            if (StringUtils.equalsIgnoreCase(orgType.name(), guid)) {
-                return orgType;
-            }
-            if (StringUtils.equalsIgnoreCase(orgType.guid, guid)) {
-                return orgType;
-            }
-        }
-        //ORGLOG.warn("[ {} ]没有对应机构类型", guid);
-        return null;
-    }
-}
+//package com.xunmei.system.api.enums;
+//
+///**
+// * @author :LuoWei
+// * @date : 2023/8/14
+// */
+//
+//import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+//import com.fasterxml.jackson.databind.ser.std.EnumSerializer;
+//import com.xunmei.common.core.utils.StringUtils;
+//import lombok.Getter;
+//import lombok.extern.slf4j.Slf4j;
+//
+///**
+// * 机构类型
+// */
+//@Slf4j
+//@JsonSerialize(using = EnumSerializer.class)
+//public enum OrgType {
+//    YJFX("一级分行", "5a6a1ca2-c55b-4473-abb7-44ae302caf8c"),
+//    EJFX("二级分行", "e226dd02-cb0d-45aa-9034-59fa6566239e"),
+//    YJZX("一级支行", "87a6b4a5-cd72-4beb-b136-2299d6a85add"),
+//    WD("营业网点", "28f4be66-af08-4064-9407-b5b8346bb5af"),
+//    ZZ("离行式自助nh", ""),
+//    JK("金库", ""),
+//    BGDL("办公大楼", ""),
+//    JKZX("视频监控中心", ""),
+//    YQ("园区", ""),
+//    OTHER("其他", ""),
+//    XJZX("现金中心","");
+//    @Getter
+//    private final String text;
+//
+//    private final String guid;
+//
+//    OrgType(final String text, final String guid) {
+//        this.text = text;
+//        this.guid = guid;
+//    }
+//
+//    public static OrgType findByGuid(final String guid) {
+//        if (StringUtils.isBlank(guid)) {
+//            return null;
+//        }
+//        for (final OrgType orgType : OrgType.values()) {
+//            if (StringUtils.equalsIgnoreCase(orgType.name(), guid)) {
+//                return orgType;
+//            }
+//            if (StringUtils.equalsIgnoreCase(orgType.guid, guid)) {
+//                return orgType;
+//            }
+//        }
+//        //ORGLOG.warn("[ {} ]没有对应机构类型", guid);
+//        return null;
+//    }
+//}

+ 2 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/vo/SysOrgVO.java

@@ -22,7 +22,8 @@ public class SysOrgVO {
     private Long id;
     private String name;
     private String path;
-    public Long parentId;
+    private Long parentId;
+    private Integer type;
     private List<SysOrgVO> children = new ArrayList<SysOrgVO>();
 
     @Override

+ 26 - 21
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/ResumptionBusiness.java

@@ -514,24 +514,29 @@ public class ResumptionBusiness {
         List<AppResumptionDataRemarkimg> allImgs = appResumptionTaskDataRemarkimgService
                 .list(new LambdaUpdateWrapper<AppResumptionDataRemarkimg>()
                         .eq(AppResumptionDataRemarkimg::getResumptionId, request.getTaskId()));
-        try {
-            for (ResumptionPointVo pointVo : pointList) {
-                List<ResumptionNfcVo> nfclista = nfclist.stream().filter(r -> r.getPointId().equals(pointVo.getPointid())).collect(Collectors.toList());
-                if (nfclista != null && nfclista.size() > 0) {
-                    nfclista.forEach(r -> r.setNfcdataid(IDHelper.id()));
-                }
-                pointVo.setPointnfclist(nfclista == null ? new ArrayList<>() : nfclista);
+        nfclist.forEach(nfc -> {
+            if (ObjectUtil.isNull(nfc.getNfcdataid())) {
+                nfc.setNfcdataid(IDHelper.id());
+            }
+        });
+//        try {
+//            for (ResumptionPointVo pointVo : pointList) {
+//                List<ResumptionNfcVo> nfclista = nfclist.stream().filter(r -> r.getPointId().equals(pointVo.getPointid())).collect(Collectors.toList());
+//                if (nfclista != null && nfclista.size() > 0) {
+//                    nfclista.forEach(r -> r.setNfcdataid(IDHelper.id()));
+//                }
+//                pointVo.setPointnfclist(nfclista == null ? new ArrayList<>() : nfclista);
                 //如果是布撤防数据要显示默认时间
 
 
-                DateTime datetime = new DateTime();
-                datetime.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
-                Date startTime = datetime.setField(DateField.HOUR_OF_DAY, 0).setField(DateField.MINUTE, 0).setField(DateField.SECOND, 0);
-                Date endTime = DateUtil.endOfDay(datetime).offset(DateField.MILLISECOND, -999);
-                SimpleDateFormat sdftb = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                sdftb.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
-                String strStartTime = sdftb.format(startTime);
-                String strEndTime = sdftb.format(endTime);
+//                DateTime datetime = new DateTime();
+//                datetime.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+//                Date startTime = datetime.setField(DateField.HOUR_OF_DAY, 0).setField(DateField.MINUTE, 0).setField(DateField.SECOND, 0);
+//                Date endTime = DateUtil.endOfDay(datetime).offset(DateField.MILLISECOND, -999);
+//                SimpleDateFormat sdftb = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//                sdftb.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
+//                String strStartTime = sdftb.format(startTime);
+//                String strEndTime = sdftb.format(endTime);
 //                //撤防时间
 //                ProtectionLog log = null;
 //                if ((pointVo.getPointid().equals("3916620810321920") || pointVo.getPointname().equals("入侵报警撤防时间")) && pointVo.getTimeType() == 1) {
@@ -551,11 +556,11 @@ public class ResumptionBusiness {
 //                    dealWithPointBusinessData(pointVo,resumption,plan);
 //                }
 
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+//            }
+//
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
         //将数据按区域分组
         Map<Long, List<ResumptionPointVo>> pointListMap = pointList.stream().collect(Collectors.groupingBy(r -> r.getAreaid()));
         for (Long key : pointListMap.keySet()) {
@@ -710,7 +715,7 @@ public class ResumptionBusiness {
         }
         //获取履职数据异常的数据个数
         int exceptionCount = (int) appResumptionDataService.count((new QueryWrapper<AppResumptionData>()).lambda().eq(AppResumptionData::getResumptionId, request.getResumptionId()).eq(AppResumptionData::getResValue, 1));
-        if(CollectionUtil.isNotEmpty(resumptionProtections)){
+        if (CollectionUtil.isNotEmpty(resumptionProtections)) {
             coreResumptionDataProtectionService.saveBatch(resumptionProtections);
         }
         resumption.setExceptionCount(exceptionCount);

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/ResumptionPointVo.java

@@ -44,7 +44,7 @@ public class ResumptionPointVo {
     private Integer submitBy;
     private String resremark;
     private Date submitTime;
-    private List<ResumptionNfcVo> pointnfclist;
+//    private List<ResumptionNfcVo> pointnfclist;
     private String rectificationDeadline;
 }
 

+ 11 - 6
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -26,10 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * 部门信息
@@ -137,12 +134,20 @@ public class SysDeptController extends BaseController {
      */
     @GetMapping("/deptTree")
     public AjaxResult deptTree(SysOrg dept) {
-        return success(deptService.selectDeptTreeList(dept));
+        return success(deptService.selectDeptTreeList(new ArrayList<>()));
+    }
+
+    /**
+     * 获取部门树列表(机构)
+     */
+    @GetMapping("/deptTree/hangshe")
+    public AjaxResult hangsheDeptTree() {
+        return success(deptService.selectDeptTreeList(Arrays.asList(1,2,3)));
     }
 
     /**
      * @param dept
-     * @return 获取部门树(真部门)
+     * @return 获取部门树(全量信息
      */
     @GetMapping("/sysDeptTree")
     public AjaxResult sysDeptTree(SysDept dept) {

+ 2 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysRoleController.java

@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -196,7 +197,7 @@ public class SysRoleController extends BaseController {
     public AjaxResult deptTree(@PathVariable("roleId") Long roleId) {
         AjaxResult ajax = AjaxResult.success();
         ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
-        ajax.put("depts", deptService.selectDeptTreeList(new SysOrg()));
+        ajax.put("depts", deptService.selectDeptTreeList(new ArrayList<>()));
         return ajax;
     }
 

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysDeptService.java

@@ -29,7 +29,7 @@ public interface ISysDeptService extends IService<SysDept> {
      * @param dept 部门信息
      * @return 部门树信息集合
      */
-    List<SysOrgVO> selectDeptTreeList(SysOrg dept);
+    List<SysOrgVO> selectDeptTreeList(List<Integer> orgTypes);
 
     /**
      * 部门管理

+ 10 - 4
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeptServiceImpl.java

@@ -108,11 +108,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
     /**
      * 查询部门树结构信息
      *
-     * @param dept 部门信息
+     * @param orgTypes 机构类型
      * @return 部门树信息集合
      */
     @Override
-    public List<SysOrgVO> selectDeptTreeList(SysOrg dept) {
+    public List<SysOrgVO> selectDeptTreeList(List<Integer> orgTypes) {
         Long s = System.currentTimeMillis();
         Long userId = SecurityUtils.getUserId();
         SysOrg sysOrg = orgMapper.selectSysOrgByUserId(userId);
@@ -129,9 +129,15 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
         List<SysOrgVO> orgs = new ArrayList<>();
         for (SysOrgVO org : cacheList) {
             String path = org.getPath();
-            if (StringUtils.isNotEmpty(path) && path.startsWith(sysOrg.getPath())) {
-                orgs.add(org);
+            if(StringUtils.isEmpty(path) || !path.startsWith(sysOrg.getPath())){
+                continue;
+            }
+
+            if(CollectionUtils.isNotEmpty(orgTypes) && !orgTypes.contains(org.getType())){
+                continue;
             }
+
+            orgs.add(org);
         }
         Long parentId = Constants.TOP_ORG_PARENT_ID;
         if (ObjectUtil.notEqual(Constants.TOP_ORG_PARENT_ID, sysOrg.getParentId())) {

+ 2 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -598,7 +598,8 @@
         SELECT id,
                `name`,
                path,
-               parent_id
+               parent_id,
+                type
         FROM sys_org
         WHERE deleted = 0
     </select>