Showing
26 changed files
with
1921 additions
and
99 deletions
| ... | ... | @@ -15,4 +15,19 @@ public interface Constant { |
| 15 | 15 | */ |
| 16 | 16 | String DEFAULT_CORP_CODE = "hfca"; |
| 17 | 17 | String DEFAULT_USER_ID = "sync_admin"; |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 停线板块编码:物流 | |
| 21 | + */ | |
| 22 | + String BLOCK_CODE_LOGISTICS = "W"; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 停线板块编码:设备 | |
| 26 | + */ | |
| 27 | + String BLOCK_CODE_EQUIPMENT = "M"; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 停线板块编码:质量 | |
| 31 | + */ | |
| 32 | + String BLOCK_CODE_QUALITY = "Q"; | |
| 18 | 33 | } | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.controller; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.apaas.sync.cps.dto.QualityDefectDailySummaryDTO; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.dto.QualityDefectWorkstationSummaryDTO; | |
| 5 | +import com.qgutech.qgyun.apaas.sync.cps.model.QualityDefect; | |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.service.QualityDefectService; | |
| 7 | +import com.qgutech.qgyun.framework.common.result.JsonResult; | |
| 8 | +import lombok.extern.slf4j.Slf4j; | |
| 9 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 12 | +import org.springframework.web.bind.annotation.RestController; | |
| 13 | + | |
| 14 | +import javax.annotation.Resource; | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * 质量缺陷信息接口 | |
| 19 | + */ | |
| 20 | +@Slf4j | |
| 21 | +@RestController | |
| 22 | +@RequestMapping("/qualityDefect") | |
| 23 | +public class QualityDefectController { | |
| 24 | + | |
| 25 | + @Resource | |
| 26 | + private QualityDefectService qualityDefectService; | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 获取所有质量缺陷信息列表 | |
| 30 | + * | |
| 31 | + * @return | |
| 32 | + */ | |
| 33 | + @GetMapping("/list/all") | |
| 34 | + public JsonResult listAll() { | |
| 35 | + List<QualityDefect> list = qualityDefectService.listAll(); | |
| 36 | + return new JsonResult<>(true, "成功", list); | |
| 37 | + } | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 按月份查询每日质量缺陷记录汇总数目 | |
| 41 | + * | |
| 42 | + * @param zrqyxx 责任区域信息,可为空 | |
| 43 | + * @param year 年份,可为空,默认当前年 | |
| 44 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 45 | + * @return 每日缺陷记录汇总列表 | |
| 46 | + */ | |
| 47 | + @GetMapping("/summary/daily") | |
| 48 | + public JsonResult summaryDailyByMonth(@RequestParam(required = false) String zrqyxx, | |
| 49 | + @RequestParam(required = false) Integer year, | |
| 50 | + @RequestParam(required = false) Integer month) { | |
| 51 | + List<QualityDefectDailySummaryDTO> list = qualityDefectService.summaryDailyByMonth(zrqyxx, year, month); | |
| 52 | + return new JsonResult<>(true, "成功", list); | |
| 53 | + } | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 按指定日期和区域汇总各工位缺陷次数(按次数降序) | |
| 57 | + * | |
| 58 | + * @param zrqyxx 责任区域信息,可为空 | |
| 59 | + * @param date 指定日期(yyyy-MM-dd),必填 | |
| 60 | + * @return 各工位缺陷次数汇总列表 | |
| 61 | + */ | |
| 62 | + @GetMapping("/summary/workstation") | |
| 63 | + public JsonResult summaryByWorkstation(@RequestParam(required = false) String zrqyxx, | |
| 64 | + @RequestParam String date) { | |
| 65 | + List<QualityDefectWorkstationSummaryDTO> list = qualityDefectService.summaryByWorkstation(zrqyxx, date); | |
| 66 | + return new JsonResult<>(true, "成功", list); | |
| 67 | + } | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 按指定日期、区域、工位查询质量缺陷明细列表 | |
| 71 | + * | |
| 72 | + * @param zrqyxx 责任区域信息,可为空 | |
| 73 | + * @param date 指定日期(yyyy-MM-dd),必填 | |
| 74 | + * @param wtgwxx 问题工位信息,可为空 | |
| 75 | + * @return 质量缺陷明细列表 | |
| 76 | + */ | |
| 77 | + @GetMapping("/list/detail") | |
| 78 | + public JsonResult listDetail(@RequestParam(required = false) String zrqyxx, | |
| 79 | + @RequestParam String date, | |
| 80 | + @RequestParam(required = false) String wtgwxx) { | |
| 81 | + List<QualityDefect> list = qualityDefectService.listDetailByCondition(zrqyxx, date, wtgwxx); | |
| 82 | + return new JsonResult<>(true, "成功", list); | |
| 83 | + } | |
| 84 | +} | ... | ... |
| ... | ... | @@ -37,73 +37,237 @@ public class StopRecordController { |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * 按天汇总统计停线时长 | |
| 40 | + * 按天汇总统计停线时长——物流板块(编码 W) | |
| 41 | 41 | * <p> |
| 42 | - * 根据线体、班次、区域、板块条件筛选停线记录,按天分组汇总停线时长 | |
| 42 | + * 根据板块编码定位板块信息 Id,再按线体、班次、区域条件筛选停线记录,按天分组汇总停线时长。 | |
| 43 | + * year/month 为空时默认取当前年/当前月。 | |
| 43 | 44 | * |
| 44 | 45 | * @param xtxx 线体信息,可为空 |
| 45 | 46 | * @param bcxx 班次信息,可为空 |
| 46 | 47 | * @param txqyxx 停线区域信息,可为空 |
| 47 | - * @param txbkxx 停线板块信息,可为空 | |
| 48 | - * @param year 年份,必填 | |
| 49 | - * @param month 月份(1-12),必填 | |
| 50 | - * @return 按天汇总的停线时长列表 | |
| 48 | + * @param year 年份,可为空,默认当前年 | |
| 49 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 50 | + * @return 按天汇总的停线时长列表(含板块信息) | |
| 51 | 51 | */ |
| 52 | - @GetMapping("/summary/daily") | |
| 53 | - public JsonResult summaryDailyByMonth(@RequestParam(required = false) String xtxx, | |
| 54 | - @RequestParam(required = false) String bcxx, | |
| 55 | - @RequestParam(required = false) String txqyxx, | |
| 56 | - @RequestParam(required = false) String txbkxx, | |
| 57 | - @RequestParam String year, | |
| 58 | - @RequestParam Integer month) { | |
| 59 | - List<StopRecordDailySummaryDTO> list = stopRecordService.summaryDailyByMonth(xtxx, bcxx, txqyxx, txbkxx, year, month); | |
| 52 | + @GetMapping("/summary/daily/logistics") | |
| 53 | + public JsonResult summaryDailyByMonthForLogistics(@RequestParam(required = false) String xtxx, | |
| 54 | + @RequestParam(required = false) String bcxx, | |
| 55 | + @RequestParam(required = false) String txqyxx, | |
| 56 | + @RequestParam(required = false) Integer year, | |
| 57 | + @RequestParam(required = false) Integer month) { | |
| 58 | + List<StopRecordDailySummaryDTO> list = stopRecordService.summaryDailyByMonthForLogistics(xtxx, bcxx, txqyxx, year, month); | |
| 60 | 59 | return new JsonResult<>(true, "成功", list); |
| 61 | 60 | } |
| 62 | 61 | |
| 63 | 62 | /** |
| 64 | - * 按工位汇总统计停线时长 | |
| 65 | - * <p> | |
| 66 | - * 根据线体、班次、区域、板块条件筛选停线记录,加上指定日期, | |
| 67 | - * 按工位汇总停线时长(降序),仅返回汇总结果,不含停线记录明细 | |
| 63 | + * 按天汇总统计停线时长——设备板块(编码 M) | |
| 64 | + * | |
| 65 | + * @param xtxx 线体信息,可为空 | |
| 66 | + * @param bcxx 班次信息,可为空 | |
| 67 | + * @param txqyxx 停线区域信息,可为空 | |
| 68 | + * @param year 年份,可为空,默认当前年 | |
| 69 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 70 | + * @return 按天汇总的停线时长列表(含板块信息) | |
| 71 | + */ | |
| 72 | + @GetMapping("/summary/daily/equipment") | |
| 73 | + public JsonResult summaryDailyByMonthForEquipment(@RequestParam(required = false) String xtxx, | |
| 74 | + @RequestParam(required = false) String bcxx, | |
| 75 | + @RequestParam(required = false) String txqyxx, | |
| 76 | + @RequestParam(required = false) Integer year, | |
| 77 | + @RequestParam(required = false) Integer month) { | |
| 78 | + List<StopRecordDailySummaryDTO> list = stopRecordService.summaryDailyByMonthForEquipment(xtxx, bcxx, txqyxx, year, month); | |
| 79 | + return new JsonResult<>(true, "成功", list); | |
| 80 | + } | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * 按天汇总统计停线时长——质量板块(编码 Q) | |
| 84 | + * | |
| 85 | + * @param xtxx 线体信息,可为空 | |
| 86 | + * @param bcxx 班次信息,可为空 | |
| 87 | + * @param txqyxx 停线区域信息,可为空 | |
| 88 | + * @param year 年份,可为空,默认当前年 | |
| 89 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 90 | + * @return 按天汇总的停线时长列表(含板块信息) | |
| 91 | + */ | |
| 92 | + @GetMapping("/summary/daily/quality") | |
| 93 | + public JsonResult summaryDailyByMonthForQuality(@RequestParam(required = false) String xtxx, | |
| 94 | + @RequestParam(required = false) String bcxx, | |
| 95 | + @RequestParam(required = false) String txqyxx, | |
| 96 | + @RequestParam(required = false) Integer year, | |
| 97 | + @RequestParam(required = false) Integer month) { | |
| 98 | + List<StopRecordDailySummaryDTO> list = stopRecordService.summaryDailyByMonthForQuality(xtxx, bcxx, txqyxx, year, month); | |
| 99 | + return new JsonResult<>(true, "成功", list); | |
| 100 | + } | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * 按天汇总统计停线时长——其他板块(非物流/设备/质量) | |
| 104 | + * | |
| 105 | + * @param xtxx 线体信息,可为空 | |
| 106 | + * @param bcxx 班次信息,可为空 | |
| 107 | + * @param txqyxx 停线区域信息,可为空 | |
| 108 | + * @param year 年份,可为空,默认当前年 | |
| 109 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 110 | + * @return 按天汇总的停线时长列表(不含板块信息) | |
| 111 | + */ | |
| 112 | + @GetMapping("/summary/daily/other") | |
| 113 | + public JsonResult summaryDailyByMonthForOther(@RequestParam(required = false) String xtxx, | |
| 114 | + @RequestParam(required = false) String bcxx, | |
| 115 | + @RequestParam(required = false) String txqyxx, | |
| 116 | + @RequestParam(required = false) Integer year, | |
| 117 | + @RequestParam(required = false) Integer month) { | |
| 118 | + List<StopRecordDailySummaryDTO> list = stopRecordService.summaryDailyByMonthForOther(xtxx, bcxx, txqyxx, year, month); | |
| 119 | + return new JsonResult<>(true, "成功", list); | |
| 120 | + } | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * 按工位汇总统计停线时长——物流板块(编码 W) | |
| 124 | + * | |
| 125 | + * @param xtxx 线体信息,可为空 | |
| 126 | + * @param bcxx 班次信息,可为空 | |
| 127 | + * @param txqyxx 停线区域信息,可为空 | |
| 128 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 129 | + * @return 各工位停线时长汇总列表(含板块信息) | |
| 130 | + */ | |
| 131 | + @GetMapping("/summary/workstation/logistics") | |
| 132 | + public JsonResult summaryByWorkstationForLogistics(@RequestParam(required = false) String xtxx, | |
| 133 | + @RequestParam(required = false) String bcxx, | |
| 134 | + @RequestParam(required = false) String txqyxx, | |
| 135 | + @RequestParam(required = false) String date) { | |
| 136 | + List<StopRecordWorkstationSummaryDTO> result = stopRecordService.summaryByWorkstationForLogistics(xtxx, bcxx, txqyxx, date); | |
| 137 | + return new JsonResult<>(true, "成功", result); | |
| 138 | + } | |
| 139 | + | |
| 140 | + /** | |
| 141 | + * 按工位汇总统计停线时长——设备板块(编码 M) | |
| 142 | + * | |
| 143 | + * @param xtxx 线体信息,可为空 | |
| 144 | + * @param bcxx 班次信息,可为空 | |
| 145 | + * @param txqyxx 停线区域信息,可为空 | |
| 146 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 147 | + * @return 各工位停线时长汇总列表(含板块信息) | |
| 148 | + */ | |
| 149 | + @GetMapping("/summary/workstation/equipment") | |
| 150 | + public JsonResult summaryByWorkstationForEquipment(@RequestParam(required = false) String xtxx, | |
| 151 | + @RequestParam(required = false) String bcxx, | |
| 152 | + @RequestParam(required = false) String txqyxx, | |
| 153 | + @RequestParam(required = false) String date) { | |
| 154 | + List<StopRecordWorkstationSummaryDTO> result = stopRecordService.summaryByWorkstationForEquipment(xtxx, bcxx, txqyxx, date); | |
| 155 | + return new JsonResult<>(true, "成功", result); | |
| 156 | + } | |
| 157 | + | |
| 158 | + /** | |
| 159 | + * 按工位汇总统计停线时长——质量板块(编码 Q) | |
| 68 | 160 | * |
| 69 | 161 | * @param xtxx 线体信息,可为空 |
| 70 | 162 | * @param bcxx 班次信息,可为空 |
| 71 | 163 | * @param txqyxx 停线区域信息,可为空 |
| 72 | - * @param txbkxx 停线板块信息,可为空 | |
| 73 | 164 | * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 |
| 74 | - * @return 各工位停线时长汇总列表 | |
| 165 | + * @return 各工位停线时长汇总列表(含板块信息) | |
| 75 | 166 | */ |
| 76 | - @GetMapping("/summary/workstation") | |
| 77 | - public JsonResult summaryByWorkstation(@RequestParam(required = false) String xtxx, | |
| 167 | + @GetMapping("/summary/workstation/quality") | |
| 168 | + public JsonResult summaryByWorkstationForQuality(@RequestParam(required = false) String xtxx, | |
| 169 | + @RequestParam(required = false) String bcxx, | |
| 170 | + @RequestParam(required = false) String txqyxx, | |
| 171 | + @RequestParam(required = false) String date) { | |
| 172 | + List<StopRecordWorkstationSummaryDTO> result = stopRecordService.summaryByWorkstationForQuality(xtxx, bcxx, txqyxx, date); | |
| 173 | + return new JsonResult<>(true, "成功", result); | |
| 174 | + } | |
| 175 | + | |
| 176 | + /** | |
| 177 | + * 按工位汇总统计停线时长——其他板块(非物流/设备/质量) | |
| 178 | + * | |
| 179 | + * @param xtxx 线体信息,可为空 | |
| 180 | + * @param bcxx 班次信息,可为空 | |
| 181 | + * @param txqyxx 停线区域信息,可为空 | |
| 182 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 183 | + * @return 各工位停线时长汇总列表(不含板块信息) | |
| 184 | + */ | |
| 185 | + @GetMapping("/summary/workstation/other") | |
| 186 | + public JsonResult summaryByWorkstationForOther(@RequestParam(required = false) String xtxx, | |
| 187 | + @RequestParam(required = false) String bcxx, | |
| 188 | + @RequestParam(required = false) String txqyxx, | |
| 189 | + @RequestParam(required = false) String date) { | |
| 190 | + List<StopRecordWorkstationSummaryDTO> result = stopRecordService.summaryByWorkstationForOther(xtxx, bcxx, txqyxx, date); | |
| 191 | + return new JsonResult<>(true, "成功", result); | |
| 192 | + } | |
| 193 | + | |
| 194 | + /** | |
| 195 | + * 查询停线记录明细列表——物流板块(编码 W) | |
| 196 | + * | |
| 197 | + * @param xtxx 线体信息,可为空 | |
| 198 | + * @param bcxx 班次信息,可为空 | |
| 199 | + * @param txqyxx 停线区域信息,可为空 | |
| 200 | + * @param txgwxx 停线工位信息,可为空 | |
| 201 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 202 | + * @return 停线记录明细列表 | |
| 203 | + */ | |
| 204 | + @GetMapping("/list/detail/logistics") | |
| 205 | + public JsonResult listDetailForLogistics(@RequestParam(required = false) String xtxx, | |
| 206 | + @RequestParam(required = false) String bcxx, | |
| 207 | + @RequestParam(required = false) String txqyxx, | |
| 208 | + @RequestParam(required = false) String txgwxx, | |
| 209 | + @RequestParam(required = false) String date) { | |
| 210 | + List<StopRecord> result = stopRecordService.listDetailForLogistics(xtxx, bcxx, txqyxx, txgwxx, date); | |
| 211 | + return new JsonResult<>(true, "成功", result); | |
| 212 | + } | |
| 213 | + | |
| 214 | + /** | |
| 215 | + * 查询停线记录明细列表——设备板块(编码 M) | |
| 216 | + * | |
| 217 | + * @param xtxx 线体信息,可为空 | |
| 218 | + * @param bcxx 班次信息,可为空 | |
| 219 | + * @param txqyxx 停线区域信息,可为空 | |
| 220 | + * @param txgwxx 停线工位信息,可为空 | |
| 221 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 222 | + * @return 停线记录明细列表 | |
| 223 | + */ | |
| 224 | + @GetMapping("/list/detail/equipment") | |
| 225 | + public JsonResult listDetailForEquipment(@RequestParam(required = false) String xtxx, | |
| 226 | + @RequestParam(required = false) String bcxx, | |
| 227 | + @RequestParam(required = false) String txqyxx, | |
| 228 | + @RequestParam(required = false) String txgwxx, | |
| 229 | + @RequestParam(required = false) String date) { | |
| 230 | + List<StopRecord> result = stopRecordService.listDetailForEquipment(xtxx, bcxx, txqyxx, txgwxx, date); | |
| 231 | + return new JsonResult<>(true, "成功", result); | |
| 232 | + } | |
| 233 | + | |
| 234 | + /** | |
| 235 | + * 查询停线记录明细列表——质量板块(编码 Q) | |
| 236 | + * | |
| 237 | + * @param xtxx 线体信息,可为空 | |
| 238 | + * @param bcxx 班次信息,可为空 | |
| 239 | + * @param txqyxx 停线区域信息,可为空 | |
| 240 | + * @param txgwxx 停线工位信息,可为空 | |
| 241 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 242 | + * @return 停线记录明细列表 | |
| 243 | + */ | |
| 244 | + @GetMapping("/list/detail/quality") | |
| 245 | + public JsonResult listDetailForQuality(@RequestParam(required = false) String xtxx, | |
| 78 | 246 | @RequestParam(required = false) String bcxx, |
| 79 | 247 | @RequestParam(required = false) String txqyxx, |
| 80 | - @RequestParam(required = false) String txbkxx, | |
| 248 | + @RequestParam(required = false) String txgwxx, | |
| 81 | 249 | @RequestParam(required = false) String date) { |
| 82 | - List<StopRecordWorkstationSummaryDTO> result = stopRecordService.summaryByWorkstation(xtxx, bcxx, txqyxx, txbkxx, date); | |
| 250 | + List<StopRecord> result = stopRecordService.listDetailForQuality(xtxx, bcxx, txqyxx, txgwxx, date); | |
| 83 | 251 | return new JsonResult<>(true, "成功", result); |
| 84 | 252 | } |
| 85 | 253 | |
| 86 | 254 | /** |
| 87 | - * 查询停线记录明细列表 | |
| 88 | - * <p> | |
| 89 | - * 根据线体、班次、区域、板块、工位条件及指定日期筛选停线记录,返回明细列表 | |
| 255 | + * 查询停线记录明细列表——其他板块(非物流/设备/质量) | |
| 90 | 256 | * |
| 91 | 257 | * @param xtxx 线体信息,可为空 |
| 92 | 258 | * @param bcxx 班次信息,可为空 |
| 93 | 259 | * @param txqyxx 停线区域信息,可为空 |
| 94 | - * @param txbkxx 停线板块信息,可为空 | |
| 95 | 260 | * @param txgwxx 停线工位信息,可为空 |
| 96 | 261 | * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 |
| 97 | 262 | * @return 停线记录明细列表 |
| 98 | 263 | */ |
| 99 | - @GetMapping("/list/detail") | |
| 100 | - public JsonResult listDetail(@RequestParam(required = false) String xtxx, | |
| 101 | - @RequestParam(required = false) String bcxx, | |
| 102 | - @RequestParam(required = false) String txqyxx, | |
| 103 | - @RequestParam(required = false) String txbkxx, | |
| 104 | - @RequestParam(required = false) String txgwxx, | |
| 105 | - @RequestParam(required = false) String date) { | |
| 106 | - List<StopRecord> result = stopRecordService.listDetail(xtxx, bcxx, txqyxx, txbkxx, txgwxx, date); | |
| 264 | + @GetMapping("/list/detail/other") | |
| 265 | + public JsonResult listDetailForOther(@RequestParam(required = false) String xtxx, | |
| 266 | + @RequestParam(required = false) String bcxx, | |
| 267 | + @RequestParam(required = false) String txqyxx, | |
| 268 | + @RequestParam(required = false) String txgwxx, | |
| 269 | + @RequestParam(required = false) String date) { | |
| 270 | + List<StopRecord> result = stopRecordService.listDetailForOther(xtxx, bcxx, txqyxx, txgwxx, date); | |
| 107 | 271 | return new JsonResult<>(true, "成功", result); |
| 108 | 272 | } |
| 109 | 273 | } | ... | ... |
src/main/java/com/qgutech/qgyun/apaas/sync/cps/controller/WorkshopWorkPlanController.java
0 → 100644
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.controller; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.apaas.sync.cps.model.WorkshopWorkPlan; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.service.WorkshopWorkPlanService; | |
| 5 | +import com.qgutech.qgyun.framework.common.result.JsonResult; | |
| 6 | +import lombok.extern.slf4j.Slf4j; | |
| 7 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 9 | +import org.springframework.web.bind.annotation.RestController; | |
| 10 | + | |
| 11 | +import javax.annotation.Resource; | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 车间级工作计划接口 | |
| 16 | + */ | |
| 17 | +@Slf4j | |
| 18 | +@RestController | |
| 19 | +@RequestMapping("/workshopWorkPlan") | |
| 20 | +public class WorkshopWorkPlanController { | |
| 21 | + | |
| 22 | + @Resource | |
| 23 | + private WorkshopWorkPlanService workshopWorkPlanService; | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 获取所有车间级工作计划列表 | |
| 27 | + * | |
| 28 | + * @return | |
| 29 | + */ | |
| 30 | + @GetMapping("/list/all") | |
| 31 | + public JsonResult listAll() { | |
| 32 | + List<WorkshopWorkPlan> list = workshopWorkPlanService.listAll(); | |
| 33 | + return new JsonResult<>(true, "成功", list); | |
| 34 | + } | |
| 35 | +} | ... | ... |
src/main/java/com/qgutech/qgyun/apaas/sync/cps/controller/WorkshopWorkTaskController.java
0 → 100644
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.controller; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.apaas.sync.cps.dto.WorkshopWorkTaskStatusSummaryDTO; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.model.WorkshopWorkTask; | |
| 5 | +import com.qgutech.qgyun.apaas.sync.cps.service.WorkshopWorkTaskService; | |
| 6 | +import com.qgutech.qgyun.framework.common.result.JsonResult; | |
| 7 | +import lombok.extern.slf4j.Slf4j; | |
| 8 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 9 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 10 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | +import org.springframework.web.bind.annotation.RestController; | |
| 12 | + | |
| 13 | +import javax.annotation.Resource; | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * 车间级工作任务接口 | |
| 18 | + */ | |
| 19 | +@Slf4j | |
| 20 | +@RestController | |
| 21 | +@RequestMapping("/workshopWorkTask") | |
| 22 | +public class WorkshopWorkTaskController { | |
| 23 | + | |
| 24 | + @Resource | |
| 25 | + private WorkshopWorkTaskService workshopWorkTaskService; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 获取所有车间级工作任务列表 | |
| 29 | + * | |
| 30 | + * @return | |
| 31 | + */ | |
| 32 | + @GetMapping("/list/all") | |
| 33 | + public JsonResult listAll() { | |
| 34 | + List<WorkshopWorkTask> list = workshopWorkTaskService.listAll(); | |
| 35 | + return new JsonResult<>(true, "成功", list); | |
| 36 | + } | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 根据区域、年份、月份查询工作任务明细列表 | |
| 40 | + * | |
| 41 | + * @param qyxx 区域信息,可为空 | |
| 42 | + * @param year 年份,可为空,默认当前年 | |
| 43 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 44 | + * @return 工作任务明细列表 | |
| 45 | + */ | |
| 46 | + @GetMapping("/list/detail") | |
| 47 | + public JsonResult listDetail(@RequestParam(required = false) String qyxx, | |
| 48 | + @RequestParam(required = false) Integer year, | |
| 49 | + @RequestParam(required = false) Integer month) { | |
| 50 | + List<WorkshopWorkTask> list = workshopWorkTaskService.listByCondition(qyxx, year, month); | |
| 51 | + return new JsonResult<>(true, "成功", list); | |
| 52 | + } | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 按任务状态汇总各状态记录条数 | |
| 56 | + * | |
| 57 | + * @param qyxx 区域信息,可为空 | |
| 58 | + * @param year 年份,可为空,默认当前年 | |
| 59 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 60 | + * @return 各状态汇总列表 | |
| 61 | + */ | |
| 62 | + @GetMapping("/summary/status") | |
| 63 | + public JsonResult summaryByStatus(@RequestParam(required = false) String qyxx, | |
| 64 | + @RequestParam(required = false) Integer year, | |
| 65 | + @RequestParam(required = false) Integer month) { | |
| 66 | + List<WorkshopWorkTaskStatusSummaryDTO> list = workshopWorkTaskService.summaryByStatus(qyxx, year, month); | |
| 67 | + return new JsonResult<>(true, "成功", list); | |
| 68 | + } | |
| 69 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.dto; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import lombok.Getter; | |
| 5 | +import lombok.Setter; | |
| 6 | +import lombok.ToString; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | + | |
| 9 | +import java.io.Serializable; | |
| 10 | +import java.util.Date; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 过程确认班组计划明细(含关联班组、工位编号与名称) | |
| 14 | + */ | |
| 15 | +@Getter | |
| 16 | +@Setter | |
| 17 | +@ToString | |
| 18 | +public class ProcessConfirmTeamPlanDetailDTO implements Serializable { | |
| 19 | + | |
| 20 | + private static final long serialVersionUID = 1L; | |
| 21 | + | |
| 22 | + /* | |
| 23 | + * 记录ID | |
| 24 | + */ | |
| 25 | + private String id; | |
| 26 | + | |
| 27 | + /* | |
| 28 | + * 创建时间 | |
| 29 | + */ | |
| 30 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 31 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 32 | + private Date createdAt; | |
| 33 | + | |
| 34 | + /* | |
| 35 | + * 计划日期 | |
| 36 | + */ | |
| 37 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 38 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 39 | + private Date jhrq; | |
| 40 | + | |
| 41 | + /* | |
| 42 | + * 执行人 | |
| 43 | + */ | |
| 44 | + private String zxr; | |
| 45 | + | |
| 46 | + /* | |
| 47 | + * 单位信息 | |
| 48 | + */ | |
| 49 | + private String dwxx; | |
| 50 | + | |
| 51 | + /* | |
| 52 | + * 线体信息 | |
| 53 | + */ | |
| 54 | + private String xtxx; | |
| 55 | + | |
| 56 | + /* | |
| 57 | + * 室组信息 | |
| 58 | + */ | |
| 59 | + private String szxx; | |
| 60 | + | |
| 61 | + /* | |
| 62 | + * 区域信息 | |
| 63 | + */ | |
| 64 | + private String qyxx; | |
| 65 | + | |
| 66 | + /* | |
| 67 | + * 状态 | |
| 68 | + */ | |
| 69 | + private String zt; | |
| 70 | + | |
| 71 | + /* | |
| 72 | + * 是否发现问题 | |
| 73 | + */ | |
| 74 | + private Boolean sffxwt; | |
| 75 | + | |
| 76 | + /* | |
| 77 | + * 班次信息 | |
| 78 | + */ | |
| 79 | + private String bcxx; | |
| 80 | + | |
| 81 | + // ========== 计划走访班组 ========== | |
| 82 | + | |
| 83 | + /* | |
| 84 | + * 计划走访班组id | |
| 85 | + */ | |
| 86 | + private String jhzfbz; | |
| 87 | + | |
| 88 | + /* | |
| 89 | + * 计划走访班组名称 | |
| 90 | + */ | |
| 91 | + private String jhzfbzName; | |
| 92 | + | |
| 93 | + /* | |
| 94 | + * 计划走访班组编号 | |
| 95 | + */ | |
| 96 | + private String jhzfbzCode; | |
| 97 | + | |
| 98 | + // ========== 计划走访工位 ========== | |
| 99 | + | |
| 100 | + /* | |
| 101 | + * 计划走访工位id | |
| 102 | + */ | |
| 103 | + private String jhzfgw; | |
| 104 | + | |
| 105 | + /* | |
| 106 | + * 计划走访工位名称 | |
| 107 | + */ | |
| 108 | + private String jhzfgwName; | |
| 109 | + | |
| 110 | + /* | |
| 111 | + * 计划走访工位编号 | |
| 112 | + */ | |
| 113 | + private String jhzfgwCode; | |
| 114 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.dto; | |
| 2 | + | |
| 3 | +import lombok.Getter; | |
| 4 | +import lombok.Setter; | |
| 5 | +import lombok.ToString; | |
| 6 | + | |
| 7 | +import java.io.Serializable; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 质量缺陷每日汇总结果 | |
| 11 | + */ | |
| 12 | +@Getter | |
| 13 | +@Setter | |
| 14 | +@ToString | |
| 15 | +public class QualityDefectDailySummaryDTO implements Serializable { | |
| 16 | + | |
| 17 | + private static final long serialVersionUID = 1L; | |
| 18 | + | |
| 19 | + /* | |
| 20 | + * 日期(yyyy-MM-dd) | |
| 21 | + */ | |
| 22 | + private String date; | |
| 23 | + | |
| 24 | + /* | |
| 25 | + * 当日缺陷记录数 | |
| 26 | + */ | |
| 27 | + private Integer count; | |
| 28 | + | |
| 29 | + public QualityDefectDailySummaryDTO() { | |
| 30 | + } | |
| 31 | + | |
| 32 | + public QualityDefectDailySummaryDTO(String date, Integer count) { | |
| 33 | + this.date = date; | |
| 34 | + this.count = count; | |
| 35 | + } | |
| 36 | +} | ... | ... |
src/main/java/com/qgutech/qgyun/apaas/sync/cps/dto/QualityDefectWorkstationSummaryDTO.java
0 → 100644
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.dto; | |
| 2 | + | |
| 3 | +import lombok.Getter; | |
| 4 | +import lombok.Setter; | |
| 5 | +import lombok.ToString; | |
| 6 | + | |
| 7 | +import java.io.Serializable; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 质量缺陷按工位汇总结果 | |
| 11 | + */ | |
| 12 | +@Getter | |
| 13 | +@Setter | |
| 14 | +@ToString | |
| 15 | +public class QualityDefectWorkstationSummaryDTO implements Serializable { | |
| 16 | + | |
| 17 | + private static final long serialVersionUID = 1L; | |
| 18 | + | |
| 19 | + /* | |
| 20 | + * 工位信息ID | |
| 21 | + */ | |
| 22 | + private String wtgwxx; | |
| 23 | + | |
| 24 | + /* | |
| 25 | + * 该工位缺陷记录数 | |
| 26 | + */ | |
| 27 | + private Integer count; | |
| 28 | + | |
| 29 | + /* | |
| 30 | + * 该工位缺陷次数合计(ydcfcs 字段求和) | |
| 31 | + */ | |
| 32 | + private Double totalYdcfcs; | |
| 33 | + | |
| 34 | + public QualityDefectWorkstationSummaryDTO() { | |
| 35 | + } | |
| 36 | + | |
| 37 | + public QualityDefectWorkstationSummaryDTO(String wtgwxx, Integer count, Double totalYdcfcs) { | |
| 38 | + this.wtgwxx = wtgwxx; | |
| 39 | + this.count = count; | |
| 40 | + this.totalYdcfcs = totalYdcfcs; | |
| 41 | + } | |
| 42 | +} | ... | ... |
| ... | ... | @@ -30,4 +30,14 @@ public class StopRecordDailySummaryDTO implements Serializable { |
| 30 | 30 | * 当日停线记录数 |
| 31 | 31 | */ |
| 32 | 32 | private Integer totalCount; |
| 33 | + | |
| 34 | + /* | |
| 35 | + * 板块编码(其他板块汇总时为空) | |
| 36 | + */ | |
| 37 | + private String bkbm; | |
| 38 | + | |
| 39 | + /* | |
| 40 | + * 板块名称(其他板块汇总时为空) | |
| 41 | + */ | |
| 42 | + private String bkmc; | |
| 33 | 43 | } | ... | ... |
| ... | ... | @@ -40,4 +40,14 @@ public class StopRecordWorkstationSummaryDTO implements Serializable { |
| 40 | 40 | * 该工位停线记录数 |
| 41 | 41 | */ |
| 42 | 42 | private Integer totalCount; |
| 43 | + | |
| 44 | + /* | |
| 45 | + * 板块编码(其他板块汇总时为空) | |
| 46 | + */ | |
| 47 | + private String bkbm; | |
| 48 | + | |
| 49 | + /* | |
| 50 | + * 板块名称(其他板块汇总时为空) | |
| 51 | + */ | |
| 52 | + private String bkmc; | |
| 43 | 53 | } | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.dto; | |
| 2 | + | |
| 3 | +import lombok.Getter; | |
| 4 | +import lombok.Setter; | |
| 5 | +import lombok.ToString; | |
| 6 | + | |
| 7 | +import java.io.Serializable; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 车间级工作任务按状态汇总结果 | |
| 11 | + */ | |
| 12 | +@Getter | |
| 13 | +@Setter | |
| 14 | +@ToString | |
| 15 | +public class WorkshopWorkTaskStatusSummaryDTO implements Serializable { | |
| 16 | + | |
| 17 | + private static final long serialVersionUID = 1L; | |
| 18 | + | |
| 19 | + /* | |
| 20 | + * 任务状态编码 | |
| 21 | + */ | |
| 22 | + private String rwzt; | |
| 23 | + | |
| 24 | + /* | |
| 25 | + * 该状态下的任务数量 | |
| 26 | + */ | |
| 27 | + private Integer count; | |
| 28 | + | |
| 29 | + public WorkshopWorkTaskStatusSummaryDTO() { | |
| 30 | + } | |
| 31 | + | |
| 32 | + public WorkshopWorkTaskStatusSummaryDTO(String rwzt, Integer count) { | |
| 33 | + this.rwzt = rwzt; | |
| 34 | + this.count = count; | |
| 35 | + } | |
| 36 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.mapper; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.model.QualityDefect; | |
| 5 | + | |
| 6 | +public interface QualityDefectMapper extends QguBaseMapper<QualityDefect> { | |
| 7 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.mapper; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.model.WorkshopWorkPlan; | |
| 5 | + | |
| 6 | +public interface WorkshopWorkPlanMapper extends QguBaseMapper<WorkshopWorkPlan> { | |
| 7 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.mapper; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.framework.database.mybatis.registermapper.QguBaseMapper; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.cps.model.WorkshopWorkTask; | |
| 5 | + | |
| 6 | +public interface WorkshopWorkTaskMapper extends QguBaseMapper<WorkshopWorkTask> { | |
| 7 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.model; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import com.qgutech.qgyun.framework.database.model.BaseCorpModel; | |
| 5 | +import lombok.Getter; | |
| 6 | +import lombok.Setter; | |
| 7 | +import lombok.ToString; | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | + | |
| 10 | +import javax.persistence.Table; | |
| 11 | +import java.util.Date; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 质量缺陷信息 | |
| 15 | + */ | |
| 16 | +@Getter | |
| 17 | +@Setter | |
| 18 | +@ToString | |
| 19 | +@Table(name = "t_auto_hfca_zlujkl_jkwtix") | |
| 20 | +public class QualityDefect extends BaseCorpModel { | |
| 21 | + | |
| 22 | + public static final String WTGWXX = "wtgwxx"; | |
| 23 | + public static final String TCRQ = "tcrq"; | |
| 24 | + public static final String WTSX = "wtsx"; | |
| 25 | + public static final String ZRQYXX = "zrqyxx"; | |
| 26 | + | |
| 27 | + /* | |
| 28 | + * 事件属性 | |
| 29 | + */ | |
| 30 | + private String sjsx; | |
| 31 | + | |
| 32 | + /* | |
| 33 | + * 提出日期 | |
| 34 | + */ | |
| 35 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 36 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 37 | + private Date tcrq; | |
| 38 | + | |
| 39 | + /* | |
| 40 | + * 控制案例号 | |
| 41 | + */ | |
| 42 | + private String kzahnt; | |
| 43 | + | |
| 44 | + /* | |
| 45 | + * VIN码 | |
| 46 | + */ | |
| 47 | + private String vin; | |
| 48 | + | |
| 49 | + /* | |
| 50 | + * 问题部位 | |
| 51 | + */ | |
| 52 | + private String wtbw; | |
| 53 | + | |
| 54 | + /* | |
| 55 | + * 问题描述 | |
| 56 | + */ | |
| 57 | + private String wtms; | |
| 58 | + | |
| 59 | + /* | |
| 60 | + * 问题工位信息 | |
| 61 | + */ | |
| 62 | + private String wtgwxx; | |
| 63 | + | |
| 64 | + /* | |
| 65 | + * 缺陷次数 | |
| 66 | + */ | |
| 67 | + private Double ydcfcs; | |
| 68 | + | |
| 69 | + /* | |
| 70 | + * 问题图片 | |
| 71 | + */ | |
| 72 | + private String wtImg; | |
| 73 | + | |
| 74 | + /* | |
| 75 | + * 问题提出单位 | |
| 76 | + */ | |
| 77 | + private String wttcdw; | |
| 78 | + | |
| 79 | + /* | |
| 80 | + * 问题属性 | |
| 81 | + */ | |
| 82 | + private String wtsx; | |
| 83 | + | |
| 84 | + /* | |
| 85 | + * 问题班次信息 | |
| 86 | + */ | |
| 87 | + private String wtbcxx; | |
| 88 | + | |
| 89 | + /* | |
| 90 | + * 通知时间 | |
| 91 | + */ | |
| 92 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 93 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 94 | + private Date tzsj; | |
| 95 | + | |
| 96 | + /* | |
| 97 | + * 通知人员 | |
| 98 | + */ | |
| 99 | + private String tzry; | |
| 100 | + | |
| 101 | + /* | |
| 102 | + * 责任区域信息 | |
| 103 | + */ | |
| 104 | + private String zrqyxx; | |
| 105 | + | |
| 106 | + /* | |
| 107 | + * 责任人员 | |
| 108 | + */ | |
| 109 | + private String zrry; | |
| 110 | + | |
| 111 | + /* | |
| 112 | + * 是否排出 | |
| 113 | + */ | |
| 114 | + private Boolean sfpc; | |
| 115 | + | |
| 116 | + /* | |
| 117 | + * 排出问题原因 | |
| 118 | + */ | |
| 119 | + private String pcwtyy; | |
| 120 | + | |
| 121 | + /* | |
| 122 | + * 排出措施 | |
| 123 | + */ | |
| 124 | + private String pcts; | |
| 125 | + | |
| 126 | + /* | |
| 127 | + * 是否纳入区域管理看板 | |
| 128 | + */ | |
| 129 | + private Boolean sfnrqygk; | |
| 130 | + | |
| 131 | + /* | |
| 132 | + * 员工号 | |
| 133 | + */ | |
| 134 | + private String ygh; | |
| 135 | + | |
| 136 | + /* | |
| 137 | + * 问题基准车号 | |
| 138 | + */ | |
| 139 | + private String wtjzch; | |
| 140 | + | |
| 141 | + /* | |
| 142 | + * 发生原因 | |
| 143 | + */ | |
| 144 | + private String fsyy; | |
| 145 | + | |
| 146 | + /* | |
| 147 | + * 管控措施 | |
| 148 | + */ | |
| 149 | + private String gkcs; | |
| 150 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.model; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.framework.database.model.BaseCorpModel; | |
| 4 | +import lombok.Getter; | |
| 5 | +import lombok.Setter; | |
| 6 | +import lombok.ToString; | |
| 7 | + | |
| 8 | +import javax.persistence.Table; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 车间级工作计划信息 | |
| 12 | + */ | |
| 13 | +@Getter | |
| 14 | +@Setter | |
| 15 | +@ToString | |
| 16 | +@Table(name = "t_auto_hfca_zlujkl_haxddh") | |
| 17 | +public class WorkshopWorkPlan extends BaseCorpModel { | |
| 18 | + | |
| 19 | + public static final String GZJHMC = "gzjhmc"; | |
| 20 | + public static final String DWXX = "dwxx"; | |
| 21 | + public static final String GZJHZT = "gzjhzt"; | |
| 22 | + | |
| 23 | + /* | |
| 24 | + * 工作计划序号 | |
| 25 | + */ | |
| 26 | + private String gzjhxh; | |
| 27 | + | |
| 28 | + /* | |
| 29 | + * 工作计划名称 | |
| 30 | + */ | |
| 31 | + private String gzjhmc; | |
| 32 | + | |
| 33 | + /* | |
| 34 | + * 单位信息 | |
| 35 | + */ | |
| 36 | + private String dwxx; | |
| 37 | + | |
| 38 | + /* | |
| 39 | + * 室组信息 | |
| 40 | + */ | |
| 41 | + private String szxx; | |
| 42 | + | |
| 43 | + /* | |
| 44 | + * 区域信息 | |
| 45 | + */ | |
| 46 | + private String qyxx; | |
| 47 | + | |
| 48 | + /* | |
| 49 | + * 班组信息 | |
| 50 | + */ | |
| 51 | + private String bzxx; | |
| 52 | + | |
| 53 | + /* | |
| 54 | + * 计划负责人 | |
| 55 | + */ | |
| 56 | + private String jhfzr; | |
| 57 | + | |
| 58 | + /* | |
| 59 | + * 计划是否开启 | |
| 60 | + */ | |
| 61 | + private Boolean jhsfkq; | |
| 62 | + | |
| 63 | + /* | |
| 64 | + * 工作计划状态 | |
| 65 | + */ | |
| 66 | + private String gzjhzt; | |
| 67 | + | |
| 68 | + /* | |
| 69 | + * 板块信息 | |
| 70 | + */ | |
| 71 | + private String bkxx; | |
| 72 | + | |
| 73 | + /* | |
| 74 | + * 板块序号 | |
| 75 | + */ | |
| 76 | + private String bkxh; | |
| 77 | + | |
| 78 | + /* | |
| 79 | + * 序号 | |
| 80 | + */ | |
| 81 | + private String xh; | |
| 82 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.model; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import com.qgutech.qgyun.framework.database.model.BaseCorpModel; | |
| 5 | +import lombok.Getter; | |
| 6 | +import lombok.Setter; | |
| 7 | +import lombok.ToString; | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | + | |
| 10 | +import javax.persistence.Table; | |
| 11 | +import java.util.Date; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 车间级工作任务 | |
| 15 | + */ | |
| 16 | +@Getter | |
| 17 | +@Setter | |
| 18 | +@ToString | |
| 19 | +@Table(name = "t_auto_hfca_zlujkl_ddxxsf") | |
| 20 | +public class WorkshopWorkTask extends BaseCorpModel { | |
| 21 | + | |
| 22 | + public static final String SSGZJH = "ssgzjh"; | |
| 23 | + public static final String RWZT = "rwzt"; | |
| 24 | + public static final String START_DATE = "startDate"; | |
| 25 | + public static final String END_DATE = "endDate"; | |
| 26 | + public static final String QYXX = "qyxx"; | |
| 27 | + | |
| 28 | + /* | |
| 29 | + * 任务序号 | |
| 30 | + */ | |
| 31 | + private String rwxh; | |
| 32 | + | |
| 33 | + /* | |
| 34 | + * 任务名称 | |
| 35 | + */ | |
| 36 | + private String rwmc; | |
| 37 | + | |
| 38 | + /* | |
| 39 | + * 所属工作计划 | |
| 40 | + */ | |
| 41 | + private String ssgzjh; | |
| 42 | + | |
| 43 | + /* | |
| 44 | + * 任务负责人 | |
| 45 | + */ | |
| 46 | + private String rwfzr; | |
| 47 | + | |
| 48 | + /* | |
| 49 | + * 开始日期 | |
| 50 | + */ | |
| 51 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 52 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 53 | + private Date startDate; | |
| 54 | + | |
| 55 | + /* | |
| 56 | + * 结束日期 | |
| 57 | + */ | |
| 58 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 59 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 60 | + private Date endDate; | |
| 61 | + | |
| 62 | + /* | |
| 63 | + * 任务状态 | |
| 64 | + */ | |
| 65 | + private String rwzt; | |
| 66 | + | |
| 67 | + /* | |
| 68 | + * 工作计划序号 | |
| 69 | + */ | |
| 70 | + private String gzjhxh; | |
| 71 | + | |
| 72 | + /* | |
| 73 | + * 计划负责人 | |
| 74 | + */ | |
| 75 | + private String jhfzr; | |
| 76 | + | |
| 77 | + /* | |
| 78 | + * 区域信息 | |
| 79 | + */ | |
| 80 | + private String qyxx; | |
| 81 | + | |
| 82 | + /* | |
| 83 | + * 关联信息 | |
| 84 | + */ | |
| 85 | + private String iejjof; | |
| 86 | + | |
| 87 | + /* | |
| 88 | + * 序号 | |
| 89 | + */ | |
| 90 | + private String xh; | |
| 91 | + | |
| 92 | + /* | |
| 93 | + * 任务目标 | |
| 94 | + */ | |
| 95 | + private String rwmb; | |
| 96 | + | |
| 97 | + /* | |
| 98 | + * 完成情况 | |
| 99 | + */ | |
| 100 | + private String wcqk; | |
| 101 | + | |
| 102 | + /* | |
| 103 | + * 完成情况附件 | |
| 104 | + */ | |
| 105 | + private String wcqkfj; | |
| 106 | + | |
| 107 | + /* | |
| 108 | + * 备注 | |
| 109 | + */ | |
| 110 | + private String remark; | |
| 111 | +} | ... | ... |
| ... | ... | @@ -6,6 +6,7 @@ import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | 6 | import com.qgutech.qgyun.apaas.sync.cps.mapper.BlockInfoMapper; |
| 7 | 7 | import com.qgutech.qgyun.apaas.sync.cps.model.BlockInfo; |
| 8 | 8 | import org.apache.commons.collections4.CollectionUtils; |
| 9 | +import org.apache.commons.lang3.StringUtils; | |
| 9 | 10 | import org.springframework.stereotype.Service; |
| 10 | 11 | import org.springframework.transaction.annotation.Transactional; |
| 11 | 12 | import org.springframework.util.Assert; |
| ... | ... | @@ -69,4 +70,24 @@ public class BlockInfoService extends BaseServiceImpl<BlockInfo> { |
| 69 | 70 | Example example = CorpExample.ofCorp(entityClass); |
| 70 | 71 | return blockInfoMapper.selectByExample(example); |
| 71 | 72 | } |
| 73 | + | |
| 74 | + /** | |
| 75 | + * 根据板块编码(bm)查询板块信息 | |
| 76 | + * | |
| 77 | + * @param bm 板块编码,可为空 | |
| 78 | + * @return 匹配的板块信息,不存在或 bm 为空时返回 null | |
| 79 | + */ | |
| 80 | + @Transactional(readOnly = true) | |
| 81 | + public BlockInfo getByBm(String bm) { | |
| 82 | + if (StringUtils.isBlank(bm)) { | |
| 83 | + return null; | |
| 84 | + } | |
| 85 | + Example example = new Example(entityClass); | |
| 86 | + CorpExample.criteria(example).andEqualTo(BlockInfo.BM, bm); | |
| 87 | + List<BlockInfo> list = blockInfoMapper.selectByExample(example); | |
| 88 | + if (CollectionUtils.isEmpty(list)) { | |
| 89 | + return null; | |
| 90 | + } | |
| 91 | + return list.get(0); | |
| 92 | + } | |
| 72 | 93 | } | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.service; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | |
| 5 | +import com.qgutech.qgyun.apaas.sync.base.BoException; | |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.dto.QualityDefectDailySummaryDTO; | |
| 7 | +import com.qgutech.qgyun.apaas.sync.cps.dto.QualityDefectWorkstationSummaryDTO; | |
| 8 | +import com.qgutech.qgyun.apaas.sync.cps.mapper.QualityDefectMapper; | |
| 9 | +import com.qgutech.qgyun.apaas.sync.cps.model.QualityDefect; | |
| 10 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | |
| 11 | +import com.qgutech.qgyun.apaas.sync.utils.DateDealUtils; | |
| 12 | +import org.apache.commons.collections4.CollectionUtils; | |
| 13 | +import org.apache.commons.lang3.StringUtils; | |
| 14 | +import org.springframework.stereotype.Service; | |
| 15 | +import org.springframework.transaction.annotation.Transactional; | |
| 16 | +import org.springframework.util.Assert; | |
| 17 | +import tk.mybatis.mapper.entity.Example; | |
| 18 | + | |
| 19 | +import javax.annotation.Resource; | |
| 20 | +import java.text.SimpleDateFormat; | |
| 21 | +import java.util.*; | |
| 22 | +import java.util.stream.Collectors; | |
| 23 | + | |
| 24 | +/** | |
| 25 | + * QualityDefect 服务 | |
| 26 | + */ | |
| 27 | +@Service | |
| 28 | +public class QualityDefectService extends BaseServiceImpl<QualityDefect> { | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private QualityDefectMapper qualityDefectMapper; | |
| 32 | + | |
| 33 | + @Transactional(readOnly = true) | |
| 34 | + public QualityDefect getById(String id) { | |
| 35 | + Assert.hasLength(id, "id is empty!"); | |
| 36 | + | |
| 37 | + Example example = new Example(entityClass); | |
| 38 | + CorpExample.criteria(example).andEqualTo(QualityDefect.ID, id); | |
| 39 | + QualityDefect qualityDefect = qualityDefectMapper.selectOneByExample(example); | |
| 40 | + if (null == qualityDefect) { | |
| 41 | + throw new BoException(BoErrorCode.DATA_ERROR); | |
| 42 | + } | |
| 43 | + return qualityDefect; | |
| 44 | + } | |
| 45 | + | |
| 46 | + @Transactional(readOnly = true) | |
| 47 | + public List<QualityDefect> listByIds(Collection<String> ids) { | |
| 48 | + Assert.notEmpty(ids, "ids is empty!"); | |
| 49 | + | |
| 50 | + Example example = new Example(entityClass); | |
| 51 | + CorpExample.criteria(example).andIn(QualityDefect.ID, ids); | |
| 52 | + List<QualityDefect> list = qualityDefectMapper.selectByExample(example); | |
| 53 | + if (CollectionUtils.isEmpty(list)) { | |
| 54 | + return new ArrayList<>(0); | |
| 55 | + } | |
| 56 | + return list; | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Transactional(readOnly = true) | |
| 60 | + public Map<String, QualityDefect> mapByIds(Collection<String> ids) { | |
| 61 | + Assert.notEmpty(ids, "ids is empty!"); | |
| 62 | + | |
| 63 | + List<QualityDefect> list = listByIds(ids); | |
| 64 | + if (CollectionUtils.isEmpty(list)) { | |
| 65 | + return new HashMap<>(0); | |
| 66 | + } | |
| 67 | + | |
| 68 | + return list.stream().collect(Collectors.toMap(QualityDefect::getId, item -> item)); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Transactional(readOnly = true) | |
| 72 | + public List<QualityDefect> listAll() { | |
| 73 | + | |
| 74 | + Example example = CorpExample.ofCorp(entityClass); | |
| 75 | + return qualityDefectMapper.selectByExample(example); | |
| 76 | + } | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * 按月份查询每日质量缺陷记录汇总数目 | |
| 80 | + * | |
| 81 | + * @param zrqyxx 责任区域信息,可为空 | |
| 82 | + * @param year 年份,可为空,默认当前年 | |
| 83 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 84 | + * @return 每日缺陷记录汇总列表(按日期升序) | |
| 85 | + */ | |
| 86 | + @Transactional(readOnly = true) | |
| 87 | + public List<QualityDefectDailySummaryDTO> summaryDailyByMonth(String zrqyxx, Integer year, Integer month) { | |
| 88 | + Date start = DateDealUtils.getMonthStartTime(year, month); | |
| 89 | + Date end = DateDealUtils.getMonthEndTime(year, month); | |
| 90 | + | |
| 91 | + List<QualityDefect> list = listByCondition(zrqyxx, start, end, null); | |
| 92 | + if (CollectionUtils.isEmpty(list)) { | |
| 93 | + return new ArrayList<>(0); | |
| 94 | + } | |
| 95 | + | |
| 96 | + // 按天分组统计 | |
| 97 | + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); | |
| 98 | + Map<String, Long> dailyCountMap = list.stream() | |
| 99 | + .filter(item -> item.getTcrq() != null) | |
| 100 | + .collect(Collectors.groupingBy( | |
| 101 | + item -> dateFormat.format(item.getTcrq()), | |
| 102 | + Collectors.counting())); | |
| 103 | + | |
| 104 | + List<QualityDefectDailySummaryDTO> result = new ArrayList<>(); | |
| 105 | + for (Map.Entry<String, Long> entry : dailyCountMap.entrySet()) { | |
| 106 | + result.add(new QualityDefectDailySummaryDTO(entry.getKey(), entry.getValue().intValue())); | |
| 107 | + } | |
| 108 | + | |
| 109 | + // 按日期升序 | |
| 110 | + result.sort(Comparator.comparing(QualityDefectDailySummaryDTO::getDate)); | |
| 111 | + return result; | |
| 112 | + } | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * 按指定日期和区域汇总各工位缺陷次数(按次数降序) | |
| 116 | + * | |
| 117 | + * @param zrqyxx 责任区域信息,可为空 | |
| 118 | + * @param date 指定日期(yyyy-MM-dd),不可为空 | |
| 119 | + * @return 各工位缺陷次数汇总列表(按缺陷次数降序) | |
| 120 | + */ | |
| 121 | + @Transactional(readOnly = true) | |
| 122 | + public List<QualityDefectWorkstationSummaryDTO> summaryByWorkstation(String zrqyxx, String date) { | |
| 123 | + Date[] range = parseDateRange(date); | |
| 124 | + | |
| 125 | + List<QualityDefect> list = listByCondition(zrqyxx, range[0], range[1], null); | |
| 126 | + if (CollectionUtils.isEmpty(list)) { | |
| 127 | + return new ArrayList<>(0); | |
| 128 | + } | |
| 129 | + | |
| 130 | + // 按工位分组汇总 | |
| 131 | + Map<String, List<QualityDefect>> workstationGroup = list.stream() | |
| 132 | + .filter(item -> StringUtils.isNotBlank(item.getWtgwxx())) | |
| 133 | + .collect(Collectors.groupingBy(QualityDefect::getWtgwxx)); | |
| 134 | + | |
| 135 | + List<QualityDefectWorkstationSummaryDTO> result = new ArrayList<>(); | |
| 136 | + for (Map.Entry<String, List<QualityDefect>> entry : workstationGroup.entrySet()) { | |
| 137 | + List<QualityDefect> wsList = entry.getValue(); | |
| 138 | + double totalYdcfcs = wsList.stream() | |
| 139 | + .mapToDouble(item -> item.getYdcfcs() == null ? 0.0 : item.getYdcfcs()) | |
| 140 | + .sum(); | |
| 141 | + result.add(new QualityDefectWorkstationSummaryDTO(entry.getKey(), wsList.size(), totalYdcfcs)); | |
| 142 | + } | |
| 143 | + | |
| 144 | + // 按缺陷次数降序 | |
| 145 | + result.sort(Comparator.comparing(QualityDefectWorkstationSummaryDTO::getTotalYdcfcs, | |
| 146 | + Comparator.nullsLast(Comparator.reverseOrder()))); | |
| 147 | + return result; | |
| 148 | + } | |
| 149 | + | |
| 150 | + /** | |
| 151 | + * 按指定日期、区域、工位查询质量缺陷明细列表 | |
| 152 | + * | |
| 153 | + * @param zrqyxx 责任区域信息,可为空 | |
| 154 | + * @param date 指定日期(yyyy-MM-dd),不可为空 | |
| 155 | + * @param wtgwxx 问题工位信息,可为空 | |
| 156 | + * @return 质量缺陷明细列表 | |
| 157 | + */ | |
| 158 | + @Transactional(readOnly = true) | |
| 159 | + public List<QualityDefect> listDetailByCondition(String zrqyxx, String date, String wtgwxx) { | |
| 160 | + Date[] range = parseDateRange(date); | |
| 161 | + return listByCondition(zrqyxx, range[0], range[1], wtgwxx); | |
| 162 | + } | |
| 163 | + | |
| 164 | + /** | |
| 165 | + * 根据条件查询质量缺陷记录 | |
| 166 | + * | |
| 167 | + * @param zrqyxx 责任区域信息,可为空 | |
| 168 | + * @param start 提出日期范围-开始,可为空 | |
| 169 | + * @param end 提出日期范围-结束,可为空 | |
| 170 | + * @param wtgwxx 问题工位信息,可为空 | |
| 171 | + * @return 质量缺陷记录列表 | |
| 172 | + */ | |
| 173 | + private List<QualityDefect> listByCondition(String zrqyxx, Date start, Date end, String wtgwxx) { | |
| 174 | + Example example = new Example(entityClass); | |
| 175 | + Example.Criteria criteria = CorpExample.criteria(example); | |
| 176 | + | |
| 177 | + if (start != null && end != null) { | |
| 178 | + criteria.andBetween(QualityDefect.TCRQ, start, end); | |
| 179 | + } | |
| 180 | + if (StringUtils.isNotBlank(zrqyxx)) { | |
| 181 | + criteria.andEqualTo(QualityDefect.ZRQYXX, zrqyxx); | |
| 182 | + } | |
| 183 | + if (StringUtils.isNotBlank(wtgwxx)) { | |
| 184 | + criteria.andEqualTo(QualityDefect.WTGWXX, wtgwxx); | |
| 185 | + } | |
| 186 | + | |
| 187 | + List<QualityDefect> list = qualityDefectMapper.selectByExample(example); | |
| 188 | + if (CollectionUtils.isEmpty(list)) { | |
| 189 | + return new ArrayList<>(0); | |
| 190 | + } | |
| 191 | + return list; | |
| 192 | + } | |
| 193 | + | |
| 194 | + /** | |
| 195 | + * 将指定日期(yyyy-MM-dd)解析为当天的起止时间范围 | |
| 196 | + * | |
| 197 | + * @param date 指定日期 | |
| 198 | + * @return 长度为 2 的数组 [start, end] | |
| 199 | + */ | |
| 200 | + private Date[] parseDateRange(String date) { | |
| 201 | + Assert.hasLength(date, "date is empty!"); | |
| 202 | + try { | |
| 203 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
| 204 | + Calendar cal = Calendar.getInstance(); | |
| 205 | + cal.setTime(sdf.parse(date)); | |
| 206 | + cal.set(Calendar.HOUR_OF_DAY, 0); | |
| 207 | + cal.set(Calendar.MINUTE, 0); | |
| 208 | + cal.set(Calendar.SECOND, 0); | |
| 209 | + cal.set(Calendar.MILLISECOND, 0); | |
| 210 | + Date start = cal.getTime(); | |
| 211 | + | |
| 212 | + cal.set(Calendar.HOUR_OF_DAY, 23); | |
| 213 | + cal.set(Calendar.MINUTE, 59); | |
| 214 | + cal.set(Calendar.SECOND, 59); | |
| 215 | + cal.set(Calendar.MILLISECOND, 999); | |
| 216 | + Date end = cal.getTime(); | |
| 217 | + return new Date[]{start, end}; | |
| 218 | + } catch (Exception e) { | |
| 219 | + throw new BoException(BoErrorCode.PARAM_ERROR, "日期格式错误,应为 yyyy-MM-dd"); | |
| 220 | + } | |
| 221 | + } | |
| 222 | +} | ... | ... |
| ... | ... | @@ -3,9 +3,11 @@ package com.qgutech.qgyun.apaas.sync.cps.service; |
| 3 | 3 | import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; |
| 4 | 4 | import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; |
| 5 | 5 | import com.qgutech.qgyun.apaas.sync.base.BoException; |
| 6 | +import com.qgutech.qgyun.apaas.sync.constant.Constant; | |
| 6 | 7 | import com.qgutech.qgyun.apaas.sync.cps.dto.StopRecordDailySummaryDTO; |
| 7 | 8 | import com.qgutech.qgyun.apaas.sync.cps.dto.StopRecordWorkstationSummaryDTO; |
| 8 | 9 | import com.qgutech.qgyun.apaas.sync.cps.mapper.StopRecordMapper; |
| 10 | +import com.qgutech.qgyun.apaas.sync.cps.model.BlockInfo; | |
| 9 | 11 | import com.qgutech.qgyun.apaas.sync.cps.model.StopRecord; |
| 10 | 12 | import com.qgutech.qgyun.apaas.sync.cps.model.StopWorkstation; |
| 11 | 13 | import org.apache.commons.collections4.CollectionUtils; |
| ... | ... | @@ -27,12 +29,20 @@ import java.util.stream.Collectors; |
| 27 | 29 | @Service |
| 28 | 30 | public class StopRecordService extends BaseServiceImpl<StopRecord> { |
| 29 | 31 | |
| 32 | + /** | |
| 33 | + * “其他板块”哨兵值:表示停线板块不属于物流(W)/设备(M)/质量(Q) 三者 | |
| 34 | + */ | |
| 35 | + private static final String BLOCK_OTHER = "__OTHER__"; | |
| 36 | + | |
| 30 | 37 | @Resource |
| 31 | 38 | private StopRecordMapper stopRecordMapper; |
| 32 | 39 | |
| 33 | 40 | @Resource |
| 34 | 41 | private StopWorkstationService stopWorkstationService; |
| 35 | 42 | |
| 43 | + @Resource | |
| 44 | + private BlockInfoService blockInfoService; | |
| 45 | + | |
| 36 | 46 | @Transactional(readOnly = true) |
| 37 | 47 | public StopRecord getById(String id) { |
| 38 | 48 | Assert.hasLength(id, "id is empty!"); |
| ... | ... | @@ -152,29 +162,94 @@ public class StopRecordService extends BaseServiceImpl<StopRecord> { |
| 152 | 162 | } |
| 153 | 163 | |
| 154 | 164 | /** |
| 155 | - * 按天汇总统计停线时长 | |
| 156 | - * <p> | |
| 157 | - * 根据线体、班次、区域、板块条件筛选停线记录,按天分组汇总停线时长 | |
| 165 | + * 按天汇总统计停线时长——物流板块(编码 W) | |
| 158 | 166 | * |
| 159 | 167 | * @param xtxx 线体信息,可为空 |
| 160 | 168 | * @param bcxx 班次信息,可为空 |
| 161 | 169 | * @param txqyxx 停线区域信息,可为空 |
| 162 | - * @param txbkxx 停线板块信息,可为空 | |
| 163 | - * @param year 年份,必填 | |
| 164 | - * @param month 月份(1-12),必填 | |
| 165 | - * @return 按天汇总的停线时长列表 | |
| 170 | + * @param year 年份,可为空,默认当前年 | |
| 171 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 172 | + * @return 按天汇总的停线时长列表(含板块信息) | |
| 173 | + */ | |
| 174 | + @Transactional(readOnly = true) | |
| 175 | + public List<StopRecordDailySummaryDTO> summaryDailyByMonthForLogistics(String xtxx, String bcxx, String txqyxx, | |
| 176 | + Integer year, Integer month) { | |
| 177 | + return summaryDailyByBlock(Constant.BLOCK_CODE_LOGISTICS, xtxx, bcxx, txqyxx, year, month); | |
| 178 | + } | |
| 179 | + | |
| 180 | + /** | |
| 181 | + * 按天汇总统计停线时长——设备板块(编码 M) | |
| 182 | + * | |
| 183 | + * @param xtxx 线体信息,可为空 | |
| 184 | + * @param bcxx 班次信息,可为空 | |
| 185 | + * @param txqyxx 停线区域信息,可为空 | |
| 186 | + * @param year 年份,可为空,默认当前年 | |
| 187 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 188 | + * @return 按天汇总的停线时长列表(含板块信息) | |
| 166 | 189 | */ |
| 167 | 190 | @Transactional(readOnly = true) |
| 168 | - public List<StopRecordDailySummaryDTO> summaryDailyByMonth(String xtxx, String bcxx, String txqyxx, | |
| 169 | - String txbkxx, String year, Integer month) { | |
| 170 | - Assert.hasLength(year, "year is empty!"); | |
| 171 | - Assert.notNull(month, "month is empty!"); | |
| 172 | - Assert.isTrue(month >= 1 && month <= 12, "month must be between 1 and 12!"); | |
| 191 | + public List<StopRecordDailySummaryDTO> summaryDailyByMonthForEquipment(String xtxx, String bcxx, String txqyxx, | |
| 192 | + Integer year, Integer month) { | |
| 193 | + return summaryDailyByBlock(Constant.BLOCK_CODE_EQUIPMENT, xtxx, bcxx, txqyxx, year, month); | |
| 194 | + } | |
| 195 | + | |
| 196 | + /** | |
| 197 | + * 按天汇总统计停线时长——质量板块(编码 Q) | |
| 198 | + * | |
| 199 | + * @param xtxx 线体信息,可为空 | |
| 200 | + * @param bcxx 班次信息,可为空 | |
| 201 | + * @param txqyxx 停线区域信息,可为空 | |
| 202 | + * @param year 年份,可为空,默认当前年 | |
| 203 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 204 | + * @return 按天汇总的停线时长列表(含板块信息) | |
| 205 | + */ | |
| 206 | + @Transactional(readOnly = true) | |
| 207 | + public List<StopRecordDailySummaryDTO> summaryDailyByMonthForQuality(String xtxx, String bcxx, String txqyxx, | |
| 208 | + Integer year, Integer month) { | |
| 209 | + return summaryDailyByBlock(Constant.BLOCK_CODE_QUALITY, xtxx, bcxx, txqyxx, year, month); | |
| 210 | + } | |
| 211 | + | |
| 212 | + /** | |
| 213 | + * 按天汇总统计停线时长——其他板块(非物流/设备/质量) | |
| 214 | + * | |
| 215 | + * @param xtxx 线体信息,可为空 | |
| 216 | + * @param bcxx 班次信息,可为空 | |
| 217 | + * @param txqyxx 停线区域信息,可为空 | |
| 218 | + * @param year 年份,可为空,默认当前年 | |
| 219 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 220 | + * @return 按天汇总的停线时长列表(不含板块信息) | |
| 221 | + */ | |
| 222 | + @Transactional(readOnly = true) | |
| 223 | + public List<StopRecordDailySummaryDTO> summaryDailyByMonthForOther(String xtxx, String bcxx, String txqyxx, | |
| 224 | + Integer year, Integer month) { | |
| 225 | + return summaryDailyByBlock(BLOCK_OTHER, xtxx, bcxx, txqyxx, year, month); | |
| 226 | + } | |
| 227 | + | |
| 228 | + /** | |
| 229 | + * 按天汇总统计停线时长(按板块通用实现) | |
| 230 | + * <p> | |
| 231 | + * 根据板块编码定位板块信息 Id,再结合线体、班次、区域条件筛选停线记录,按天分组汇总停线时长。 | |
| 232 | + * year/month 为空时默认取当前年/当前月。 | |
| 233 | + * | |
| 234 | + * @param blockCode 板块编码(W/M/Q)或 {@link #BLOCK_OTHER}(其他板块) | |
| 235 | + * @param xtxx 线体信息,可为空 | |
| 236 | + * @param bcxx 班次信息,可为空 | |
| 237 | + * @param txqyxx 停线区域信息,可为空 | |
| 238 | + * @param year 年份,可为空,默认当前年 | |
| 239 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 240 | + * @return 按天汇总的停线时长列表 | |
| 241 | + */ | |
| 242 | + private List<StopRecordDailySummaryDTO> summaryDailyByBlock(String blockCode, String xtxx, String bcxx, | |
| 243 | + String txqyxx, Integer year, Integer month) { | |
| 244 | + Calendar now = Calendar.getInstance(); | |
| 245 | + int targetYear = (year == null) ? now.get(Calendar.YEAR) : year; | |
| 246 | + int targetMonth = (month == null) ? (now.get(Calendar.MONTH) + 1) : month; | |
| 247 | + Assert.isTrue(targetMonth >= 1 && targetMonth <= 12, "month must be between 1 and 12!"); | |
| 173 | 248 | |
| 174 | 249 | // 计算月份时间范围 |
| 175 | 250 | Calendar cal = Calendar.getInstance(); |
| 176 | - cal.set(Calendar.YEAR, Integer.parseInt(year)); | |
| 177 | - cal.set(Calendar.MONTH, month - 1); | |
| 251 | + cal.set(Calendar.YEAR, targetYear); | |
| 252 | + cal.set(Calendar.MONTH, targetMonth - 1); | |
| 178 | 253 | cal.set(Calendar.DAY_OF_MONTH, 1); |
| 179 | 254 | cal.set(Calendar.HOUR_OF_DAY, 0); |
| 180 | 255 | cal.set(Calendar.MINUTE, 0); |
| ... | ... | @@ -189,12 +264,15 @@ public class StopRecordService extends BaseServiceImpl<StopRecord> { |
| 189 | 264 | cal.set(Calendar.MILLISECOND, 999); |
| 190 | 265 | Date end = cal.getTime(); |
| 191 | 266 | |
| 192 | - // 查询该月份内满足条件的停线记录 | |
| 193 | - List<StopRecord> list = listByCondition(xtxx, bcxx, txqyxx, txbkxx, null, start, end); | |
| 267 | + // 查询该月份内满足板块及其他条件的停线记录 | |
| 268 | + List<StopRecord> list = listByBlock(blockCode, xtxx, bcxx, txqyxx, null, start, end); | |
| 194 | 269 | if (CollectionUtils.isEmpty(list)) { |
| 195 | 270 | return new ArrayList<>(0); |
| 196 | 271 | } |
| 197 | 272 | |
| 273 | + // 板块信息(其他板块时为 null,不返回板块字段) | |
| 274 | + BlockInfo block = blockInfoForCode(blockCode); | |
| 275 | + | |
| 198 | 276 | // 按天分组汇总停线时长 |
| 199 | 277 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| 200 | 278 | Map<String, List<StopRecord>> dailyMap = list.stream() |
| ... | ... | @@ -215,6 +293,11 @@ public class StopRecordService extends BaseServiceImpl<StopRecord> { |
| 215 | 293 | .sum(); |
| 216 | 294 | dto.setTotalTxsc(totalTxsc); |
| 217 | 295 | |
| 296 | + if (block != null) { | |
| 297 | + dto.setBkbm(block.getBm()); | |
| 298 | + dto.setBkmc(block.getMc()); | |
| 299 | + } | |
| 300 | + | |
| 218 | 301 | resultList.add(dto); |
| 219 | 302 | } |
| 220 | 303 | |
| ... | ... | @@ -224,62 +307,248 @@ public class StopRecordService extends BaseServiceImpl<StopRecord> { |
| 224 | 307 | } |
| 225 | 308 | |
| 226 | 309 | /** |
| 227 | - * 按工位汇总统计停线时长 | |
| 310 | + * 根据板块编码及查询条件筛选停线记录 | |
| 228 | 311 | * <p> |
| 229 | - * 根据线体、班次、区域、板块条件筛选停线记录,加上指定日期, | |
| 230 | - * 按工位汇总停线时长(按停线时长降序排列),仅返回汇总结果,不含明细 | |
| 312 | + * 板块编码为 W/M/Q 时,先根据编码定位板块信息 Id,再按 txbkxx 等值过滤; | |
| 313 | + * 板块编码为 {@link #BLOCK_OTHER} 时,过滤掉属于物流/设备/质量三者的记录(含板块为空的记录)。 | |
| 314 | + * | |
| 315 | + * @param blockCode 板块编码(W/M/Q)或 {@link #BLOCK_OTHER} | |
| 316 | + * @param xtxx 线体信息,可为空 | |
| 317 | + * @param bcxx 班次信息,可为空 | |
| 318 | + * @param txqyxx 停线区域信息,可为空 | |
| 319 | + * @param txgwxx 停线工位信息,可为空 | |
| 320 | + * @param start 停线开始时间范围-开始,可为空 | |
| 321 | + * @param end 停线开始时间范围-结束,可为空 | |
| 322 | + * @return 停线记录列表 | |
| 323 | + */ | |
| 324 | + private List<StopRecord> listByBlock(String blockCode, String xtxx, String bcxx, String txqyxx, | |
| 325 | + String txgwxx, Date start, Date end) { | |
| 326 | + if (BLOCK_OTHER.equals(blockCode)) { | |
| 327 | + List<StopRecord> all = listByCondition(xtxx, bcxx, txqyxx, null, txgwxx, start, end); | |
| 328 | + Set<String> specialIds = resolveSpecialBlockIds(); | |
| 329 | + if (specialIds.isEmpty()) { | |
| 330 | + return all; | |
| 331 | + } | |
| 332 | + return all.stream() | |
| 333 | + .filter(item -> !specialIds.contains(item.getTxbkxx())) | |
| 334 | + .collect(Collectors.toList()); | |
| 335 | + } | |
| 336 | + | |
| 337 | + BlockInfo block = blockInfoService.getByBm(blockCode); | |
| 338 | + if (block == null) { | |
| 339 | + // 板块未配置,视为无数据 | |
| 340 | + return new ArrayList<>(0); | |
| 341 | + } | |
| 342 | + return listByCondition(xtxx, bcxx, txqyxx, block.getId(), txgwxx, start, end); | |
| 343 | + } | |
| 344 | + | |
| 345 | + /** | |
| 346 | + * 获取物流/设备/质量三大板块的信息 Id 集合(未配置的板块自动忽略) | |
| 347 | + * | |
| 348 | + * @return 板块 Id 集合 | |
| 349 | + */ | |
| 350 | + private Set<String> resolveSpecialBlockIds() { | |
| 351 | + Set<String> ids = new HashSet<>(); | |
| 352 | + for (String bm : new String[]{Constant.BLOCK_CODE_LOGISTICS, | |
| 353 | + Constant.BLOCK_CODE_EQUIPMENT, Constant.BLOCK_CODE_QUALITY}) { | |
| 354 | + BlockInfo block = blockInfoService.getByBm(bm); | |
| 355 | + if (block != null) { | |
| 356 | + ids.add(block.getId()); | |
| 357 | + } | |
| 358 | + } | |
| 359 | + return ids; | |
| 360 | + } | |
| 361 | + | |
| 362 | + /** | |
| 363 | + * 根据板块编码获取板块信息,其他板块返回 null | |
| 364 | + * | |
| 365 | + * @param blockCode 板块编码(W/M/Q)或 {@link #BLOCK_OTHER} | |
| 366 | + * @return 板块信息,其他板块或板块未配置时返回 null | |
| 367 | + */ | |
| 368 | + private BlockInfo blockInfoForCode(String blockCode) { | |
| 369 | + if (BLOCK_OTHER.equals(blockCode)) { | |
| 370 | + return null; | |
| 371 | + } | |
| 372 | + return blockInfoService.getByBm(blockCode); | |
| 373 | + } | |
| 374 | + | |
| 375 | + /** | |
| 376 | + * 按工位汇总统计停线时长——物流板块(编码 W) | |
| 231 | 377 | * |
| 232 | 378 | * @param xtxx 线体信息,可为空 |
| 233 | 379 | * @param bcxx 班次信息,可为空 |
| 234 | 380 | * @param txqyxx 停线区域信息,可为空 |
| 235 | - * @param txbkxx 停线板块信息,可为空 | |
| 236 | 381 | * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 |
| 237 | - * @return 各工位停线时长汇总列表 | |
| 382 | + * @return 各工位停线时长汇总列表(含板块信息) | |
| 238 | 383 | */ |
| 239 | 384 | @Transactional(readOnly = true) |
| 240 | - public List<StopRecordWorkstationSummaryDTO> summaryByWorkstation(String xtxx, String bcxx, String txqyxx, | |
| 241 | - String txbkxx, String date) { | |
| 385 | + public List<StopRecordWorkstationSummaryDTO> summaryByWorkstationForLogistics(String xtxx, String bcxx, | |
| 386 | + String txqyxx, String date) { | |
| 387 | + return summaryByWorkstationForBlock(Constant.BLOCK_CODE_LOGISTICS, xtxx, bcxx, txqyxx, date); | |
| 388 | + } | |
| 389 | + | |
| 390 | + /** | |
| 391 | + * 按工位汇总统计停线时长——设备板块(编码 M) | |
| 392 | + * | |
| 393 | + * @param xtxx 线体信息,可为空 | |
| 394 | + * @param bcxx 班次信息,可为空 | |
| 395 | + * @param txqyxx 停线区域信息,可为空 | |
| 396 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 397 | + * @return 各工位停线时长汇总列表(含板块信息) | |
| 398 | + */ | |
| 399 | + @Transactional(readOnly = true) | |
| 400 | + public List<StopRecordWorkstationSummaryDTO> summaryByWorkstationForEquipment(String xtxx, String bcxx, | |
| 401 | + String txqyxx, String date) { | |
| 402 | + return summaryByWorkstationForBlock(Constant.BLOCK_CODE_EQUIPMENT, xtxx, bcxx, txqyxx, date); | |
| 403 | + } | |
| 404 | + | |
| 405 | + /** | |
| 406 | + * 按工位汇总统计停线时长——质量板块(编码 Q) | |
| 407 | + * | |
| 408 | + * @param xtxx 线体信息,可为空 | |
| 409 | + * @param bcxx 班次信息,可为空 | |
| 410 | + * @param txqyxx 停线区域信息,可为空 | |
| 411 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 412 | + * @return 各工位停线时长汇总列表(含板块信息) | |
| 413 | + */ | |
| 414 | + @Transactional(readOnly = true) | |
| 415 | + public List<StopRecordWorkstationSummaryDTO> summaryByWorkstationForQuality(String xtxx, String bcxx, | |
| 416 | + String txqyxx, String date) { | |
| 417 | + return summaryByWorkstationForBlock(Constant.BLOCK_CODE_QUALITY, xtxx, bcxx, txqyxx, date); | |
| 418 | + } | |
| 419 | + | |
| 420 | + /** | |
| 421 | + * 按工位汇总统计停线时长——其他板块(非物流/设备/质量) | |
| 422 | + * | |
| 423 | + * @param xtxx 线体信息,可为空 | |
| 424 | + * @param bcxx 班次信息,可为空 | |
| 425 | + * @param txqyxx 停线区域信息,可为空 | |
| 426 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 427 | + * @return 各工位停线时长汇总列表(不含板块信息) | |
| 428 | + */ | |
| 429 | + @Transactional(readOnly = true) | |
| 430 | + public List<StopRecordWorkstationSummaryDTO> summaryByWorkstationForOther(String xtxx, String bcxx, | |
| 431 | + String txqyxx, String date) { | |
| 432 | + return summaryByWorkstationForBlock(BLOCK_OTHER, xtxx, bcxx, txqyxx, date); | |
| 433 | + } | |
| 434 | + | |
| 435 | + /** | |
| 436 | + * 按工位汇总统计停线时长(按板块通用实现) | |
| 437 | + * <p> | |
| 438 | + * 根据板块编码定位板块信息 Id,再结合线体、班次、区域及指定日期筛选停线记录, | |
| 439 | + * 按工位汇总停线时长(降序),仅返回汇总结果,不含明细。 | |
| 440 | + * | |
| 441 | + * @param blockCode 板块编码(W/M/Q)或 {@link #BLOCK_OTHER} | |
| 442 | + * @param xtxx 线体信息,可为空 | |
| 443 | + * @param bcxx 班次信息,可为空 | |
| 444 | + * @param txqyxx 停线区域信息,可为空 | |
| 445 | + * @param date 指定日期(yyyy-MM-dd),可为空 | |
| 446 | + * @return 各工位停线时长汇总列表 | |
| 447 | + */ | |
| 448 | + private List<StopRecordWorkstationSummaryDTO> summaryByWorkstationForBlock(String blockCode, String xtxx, | |
| 449 | + String bcxx, String txqyxx, String date) { | |
| 242 | 450 | // 解析指定日期为当天时间范围 |
| 243 | 451 | Date[] range = parseDateRange(date); |
| 244 | 452 | |
| 245 | - // 查询满足条件的停线记录 | |
| 246 | - List<StopRecord> list = listByCondition(xtxx, bcxx, txqyxx, txbkxx, null, range[0], range[1]); | |
| 453 | + // 查询满足板块及其他条件的停线记录 | |
| 454 | + List<StopRecord> list = listByBlock(blockCode, xtxx, bcxx, txqyxx, null, range[0], range[1]); | |
| 247 | 455 | if (CollectionUtils.isEmpty(list)) { |
| 248 | 456 | return new ArrayList<>(0); |
| 249 | 457 | } |
| 250 | 458 | |
| 459 | + // 板块信息(其他板块时为 null) | |
| 460 | + BlockInfo block = blockInfoForCode(blockCode); | |
| 461 | + | |
| 251 | 462 | // 各工位停线时长汇总(降序) |
| 252 | - return buildWorkstationSummary(list); | |
| 463 | + return buildWorkstationSummary(list, block); | |
| 253 | 464 | } |
| 254 | 465 | |
| 255 | 466 | /** |
| 256 | - * 根据条件查询停线记录明细列表 | |
| 257 | - * <p> | |
| 258 | - * 根据线体、班次、区域、板块、工位条件及指定日期筛选停线记录,返回明细列表 | |
| 467 | + * 查询停线记录明细列表——物流板块(编码 W) | |
| 259 | 468 | * |
| 260 | 469 | * @param xtxx 线体信息,可为空 |
| 261 | 470 | * @param bcxx 班次信息,可为空 |
| 262 | 471 | * @param txqyxx 停线区域信息,可为空 |
| 263 | - * @param txbkxx 停线板块信息,可为空 | |
| 264 | 472 | * @param txgwxx 停线工位信息,可为空 |
| 265 | 473 | * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 |
| 266 | 474 | * @return 停线记录明细列表 |
| 267 | 475 | */ |
| 268 | 476 | @Transactional(readOnly = true) |
| 269 | - public List<StopRecord> listDetail(String xtxx, String bcxx, String txqyxx, String txbkxx, | |
| 270 | - String txgwxx, String date) { | |
| 477 | + public List<StopRecord> listDetailForLogistics(String xtxx, String bcxx, String txqyxx, String txgwxx, String date) { | |
| 478 | + return listDetailByBlock(Constant.BLOCK_CODE_LOGISTICS, xtxx, bcxx, txqyxx, txgwxx, date); | |
| 479 | + } | |
| 480 | + | |
| 481 | + /** | |
| 482 | + * 查询停线记录明细列表——设备板块(编码 M) | |
| 483 | + * | |
| 484 | + * @param xtxx 线体信息,可为空 | |
| 485 | + * @param bcxx 班次信息,可为空 | |
| 486 | + * @param txqyxx 停线区域信息,可为空 | |
| 487 | + * @param txgwxx 停线工位信息,可为空 | |
| 488 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 489 | + * @return 停线记录明细列表 | |
| 490 | + */ | |
| 491 | + @Transactional(readOnly = true) | |
| 492 | + public List<StopRecord> listDetailForEquipment(String xtxx, String bcxx, String txqyxx, String txgwxx, String date) { | |
| 493 | + return listDetailByBlock(Constant.BLOCK_CODE_EQUIPMENT, xtxx, bcxx, txqyxx, txgwxx, date); | |
| 494 | + } | |
| 495 | + | |
| 496 | + /** | |
| 497 | + * 查询停线记录明细列表——质量板块(编码 Q) | |
| 498 | + * | |
| 499 | + * @param xtxx 线体信息,可为空 | |
| 500 | + * @param bcxx 班次信息,可为空 | |
| 501 | + * @param txqyxx 停线区域信息,可为空 | |
| 502 | + * @param txgwxx 停线工位信息,可为空 | |
| 503 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 504 | + * @return 停线记录明细列表 | |
| 505 | + */ | |
| 506 | + @Transactional(readOnly = true) | |
| 507 | + public List<StopRecord> listDetailForQuality(String xtxx, String bcxx, String txqyxx, String txgwxx, String date) { | |
| 508 | + return listDetailByBlock(Constant.BLOCK_CODE_QUALITY, xtxx, bcxx, txqyxx, txgwxx, date); | |
| 509 | + } | |
| 510 | + | |
| 511 | + /** | |
| 512 | + * 查询停线记录明细列表——其他板块(非物流/设备/质量) | |
| 513 | + * | |
| 514 | + * @param xtxx 线体信息,可为空 | |
| 515 | + * @param bcxx 班次信息,可为空 | |
| 516 | + * @param txqyxx 停线区域信息,可为空 | |
| 517 | + * @param txgwxx 停线工位信息,可为空 | |
| 518 | + * @param date 指定日期(yyyy-MM-dd),可为空,为空时不限定日期 | |
| 519 | + * @return 停线记录明细列表 | |
| 520 | + */ | |
| 521 | + @Transactional(readOnly = true) | |
| 522 | + public List<StopRecord> listDetailForOther(String xtxx, String bcxx, String txqyxx, String txgwxx, String date) { | |
| 523 | + return listDetailByBlock(BLOCK_OTHER, xtxx, bcxx, txqyxx, txgwxx, date); | |
| 524 | + } | |
| 525 | + | |
| 526 | + /** | |
| 527 | + * 根据板块编码及条件查询停线记录明细列表(按板块通用实现) | |
| 528 | + * | |
| 529 | + * @param blockCode 板块编码(W/M/Q)或 {@link #BLOCK_OTHER} | |
| 530 | + * @param xtxx 线体信息,可为空 | |
| 531 | + * @param bcxx 班次信息,可为空 | |
| 532 | + * @param txqyxx 停线区域信息,可为空 | |
| 533 | + * @param txgwxx 停线工位信息,可为空 | |
| 534 | + * @param date 指定日期(yyyy-MM-dd),可为空 | |
| 535 | + * @return 停线记录明细列表 | |
| 536 | + */ | |
| 537 | + private List<StopRecord> listDetailByBlock(String blockCode, String xtxx, String bcxx, String txqyxx, | |
| 538 | + String txgwxx, String date) { | |
| 271 | 539 | // 解析指定日期为当天时间范围 |
| 272 | 540 | Date[] range = parseDateRange(date); |
| 273 | - return listByCondition(xtxx, bcxx, txqyxx, txbkxx, txgwxx, range[0], range[1]); | |
| 541 | + return listByBlock(blockCode, xtxx, bcxx, txqyxx, txgwxx, range[0], range[1]); | |
| 274 | 542 | } |
| 275 | 543 | |
| 276 | 544 | /** |
| 277 | 545 | * 按工位汇总停线时长(按停线时长降序排列) |
| 278 | 546 | * |
| 279 | - * @param list 停线记录列表 | |
| 547 | + * @param list 停线记录列表 | |
| 548 | + * @param block 板块信息,为 null 时不回填板块字段 | |
| 280 | 549 | * @return 工位汇总列表 |
| 281 | 550 | */ |
| 282 | - private List<StopRecordWorkstationSummaryDTO> buildWorkstationSummary(List<StopRecord> list) { | |
| 551 | + private List<StopRecordWorkstationSummaryDTO> buildWorkstationSummary(List<StopRecord> list, BlockInfo block) { | |
| 283 | 552 | // 批量查询工位信息,避免循环查库 |
| 284 | 553 | Set<String> workstationIds = list.stream() |
| 285 | 554 | .map(StopRecord::getTxgwxx) |
| ... | ... | @@ -314,6 +583,12 @@ public class StopRecordService extends BaseServiceImpl<StopRecord> { |
| 314 | 583 | dto.setGwbh(workstation.getGwbh()); |
| 315 | 584 | } |
| 316 | 585 | |
| 586 | + // 设置板块信息(其他板块时 block 为 null,不回填) | |
| 587 | + if (block != null) { | |
| 588 | + dto.setBkbm(block.getBm()); | |
| 589 | + dto.setBkmc(block.getMc()); | |
| 590 | + } | |
| 591 | + | |
| 317 | 592 | resultList.add(dto); |
| 318 | 593 | } |
| 319 | 594 | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.service; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | |
| 5 | +import com.qgutech.qgyun.apaas.sync.base.BoException; | |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.mapper.WorkshopWorkPlanMapper; | |
| 7 | +import com.qgutech.qgyun.apaas.sync.cps.model.WorkshopWorkPlan; | |
| 8 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | |
| 9 | +import org.apache.commons.collections4.CollectionUtils; | |
| 10 | +import org.springframework.stereotype.Service; | |
| 11 | +import org.springframework.transaction.annotation.Transactional; | |
| 12 | +import org.springframework.util.Assert; | |
| 13 | +import tk.mybatis.mapper.entity.Example; | |
| 14 | + | |
| 15 | +import javax.annotation.Resource; | |
| 16 | +import java.util.*; | |
| 17 | +import java.util.stream.Collectors; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * WorkshopWorkPlan 服务 | |
| 21 | + */ | |
| 22 | +@Service | |
| 23 | +public class WorkshopWorkPlanService extends BaseServiceImpl<WorkshopWorkPlan> { | |
| 24 | + | |
| 25 | + @Resource | |
| 26 | + private WorkshopWorkPlanMapper workshopWorkPlanMapper; | |
| 27 | + | |
| 28 | + @Transactional(readOnly = true) | |
| 29 | + public WorkshopWorkPlan getById(String id) { | |
| 30 | + Assert.hasLength(id, "id is empty!"); | |
| 31 | + | |
| 32 | + Example example = new Example(entityClass); | |
| 33 | + CorpExample.criteria(example).andEqualTo(WorkshopWorkPlan.ID, id); | |
| 34 | + WorkshopWorkPlan plan = workshopWorkPlanMapper.selectOneByExample(example); | |
| 35 | + if (null == plan) { | |
| 36 | + throw new BoException(BoErrorCode.DATA_ERROR); | |
| 37 | + } | |
| 38 | + return plan; | |
| 39 | + } | |
| 40 | + | |
| 41 | + @Transactional(readOnly = true) | |
| 42 | + public List<WorkshopWorkPlan> listByIds(Collection<String> ids) { | |
| 43 | + Assert.notEmpty(ids, "ids is empty!"); | |
| 44 | + | |
| 45 | + Example example = new Example(entityClass); | |
| 46 | + CorpExample.criteria(example).andIn(WorkshopWorkPlan.ID, ids); | |
| 47 | + List<WorkshopWorkPlan> list = workshopWorkPlanMapper.selectByExample(example); | |
| 48 | + if (CollectionUtils.isEmpty(list)) { | |
| 49 | + return new ArrayList<>(0); | |
| 50 | + } | |
| 51 | + return list; | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Transactional(readOnly = true) | |
| 55 | + public Map<String, WorkshopWorkPlan> mapByIds(Collection<String> ids) { | |
| 56 | + Assert.notEmpty(ids, "ids is empty!"); | |
| 57 | + | |
| 58 | + List<WorkshopWorkPlan> list = listByIds(ids); | |
| 59 | + if (CollectionUtils.isEmpty(list)) { | |
| 60 | + return new HashMap<>(0); | |
| 61 | + } | |
| 62 | + | |
| 63 | + return list.stream().collect(Collectors.toMap(WorkshopWorkPlan::getId, item -> item)); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @Transactional(readOnly = true) | |
| 67 | + public List<WorkshopWorkPlan> listAll() { | |
| 68 | + | |
| 69 | + Example example = CorpExample.ofCorp(entityClass); | |
| 70 | + return workshopWorkPlanMapper.selectByExample(example); | |
| 71 | + } | |
| 72 | +} | ... | ... |
| 1 | +package com.qgutech.qgyun.apaas.sync.cps.service; | |
| 2 | + | |
| 3 | +import com.qgutech.qgyun.framework.database.mybatis.service.BaseServiceImpl; | |
| 4 | +import com.qgutech.qgyun.apaas.sync.base.BoErrorCode; | |
| 5 | +import com.qgutech.qgyun.apaas.sync.base.BoException; | |
| 6 | +import com.qgutech.qgyun.apaas.sync.cps.dto.WorkshopWorkTaskStatusSummaryDTO; | |
| 7 | +import com.qgutech.qgyun.apaas.sync.cps.mapper.WorkshopWorkTaskMapper; | |
| 8 | +import com.qgutech.qgyun.apaas.sync.cps.model.WorkshopWorkTask; | |
| 9 | +import com.qgutech.qgyun.apaas.sync.utils.CorpExample; | |
| 10 | +import com.qgutech.qgyun.apaas.sync.utils.DateDealUtils; | |
| 11 | +import org.apache.commons.collections4.CollectionUtils; | |
| 12 | +import org.apache.commons.lang3.StringUtils; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | +import org.springframework.transaction.annotation.Transactional; | |
| 15 | +import org.springframework.util.Assert; | |
| 16 | +import tk.mybatis.mapper.entity.Example; | |
| 17 | + | |
| 18 | +import javax.annotation.Resource; | |
| 19 | +import java.util.*; | |
| 20 | +import java.util.stream.Collectors; | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * WorkshopWorkTask 服务 | |
| 24 | + */ | |
| 25 | +@Service | |
| 26 | +public class WorkshopWorkTaskService extends BaseServiceImpl<WorkshopWorkTask> { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private WorkshopWorkTaskMapper workshopWorkTaskMapper; | |
| 30 | + | |
| 31 | + @Transactional(readOnly = true) | |
| 32 | + public WorkshopWorkTask getById(String id) { | |
| 33 | + Assert.hasLength(id, "id is empty!"); | |
| 34 | + | |
| 35 | + Example example = new Example(entityClass); | |
| 36 | + CorpExample.criteria(example).andEqualTo(WorkshopWorkTask.ID, id); | |
| 37 | + WorkshopWorkTask task = workshopWorkTaskMapper.selectOneByExample(example); | |
| 38 | + if (null == task) { | |
| 39 | + throw new BoException(BoErrorCode.DATA_ERROR); | |
| 40 | + } | |
| 41 | + return task; | |
| 42 | + } | |
| 43 | + | |
| 44 | + @Transactional(readOnly = true) | |
| 45 | + public List<WorkshopWorkTask> listByIds(Collection<String> ids) { | |
| 46 | + Assert.notEmpty(ids, "ids is empty!"); | |
| 47 | + | |
| 48 | + Example example = new Example(entityClass); | |
| 49 | + CorpExample.criteria(example).andIn(WorkshopWorkTask.ID, ids); | |
| 50 | + List<WorkshopWorkTask> list = workshopWorkTaskMapper.selectByExample(example); | |
| 51 | + if (CollectionUtils.isEmpty(list)) { | |
| 52 | + return new ArrayList<>(0); | |
| 53 | + } | |
| 54 | + return list; | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Transactional(readOnly = true) | |
| 58 | + public Map<String, WorkshopWorkTask> mapByIds(Collection<String> ids) { | |
| 59 | + Assert.notEmpty(ids, "ids is empty!"); | |
| 60 | + | |
| 61 | + List<WorkshopWorkTask> list = listByIds(ids); | |
| 62 | + if (CollectionUtils.isEmpty(list)) { | |
| 63 | + return new HashMap<>(0); | |
| 64 | + } | |
| 65 | + | |
| 66 | + return list.stream().collect(Collectors.toMap(WorkshopWorkTask::getId, item -> item)); | |
| 67 | + } | |
| 68 | + | |
| 69 | + @Transactional(readOnly = true) | |
| 70 | + public List<WorkshopWorkTask> listAll() { | |
| 71 | + | |
| 72 | + Example example = CorpExample.ofCorp(entityClass); | |
| 73 | + return workshopWorkTaskMapper.selectByExample(example); | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 根据条件查询工作任务明细列表 | |
| 78 | + * | |
| 79 | + * @param qyxx 区域信息,可为空 | |
| 80 | + * @param year 年份,可为空,默认当前年 | |
| 81 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 82 | + * @return 工作任务明细列表 | |
| 83 | + */ | |
| 84 | + @Transactional(readOnly = true) | |
| 85 | + public List<WorkshopWorkTask> listByCondition(String qyxx, Integer year, Integer month) { | |
| 86 | + Date start = DateDealUtils.getMonthStartTime(year, month); | |
| 87 | + Date end = DateDealUtils.getMonthEndTime(year, month); | |
| 88 | + | |
| 89 | + Example example = new Example(entityClass); | |
| 90 | + Example.Criteria criteria = CorpExample.criteria(example); | |
| 91 | + criteria.andBetween(WorkshopWorkTask.START_DATE, start, end); | |
| 92 | + if (StringUtils.isNotBlank(qyxx)) { | |
| 93 | + criteria.andEqualTo(WorkshopWorkTask.QYXX, qyxx); | |
| 94 | + } | |
| 95 | + | |
| 96 | + List<WorkshopWorkTask> list = workshopWorkTaskMapper.selectByExample(example); | |
| 97 | + if (CollectionUtils.isEmpty(list)) { | |
| 98 | + return new ArrayList<>(0); | |
| 99 | + } | |
| 100 | + return list; | |
| 101 | + } | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 按任务状态汇总各状态记录条数 | |
| 105 | + * | |
| 106 | + * @param qyxx 区域信息,可为空 | |
| 107 | + * @param year 年份,可为空,默认当前年 | |
| 108 | + * @param month 月份(1-12),可为空,默认当前月 | |
| 109 | + * @return 各状态汇总列表 | |
| 110 | + */ | |
| 111 | + @Transactional(readOnly = true) | |
| 112 | + public List<WorkshopWorkTaskStatusSummaryDTO> summaryByStatus(String qyxx, Integer year, Integer month) { | |
| 113 | + List<WorkshopWorkTask> list = listByCondition(qyxx, year, month); | |
| 114 | + if (CollectionUtils.isEmpty(list)) { | |
| 115 | + return new ArrayList<>(0); | |
| 116 | + } | |
| 117 | + | |
| 118 | + // 按任务状态分组统计 | |
| 119 | + Map<String, Long> statusCountMap = list.stream() | |
| 120 | + .collect(Collectors.groupingBy( | |
| 121 | + item -> StringUtils.isNotBlank(item.getRwzt()) ? item.getRwzt() : "未知", | |
| 122 | + Collectors.counting())); | |
| 123 | + | |
| 124 | + List<WorkshopWorkTaskStatusSummaryDTO> result = new ArrayList<>(); | |
| 125 | + for (Map.Entry<String, Long> entry : statusCountMap.entrySet()) { | |
| 126 | + result.add(new WorkshopWorkTaskStatusSummaryDTO(entry.getKey(), entry.getValue().intValue())); | |
| 127 | + } | |
| 128 | + return result; | |
| 129 | + } | |
| 130 | +} | ... | ... |
| ... | ... | @@ -38,9 +38,9 @@ |
| 38 | 38 | - [7.6 获取所有启用的班次列表](#76-获取所有启用的班次列表) |
| 39 | 39 | - [8. 停线记录接口](#8-停线记录接口) |
| 40 | 40 | - [8.1 获取所有停线记录列表 🆕新增](#81-获取所有停线记录列表) |
| 41 | - - [8.2 按月份汇总统计每天的停线时长 🆕新增](#82-按月份汇总统计每天的停线时长) | |
| 42 | - - [8.3 按工位汇总统计停线时长 ✏️更新](#83-按工位汇总统计停线时长) | |
| 43 | - - [8.4 查询停线记录明细列表 🆕新增](#84-查询停线记录明细列表) | |
| 41 | + - [8.2 按月份按天汇总停线时长(按板块拆分) ✏️更新](#82-按月份按天汇总停线时长按板块拆分) | |
| 42 | + - [8.3 按工位汇总停线时长(按板块拆分) ✏️更新](#83-按工位汇总停线时长按板块拆分) | |
| 43 | + - [8.4 查询停线记录明细列表(按板块拆分) ✏️更新](#84-查询停线记录明细列表按板块拆分) | |
| 44 | 44 | - [9. 过程确认班组计划接口](#9-过程确认班组计划接口) |
| 45 | 45 | - [9.1 按区域查询当前周过程确认班组计划明细列表 🆕新增](#91-按区域查询当前周过程确认班组计划明细列表) |
| 46 | 46 | |
| ... | ... | @@ -59,9 +59,9 @@ |
| 59 | 59 | | 🆕 | [4.4](#44-根据条件查询过程确认执行记录对应的问题记录明细列表) | `GET /processConfirmExec/list/problem` | 新增接口 | 入参同 [4.3](#43-根据条件查询过程确认执行记录明细列表) 但去掉状态 zt,返回这些执行记录来源发现的 CPS 问题记录明细 | |
| 60 | 60 | | 🆕 | [5.3](#53-查询区域内当前周pjo执行记录明细列表) | `GET /pjoExec/list/detail/currentWeek` | 新增接口 | 按区域(qy,可选)查询当前时间所在周(周一~周日)的 PJO 执行记录明细,出参结构同 [5.2](#52-根据条件查询人员pjo计划明细列表) | |
| 61 | 61 | | 🆕 | [8.1](#81-获取所有停线记录列表) | `GET /stopRecord/list/all` | 新增接口 | 获取当前企业下所有停线记录信息列表 | |
| 62 | -| 🆕 | [8.2](#82-按月份汇总统计每天的停线时长) | `GET /stopRecord/summary/daily` | 新增接口 | 按线体、班次、区域、板块、年月(1-12)筛选停线记录,按天汇总每天的停线时长,结果按日期升序 | | |
| 63 | -| ✏️ | [8.3](#83-按工位汇总统计停线时长) | `GET /stopRecord/summary/workstation` | 接口更新 | 出参精简:不再返回停线记录明细 records,仅返回各工位停线时长汇总(`List<StopRecordWorkstationSummaryDTO>`,降序) | | |
| 64 | -| 🆕 | [8.4](#84-查询停线记录明细列表) | `GET /stopRecord/list/detail` | 新增接口 | 拆分自原 8.3:按线体、班次、区域、板块、工位(新增 txgwxx)及指定日期筛选,返回停线记录明细列表 | | |
| 62 | +| ✏️ | [8.2](#82-按月份按天汇总停线时长按板块拆分) | `GET /stopRecord/summary/daily/{logistics\|equipment\|quality\|other}` | 接口更新 | 原单一 `/summary/daily` 按板块拆分为物流(W)/设备(M)/质量(Q)/其他 四个接口;去掉 txbkxx 入参改由接口固定板块;year/month 改为可选(默认当前年/月);汇总结果新增板块信息 bkbm/bkmc(其他板块不返回) | | |
| 63 | +| ✏️ | [8.3](#83-按工位汇总停线时长按板块拆分) | `GET /stopRecord/summary/workstation/{logistics\|equipment\|quality\|other}` | 接口更新 | 原单一 `/summary/workstation` 按板块拆分为四个接口;去掉 txbkxx 入参改由接口固定板块;汇总结果新增板块信息 bkbm/bkmc(其他板块不返回) | | |
| 64 | +| ✏️ | [8.4](#84-查询停线记录明细列表按板块拆分) | `GET /stopRecord/list/detail/{logistics\|equipment\|quality\|other}` | 接口更新 | 原单一 `/list/detail` 按板块拆分为四个接口;去掉 txbkxx 入参改由接口固定板块,其余线体/班次/区域/工位/日期条件不变 | | |
| 65 | 65 | | 🆕 | [9.1](#91-按区域查询当前周过程确认班组计划明细列表) | `GET /processConfirmTeamPlan/list/currentWeek` | 新增接口 | 按区域(qyxx,可选)查询当前时间所在周(周一~周日)的过程确认班组计划明细,关联计划走访班组、工位的编号与名称 | |
| 66 | 66 | |
| 67 | 67 | > 编号调整说明:因 2.3 新增了「按单位车间查室组」接口,原「2.3 根据年份、季度、室组id查询C类改善记录详情」顺延为 **2.4**(接口路径与内容未变)。 |
| ... | ... | @@ -2443,11 +2443,20 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2443 | 2443 | |
| 2444 | 2444 | --- |
| 2445 | 2445 | |
| 2446 | -### 8.2 按月份汇总统计每天的停线时长 🆕新增 | |
| 2446 | +### 8.2 按月份按天汇总停线时长(按板块拆分) ✏️更新 | |
| 2447 | 2447 | |
| 2448 | -**接口路径:** `GET /stopRecord/summary/daily` | |
| 2448 | +> ✏️ **接口更新**(本次变更:原单一 `GET /stopRecord/summary/daily` 按停线板块拆分为物流(W)/设备(M)/质量(Q)/其他 四个独立接口;板块不再作为入参,改由接口路径固定;year/month 改为可选,默认当前年/当前月;汇总结果新增板块信息字段) | |
| 2449 | 2449 | |
| 2450 | -**接口说明:** 根据线体、班次、区域、板块条件筛选指定年月(1-12 月)范围内的停线记录,按天分组汇总每天的停线时长与记录数,结果按日期升序排列。 | |
| 2450 | +**接口路径:** 四个板块各对应一个端点,其余入参、出参结构完全一致: | |
| 2451 | + | |
| 2452 | +| 板块 | 板块编码 | 接口路径 | | |
| 2453 | +|------|----------|----------| | |
| 2454 | +| 物流 | W | `GET /stopRecord/summary/daily/logistics` | | |
| 2455 | +| 设备 | M | `GET /stopRecord/summary/daily/equipment` | | |
| 2456 | +| 质量 | Q | `GET /stopRecord/summary/daily/quality` | | |
| 2457 | +| 其他(非 W/M/Q) | — | `GET /stopRecord/summary/daily/other` | | |
| 2458 | + | |
| 2459 | +**接口说明:** 后端先根据板块编码(W/M/Q)定位板块信息 Id,再根据线体、班次、区域条件筛选指定年月范围内的停线记录,按天分组汇总每天的停线时长与记录数,结果按日期升序排列。「其他」端点筛选板块不属于物流/设备/质量三者的记录(含板块为空的记录)。`year`/`month` 为空时默认取当前年/当前月。 | |
| 2451 | 2460 | |
| 2452 | 2461 | **请求参数:** |
| 2453 | 2462 | |
| ... | ... | @@ -2456,9 +2465,8 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2456 | 2465 | | xtxx | String | 否 | 线体信息(线体id),为空则不限定 | |
| 2457 | 2466 | | bcxx | String | 否 | 班次信息(班次id),为空则不限定 | |
| 2458 | 2467 | | txqyxx | String | 否 | 停线区域信息(区域id),为空则不限定 | |
| 2459 | -| txbkxx | String | 否 | 停线板块信息(板块id),为空则不限定 | | |
| 2460 | -| year | String | 是 | 年份,如 2026 | | |
| 2461 | -| month | Integer | 是 | 月份(1-12) | | |
| 2468 | +| year | Integer | 否 | 年份,如 2026;为空时默认当前年 | | |
| 2469 | +| month | Integer | 否 | 月份(1-12);为空时默认当前月 | | |
| 2462 | 2470 | |
| 2463 | 2471 | **响应数据:** `List<StopRecordDailySummaryDTO>` |
| 2464 | 2472 | |
| ... | ... | @@ -2469,8 +2477,10 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2469 | 2477 | | date | String | 日期(yyyy-MM-dd) | |
| 2470 | 2478 | | totalTxsc | Double | 当日停线时长总计(分钟),单条记录 txsc 为 null 时按 0 计 | |
| 2471 | 2479 | | totalCount | Integer | 当日停线记录数 | |
| 2480 | +| bkbm | String | 板块编码(物流 W / 设备 M / 质量 Q;「其他」端点为 null) | | |
| 2481 | +| bkmc | String | 板块名称(「其他」端点为 null) | | |
| 2472 | 2482 | |
| 2473 | -**响应示例:** | |
| 2483 | +**响应示例(物流端点 `/summary/daily/logistics`):** | |
| 2474 | 2484 | |
| 2475 | 2485 | ```json |
| 2476 | 2486 | { |
| ... | ... | @@ -2479,12 +2489,16 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2479 | 2489 | { |
| 2480 | 2490 | "date": "2026-09-01", |
| 2481 | 2491 | "totalTxsc": 120.5, |
| 2482 | - "totalCount": 3 | |
| 2492 | + "totalCount": 3, | |
| 2493 | + "bkbm": "W", | |
| 2494 | + "bkmc": "物流" | |
| 2483 | 2495 | }, |
| 2484 | 2496 | { |
| 2485 | 2497 | "date": "2026-09-02", |
| 2486 | 2498 | "totalTxsc": 60.0, |
| 2487 | - "totalCount": 1 | |
| 2499 | + "totalCount": 1, | |
| 2500 | + "bkbm": "W", | |
| 2501 | + "bkmc": "物流" | |
| 2488 | 2502 | } |
| 2489 | 2503 | ], |
| 2490 | 2504 | "msg": "成功", |
| ... | ... | @@ -2494,13 +2508,20 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2494 | 2508 | |
| 2495 | 2509 | --- |
| 2496 | 2510 | |
| 2497 | -### 8.3 按工位汇总统计停线时长 ✏️更新 | |
| 2511 | +### 8.3 按工位汇总停线时长(按板块拆分) ✏️更新 | |
| 2498 | 2512 | |
| 2499 | -> ✏️ **接口更新**(本次变更:出参精简,不再返回停线记录明细 records,仅返回各工位停线时长汇总;明细查询拆分至 [8.4](#84-查询停线记录明细列表)) | |
| 2513 | +> ✏️ **接口更新**(本次变更:原单一 `GET /stopRecord/summary/workstation` 按停线板块拆分为物流(W)/设备(M)/质量(Q)/其他 四个独立接口;板块不再作为入参,改由接口路径固定;汇总结果新增板块信息字段) | |
| 2500 | 2514 | |
| 2501 | -**接口路径:** `GET /stopRecord/summary/workstation` | |
| 2515 | +**接口路径:** 四个板块各对应一个端点,其余入参、出参结构完全一致: | |
| 2502 | 2516 | |
| 2503 | -**接口说明:** 在 [8.2](#82-按月份汇总统计每天的停线时长) 相同的线体、班次、区域、板块条件基础上,加上指定日期,按工位汇总停线时长(关联停线工位信息补充工位名称与编号),汇总结果按停线时长降序排列。`date` 为空时不限定日期。**仅返回汇总结果,不含停线记录明细。** | |
| 2517 | +| 板块 | 板块编码 | 接口路径 | | |
| 2518 | +|------|----------|----------| | |
| 2519 | +| 物流 | W | `GET /stopRecord/summary/workstation/logistics` | | |
| 2520 | +| 设备 | M | `GET /stopRecord/summary/workstation/equipment` | | |
| 2521 | +| 质量 | Q | `GET /stopRecord/summary/workstation/quality` | | |
| 2522 | +| 其他(非 W/M/Q) | — | `GET /stopRecord/summary/workstation/other` | | |
| 2523 | + | |
| 2524 | +**接口说明:** 后端先根据板块编码定位板块信息 Id,再在线体、班次、区域条件基础上加上指定日期,按工位汇总停线时长(关联停线工位信息补充工位名称与编号),汇总结果按停线时长降序排列。`date` 为空时不限定日期。「其他」端点筛选板块不属于物流/设备/质量三者的记录。**仅返回汇总结果,不含停线记录明细(明细查询见 [8.4](#84-查询停线记录明细列表按板块拆分))。** | |
| 2504 | 2525 | |
| 2505 | 2526 | **请求参数:** |
| 2506 | 2527 | |
| ... | ... | @@ -2509,7 +2530,6 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2509 | 2530 | | xtxx | String | 否 | 线体信息(线体id),为空则不限定 | |
| 2510 | 2531 | | bcxx | String | 否 | 班次信息(班次id),为空则不限定 | |
| 2511 | 2532 | | txqyxx | String | 否 | 停线区域信息(区域id),为空则不限定 | |
| 2512 | -| txbkxx | String | 否 | 停线板块信息(板块id),为空则不限定 | | |
| 2513 | 2533 | | date | String | 否 | 指定日期,格式:yyyy-MM-dd,为空时不限定日期 | |
| 2514 | 2534 | |
| 2515 | 2535 | **响应数据:** `List<StopRecordWorkstationSummaryDTO>` |
| ... | ... | @@ -2523,8 +2543,10 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2523 | 2543 | | gwbh | String | 工位编号(关联停线工位信息) | |
| 2524 | 2544 | | totalTxsc | Double | 该工位停线时长总计(分钟) | |
| 2525 | 2545 | | totalCount | Integer | 该工位停线记录数 | |
| 2546 | +| bkbm | String | 板块编码(物流 W / 设备 M / 质量 Q;「其他」端点为 null) | | |
| 2547 | +| bkmc | String | 板块名称(「其他」端点为 null) | | |
| 2526 | 2548 | |
| 2527 | -**响应示例:** | |
| 2549 | +**响应示例(物流端点 `/summary/workstation/logistics`):** | |
| 2528 | 2550 | |
| 2529 | 2551 | ```json |
| 2530 | 2552 | { |
| ... | ... | @@ -2535,14 +2557,18 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2535 | 2557 | "gwmc": "焊接工位", |
| 2536 | 2558 | "gwbh": "01", |
| 2537 | 2559 | "totalTxsc": 90.0, |
| 2538 | - "totalCount": 1 | |
| 2560 | + "totalCount": 1, | |
| 2561 | + "bkbm": "W", | |
| 2562 | + "bkmc": "物流" | |
| 2539 | 2563 | }, |
| 2540 | 2564 | { |
| 2541 | 2565 | "txgwxx": "GW002", |
| 2542 | 2566 | "gwmc": "装配工位", |
| 2543 | 2567 | "gwbh": "02", |
| 2544 | 2568 | "totalTxsc": 30.0, |
| 2545 | - "totalCount": 1 | |
| 2569 | + "totalCount": 1, | |
| 2570 | + "bkbm": "W", | |
| 2571 | + "bkmc": "物流" | |
| 2546 | 2572 | } |
| 2547 | 2573 | ], |
| 2548 | 2574 | "msg": "成功", |
| ... | ... | @@ -2552,13 +2578,20 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2552 | 2578 | |
| 2553 | 2579 | --- |
| 2554 | 2580 | |
| 2555 | -### 8.4 查询停线记录明细列表 🆕新增 | |
| 2581 | +### 8.4 查询停线记录明细列表(按板块拆分) ✏️更新 | |
| 2582 | + | |
| 2583 | +> ✏️ **接口更新**(本次变更:原单一 `GET /stopRecord/list/detail` 按停线板块拆分为物流(W)/设备(M)/质量(Q)/其他 四个独立接口;板块不再作为入参,改由接口路径固定) | |
| 2556 | 2584 | |
| 2557 | -> 🆕 **新增接口**(本次变更:停线记录明细从原 8.3 拆分独立,查询条件新增「工位 txgwxx」) | |
| 2585 | +**接口路径:** 四个板块各对应一个端点,其余入参、出参结构完全一致: | |
| 2558 | 2586 | |
| 2559 | -**接口路径:** `GET /stopRecord/list/detail` | |
| 2587 | +| 板块 | 板块编码 | 接口路径 | | |
| 2588 | +|------|----------|----------| | |
| 2589 | +| 物流 | W | `GET /stopRecord/list/detail/logistics` | | |
| 2590 | +| 设备 | M | `GET /stopRecord/list/detail/equipment` | | |
| 2591 | +| 质量 | Q | `GET /stopRecord/list/detail/quality` | | |
| 2592 | +| 其他(非 W/M/Q) | — | `GET /stopRecord/list/detail/other` | | |
| 2560 | 2593 | |
| 2561 | -**接口说明:** 根据线体、班次、区域、板块、工位条件及指定日期筛选停线记录,返回停线记录明细列表。所有参数均为可选,`date` 为空时不限定日期。 | |
| 2594 | +**接口说明:** 后端先根据板块编码定位板块信息 Id,再根据线体、班次、区域、工位条件及指定日期筛选停线记录,返回停线记录明细列表。「其他」端点筛选板块不属于物流/设备/质量三者的记录。除板块外的参数均为可选,`date` 为空时不限定日期。 | |
| 2562 | 2595 | |
| 2563 | 2596 | **请求参数:** |
| 2564 | 2597 | |
| ... | ... | @@ -2567,7 +2600,6 @@ uat3环境: https://uat3.qgutech.com/fkyycustom |
| 2567 | 2600 | | xtxx | String | 否 | 线体信息(线体id),为空则不限定 | |
| 2568 | 2601 | | bcxx | String | 否 | 班次信息(班次id),为空则不限定 | |
| 2569 | 2602 | | txqyxx | String | 否 | 停线区域信息(区域id),为空则不限定 | |
| 2570 | -| txbkxx | String | 否 | 停线板块信息(板块id),为空则不限定 | | |
| 2571 | 2603 | | txgwxx | String | 否 | 停线工位信息(工位id),为空则不限定 | |
| 2572 | 2604 | | date | String | 否 | 指定日期,格式:yyyy-MM-dd,为空时不限定日期 | |
| 2573 | 2605 | ... | ... |
No preview for this file type
| ... | ... | @@ -653,3 +653,92 @@ CREATE TABLE `t_auto_hfca_dnxpkp_bkxxxx` |
| 653 | 653 | `qtdwfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, |
| 654 | 654 | PRIMARY KEY (`id`) |
| 655 | 655 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; |
| 656 | + | |
| 657 | +--质量缺陷信息 | |
| 658 | +CREATE TABLE `t_auto_hfca_zlujkl_jkwtix` | |
| 659 | +( | |
| 660 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | |
| 661 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | |
| 662 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | |
| 663 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | |
| 664 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | |
| 665 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | |
| 666 | + `sjsx` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 667 | + `tcrq` datetime(3) DEFAULT NULL, | |
| 668 | + `kzahnt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 669 | + `vin` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 670 | + `wtbw` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 671 | + `wtms` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 672 | + `wtgwxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 673 | + `ydcfcs` double (21,6) DEFAULT NULL, | |
| 674 | + `wt_img` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 675 | + `wttcdw` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 676 | + `wtsx` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 677 | + `wtbcxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 678 | + `tzsj` datetime(3) DEFAULT NULL, | |
| 679 | + `tzry` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 680 | + `zrqyxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 681 | + `zrry` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 682 | + `sfpc` tinyint(1) DEFAULT NULL, | |
| 683 | + `pcwtyy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 684 | + `pcts` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 685 | + `sfnrqygk` tinyint(1) DEFAULT NULL, | |
| 686 | + `ygh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 687 | + `wtjzch` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 688 | + `fsyy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 689 | + `gkcs` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 690 | + PRIMARY KEY (`id`) | |
| 691 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | |
| 692 | + | |
| 693 | +--车间级工作计划信息 | |
| 694 | +CREATE TABLE `t_auto_hfca_zlujkl_haxddh` | |
| 695 | +( | |
| 696 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | |
| 697 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | |
| 698 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | |
| 699 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | |
| 700 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | |
| 701 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | |
| 702 | + `gzjhxh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 703 | + `gzjhmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 704 | + `dwxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 705 | + `szxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 706 | + `qyxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 707 | + `bzxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 708 | + `jhfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 709 | + `jhsfkq` tinyint(1) DEFAULT NULL, | |
| 710 | + `gzjhzt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 711 | + `bkxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 712 | + `bkxh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 713 | + `xh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 714 | + PRIMARY KEY (`id`) | |
| 715 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | |
| 716 | + | |
| 717 | + | |
| 718 | +--车间级工作任务 | |
| 719 | +CREATE TABLE `t_auto_hfca_zlujkl_ddxxsf` | |
| 720 | +( | |
| 721 | + `id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID', | |
| 722 | + `corp_code` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '公司编号', | |
| 723 | + `created_at` datetime(3) NOT NULL COMMENT '创建时间', | |
| 724 | + `created_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人ID', | |
| 725 | + `updated_at` datetime(3) NOT NULL COMMENT '最后更新时间', | |
| 726 | + `updated_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '最后更新人', | |
| 727 | + `rwxh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 728 | + `rwmc` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 729 | + `ssgzjh` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 730 | + `rwfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 731 | + `start_date` datetime(3) DEFAULT NULL, | |
| 732 | + `end_date` datetime(3) DEFAULT NULL, | |
| 733 | + `rwzt` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 734 | + `gzjhxh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 735 | + `jhfzr` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 736 | + `qyxx` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 737 | + `iejjof` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 738 | + `xh` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 739 | + `rwmb` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 740 | + `wcqk` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 741 | + `wcqkfj` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 742 | + `remark` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | |
| 743 | + PRIMARY KEY (`id`) | |
| 744 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ... | ... |