|
@@ -41,9 +41,11 @@ import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
|
import com.ozs.system.mapper.SysDeptMapper;
|
|
|
import com.ozs.system.mapper.SysRoleMapper;
|
|
|
import com.ozs.system.service.*;
|
|
|
+import com.sun.xml.internal.bind.v2.util.CollisionCheckStack;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -1978,18 +1980,6 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
return pmDemandMapper.selectByPlanId(planId);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 采购项目--项目数量分析
|
|
|
- *
|
|
|
- * @param pmDemandReqVo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Map<String, Integer> purchaseProjectNumber(PmDemandReqVo pmDemandReqVo) {
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 项目执行进度统计
|
|
|
* 1、正常推进项目数量:指未完成并且没有逾期的项目
|
|
@@ -2238,7 +2228,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 项目数量分析
|
|
|
+ * 项目数量分析---------年度的同比和环比不展示-----------
|
|
|
*
|
|
|
* @param pmDemandReqVo
|
|
|
* @return
|
|
@@ -2248,7 +2238,6 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
List<Map<String, String>> mapReturn = new ArrayList<>();
|
|
|
// 统计时间类型 1:年度,2:季度,3:月份
|
|
|
if ("1".equals(pmDemandReqVo.getTimeType())) {
|
|
|
- // *** 年度的同比和环比不展示 *** //
|
|
|
// 查询数据库中最小的年份
|
|
|
int minYear = pmDemandMapper.selectMinYear();
|
|
|
// 获取当前年份
|
|
@@ -2276,7 +2265,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
// 当前年份季度统计
|
|
|
// 获取统计数据
|
|
|
List<Map<String, String>> listMap = pmDemandMapper.purchaseProjectNumberAnalysisQuarter(pmDemandReqVo);
|
|
|
- mapReturn.addAll(listMap);
|
|
|
+ List<Map<String, String>> mapList = new ArrayList<>();
|
|
|
+ mapList.addAll(listMap);
|
|
|
for (int i = 1; i <= 4; i++) {
|
|
|
boolean isYear = false;
|
|
|
for (Map<String, String> map : listMap) {
|
|
@@ -2288,9 +2278,186 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
Map<String, String> map1 = new HashMap<>();
|
|
|
map1.put("yy", i + "");
|
|
|
map1.put("countNum", 0 + "");
|
|
|
- mapReturn.add(map1);
|
|
|
+ map1.put("evaluationSum", 0 + "");
|
|
|
+ mapList.add(map1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map<String, String> map1 = new HashMap<>();
|
|
|
+ Map<String, String> map2 = new HashMap<>();
|
|
|
+ Map<String, String> map3 = new HashMap<>();
|
|
|
+ Map<String, String> map4 = new HashMap<>();
|
|
|
+ for (Map<String, String> map : mapList) {
|
|
|
+ String yy = String.valueOf(map.get("yy"));
|
|
|
+ if ("1".equals(yy)) {
|
|
|
+ map1.putAll(map);
|
|
|
+ } else if ("2".equals(yy)) {
|
|
|
+ map2.putAll(map);
|
|
|
+ } else if ("3".equals(yy)) {
|
|
|
+ map3.putAll(map);
|
|
|
+ } else if ("4".equals(yy)) {
|
|
|
+ map4.putAll(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String countNum1 = String.valueOf(map1.get("countNum"));
|
|
|
+ String countNum2 = String.valueOf(map2.get("countNum"));
|
|
|
+ String countNum3 = String.valueOf(map3.get("countNum"));
|
|
|
+ String countNum4 = String.valueOf(map4.get("countNum"));
|
|
|
+
|
|
|
+ String evaluationSum1 = String.valueOf(map1.get("evaluationSum"));
|
|
|
+ String evaluationSum2 = String.valueOf(map2.get("evaluationSum"));
|
|
|
+ String evaluationSum3 = String.valueOf(map3.get("evaluationSum"));
|
|
|
+ String evaluationSum4 = String.valueOf(map4.get("evaluationSum"));
|
|
|
+ // 查询上一年四季度数据
|
|
|
+ List<Map<String, String>> listMapOldYear = pmDemandMapper.purchaseProjectNumberAnalysisOldYearQuarter(pmDemandReqVo);
|
|
|
+ List<Map<String, String>> mapListOld = new ArrayList<>();
|
|
|
+ mapListOld.addAll(listMapOldYear);
|
|
|
+ for (int i = 1; i <= 4; i++) {
|
|
|
+ boolean isYear = false;
|
|
|
+ for (Map<String, String> map : listMapOldYear) {
|
|
|
+ if (i == Integer.parseInt(String.valueOf(map.get("yy")))) {
|
|
|
+ isYear = true;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ if (!isYear) {
|
|
|
+ Map<String, String> map11 = new HashMap<>();
|
|
|
+ map11.put("yy", i + "");
|
|
|
+ map11.put("countNum", 0 + "");
|
|
|
+ map11.put("evaluationSum", 0 + "");
|
|
|
+ mapListOld.add(map11);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Map<String, String> mapOld1 = new HashMap<>();
|
|
|
+ Map<String, String> mapOld2 = new HashMap<>();
|
|
|
+ Map<String, String> mapOld3 = new HashMap<>();
|
|
|
+ Map<String, String> mapOld4 = new HashMap<>();
|
|
|
+ for (Map<String, String> mapOld : mapListOld) {
|
|
|
+ String yy = String.valueOf(mapOld.get("yy"));
|
|
|
+ if ("1".equals(yy)) {
|
|
|
+ mapOld1.putAll(mapOld);
|
|
|
+ } else if ("2".equals(yy)) {
|
|
|
+ mapOld2.putAll(mapOld);
|
|
|
+ } else if ("3".equals(yy)) {
|
|
|
+ mapOld3.putAll(mapOld);
|
|
|
+ } else if ("4".equals(yy)) {
|
|
|
+ mapOld4.putAll(mapOld);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String countNumOld1 = String.valueOf(mapOld1.get("countNum"));
|
|
|
+ String countNumOld2 = String.valueOf(mapOld2.get("countNum"));
|
|
|
+ String countNumOld3 = String.valueOf(mapOld3.get("countNum"));
|
|
|
+ String countNumOld4 = String.valueOf(mapOld4.get("countNum"));
|
|
|
+ String evaluationSumOld1 = String.valueOf(mapOld1.get("evaluationSum"));
|
|
|
+ String evaluationSumOld2 = String.valueOf(mapOld2.get("evaluationSum"));
|
|
|
+ String evaluationSumOld3 = String.valueOf(mapOld3.get("evaluationSum"));
|
|
|
+ String evaluationSumOld4 = String.valueOf(mapOld4.get("evaluationSum"));
|
|
|
+
|
|
|
+ BigDecimal countNum11 = new BigDecimal(countNum1);
|
|
|
+ BigDecimal countNum22 = new BigDecimal(countNum2);
|
|
|
+ BigDecimal countNum33 = new BigDecimal(countNum3);
|
|
|
+ BigDecimal countNum44 = new BigDecimal(countNum4);
|
|
|
+ BigDecimal countNumOld11 = new BigDecimal(countNumOld1);
|
|
|
+ BigDecimal countNumOld22 = new BigDecimal(countNumOld2);
|
|
|
+ BigDecimal countNumOld33 = new BigDecimal(countNumOld3);
|
|
|
+ BigDecimal countNumOld44 = new BigDecimal(countNumOld4);
|
|
|
+
|
|
|
+ BigDecimal evaluationSum11 = new BigDecimal(evaluationSum1);
|
|
|
+ BigDecimal evaluationSum22 = new BigDecimal(evaluationSum2);
|
|
|
+ BigDecimal evaluationSum33 = new BigDecimal(evaluationSum3);
|
|
|
+ BigDecimal evaluationSum44 = new BigDecimal(evaluationSum4);
|
|
|
+ BigDecimal evaluationSumOld11 = new BigDecimal(evaluationSumOld1);
|
|
|
+ BigDecimal evaluationSumOld22 = new BigDecimal(evaluationSumOld2);
|
|
|
+ BigDecimal evaluationSumOld33 = new BigDecimal(evaluationSumOld3);
|
|
|
+ BigDecimal evaluationSumOld44 = new BigDecimal(evaluationSumOld4);
|
|
|
+
|
|
|
+ // 项目数量环比 对比
|
|
|
+ BigDecimal monthonmonthNum1 = new BigDecimal(0.00);
|
|
|
+ BigDecimal monthonmonthNum2 = new BigDecimal(0.00);
|
|
|
+ BigDecimal monthonmonthNum3 = new BigDecimal(0.00);
|
|
|
+ BigDecimal monthonmonthNum4 = new BigDecimal(0.00);
|
|
|
+ if (!"0".equals(countNumOld4)) {
|
|
|
+ monthonmonthNum1 = (countNum11.subtract(countNumOld44)).divide(countNumOld44).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(countNum1)) {
|
|
|
+ monthonmonthNum2 = (countNum22.subtract(countNum11)).divide(countNum11).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(countNum2)) {
|
|
|
+ monthonmonthNum3 = (countNum33.subtract(countNum22)).divide(countNum22).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(countNum3)) {
|
|
|
+ monthonmonthNum4 = (countNum44.subtract(countNum33)).divide(countNum33).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ map1.put("monthonmonthNum", monthonmonthNum1.toString());
|
|
|
+ map2.put("monthonmonthNum", monthonmonthNum2.toString());
|
|
|
+ map3.put("monthonmonthNum", monthonmonthNum3.toString());
|
|
|
+ map4.put("monthonmonthNum", monthonmonthNum4.toString());
|
|
|
+ // 项目数量同比 对比
|
|
|
+ BigDecimal yearonyearNum1 = new BigDecimal(0.00);
|
|
|
+ BigDecimal yearonyearNum2 = new BigDecimal(0.00);
|
|
|
+ BigDecimal yearonyearNum3 = new BigDecimal(0.00);
|
|
|
+ BigDecimal yearonyearNum4 = new BigDecimal(0.00);
|
|
|
+ if (!"0".equals(countNumOld1)) {
|
|
|
+ yearonyearNum1 = (countNum11.subtract(countNumOld11)).divide(countNumOld11).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(countNumOld2)) {
|
|
|
+ yearonyearNum2 = (countNum22.subtract(countNumOld22)).divide(countNumOld22).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(countNumOld3)) {
|
|
|
+ yearonyearNum3 = (countNum33.subtract(countNumOld33)).divide(countNumOld33).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(countNumOld4)) {
|
|
|
+ yearonyearNum4 = (countNum44.subtract(countNumOld44)).divide(countNumOld44).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ map1.put("yearonyearNum", yearonyearNum1.toString());
|
|
|
+ map2.put("yearonyearNum", yearonyearNum2.toString());
|
|
|
+ map3.put("yearonyearNum", yearonyearNum3.toString());
|
|
|
+ map4.put("yearonyearNum", yearonyearNum4.toString());
|
|
|
+ // 预算金额环比 对比
|
|
|
+ BigDecimal monthonmonthAmount1 = new BigDecimal(0.00);
|
|
|
+ BigDecimal monthonmonthAmount2 = new BigDecimal(0.00);
|
|
|
+ BigDecimal monthonmonthAmount3 = new BigDecimal(0.00);
|
|
|
+ BigDecimal monthonmonthAmount4 = new BigDecimal(0.00);
|
|
|
+ if (!"0".equals(evaluationSumOld4)) {
|
|
|
+ monthonmonthAmount1 = (evaluationSum11.subtract(evaluationSumOld44)).divide(evaluationSumOld44).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(evaluationSum1)) {
|
|
|
+ monthonmonthAmount2 = (evaluationSum22.subtract(evaluationSum11)).divide(evaluationSum11).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(evaluationSum2)) {
|
|
|
+ monthonmonthAmount3 = (evaluationSum33.subtract(evaluationSum22)).divide(evaluationSum22).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(evaluationSum3)) {
|
|
|
+ monthonmonthAmount4 = (evaluationSum44.subtract(evaluationSum33)).divide(evaluationSum33).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ map1.put("monthonmonthAmount", monthonmonthAmount1.toString());
|
|
|
+ map2.put("monthonmonthAmount", monthonmonthAmount2.toString());
|
|
|
+ map3.put("monthonmonthAmount", monthonmonthAmount3.toString());
|
|
|
+ map4.put("monthonmonthAmount", monthonmonthAmount4.toString());
|
|
|
+ // 预算金额同比比 对比
|
|
|
+ BigDecimal yearonyearAmount1 = new BigDecimal(0.00);
|
|
|
+ BigDecimal yearonyearAmount2 = new BigDecimal(0.00);
|
|
|
+ BigDecimal yearonyearAmount3 = new BigDecimal(0.00);
|
|
|
+ BigDecimal yearonyearAmount4 = new BigDecimal(0.00);
|
|
|
+ if (!"0".equals(evaluationSumOld1)) {
|
|
|
+ yearonyearAmount1 = (evaluationSum11.subtract(evaluationSumOld11)).divide(evaluationSumOld11).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(evaluationSumOld2)) {
|
|
|
+ yearonyearAmount2 = (evaluationSum22.subtract(evaluationSumOld22)).divide(evaluationSumOld22).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(evaluationSumOld3)) {
|
|
|
+ yearonyearAmount3 = (evaluationSum33.subtract(evaluationSumOld33)).divide(evaluationSumOld33).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ if (!"0".equals(evaluationSumOld4)) {
|
|
|
+ yearonyearAmount4 = (evaluationSum44.subtract(evaluationSumOld44)).divide(evaluationSumOld44).multiply(new BigDecimal("100"));
|
|
|
+ }
|
|
|
+ map1.put("yearonyearAmount", yearonyearAmount1.toString());
|
|
|
+ map2.put("yearonyearAmount", yearonyearAmount2.toString());
|
|
|
+ map3.put("yearonyearAmount", yearonyearAmount3.toString());
|
|
|
+ map4.put("yearonyearAmount", yearonyearAmount4.toString());
|
|
|
+ // 存入集合
|
|
|
+ mapReturn.add(map1);
|
|
|
+ mapReturn.add(map2);
|
|
|
+ mapReturn.add(map3);
|
|
|
+ mapReturn.add(map4);
|
|
|
} else if ("3".equals(pmDemandReqVo.getTimeType())) {
|
|
|
// 当前年份月份统计
|
|
|
// 获取统计数据
|
|
@@ -2314,6 +2481,16 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
return mapReturn;
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
+ BigDecimal aa = new BigDecimal(14.00);
|
|
|
+ BigDecimal bb = new BigDecimal(0.00);
|
|
|
+ BigDecimal monthonmonthNum111 = (aa.subtract(bb)).divide(bb).multiply(new BigDecimal(100));
|
|
|
+ // BigDecimal monthonmonthNum1 = (aa.subtract(bb)).divide(bb).multiply(new BigDecimal(100));
|
|
|
+ // monthonmonthNum1 = (countNum11.subtract(countNumOld44)).divide(countNumOld44).multiply(new BigDecimal("100"));
|
|
|
+
|
|
|
+ BigDecimal mm = monthonmonthNum111;
|
|
|
+ }
|
|
|
+
|
|
|
//查询不同状态下的项目数据
|
|
|
public List<PmDemandResVo> getListByStatus(String projectStatus) {
|
|
|
LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
|