Showing
10 changed files
with
629 additions
and
16 deletions
| 1 | 1 | package com.qgutech.qgyun.apaas.sync.cps.controller; |
| 2 | 2 | |
| 3 | +import com.qgutech.qgyun.apaas.sync.cps.dto.AbImprovementDeptSummaryDTO; | |
| 3 | 4 | import com.qgutech.qgyun.apaas.sync.cps.dto.AbImprovementSummaryDTO; |
| 4 | 5 | import com.qgutech.qgyun.apaas.sync.cps.model.AbImprovement; |
| 5 | 6 | import com.qgutech.qgyun.apaas.sync.cps.service.AbImprovementService; |
| ... | ... | @@ -48,4 +49,20 @@ public class AbImprovementController { |
| 48 | 49 | List<AbImprovementSummaryDTO> summaryList = abImprovementService.summaryByYear(year); |
| 49 | 50 | return new JsonResult<>(true, "成功", summaryList); |
| 50 | 51 | } |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 根据单位和年份查询AB类改善汇总(按申请部门分组) | |
| 55 | + * <p> | |
| 56 | + * 年份为空时默认查询当前年 | |
| 57 | + * | |
| 58 | + * @param dwxx 单位(组织架构ID),不可为空 | |
| 59 | + * @param year 年份,格式:yyyy,可为空 | |
| 60 | + * @return AB类改善按申请部门汇总列表 | |
| 61 | + */ | |
| 62 | + @GetMapping("/summary/dept") | |
| 63 | + public JsonResult summaryByDept(@RequestParam String dwxx, | |
| 64 | + @RequestParam(required = false) String year) { | |
| 65 | + List<AbImprovementDeptSummaryDTO> summaryList = abImprovementService.summaryByDept(dwxx, year); | |
| 66 | + return new JsonResult<>(true, "成功", summaryList); | |
| 67 | + } | |
| 51 | 68 | } | ... | ... |
| ... | ... | @@ -53,6 +53,24 @@ public class CImprovementController { |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | + * 根据年份、季度和单位车间id查询C类改善发起率汇总(按室组分组) | |
| 57 | + * <p> | |
| 58 | + * 统计指定单位车间下各室组的C类改善信息;年份为空时默认查询当前年,季度、单位车间id必传 | |
| 59 | + * | |
| 60 | + * @param year 年份,格式:yyyy,可为空 | |
| 61 | + * @param quarter 季度枚举值(#1#-#4#),必传 | |
| 62 | + * @param dwcj 单位车间id,必传 | |
| 63 | + * @return 室组C类改善发起率信息列表(含目标值) | |
| 64 | + */ | |
| 65 | + @GetMapping("/summary/workshop") | |
| 66 | + public JsonResult summaryByWorkshop(@RequestParam(required = false) String year, | |
| 67 | + @RequestParam String quarter, | |
| 68 | + @RequestParam String dwcj) { | |
| 69 | + List<CImprovementSummaryDTO> summaryList = cImprovementService.summaryByYearQuarterAndWorkshop(year, quarter, dwcj); | |
| 70 | + return new JsonResult<>(true, "成功", summaryList); | |
| 71 | + } | |
| 72 | + | |
| 73 | + /** | |
| 56 | 74 | * 根据年份、季度、单位车间id查询C类改善记录详情列表 |
| 57 | 75 | * <p> |
| 58 | 76 | * 查询该年份季度时间范围内、由该单位车间下人员发起的C类改善记录, | ... | ... |
| 1 | 1 | package com.qgutech.qgyun.apaas.sync.cps.controller; |
| 2 | 2 | |
| 3 | 3 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecDetailDTO; |
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.dto.CpsProblemDetailDTO; | |
| 4 | 5 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecSummaryDTO; |
| 5 | 6 | import com.qgutech.qgyun.apaas.sync.cps.model.ProcessConfirmExec; |
| 6 | 7 | import com.qgutech.qgyun.apaas.sync.cps.service.ProcessConfirmExecService; |
| ... | ... | @@ -80,4 +81,26 @@ public class ProcessConfirmExecController { |
| 80 | 81 | processConfirmExecService.listDetailByCondition(startTime, endTime, dw, rylb, zt); |
| 81 | 82 | return new JsonResult<>(true, "成功", detailList); |
| 82 | 83 | } |
| 84 | + | |
| 85 | + /** | |
| 86 | + * 根据条件查询过程确认执行记录对应发现的问题记录明细列表(CPS问题记录) | |
| 87 | + * <p> | |
| 88 | + * 入参同 /list/detail,但去掉状态(zt)参数;返回这些执行记录来源的CPS问题记录明细; | |
| 89 | + * 所有参数均非必填,开始时间为空时默认使用当前月 1 号,结束时间为空时默认使用当前日期前一天 | |
| 90 | + * | |
| 91 | + * @param startTime 开始时间,格式:yyyy-MM-dd [HH:mm:ss],可为空(默认当前月 1 号 00:00:00) | |
| 92 | + * @param endTime 结束时间,格式:yyyy-MM-dd [HH:mm:ss],可为空(默认当前日期前一天 23:59:59) | |
| 93 | + * @param dw 单位id,可为空 | |
| 94 | + * @param rylb 人员类别编号(#1#-#7#,兼容 1 ~ 7),可为空 | |
| 95 | + * @return CPS问题记录明细列表 | |
| 96 | + */ | |
| 97 | + @GetMapping("/list/problem") | |
| 98 | + public JsonResult listProblemDetailByCondition(@RequestParam(required = false) String startTime, | |
| 99 | + @RequestParam(required = false) String endTime, | |
| 100 | + @RequestParam(required = false) String dw, | |
| 101 | + @RequestParam(required = false) String rylb) { | |
| 102 | + List<CpsProblemDetailDTO> problemList = | |
| 103 | + processConfirmExecService.listProblemDetailByCondition(startTime, endTime, dw, rylb); | |
| 104 | + return new JsonResult<>(true, "成功", problemList); | |
| 105 | + } | |
| 83 | 106 | } | ... | ... |
| ... | ... | @@ -6,6 +6,7 @@ import com.qgutech.qgyun.apaas.sync.utils.DateDealUtils; |
| 6 | 6 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 7 | 7 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 8 | 8 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 9 | +import com.qgutech.qgyun.apaas.sync.cps.dto.AbImprovementDeptSummaryDTO; | |
| 9 | 10 | import com.qgutech.qgyun.apaas.sync.cps.dto.AbImprovementSummaryDTO; |
| 10 | 11 | import com.qgutech.qgyun.apaas.sync.cps.mapper.AbImprovementMapper; |
| 11 | 12 | import com.qgutech.qgyun.apaas.sync.cps.model.AbImprovement; |
| ... | ... | @@ -171,4 +172,104 @@ public class AbImprovementService extends BaseServiceImpl<AbImprovement> { |
| 171 | 172 | Comparator.nullsLast(Comparator.naturalOrder()))); |
| 172 | 173 | return resultList; |
| 173 | 174 | } |
| 175 | + | |
| 176 | + /** | |
| 177 | + * 根据单位和年份查询AB类改善汇总(按申请部门分组) | |
| 178 | + * <p> | |
| 179 | + * 查询指定年份开始结束时间范围内、指定单位下的所有记录,再按申请部门分组统计各部门汇总信息, | |
| 180 | + * 并查询部门目标信息统一返回。年份为空时默认查询当前年。 | |
| 181 | + * | |
| 182 | + * @param dwxx 单位(组织架构ID),不可为空 | |
| 183 | + * @param year 年份,格式:yyyy,可为空 | |
| 184 | + * @return AB类改善按申请部门汇总列表 | |
| 185 | + */ | |
| 186 | + @Transactional(readOnly = true) | |
| 187 | + public List<AbImprovementDeptSummaryDTO> summaryByDept(String dwxx, String year) { | |
| 188 | + // 1. 校验单位参数 | |
| 189 | + Assert.isTrue(StringUtils.isNotBlank(dwxx), "dwxx is empty!"); | |
| 190 | + | |
| 191 | + // 2. 处理年份参数,为空时默认为当前年 | |
| 192 | + String queryYear = StringUtils.isBlank(year) ? String.valueOf(Calendar.getInstance().get(Calendar.YEAR)) : year; | |
| 193 | + Assert.isTrue(queryYear.matches("\\d{4}"), "year format must be yyyy!"); | |
| 194 | + | |
| 195 | + // 3. 计算年份的开始时间和结束时间 | |
| 196 | + Date startTime = DateDealUtils.parseYearStartTime(queryYear); | |
| 197 | + Date endTime = DateDealUtils.parseYearEndTime(queryYear); | |
| 198 | + | |
| 199 | + // 4. 查询该年份、该单位下的所有AB类改善记录 | |
| 200 | + Example example = new Example(AbImprovement.class); | |
| 201 | + CorpExample.criteria(example) | |
| 202 | + .andEqualTo(AbImprovement.DWXX, dwxx) | |
| 203 | + .andBetween(AbImprovement.CREATED_AT, startTime, endTime); | |
| 204 | + List<AbImprovement> abImprovementList = abImprovementMapper.selectByExample(example); | |
| 205 | + | |
| 206 | + if (CollectionUtils.isEmpty(abImprovementList)) { | |
| 207 | + return new ArrayList<>(0); | |
| 208 | + } | |
| 209 | + | |
| 210 | + // 5. 按申请部门分组,汇总节约价值(qnjyjz为空按0计入,避免丢失部门) | |
| 211 | + Map<String, Double> sqbmSummaryMap = abImprovementList.stream() | |
| 212 | + .filter(item -> item.getSqbm() != null) | |
| 213 | + .collect(Collectors.groupingBy( | |
| 214 | + AbImprovement::getSqbm, | |
| 215 | + Collectors.summingDouble(item -> item.getQnjyjz() == null ? 0.0D : item.getQnjyjz()) | |
| 216 | + )); | |
| 217 | + | |
| 218 | + if (sqbmSummaryMap.isEmpty()) { | |
| 219 | + return new ArrayList<>(0); | |
| 220 | + } | |
| 221 | + | |
| 222 | + // 6. 查询该年份的AB类目标信息,构建目标值映射Map:dwxx -> mb | |
| 223 | + List<AbImprovementTarget> targetList = abImprovementTargetService.listByYear(queryYear); | |
| 224 | + Map<String, Double> targetMap = new HashMap<>(); | |
| 225 | + if (CollectionUtils.isNotEmpty(targetList)) { | |
| 226 | + targetMap = targetList.stream() | |
| 227 | + .filter(item -> item.getDwxx() != null && item.getMb() != null) | |
| 228 | + .collect(Collectors.toMap( | |
| 229 | + AbImprovementTarget::getDwxx, | |
| 230 | + AbImprovementTarget::getMb, | |
| 231 | + (v1, v2) -> v1 | |
| 232 | + )); | |
| 233 | + } | |
| 234 | + | |
| 235 | + // 7. 根据分组得到的申请部门id集合,查询部门详细信息 | |
| 236 | + Set<String> sqbmIds = sqbmSummaryMap.keySet(); | |
| 237 | + Map<String, UcOrg> ucOrgMap = ucOrgService.mapByIds(sqbmIds); | |
| 238 | + | |
| 239 | + // 查询单位名称(用于回填每条汇总记录的单位名称) | |
| 240 | + Map<String, UcOrg> dwOrgMap = ucOrgService.mapByIds(Collections.singleton(dwxx)); | |
| 241 | + UcOrg dwOrg = dwOrgMap.get(dwxx); | |
| 242 | + String dwxxName = dwOrg == null ? null : dwOrg.getName(); | |
| 243 | + | |
| 244 | + // 8. 组装汇总结果(每个申请部门一条记录) | |
| 245 | + Map<String, Double> finalTargetMap = targetMap; | |
| 246 | + List<AbImprovementDeptSummaryDTO> resultList = sqbmSummaryMap.entrySet().stream() | |
| 247 | + .map(entry -> { | |
| 248 | + String sqbmId = entry.getKey(); | |
| 249 | + AbImprovementDeptSummaryDTO dto = new AbImprovementDeptSummaryDTO(); | |
| 250 | + dto.setDwxx(dwxx); | |
| 251 | + dto.setDwxxName(dwxxName); | |
| 252 | + dto.setSqbm(sqbmId); | |
| 253 | + dto.setYear(queryYear); | |
| 254 | + dto.setTotalQnjyjz(entry.getValue()); | |
| 255 | + dto.setMb(finalTargetMap.get(sqbmId)); | |
| 256 | + // 设置申请部门名称、部门编号 | |
| 257 | + UcOrg ucOrg = ucOrgMap.get(sqbmId); | |
| 258 | + if (ucOrg != null) { | |
| 259 | + dto.setSqbmName(ucOrg.getName()); | |
| 260 | + dto.setSqbmCode(ucOrg.getCode()); | |
| 261 | + } | |
| 262 | + // 计算完成率 | |
| 263 | + if (dto.getMb() != null && dto.getMb() > 0) { | |
| 264 | + dto.setCompletionRate(Math.round(entry.getValue() / dto.getMb() * 10000) / 100.0); | |
| 265 | + } | |
| 266 | + return dto; | |
| 267 | + }) | |
| 268 | + .collect(Collectors.toList()); | |
| 269 | + | |
| 270 | + // 9. 按申请部门编号升序排序,编号为空的排在最后 | |
| 271 | + resultList.sort(Comparator.comparing(AbImprovementDeptSummaryDTO::getSqbmCode, | |
| 272 | + Comparator.nullsLast(Comparator.naturalOrder()))); | |
| 273 | + return resultList; | |
| 274 | + } | |
| 174 | 275 | } | ... | ... |
| ... | ... | @@ -116,13 +116,14 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * 根据年份和季度查询C类改善汇总(按室组维度分组) | |
| 119 | + * 根据年份和季度查询C类改善汇总(按单位车间维度分组) | |
| 120 | 120 | * <p> |
| 121 | - * 年份为空时默认查询当前年,季度必传;返回列表按室组编号升序排序 | |
| 121 | + * 年份为空时默认查询当前年,季度必传;以单位车间(季度人员所在单位 shdw,对应单位车间信息)为分组维度, | |
| 122 | + * 统计各单位车间下总人数、有C类改善记录人数及发起率;返回列表按单位车间编号升序排序 | |
| 122 | 123 | * |
| 123 | 124 | * @param year 年份,格式:yyyy,可为空 |
| 124 | 125 | * @param quarter 季度枚举值(#1#-#4#),必传 |
| 125 | - * @return C类改善汇总列表(按室组编号升序) | |
| 126 | + * @return C类改善汇总列表(按单位车间维度,单位车间编号升序) | |
| 126 | 127 | */ |
| 127 | 128 | @Transactional(readOnly = true) |
| 128 | 129 | public List<CImprovementSummaryDTO> summaryByYearAndQuarter(String year, String quarter) { |
| ... | ... | @@ -161,6 +162,138 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { |
| 161 | 162 | (v1, v2) -> v1 |
| 162 | 163 | )); |
| 163 | 164 | |
| 165 | + // 7. 按单位车间(shdw)分组统计总人数 | |
| 166 | + Map<String, Long> workshopPersonnelCountMap = quarterPersonnelList.stream() | |
| 167 | + .filter(item -> item.getShdw() != null) | |
| 168 | + .collect(Collectors.groupingBy( | |
| 169 | + QuarterPersonnel::getShdw, | |
| 170 | + Collectors.counting() | |
| 171 | + )); | |
| 172 | + | |
| 173 | + // 8. 统计每个单位车间有C类改善记录的人数(同一人多条记录算一次) | |
| 174 | + Set<String> improvementFqrSet = CollectionUtils.isEmpty(cImprovementList) ? Collections.emptySet() | |
| 175 | + : cImprovementList.stream() | |
| 176 | + .filter(item -> item.getFqr() != null) | |
| 177 | + .map(CImprovement::getFqr) | |
| 178 | + .collect(Collectors.toSet()); | |
| 179 | + | |
| 180 | + Map<String, Set<String>> workshopImprovementPersonnelMap = new HashMap<>(); | |
| 181 | + for (String fqr : improvementFqrSet) { | |
| 182 | + QuarterPersonnel personnel = personnelMap.get(fqr); | |
| 183 | + if (personnel != null && personnel.getShdw() != null) { | |
| 184 | + workshopImprovementPersonnelMap.computeIfAbsent(personnel.getShdw(), k -> new HashSet<>()).add(fqr); | |
| 185 | + } | |
| 186 | + } | |
| 187 | + | |
| 188 | + // 9. 查询该年份的C类目标信息(按单位车间维度 dwcj) | |
| 189 | + List<CImprovementTarget> targetList = cImprovementTargetService.listByYear(queryYear); | |
| 190 | + Map<String, Double> targetMap = new HashMap<>(); | |
| 191 | + if (CollectionUtils.isNotEmpty(targetList)) { | |
| 192 | + targetMap = targetList.stream() | |
| 193 | + .filter(item -> item.getDwcj() != null && item.getMb() != null) | |
| 194 | + .collect(Collectors.toMap( | |
| 195 | + CImprovementTarget::getDwcj, | |
| 196 | + CImprovementTarget::getMb, | |
| 197 | + (v1, v2) -> v1 | |
| 198 | + )); | |
| 199 | + } | |
| 200 | + | |
| 201 | + // 10. 查询单位车间详细信息(含单位名称、单位编号) | |
| 202 | + Set<String> workshopIds = workshopPersonnelCountMap.keySet(); | |
| 203 | + Map<String, Workshop> workshopMap = CollectionUtils.isEmpty(workshopIds) | |
| 204 | + ? new HashMap<>(0) | |
| 205 | + : workshopService.mapByIds(workshopIds); | |
| 206 | + | |
| 207 | + // 11. 组装汇总结果(按单位车间维度) | |
| 208 | + Map<String, Double> finalTargetMap = targetMap; | |
| 209 | + Map<String, Workshop> finalWorkshopMap = workshopMap; | |
| 210 | + List<CImprovementSummaryDTO> resultList = workshopPersonnelCountMap.entrySet().stream() | |
| 211 | + .map(entry -> { | |
| 212 | + String dwcj = entry.getKey(); | |
| 213 | + int totalPersonnel = entry.getValue().intValue(); | |
| 214 | + int improvementPersonnel = workshopImprovementPersonnelMap.getOrDefault(dwcj, Collections.emptySet()).size(); | |
| 215 | + | |
| 216 | + CImprovementSummaryDTO dto = new CImprovementSummaryDTO(); | |
| 217 | + dto.setDwcj(dwcj); | |
| 218 | + dto.setYear(queryYear); | |
| 219 | + dto.setQuarter(quarter); | |
| 220 | + dto.setQuarterDesc(quarterEnum.getDesc()); | |
| 221 | + dto.setTotalPersonnel(totalPersonnel); | |
| 222 | + dto.setImprovementPersonnel(improvementPersonnel); | |
| 223 | + // 目标值按单位车间维度匹配 | |
| 224 | + dto.setMb(finalTargetMap.get(dwcj)); | |
| 225 | + | |
| 226 | + // 设置单位车间名称、单位编号 | |
| 227 | + Workshop workshop = finalWorkshopMap.get(dwcj); | |
| 228 | + if (workshop != null) { | |
| 229 | + dto.setDwcjName(workshop.getDwmc()); | |
| 230 | + dto.setDwcjCode(workshop.getDwbh()); | |
| 231 | + } | |
| 232 | + | |
| 233 | + // 计算发起率 | |
| 234 | + if (totalPersonnel > 0) { | |
| 235 | + dto.setImprovementRate(Math.round((double) improvementPersonnel / totalPersonnel * 10000) / 100.0); | |
| 236 | + } | |
| 237 | + | |
| 238 | + return dto; | |
| 239 | + }) | |
| 240 | + .collect(Collectors.toList()); | |
| 241 | + | |
| 242 | + // 12. 按单位车间编号升序排序,编号为空的排在最后 | |
| 243 | + resultList.sort(Comparator.comparing(CImprovementSummaryDTO::getDwcjCode, | |
| 244 | + Comparator.nullsLast(Comparator.naturalOrder()))); | |
| 245 | + return resultList; | |
| 246 | + } | |
| 247 | + | |
| 248 | + /** | |
| 249 | + * 根据年份、季度和单位车间id查询C类改善汇总(按室组维度分组) | |
| 250 | + * <p> | |
| 251 | + * 统计指定单位车间下各室组的C类改善信息,年份为空时默认查询当前年,季度、单位车间id必传; | |
| 252 | + * 返回列表按室组编号升序排序 | |
| 253 | + * | |
| 254 | + * @param year 年份,格式:yyyy,可为空 | |
| 255 | + * @param quarter 季度枚举值(#1#-#4#),必传 | |
| 256 | + * @param dwcj 单位车间id,必传 | |
| 257 | + * @return C类改善汇总列表(按室组维度,室组编号升序) | |
| 258 | + */ | |
| 259 | + @Transactional(readOnly = true) | |
| 260 | + public List<CImprovementSummaryDTO> summaryByYearQuarterAndWorkshop(String year, String quarter, String dwcj) { | |
| 261 | + // 1. 校验参数 | |
| 262 | + Assert.hasLength(quarter, "quarter is empty!"); | |
| 263 | + Assert.hasLength(dwcj, "dwcj is empty!"); | |
| 264 | + QuarterEnum quarterEnum = QuarterEnum.fromCode(quarter); | |
| 265 | + Assert.notNull(quarterEnum, "quarter format is invalid!"); | |
| 266 | + | |
| 267 | + // 2. 处理年份参数,为空时默认为当前年 | |
| 268 | + String queryYear = StringUtils.isBlank(year) ? String.valueOf(Calendar.getInstance().get(Calendar.YEAR)) : year; | |
| 269 | + Assert.isTrue(queryYear.matches("\\d{4}"), "year format must be yyyy!"); | |
| 270 | + | |
| 271 | + // 3. 计算季度的开始时间和结束时间 | |
| 272 | + Date startTime = DateDealUtils.parseQuarterStartTime(queryYear, quarterEnum); | |
| 273 | + Date endTime = DateDealUtils.parseQuarterEndTime(queryYear, quarterEnum); | |
| 274 | + | |
| 275 | + // 4. 查询该季度时间范围内的C类改善记录 | |
| 276 | + Example example = new Example(CImprovement.class); | |
| 277 | + CorpExample.criteria(example) | |
| 278 | + .andBetween(CImprovement.CREATED_AT, startTime, endTime); | |
| 279 | + List<CImprovement> cImprovementList = cImprovementMapper.selectByExample(example); | |
| 280 | + | |
| 281 | + // 5. 查询该年份季度、该单位车间下的季度人员信息 | |
| 282 | + List<QuarterPersonnel> quarterPersonnelList = quarterPersonnelService.listByYearQuarterAndWorkshop(queryYear, quarterEnum, dwcj); | |
| 283 | + | |
| 284 | + if (CollectionUtils.isEmpty(quarterPersonnelList)) { | |
| 285 | + return new ArrayList<>(0); | |
| 286 | + } | |
| 287 | + | |
| 288 | + // 6. 构建人员id到季度人员信息的映射 | |
| 289 | + Map<String, QuarterPersonnel> personnelMap = quarterPersonnelList.stream() | |
| 290 | + .filter(item -> item.getRygh() != null) | |
| 291 | + .collect(Collectors.toMap( | |
| 292 | + QuarterPersonnel::getYhry, | |
| 293 | + item -> item, | |
| 294 | + (v1, v2) -> v1 | |
| 295 | + )); | |
| 296 | + | |
| 164 | 297 | // 7. 按室组分组统计总人数 |
| 165 | 298 | Map<String, Long> roomGroupPersonnelCountMap = quarterPersonnelList.stream() |
| 166 | 299 | .filter(item -> item.getShsz() != null) |
| ... | ... | @@ -184,7 +317,7 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { |
| 184 | 317 | } |
| 185 | 318 | } |
| 186 | 319 | |
| 187 | - // 9. 查询该年份的C类目标信息(按室组维度),走 CImprovementTargetService | |
| 320 | + // 9. 查询该年份的C类目标信息(按室组维度 szxx) | |
| 188 | 321 | List<CImprovementTarget> targetList = cImprovementTargetService.listByYear(queryYear); |
| 189 | 322 | Map<String, Double> targetMap = new HashMap<>(); |
| 190 | 323 | if (CollectionUtils.isNotEmpty(targetList)) { |
| ... | ... | @@ -237,9 +370,9 @@ public class CImprovementService extends BaseServiceImpl<CImprovement> { |
| 237 | 370 | if (roomGroup != null) { |
| 238 | 371 | dto.setSzmc(roomGroup.getSzmc()); |
| 239 | 372 | dto.setSzbh(roomGroup.getSzbh()); |
| 240 | - String dwcj = roomGroup.getSsdw(); | |
| 241 | - dto.setDwcj(dwcj); | |
| 242 | - Workshop workshop = finalWorkshopMap.get(dwcj); | |
| 373 | + String ssdw = roomGroup.getSsdw(); | |
| 374 | + dto.setDwcj(ssdw); | |
| 375 | + Workshop workshop = finalWorkshopMap.get(ssdw); | |
| 243 | 376 | if (workshop != null) { |
| 244 | 377 | dto.setDwcjName(workshop.getDwmc()); |
| 245 | 378 | dto.setDwcjCode(workshop.getDwbh()); | ... | ... |
| ... | ... | @@ -125,6 +125,65 @@ public class CpsProblemService extends BaseServiceImpl<CpsProblem> { |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | + * 根据来源过程确认执行记录id集合查询问题记录明细 | |
| 129 | + * <p> | |
| 130 | + * 结果中包含工作单位、责任单位、室组、区域、班组、问题提出人、问题处理人等关联实体名称及枚举中文描述 | |
| 131 | + * | |
| 132 | + * @param lygcqrzxIds 来源过程确认执行记录id集合,为空时返回空列表 | |
| 133 | + * @return 问题记录明细列表(按创建时间降序) | |
| 134 | + */ | |
| 135 | + @Transactional(readOnly = true) | |
| 136 | + public List<CpsProblemDetailDTO> listDetailByLygcqrzxIds(Collection<String> lygcqrzxIds) { | |
| 137 | + if (CollectionUtils.isEmpty(lygcqrzxIds)) { | |
| 138 | + return new ArrayList<>(0); | |
| 139 | + } | |
| 140 | + | |
| 141 | + // 1. 查询来源过程确认执行记录id在集合内的问题记录 | |
| 142 | + Example example = new Example(entityClass); | |
| 143 | + CorpExample.criteria(example).andIn(CpsProblem.LYGCQRZX, lygcqrzxIds); | |
| 144 | + List<CpsProblem> cpsProblemList = cpsProblemMapper.selectByExample(example); | |
| 145 | + if (CollectionUtils.isEmpty(cpsProblemList)) { | |
| 146 | + return new ArrayList<>(0); | |
| 147 | + } | |
| 148 | + | |
| 149 | + // 2. 收集所有关联实体ID | |
| 150 | + Set<String> workshopIds = new HashSet<>(); | |
| 151 | + Set<String> roomGroupIds = new HashSet<>(); | |
| 152 | + Set<String> areaIds = new HashSet<>(); | |
| 153 | + Set<String> teamIds = new HashSet<>(); | |
| 154 | + Set<String> userIds = new HashSet<>(); | |
| 155 | + for (CpsProblem item : cpsProblemList) { | |
| 156 | + if (item.getGzdw() != null) workshopIds.add(item.getGzdw()); | |
| 157 | + if (item.getWtzrdw() != null) workshopIds.add(item.getWtzrdw()); | |
| 158 | + if (item.getSz() != null) roomGroupIds.add(item.getSz()); | |
| 159 | + if (item.getQy() != null) areaIds.add(item.getQy()); | |
| 160 | + if (item.getBz() != null) teamIds.add(item.getBz()); | |
| 161 | + if (item.getWttcr() != null) userIds.add(item.getWttcr()); | |
| 162 | + if (item.getWtclr() != null) userIds.add(item.getWtclr()); | |
| 163 | + } | |
| 164 | + | |
| 165 | + // 3. 批量查询关联实体 | |
| 166 | + Map<String, Workshop> workshopMap = CollectionUtils.isEmpty(workshopIds) | |
| 167 | + ? new HashMap<>(0) : workshopService.mapByIds(workshopIds); | |
| 168 | + Map<String, RoomGroup> roomGroupMap = CollectionUtils.isEmpty(roomGroupIds) | |
| 169 | + ? new HashMap<>(0) : roomGroupService.mapByIds(roomGroupIds); | |
| 170 | + Map<String, Area> areaMap = CollectionUtils.isEmpty(areaIds) | |
| 171 | + ? new HashMap<>(0) : areaService.mapByIds(areaIds); | |
| 172 | + Map<String, Team> teamMap = CollectionUtils.isEmpty(teamIds) | |
| 173 | + ? new HashMap<>(0) : teamService.mapByIds(teamIds); | |
| 174 | + Map<String, UcUser> userMap = CollectionUtils.isEmpty(userIds) | |
| 175 | + ? new HashMap<>(0) : ucUserService.mapByIds(userIds); | |
| 176 | + | |
| 177 | + // 4. 组装明细结果 | |
| 178 | + List<CpsProblemDetailDTO> resultList = buildDetailList(cpsProblemList, workshopMap, roomGroupMap, areaMap, teamMap, userMap); | |
| 179 | + | |
| 180 | + // 5. 按创建时间降序排序 | |
| 181 | + resultList.sort(Comparator.comparing(CpsProblemDetailDTO::getCreatedAt, | |
| 182 | + Comparator.nullsLast(Comparator.reverseOrder()))); | |
| 183 | + return resultList; | |
| 184 | + } | |
| 185 | + | |
| 186 | + /** | |
| 128 | 187 | * 根据计划解决时间范围查询问题记录,并按责任单位 + 问题处理状态维度汇总问题数 |
| 129 | 188 | * <p> |
| 130 | 189 | * 开始、结束时间为空时默认使用当前月的开始、结束时间 | ... | ... |
| ... | ... | @@ -4,6 +4,7 @@ import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 4 | 4 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 5 | 5 | import com.qgutech.qgyun.apaas.sync.constant.Constant; |
| 6 | 6 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecDetailDTO; |
| 7 | +import com.qgutech.qgyun.apaas.sync.cps.dto.CpsProblemDetailDTO; | |
| 7 | 8 | import com.qgutech.qgyun.apaas.sync.cps.dto.ProcessConfirmExecSummaryDTO; |
| 8 | 9 | import com.qgutech.qgyun.apaas.sync.cps.enums.GcqrZtEnum; |
| 9 | 10 | import com.qgutech.qgyun.apaas.sync.cps.enums.PjoExecZtEnum; |
| ... | ... | @@ -390,6 +391,53 @@ public class ProcessConfirmExecService extends BaseServiceImpl<ProcessConfirmExe |
| 390 | 391 | } |
| 391 | 392 | |
| 392 | 393 | /** |
| 394 | + * 根据条件查询过程确认执行记录对应发现的问题记录明细列表(CPS问题记录) | |
| 395 | + * <p> | |
| 396 | + * 参照 {@link #listDetailByCondition},入参相同但去掉状态(zt)参数: | |
| 397 | + * 先按活动执行日期范围、单位、人员类别过滤过程确认执行记录, | |
| 398 | + * 再查询这些执行记录来源的问题记录明细(含关联实体名称及枚举中文描述) | |
| 399 | + * | |
| 400 | + * @param startTime 开始时间,格式:yyyy-MM-dd [HH:mm:ss],可为空(默认当前月 1 号 00:00:00) | |
| 401 | + * @param endTime 结束时间,格式:yyyy-MM-dd [HH:mm:ss],可为空(默认当前日期前一天 23:59:59) | |
| 402 | + * @param dw 单位id,可为空 | |
| 403 | + * @param rylb 人员类别编号(兼容 #1# 与 1 两种形式),可为空 | |
| 404 | + * @return CPS问题记录明细列表(按创建时间降序) | |
| 405 | + */ | |
| 406 | + @Transactional(readOnly = true) | |
| 407 | + public List<CpsProblemDetailDTO> listProblemDetailByCondition(String startTime, String endTime, | |
| 408 | + String dw, String rylb) { | |
| 409 | + // 1. 解析时间参数,开始时间为空默认当前月1号,结束时间为空默认当前日期前一天 | |
| 410 | + Date start = DateDealUtils.parseStartTimeOrCurrentMonthStart(startTime); | |
| 411 | + Date end = DateDealUtils.parseEndTimeOrYesterdayEnd(endTime); | |
| 412 | + Assert.notNull(start, "startTime is invalid!"); | |
| 413 | + Assert.notNull(end, "endTime is invalid!"); | |
| 414 | + Assert.isTrue(!start.after(end), "startTime must be earlier than endTime!"); | |
| 415 | + | |
| 416 | + // 2. 构建查询条件(活动执行日期范围必带,其余条件非空才追加;不含状态 zt) | |
| 417 | + Example example = new Example(ProcessConfirmExec.class); | |
| 418 | + Example.Criteria criteria = CorpExample.criteria(example) | |
| 419 | + .andBetween(ProcessConfirmExec.HDZXRQ, start, end); | |
| 420 | + if (StringUtils.isNotBlank(dw)) { | |
| 421 | + criteria.andEqualTo(ProcessConfirmExec.DW, dw); | |
| 422 | + } | |
| 423 | + if (StringUtils.isNotBlank(rylb)) { | |
| 424 | + RylbEnum rylbEnum = RylbEnum.fromCode(rylb); | |
| 425 | + Assert.notNull(rylbEnum, "rylb format is invalid!"); | |
| 426 | + criteria.andEqualTo(ProcessConfirmExec.RYLB, rylbEnum.getCode()); | |
| 427 | + } | |
| 428 | + List<ProcessConfirmExec> execList = processConfirmExecMapper.selectByExample(example); | |
| 429 | + if (CollectionUtils.isEmpty(execList)) { | |
| 430 | + return new ArrayList<>(0); | |
| 431 | + } | |
| 432 | + | |
| 433 | + // 3. 提取执行记录id集合,查询其来源的问题记录明细 | |
| 434 | + List<String> execIds = execList.stream() | |
| 435 | + .map(ProcessConfirmExec::getId) | |
| 436 | + .collect(Collectors.toList()); | |
| 437 | + return cpsProblemService.listDetailByLygcqrzxIds(execIds); | |
| 438 | + } | |
| 439 | + | |
| 440 | + /** | |
| 393 | 441 | * 组装过程确认执行记录明细 DTO 列表(含枚举名称、关联实体名称) |
| 394 | 442 | */ |
| 395 | 443 | private List<ProcessConfirmExecDetailDTO> buildDetailList(List<ProcessConfirmExec> execList, | ... | ... |
| ... | ... | @@ -132,4 +132,37 @@ public class QuarterPersonnelService extends BaseServiceImpl<QuarterPersonnel> { |
| 132 | 132 | } |
| 133 | 133 | return quarterPersonnelList; |
| 134 | 134 | } |
| 135 | + | |
| 136 | + /** | |
| 137 | + * 根据年份、季度和单位车间id查询季度人员信息 | |
| 138 | + * | |
| 139 | + * @param year 年份,格式:yyyy,为空时默认当前年 | |
| 140 | + * @param quarter 季度枚举值(#1#-#4#) | |
| 141 | + * @param workshopId 单位车间id | |
| 142 | + * @return 季度人员信息列表 | |
| 143 | + */ | |
| 144 | + @Transactional(readOnly = true) | |
| 145 | + public List<QuarterPersonnel> listByYearQuarterAndWorkshop(String year, QuarterEnum quarter, String workshopId) { | |
| 146 | + // 1. 处理年份参数,为空时默认为当前年 | |
| 147 | + String queryYear = StringUtils.isBlank(year) ? String.valueOf(Calendar.getInstance().get(Calendar.YEAR)) : year; | |
| 148 | + Assert.isTrue(queryYear.matches("\\d{4}"), "year format must be yyyy!"); | |
| 149 | + Assert.notNull(quarter, "quarter is empty!"); | |
| 150 | + Assert.hasLength(workshopId, "workshopId is empty!"); | |
| 151 | + | |
| 152 | + // 2. 计算年份的开始时间和结束时间 | |
| 153 | + Date yearStartTime = DateDealUtils.parseYearStartTime(queryYear); | |
| 154 | + Date yearEndTime = DateDealUtils.parseYearEndTime(queryYear); | |
| 155 | + | |
| 156 | + // 3. 查询该年份季度该单位车间下的季度人员信息 | |
| 157 | + Example example = new Example(entityClass); | |
| 158 | + CorpExample.criteria(example) | |
| 159 | + .andBetween(QuarterPersonnel.YEAR, yearStartTime, yearEndTime) | |
| 160 | + .andEqualTo(QuarterPersonnel.JDXX, quarter.getCode()) | |
| 161 | + .andEqualTo(QuarterPersonnel.SHDW, workshopId); | |
| 162 | + List<QuarterPersonnel> quarterPersonnelList = quarterPersonnelMapper.selectByExample(example); | |
| 163 | + if (CollectionUtils.isEmpty(quarterPersonnelList)) { | |
| 164 | + return new ArrayList<>(0); | |
| 165 | + } | |
| 166 | + return quarterPersonnelList; | |
| 167 | + } | |
| 135 | 168 | } | ... | ... |
| ... | ... | @@ -5,10 +5,12 @@ |
| 5 | 5 | - [1. AB类改善接口](#1-ab类改善接口) |
| 6 | 6 | - [1.1 获取所有AB类改善列表](#11-获取所有ab类改善列表) |
| 7 | 7 | - [1.2 根据年份查询AB类改善汇总](#12-根据年份查询ab类改善汇总) |
| 8 | + - [1.3 根据单位和年份查询AB类改善部门汇总 🆕新增](#13-根据单位和年份查询ab类改善部门汇总) | |
| 8 | 9 | - [2. C类改善接口](#2-c类改善接口) |
| 9 | 10 | - [2.1 获取所有C类改善列表](#21-获取所有c类改善列表) |
| 10 | - - [2.2 根据年份和季度查询C类改善发起率汇总](#22-根据年份和季度查询c类改善发起率汇总) | |
| 11 | - - [2.3 根据年份、季度、室组id查询C类改善记录详情](#23-根据年份季度室组id查询c类改善记录详情) | |
| 11 | + - [2.2 根据年份和季度查询C类改善发起率汇总 ✏️更新](#22-根据年份和季度查询c类改善发起率汇总) | |
| 12 | + - [2.3 根据年份、季度和单位车间查询C类改善发起率汇总 🆕新增](#23-根据年份季度和单位车间查询c类改善发起率汇总) | |
| 13 | + - [2.4 根据年份、季度、室组id查询C类改善记录详情](#24-根据年份季度室组id查询c类改善记录详情) | |
| 12 | 14 | - [3. CPS问题接口](#3-cps问题接口) |
| 13 | 15 | - [3.1 获取所有CPS问题列表](#31-获取所有cps问题列表) |
| 14 | 16 | - [3.2 根据计划解决时间范围汇总各责任单位下各处理状态的问题数](#32-根据计划解决时间范围汇总各责任单位下各处理状态的问题数) |
| ... | ... | @@ -19,6 +21,7 @@ |
| 19 | 21 | - [4.1 获取所有过程确认执行记录列表](#41-获取所有过程确认执行记录列表) |
| 20 | 22 | - [4.2 根据活动执行日期范围汇总过程确认执行记录统计信息](#42-根据活动执行日期范围汇总过程确认执行记录统计信息) |
| 21 | 23 | - [4.3 根据条件查询过程确认执行记录明细列表](#43-根据条件查询过程确认执行记录明细列表) |
| 24 | + - [4.4 根据条件查询过程确认执行记录对应的问题记录明细列表 🆕新增](#44-根据条件查询过程确认执行记录对应的问题记录明细列表) | |
| 22 | 25 | - [5. PJO计划执行接口](#5-pjo计划执行接口) |
| 23 | 26 | - [5.1 根据PJO开展日期范围汇总PJO计划执行统计信息](#51-根据pjo开展日期范围汇总pjo计划执行统计信息) |
| 24 | 27 | - [5.2 根据条件查询人员PJO计划明细列表](#52-根据条件查询人员pjo计划明细列表) |
| ... | ... | @@ -34,6 +37,21 @@ |
| 34 | 37 | |
| 35 | 38 | --- |
| 36 | 39 | |
| 40 | +## 变更记录 | |
| 41 | + | |
| 42 | +> 标记说明:🆕 **新增接口**(本次新增的接口)| ✏️ **接口更新**(接口路径不变,统计维度/出入参发生调整) | |
| 43 | + | |
| 44 | +| 标记 | 章节 | 接口路径 | 变更类型 | 变更说明 | | |
| 45 | +|------|------|----------|----------|----------| | |
| 46 | +| 🆕 | [1.3](#13-根据单位和年份查询ab类改善部门汇总) | `GET /abImprovement/summary/dept` | 新增接口 | 以单位 + 年份为入参,查询该年度时间范围内该单位下的记录,按申请部门分组汇总 AB 类改善,含部门目标值与完成率 | | |
| 47 | +| ✏️ | [2.2](#22-根据年份和季度查询c类改善发起率汇总) | `GET /cImprovement/summary/quarter` | 接口更新 | 统计维度由「室组」调整为「单位车间」(按季度人员所在单位 shdw 分组),目标值改按单位车间 dwcj 匹配,返回字段以 dwcj/dwcjName/dwcjCode 为主 | | |
| 48 | +| 🆕 | [2.3](#23-根据年份季度和单位车间查询c类改善发起率汇总) | `GET /cImprovement/summary/workshop` | 新增接口 | 按单位 + 季度查询,统计指定单位车间下各室组的 C 类改善发起率(即原 2.2 的室组维度逻辑,目标值按室组 szxx 匹配) | | |
| 49 | +| 🆕 | [4.4](#44-根据条件查询过程确认执行记录对应的问题记录明细列表) | `GET /processConfirmExec/list/problem` | 新增接口 | 入参同 [4.3](#43-根据条件查询过程确认执行记录明细列表) 但去掉状态 zt,返回这些执行记录来源发现的 CPS 问题记录明细 | | |
| 50 | + | |
| 51 | +> 编号调整说明:因 2.3 新增了「按单位车间查室组」接口,原「2.3 根据年份、季度、室组id查询C类改善记录详情」顺延为 **2.4**(接口路径与内容未变)。 | |
| 52 | + | |
| 53 | +--- | |
| 54 | + | |
| 37 | 55 | ## 通用说明 |
| 38 | 56 | ### 环境域名 |
| 39 | 57 | uat3环境: https://uat3.qgutech.com/fkyycustom |
| ... | ... | @@ -329,6 +347,61 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 329 | 347 | |
| 330 | 348 | --- |
| 331 | 349 | |
| 350 | +### 1.3 根据单位和年份查询AB类改善部门汇总 | |
| 351 | + | |
| 352 | +> 🆕 **新增接口**(本次变更) | |
| 353 | + | |
| 354 | +**接口路径:** `GET /abImprovement/summary/dept` | |
| 355 | + | |
| 356 | +**接口说明:** 查询指定年份时间范围内、指定单位下的所有AB类改善记录,按申请部门分组汇总,包含各部门节约价值汇总、部门目标值及完成率。 | |
| 357 | + | |
| 358 | +**请求参数:** | |
| 359 | + | |
| 360 | +| 参数名 | 类型 | 必传 | 说明 | | |
| 361 | +|--------|------|------|------| | |
| 362 | +| dwxx | String | 是 | 单位(组织架构ID) | | |
| 363 | +| year | String | 否 | 年份,格式:yyyy,为空时默认当前年 | | |
| 364 | + | |
| 365 | +**响应数据:** `List<AbImprovementDeptSummaryDTO>` | |
| 366 | + | |
| 367 | +**响应字段说明:** | |
| 368 | + | |
| 369 | +| 字段 | 类型 | 说明 | | |
| 370 | +|------|------|------| | |
| 371 | +| dwxx | String | 单位(组织架构ID) | | |
| 372 | +| dwxxName | String | 单位名称 | | |
| 373 | +| sqbm | String | 申请部门(组织架构ID) | | |
| 374 | +| sqbmName | String | 申请部门名称 | | |
| 375 | +| sqbmCode | String | 申请部门编号 | | |
| 376 | +| year | String | 年份 | | |
| 377 | +| totalQnjyjz | Double | 节约价值汇总 | | |
| 378 | +| mb | Double | 目标值 | | |
| 379 | +| completionRate | Double | 完成率(%) | | |
| 380 | + | |
| 381 | +**响应示例:** | |
| 382 | + | |
| 383 | +```json | |
| 384 | +{ | |
| 385 | + "success": true, | |
| 386 | + "msg": "成功", | |
| 387 | + "data": [ | |
| 388 | + { | |
| 389 | + "dwxx": "org001", | |
| 390 | + "dwxxName": "总装厂", | |
| 391 | + "sqbm": "dept001", | |
| 392 | + "sqbmName": "生产部", | |
| 393 | + "sqbmCode": "SC001", | |
| 394 | + "year": "2026", | |
| 395 | + "totalQnjyjz": 80000.0, | |
| 396 | + "mb": 100000.0, | |
| 397 | + "completionRate": 80.0 | |
| 398 | + } | |
| 399 | + ] | |
| 400 | +} | |
| 401 | +``` | |
| 402 | + | |
| 403 | +--- | |
| 404 | + | |
| 332 | 405 | ## 2. C类改善接口 |
| 333 | 406 | |
| 334 | 407 | ### 2.1 获取所有C类改善列表 |
| ... | ... | @@ -405,9 +478,68 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 405 | 478 | |
| 406 | 479 | ### 2.2 根据年份和季度查询C类改善发起率汇总 |
| 407 | 480 | |
| 481 | +> ✏️ **接口更新**(本次变更):统计维度由「室组」调整为「单位车间」(按季度人员所在单位 shdw 分组),目标值改按单位车间 dwcj 匹配;接口路径与入参不变。原「室组维度」统计已拆分为新接口 [2.3](#23-根据年份季度和单位车间查询c类改善发起率汇总)。 | |
| 482 | + | |
| 408 | 483 | **接口路径:** `GET /cImprovement/summary/quarter` |
| 409 | 484 | |
| 410 | -**接口说明:** 按室组维度统计指定年份季度的C类改善发起率,包含室组总人数、有改善记录人数、发起率及目标值。 | |
| 485 | +**接口说明:** 按单位车间维度统计指定年份季度的C类改善发起率,包含单位车间总人数、有改善记录人数、发起率及目标值(目标值按单位车间匹配)。 | |
| 486 | + | |
| 487 | +**请求参数:** | |
| 488 | + | |
| 489 | +| 参数名 | 类型 | 必传 | 说明 | | |
| 490 | +|--------|------|------|------| | |
| 491 | +| year | String | 否 | 年份,格式:yyyy,为空时默认当前年 | | |
| 492 | +| quarter | String | 是 | 季度枚举值(#1#-#4#) | | |
| 493 | + | |
| 494 | +**响应数据:** `List<CImprovementSummaryDTO>` | |
| 495 | + | |
| 496 | +**响应字段说明:** | |
| 497 | + | |
| 498 | +| 字段 | 类型 | 说明 | | |
| 499 | +|------|------|------| | |
| 500 | +| dwcj | String | 单位车间编码 | | |
| 501 | +| dwcjName | String | 单位车间名称 | | |
| 502 | +| dwcjCode | String | 单位车间编号 | | |
| 503 | +| year | String | 年份 | | |
| 504 | +| quarter | String | 季度 | | |
| 505 | +| quarterDesc | String | 季度描述 | | |
| 506 | +| totalPersonnel | Integer | 单位车间总人数 | | |
| 507 | +| improvementPersonnel | Integer | 有C类改善记录的人数 | | |
| 508 | +| improvementRate | Double | C类改善发起率(%) | | |
| 509 | +| mb | Double | 目标值 | | |
| 510 | + | |
| 511 | +**响应示例:** | |
| 512 | + | |
| 513 | +```json | |
| 514 | +{ | |
| 515 | + "success": true, | |
| 516 | + "msg": "成功", | |
| 517 | + "data": [ | |
| 518 | + { | |
| 519 | + "dwcj": "workshop001", | |
| 520 | + "dwcjName": "总装车间", | |
| 521 | + "dwcjCode": "ZZ001", | |
| 522 | + "year": "2026", | |
| 523 | + "quarter": "#3#", | |
| 524 | + "quarterDesc": "第三季度", | |
| 525 | + "totalPersonnel": 50, | |
| 526 | + "improvementPersonnel": 35, | |
| 527 | + "improvementRate": 70.0, | |
| 528 | + "mb": 80.0 | |
| 529 | + } | |
| 530 | + ] | |
| 531 | +} | |
| 532 | +``` | |
| 533 | + | |
| 534 | +--- | |
| 535 | + | |
| 536 | +### 2.3 根据年份、季度和单位车间查询C类改善发起率汇总 | |
| 537 | + | |
| 538 | +> 🆕 **新增接口**(本次变更):承接原 2.2 的「室组维度」统计逻辑,作用域限定为指定单位车间下的各室组。 | |
| 539 | + | |
| 540 | +**接口路径:** `GET /cImprovement/summary/workshop` | |
| 541 | + | |
| 542 | +**接口说明:** 按室组维度统计指定单位车间下各室组在指定年份季度的C类改善发起率,包含室组总人数、有改善记录人数、发起率及目标值(目标值按室组匹配)。 | |
| 411 | 543 | |
| 412 | 544 | **请求参数:** |
| 413 | 545 | |
| ... | ... | @@ -415,6 +547,7 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 415 | 547 | |--------|------|------|------| |
| 416 | 548 | | year | String | 否 | 年份,格式:yyyy,为空时默认当前年 | |
| 417 | 549 | | quarter | String | 是 | 季度枚举值(#1#-#4#) | |
| 550 | +| dwcj | String | 是 | 单位车间id | | |
| 418 | 551 | |
| 419 | 552 | **响应数据:** `List<CImprovementSummaryDTO>` |
| 420 | 553 | |
| ... | ... | @@ -453,10 +586,10 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 453 | 586 | "year": "2026", |
| 454 | 587 | "quarter": "#3#", |
| 455 | 588 | "quarterDesc": "第三季度", |
| 456 | - "totalPersonnel": 50, | |
| 457 | - "improvementPersonnel": 35, | |
| 458 | - "improvementRate": 70.0, | |
| 459 | - "mb": 80.0 | |
| 589 | + "totalPersonnel": 20, | |
| 590 | + "improvementPersonnel": 15, | |
| 591 | + "improvementRate": 75.0, | |
| 592 | + "mb": 30.0 | |
| 460 | 593 | } |
| 461 | 594 | ] |
| 462 | 595 | } |
| ... | ... | @@ -464,7 +597,7 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 464 | 597 | |
| 465 | 598 | --- |
| 466 | 599 | |
| 467 | -### 2.3 根据年份、季度、室组id查询C类改善记录详情 | |
| 600 | +### 2.4 根据年份、季度、室组id查询C类改善记录详情 | |
| 468 | 601 | |
| 469 | 602 | **接口路径:** `GET /cImprovement/list/detail` |
| 470 | 603 | |
| ... | ... | @@ -1389,6 +1522,54 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 1389 | 1522 | |
| 1390 | 1523 | --- |
| 1391 | 1524 | |
| 1525 | +### 4.4 根据条件查询过程确认执行记录对应的问题记录明细列表 | |
| 1526 | + | |
| 1527 | +> 🆕 **新增接口**(本次变更):参照 [4.3](#43-根据条件查询过程确认执行记录明细列表),入参相同但去掉状态 zt,返回执行记录来源发现的 CPS 问题记录明细。 | |
| 1528 | + | |
| 1529 | +**接口路径:** `GET /processConfirmExec/list/problem` | |
| 1530 | + | |
| 1531 | +**接口说明:** 入参与 [4.3](#43-根据条件查询过程确认执行记录明细列表) 相同但去掉状态(zt)参数。先按活动执行日期范围、单位、人员类别过滤过程确认执行记录,再返回这些执行记录来源发现的 CPS 问题记录明细(含关联实体名称与枚举中文描述)。所有参数均非必填;开始时间为空时默认使用当前月 1 号,结束时间为空时默认使用当前日期前一天。 | |
| 1532 | + | |
| 1533 | +**请求参数:** | |
| 1534 | + | |
| 1535 | +| 参数名 | 类型 | 必传 | 说明 | | |
| 1536 | +|--------|------|------|------| | |
| 1537 | +| startTime | String | 否 | 开始时间,格式:yyyy-MM-dd [HH:mm:ss],为空默认当前月 1 号 00:00:00 | | |
| 1538 | +| endTime | String | 否 | 结束时间,格式:yyyy-MM-dd [HH:mm:ss],为空默认当前日期前一天 23:59:59 | | |
| 1539 | +| dw | String | 否 | 单位id | | |
| 1540 | +| rylb | String | 否 | 人员类别编号(#1#-#7#,兼容 1 ~ 7) | | |
| 1541 | + | |
| 1542 | +**响应数据:** `List<CpsProblemDetailDTO>`(字段说明参见 [3.4 CPS问题记录明细](#3-cps问题接口),按创建时间降序) | |
| 1543 | + | |
| 1544 | +**响应示例:** | |
| 1545 | + | |
| 1546 | +```json | |
| 1547 | +{ | |
| 1548 | + "success": true, | |
| 1549 | + "msg": "成功", | |
| 1550 | + "data": [ | |
| 1551 | + { | |
| 1552 | + "id": "p8IaDbP2C79yQsAY6Vv", | |
| 1553 | + "createdAt": "2026-09-11 09:20:00", | |
| 1554 | + "wtbh": "WT20260911001", | |
| 1555 | + "wtms": "设备异常停机", | |
| 1556 | + "wtly": "#3#", | |
| 1557 | + "wtlyDesc": "过程确认", | |
| 1558 | + "gzdw": "ahImSLxXBuQkFtU8Ace", | |
| 1559 | + "gzdwName": "总装车间", | |
| 1560 | + "gzdwCode": "104", | |
| 1561 | + "wtzrdw": "ahImSLxXBuQkFtU8Ace", | |
| 1562 | + "wtzrdwName": "总装车间", | |
| 1563 | + "wtzrdwCode": "104", | |
| 1564 | + "wtclzt": "#1#", | |
| 1565 | + "wtclztDesc": "待处理" | |
| 1566 | + } | |
| 1567 | + ] | |
| 1568 | +} | |
| 1569 | +``` | |
| 1570 | + | |
| 1571 | +--- | |
| 1572 | + | |
| 1392 | 1573 | ## 5. PJO计划执行接口 |
| 1393 | 1574 | |
| 1394 | 1575 | ### 5.1 根据PJO开展日期范围汇总PJO计划执行统计信息 | ... | ... |