浏览代码

DeBugDeBugDeBug

buzhanyi 2 年之前
父节点
当前提交
e8e2819f40

+ 3 - 3
purchase-admin/src/main/java/com/ozs/web/controller/system/SysUserController.java

@@ -103,11 +103,11 @@ public class SysUserController extends BaseController {
         }
         LoginUser loginUser = SecurityUtils.getLoginUser();
         if (!String.valueOf(loginUser.getUserId()).equals("1")) {
-            List<Integer> deptList = new ArrayList<>();
+            List<Long> deptList = new ArrayList<>();
             //获取到子孙级部门id
-            Integer deptId = Math.toIntExact(loginUser.getDeptId());
+            Long deptId = loginUser.getDeptId();
             if (deptService.hasChildByDeptId(loginUser.getDeptId())) {
-                List<Integer> children = deptService.getDeptChildren(deptId);
+                List<Long> children = deptService.getDeptChildren(deptId);
                 System.err.println(children.size());
                 deptList.addAll(children);
             }

+ 4 - 4
purchase-common/src/main/java/com/ozs/common/core/domain/entity/SysDept.java

@@ -90,13 +90,13 @@ public class SysDept extends BaseEntity
      * 查询全部or指定部门
      */
     @TableField(exist = false)
-    private List<Integer> deptList;
+    private List<Long> deptList;
 
-    public List<Integer> getDeptList() {
+    public List<Long> getDeptList() {
         return deptList;
     }
 
-    public void setDeptList(List<Integer> deptList) {
+    public void setDeptList(List<Long> deptList) {
         this.deptList = deptList;
     }
 
@@ -285,7 +285,7 @@ public class SysDept extends BaseEntity
     public SysDept() {
     }
 
-    public SysDept(Long deptId, Long parentId, String ancestors, String deptName, Integer orderNum, String leader, String phone, String email, String status, String delFlag, String parentName, List<SysDept> children, String remarks, String address, String projectContact, String bankAccountName, String bankOfDeposit, String accountNumber, String purchaseServices, List<Integer> deptList) {
+    public SysDept(Long deptId, Long parentId, String ancestors, String deptName, Integer orderNum, String leader, String phone, String email, String status, String delFlag, String parentName, List<SysDept> children, String remarks, String address, String projectContact, String bankAccountName, String bankOfDeposit, String accountNumber, String purchaseServices, List<Long> deptList) {
         this.deptId = deptId;
         this.parentId = parentId;
         this.ancestors = ancestors;

+ 3 - 0
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -1036,14 +1036,17 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
     }
 
     public List<PlanQuarterResponseVo> getListByProjectStatus(String projectStatus) {
+        LoginUser user = SecurityUtils.getLoginUser();
         LambdaQueryWrapper<PlanYears> yearsLp = new LambdaQueryWrapper<PlanYears>();
         yearsLp.eq(PlanYears::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
         yearsLp.eq(PlanYears::getProjectStatus, projectStatus);
+        yearsLp.eq(PlanYears::getPurchaseDeptId, user.getDeptId());
         List<PlanYears> planYears = planYearsMapper.selectList(yearsLp);
 
         LambdaQueryWrapper<PlanQuarter> quarterLp = new LambdaQueryWrapper<PlanQuarter>();
         quarterLp.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
         quarterLp.eq(PlanQuarter::getProjectStatus, projectStatus);
+        yearsLp.eq(PlanYears::getPurchaseDeptId, user.getDeptId());
         List<PlanQuarter> planQuarters = planQuarterMapper.selectList(quarterLp);
         //融合一起
         List<PlanQuarterResponseVo> vos = planComplex(planYears, planQuarters);

+ 1 - 1
purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmDemandReqVo.java

@@ -135,7 +135,7 @@ public class PmDemandReqVo extends PageVo {
     /**
      * 查询全部or指定部门
      */
-    private List<Integer> deptList;
+    private List<Long> deptList;
 
     @ApiModelProperty("回退序号")
     private Integer returnOrderNumber;

+ 7 - 6
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -3770,6 +3770,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public List<PmDemandResVo> getListByStatus(String projectStatus) {
         LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
         lw.eq(PmDemand::getProjectStatus, projectStatus);
+
         List<PmDemand> demandList = this.baseMapper.selectList(lw);
         //数据转换
         List<PmDemandResVo> pmDemandResponseVoList = new ArrayList<>();
@@ -3924,14 +3925,14 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
 
     //查询本单位还是本单位及子孙级----要查询子单位的超额数据
-    public List<Integer> isQueryAll(Integer queryAll) {
-        List<Integer> deptList = new ArrayList<>();
-        Integer deptId = Math.toIntExact(SecurityUtils.getDeptId());
+    public List<Long> isQueryAll(Integer queryAll) {
+        List<Long> deptList = new ArrayList<>();
+        Long deptId = SecurityUtils.getDeptId();
         //查询全部
         if (queryAll.equals(-1)) {
             //获取到子孙级部门id
             if (deptService.hasChildByDeptId(SecurityUtils.getDeptId())) {
-                List<Integer> children = deptService.getDeptChildren(Math.toIntExact(deptId));
+                List<Long> children = deptService.getDeptChildren(deptId);
                 System.err.println(children.size());
                 deptList.addAll(children);
             }
@@ -3954,9 +3955,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         }
         if (deptService.hasChildByDeptId(Long.valueOf(queryZd))) {
             //获取子级部门d
-            List<Integer> childByDeptId = deptService.getChildIdByDeptId(Long.valueOf(queryZd));
+            List<Long> childByDeptId = deptService.getChildIdByDeptId(Long.valueOf(queryZd));
             //取出所有可以进行统计的项目id
-            for (Integer cid : childByDeptId) {
+            for (Long cid : childByDeptId) {
                 LambdaQueryWrapper<PmAuditDeptRef> ll = new LambdaQueryWrapper<>();
                 ll.eq(PmAuditDeptRef::getDeptId, cid);
                 ll.eq(PmAuditDeptRef::getRefType, "2");

+ 1 - 1
purchase-system/src/main/java/com/ozs/system/mapper/SysDeptMapper.java

@@ -66,7 +66,7 @@ public interface SysDeptMapper {
      * @param deptId 部门ID
      * @return 结果
      */
-    public List<Integer> getChildIdByDeptId(Long deptId);
+    public List<Long> getChildIdByDeptId(Long deptId);
 
     /**
      * 查询部门是否存在用户

+ 2 - 2
purchase-system/src/main/java/com/ozs/system/service/ISysDeptService.java

@@ -83,7 +83,7 @@ public interface ISysDeptService {
      * @param deptId 部门ID
      * @return 结果
      */
-    public List<Integer> getChildIdByDeptId(Long deptId);
+    public List<Long> getChildIdByDeptId(Long deptId);
 
     /**
      * 查询部门是否存在用户
@@ -140,7 +140,7 @@ public interface ISysDeptService {
      * @param deptId
      * @return
      */
-    public List<Integer> getDeptChildren(Integer deptId);
+    public List<Long> getDeptChildren(Long deptId);
 
     public SysDept selectById(Long deptId);
 

+ 9 - 18
purchase-system/src/main/java/com/ozs/system/service/impl/SysDeptServiceImpl.java

@@ -64,25 +64,17 @@ public class SysDeptServiceImpl implements ISysDeptService {
     public List<SysDept> selectDeptList(SysDept dept) {
         LoginUser loginUser = SecurityUtils.getLoginUser();
         if (!String.valueOf(loginUser.getUserId()).equals("1")) {
-            List<Integer> deptList = new ArrayList<>();
+            List<Long> deptList = new ArrayList<>();
             //获取到子孙级部门id
-            Integer deptId = Math.toIntExact(loginUser.getDeptId());
+            Long deptId = loginUser.getDeptId();
             if (deptService.hasChildByDeptId(loginUser.getDeptId())) {
-                List<Integer> children = deptService.getDeptChildren(deptId);
+                List<Long> children = deptService.getDeptChildren(deptId);
                 System.err.println(children.size());
                 deptList.addAll(children);
             }
             deptList.add(deptId);
             dept.setDeptList(deptList);
         }
-        if (!ObjectUtils.isEmpty(dept.getDeptList())) {
-            List<Integer> list = dept.getDeptList();
-            System.err.println(list.size());
-            for (Integer integer : list) {
-                System.err.println(integer);
-            }
-
-        }
         return deptMapper.selectDeptList(dept);
     }
 
@@ -200,7 +192,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
      * @return 结果
      */
     @Override
-    public List<Integer> getChildIdByDeptId(Long deptId) {
+    public List<Long> getChildIdByDeptId(Long deptId) {
         return deptMapper.getChildIdByDeptId(deptId);
     }
 
@@ -393,13 +385,12 @@ public class SysDeptServiceImpl implements ISysDeptService {
     }
 
     //获取到子孙级部门id
-    public List<Integer> getDeptChildren(Integer deptId) {
-        List<Integer> deptList = new ArrayList<>();
-        Integer did = deptId;
-        List<Integer> childByDeptId = getChildIdByDeptId(Long.valueOf(did));
-        for (Integer cid : childByDeptId) {
+    public List<Long> getDeptChildren(Long deptId) {
+        List<Long> deptList = new ArrayList<>();
+        List<Long> childByDeptId = getChildIdByDeptId(deptId);
+        for (Long cid : childByDeptId) {
             deptList.add(cid);
-            if (hasChildByDeptId(Long.valueOf(cid))) {
+            if (hasChildByDeptId(cid)) {
                 deptList.addAll(getDeptChildren(cid));
             }
         }