Ver código fonte

统计属性

buzhanyi 2 anos atrás
pai
commit
add6f712b6

+ 23 - 5
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -1918,9 +1918,20 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         List<StatisticalChartsResVo> resVos = pmDemandMapper.countByProjectAttr(pmDemandReqVo);
         for (StatisticalChartsResVo chartsResVo : resVos) {
             for (ProjectAttribute value : ProjectAttribute.values()) {
-                if (value.getCode().equals(chartsResVo.getColumnName())) {
-                    chartsResVo.setColumnName(value.getInfo());
-                    break;
+                //项目属性为value拼接
+                if (chartsResVo.getColumnName().length() > 1) {
+                    String[] split = chartsResVo.getColumnName().split(",");
+                    for (String s : split) {
+                        if (s.equals(value.getCode())) {
+                            chartsResVo.setColumnName(value.getInfo());
+                            chartsResVo.setNum(chartsResVo.getNum() + 1);
+                        }
+                    }
+                    //planYear.setProjectAttrName(builder.toString());
+                } else {
+                    if (value.getCode().equals(chartsResVo.getColumnName())) {
+                        chartsResVo.setColumnName(value.getInfo());
+                    }
                 }
             }
         }
@@ -3848,7 +3859,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return decimalFormat.format(d1 / d2);
     }
 
-    //查询本单位还是本单位及子孙级
+    //查询本单位还是本单位及子孙级----要查询子单位的超额数据
     public List<Integer> isQueryAll(Integer queryAll) {
         List<Integer> deptList = new ArrayList<>();
         Long deptId = SecurityUtils.getDeptId();
@@ -3863,8 +3874,15 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             deptList.add(Math.toIntExact(deptId));
             //指定部门
         } else {
-            deptList.add(Math.toIntExact(deptId));
+            //deptList.add(Math.toIntExact(deptId));
             deptList.add(queryAll);
+            //if (deptService.hasChildByDeptId(deptId)) {
+            //    //获取子级部门
+            //    List<Long> childByDeptId = deptService.getChildIdByDeptId(deptId);
+            //    for (Long cid : childByDeptId) {
+            //
+            //    }
+            //}
         }
         return deptList;
     }