|
@@ -21,6 +21,7 @@ import thyyxxk.webserver.entity.highreport.TableGroupInfo;
|
|
|
import thyyxxk.webserver.entity.highreport.ZbReportCycle;
|
|
|
import thyyxxk.webserver.entity.highreport.ZbReportCycleScore;
|
|
|
import thyyxxk.webserver.entity.highreport.ZbReportResult;
|
|
|
+import thyyxxk.webserver.entity.highreport.ZbReportScoreDto;
|
|
|
import thyyxxk.webserver.entity.highreport.ZdReportType;
|
|
|
import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
import thyyxxk.webserver.entity.targetmanagement.TargetDictTree;
|
|
@@ -985,4 +986,121 @@ public class TargetManagementService {
|
|
|
return ResultVoUtil.success(resultMap);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description 查询指标得分情况
|
|
|
+ * @Author hsh
|
|
|
+ * @param dto 指标信息
|
|
|
+ * @return list
|
|
|
+ * @Date 2024/8/27 16:12
|
|
|
+ */
|
|
|
+ public ResultVo<List<Map<String, Object>>> selectTargetDictScoreById(ZbReportScoreDto dto){
|
|
|
+ String pid = dto.getPid();
|
|
|
+ String reportCycle = dto.getReportCycle();
|
|
|
+ if(StringUtil.isBlank(pid) || StringUtil.isBlank(reportCycle)){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标pid或年度周期信息不全,请检查!");
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> list = scoreDao.selectTargetDictScoreByPid(pid, reportCycle);
|
|
|
+ // 根据pid以及时间查询报表结果
|
|
|
+ List<ZbReportResult> resultList = reportDao.selectReportResultByPid(pid, dto.getStartTime(), dto.getEndTime());
|
|
|
+ Map<String, List<ZbReportResult>> resultMap = resultList.stream().collect(Collectors.groupingBy(ZbReportResult::getId, Collectors.toList()));
|
|
|
+
|
|
|
+ for (Map<String, Object> map : list){
|
|
|
+ String id = String.valueOf(map.get("id"));
|
|
|
+ List<ZbReportResult> results = resultMap.get(id);
|
|
|
+ if(null != results && !results.isEmpty()){
|
|
|
+ for(ZbReportResult r : results){
|
|
|
+ map.put("t_" + r.getYear(), r.getCalcResult());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ String s = dto.getStartTime();
|
|
|
+ int year = Integer.parseInt(s);
|
|
|
+ for(int j = 0; j < 4; j++){
|
|
|
+ int f = year + j;
|
|
|
+ map.put("t_" + f, "");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description 根据指标年度周期查询指标章节总分以及得分
|
|
|
+ * @Author hsh
|
|
|
+ * @param dto 指标年度周期
|
|
|
+ * @return list
|
|
|
+ * @Date 2024/8/30 8:58
|
|
|
+ */
|
|
|
+ public ResultVo<Map<String, Object>> selectTargetTotalScoreInfo(ZbReportScoreDto dto){
|
|
|
+ String reportCycle = dto.getReportCycle();
|
|
|
+ if(StringUtil.isBlank(reportCycle)){
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有年度周期,请检查!");
|
|
|
+ }
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ // 查询第二级指标(pid是B)
|
|
|
+ List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
+ List<ZbZdBaseInfo> ls = zbZdDao.selectTargetDictScoreBySecond("B");
|
|
|
+ // 拼接总分
|
|
|
+ Map<String, Object> m1 = new HashMap<>();
|
|
|
+ // 拼接名字
|
|
|
+ List<Map<String, Object>> mc = new ArrayList<>();
|
|
|
+ m1.put("name", "总分");
|
|
|
+ List<BigDecimal> zf = new ArrayList<>();
|
|
|
+ for (ZbZdBaseInfo zb : ls){
|
|
|
+ Map<String, Object> m2 = new HashMap<>();
|
|
|
+ zf.add(zb.getScore());
|
|
|
+ m2.put(zb.getId(), zb.getName());
|
|
|
+ mc.add(m2);
|
|
|
+ }
|
|
|
+ m1.put("data", zf);
|
|
|
+ resultList.add(m1);
|
|
|
+ resultMap.put("mc", mc);
|
|
|
+ // 查询得分
|
|
|
+ List<ZbReportCycleScore> list = scoreDao.selectTargetDictScoreByReportCycle(reportCycle);
|
|
|
+ if(null == list || list.isEmpty()){
|
|
|
+ // 没有得分就只显示总分
|
|
|
+ Map<String, Object> m3 = new HashMap<>();
|
|
|
+ m3.put("name", "得分");
|
|
|
+ m3.put("data", new int[]{0, 0, 0, 0, 0});
|
|
|
+ resultList.add(m3);
|
|
|
+ resultMap.put("infoData", resultList);
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ }
|
|
|
+ BigDecimal B1 = BigDecimal.ZERO;
|
|
|
+ BigDecimal B2 = BigDecimal.ZERO;
|
|
|
+ BigDecimal B3 = BigDecimal.ZERO;
|
|
|
+ BigDecimal B4 = BigDecimal.ZERO;
|
|
|
+ BigDecimal B5 = BigDecimal.ZERO;
|
|
|
+ for (ZbReportCycleScore score : list){
|
|
|
+ String pid = score.getPid();
|
|
|
+ String s = score.getReportScore();
|
|
|
+ if(StringUtil.isBlank(s)){
|
|
|
+ s = "0";
|
|
|
+ }
|
|
|
+ if(pid.startsWith("B1")){
|
|
|
+ B1 = DecimalUtil.add(B1, new BigDecimal(s));
|
|
|
+ } else if(pid.startsWith("B2")){
|
|
|
+ B2 = DecimalUtil.add(B2, new BigDecimal(s));
|
|
|
+ } else if(pid.startsWith("B3")){
|
|
|
+ B3 = DecimalUtil.add(B3, new BigDecimal(s));
|
|
|
+ } else if(pid.startsWith("B4")){
|
|
|
+ B4 = DecimalUtil.add(B4, new BigDecimal(s));
|
|
|
+ } else if(pid.startsWith("B5")){
|
|
|
+ B5 = DecimalUtil.add(B5, new BigDecimal(s));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 拼接得分
|
|
|
+ Map<String, Object> m3 = new HashMap<>();
|
|
|
+ m3.put("name", "得分");
|
|
|
+ List<BigDecimal> df = new ArrayList<>();
|
|
|
+ df.add(B1);
|
|
|
+ df.add(B2);
|
|
|
+ df.add(B3);
|
|
|
+ df.add(B4);
|
|
|
+ df.add(B5);
|
|
|
+ m3.put("data", df);
|
|
|
+ resultList.add(m3);
|
|
|
+ resultMap.put("infoData", resultList);
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
}
|