|
|
|
@ -291,6 +291,36 @@ public class ZyjhController {
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("sdtbczzj")
|
|
|
|
|
public ResultBean<?> sdTbCzzj(@RequestBody List<DmYdjh> list){
|
|
|
|
|
ArrayList<MpDhsj> mpDhsjSaveList = new ArrayList<>();
|
|
|
|
|
list.forEach(item-> zlgzCreate(item,mpDhsjSaveList));
|
|
|
|
|
mpDhsjServcie.saveBatch(mpDhsjSaveList);
|
|
|
|
|
return new ResultBean<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void zlgzCreate(DmYdjh item,ArrayList<MpDhsj> mpDhsjSaveList){
|
|
|
|
|
List<DmYdjhLj> ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh());
|
|
|
|
|
Map<String, Object> mpsycljljbp = zyjhService.getMPSYCLJLJBP(item.getDcCh(), item.getTzbh());
|
|
|
|
|
//质量跟踪数据
|
|
|
|
|
List<MpDhsj> collect = new ArrayList<>();
|
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
String mpDhsjDhh = zyjhService.getMpDhsjDhh();
|
|
|
|
|
for (int j = 0; j < ljList.size(); j++) {
|
|
|
|
|
DmYdjhLj item2 = ljList.get(j);
|
|
|
|
|
if (StrUtil.isNotEmpty(item.getSllph())){//兼容没有炉批号的老数据用
|
|
|
|
|
MpDhsj mpDhsj = MpDhsj.of(item2, date, item.getSllph());
|
|
|
|
|
String xh = StrUtil.padPre(j + 1 + "", 3, "0");
|
|
|
|
|
mpDhsj.setDhh(mpDhsjDhh+"-"+xh);
|
|
|
|
|
if (ObjUtil.isNotEmpty(mpsycljljbp)) {
|
|
|
|
|
mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3"));
|
|
|
|
|
}
|
|
|
|
|
collect.add(mpDhsj);
|
|
|
|
|
mpDhsjSaveList.add(mpDhsj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 作业计划执行,派工&反馈
|
|
|
|
|
*/
|
|
|
|
@ -365,8 +395,6 @@ public class ZyjhController {
|
|
|
|
|
updateYlList.add(dmYlInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//生成零件信息
|
|
|
|
|
List<DmYdjhLj> ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh());
|
|
|
|
|
|
|
|
|
|
//临时使用异常捕获,防止生产未更新余料库存表导致无法正常切割报工
|
|
|
|
|
try {
|
|
|
|
@ -396,24 +424,8 @@ public class ZyjhController {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, Object> mpsycljljbp = zyjhService.getMPSYCLJLJBP(item.getDcCh(), item.getTzbh());
|
|
|
|
|
//质量跟踪数据
|
|
|
|
|
List<MpDhsj> collect = new ArrayList<>();
|
|
|
|
|
String date = DateUtil.date().toString("yyyy/MM/dd");
|
|
|
|
|
String mpDhsjDhh = zyjhService.getMpDhsjDhh();
|
|
|
|
|
for (int j = 0; j < ljList.size(); j++) {
|
|
|
|
|
DmYdjhLj item2 = ljList.get(j);
|
|
|
|
|
if (StrUtil.isNotEmpty(item.getSllph())){//兼容没有炉批号的老数据用
|
|
|
|
|
MpDhsj mpDhsj = MpDhsj.of(item2, date, item.getSllph());
|
|
|
|
|
String xh = StrUtil.padPre(j + 1 + "", 3, "0");
|
|
|
|
|
mpDhsj.setDhh(mpDhsjDhh+"-"+xh);
|
|
|
|
|
if (ObjUtil.isNotEmpty(mpsycljljbp)) {
|
|
|
|
|
mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3"));
|
|
|
|
|
}
|
|
|
|
|
collect.add(mpDhsj);
|
|
|
|
|
MpDhsjSaveList.add(mpDhsj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
zlgzCreate(item,MpDhsjSaveList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mpDhsjServcie.saveBatch(MpDhsjSaveList);
|
|
|
|
|