|
|
|
@ -127,5 +127,77 @@ public class ShiftAbnormalRollReportController { |
|
|
|
return R.error(500, "操作失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询卷号列表(去重)用于异常续卷 |
|
|
|
*/ |
|
|
|
@PostMapping("/getRollNoList") |
|
|
|
public R getRollNoList(@RequestBody Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String orderNo = (String) params.get("orderNo"); |
|
|
|
|
|
|
|
List<Map<String, Object>> list = shiftAbnormalRollReportService.getRollNoList(site, orderNo); |
|
|
|
|
|
|
|
return R.ok() |
|
|
|
.put("code", 0) |
|
|
|
.put("data", list) |
|
|
|
.put("count", list != null ? list.size() : 0); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据卷号组合查询详细数据 |
|
|
|
*/ |
|
|
|
@PostMapping("/getByRollNos") |
|
|
|
public R getByRollNos(@RequestBody Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String orderNo = (String) params.get("orderNo"); |
|
|
|
String currentRollNo = (String) params.get("currentRollNo"); |
|
|
|
String newRollNo = (String) params.get("newRollNo"); |
|
|
|
|
|
|
|
List<ShiftAbnormalRollReportEntity> list = shiftAbnormalRollReportService.getByRollNos(site, orderNo, currentRollNo, newRollNo); |
|
|
|
|
|
|
|
return R.ok() |
|
|
|
.put("code", 0) |
|
|
|
.put("data", list) |
|
|
|
.put("count", list != null ? list.size() : 0); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 异常续卷(更新数据) |
|
|
|
*/ |
|
|
|
@PostMapping("/continueRoll") |
|
|
|
public R continueRoll(@RequestBody Map<String, Object> params) { |
|
|
|
try { |
|
|
|
String processedBy = (String) params.get("processedBy"); |
|
|
|
|
|
|
|
// 获取行数据列表 |
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
List<Map<String, Object>> rowDataList = (List<Map<String, Object>>) params.get("rowDataList"); |
|
|
|
|
|
|
|
// 构建实体列表 |
|
|
|
List<ShiftAbnormalRollReportEntity> entityList = new ArrayList<>(); |
|
|
|
if (rowDataList != null) { |
|
|
|
for (Map<String, Object> rowData : rowDataList) { |
|
|
|
ShiftAbnormalRollReportEntity entity = new ShiftAbnormalRollReportEntity(); |
|
|
|
entity.setId(rowData.get("id") != null ? Long.valueOf(rowData.get("id").toString()) : null); |
|
|
|
entity.setGoodQty(rowData.get("goodQty") != null ? new BigDecimal(rowData.get("goodQty").toString()) : BigDecimal.ZERO); |
|
|
|
entity.setDefectQty(rowData.get("defectQty") != null ? new BigDecimal(rowData.get("defectQty").toString()) : BigDecimal.ZERO); |
|
|
|
entity.setSurfaceLossQty(rowData.get("surfaceLossQty") != null ? new BigDecimal(rowData.get("surfaceLossQty").toString()) : BigDecimal.ZERO); |
|
|
|
entity.setPoorPerformanceQty(rowData.get("poorPerformanceQty") != null ? new BigDecimal(rowData.get("poorPerformanceQty").toString()) : BigDecimal.ZERO); |
|
|
|
entity.setRemark(rowData.get("remark") != null ? rowData.get("remark").toString() : ""); |
|
|
|
entityList.add(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 更新数据 |
|
|
|
shiftAbnormalRollReportService.continueRoll(entityList, processedBy); |
|
|
|
|
|
|
|
return R.ok() |
|
|
|
.put("code", 0) |
|
|
|
.put("msg", "异常续卷数据更新成功"); |
|
|
|
} catch (Exception e) { |
|
|
|
return R.error(500, "操作失败:" + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|