opt: 子卷判断是送到废品还是成品称重的优化

This commit is contained in:
2024-05-23 10:10:10 +08:00
parent 8e5fcb1006
commit 16cb0f8da4

View File

@@ -555,6 +555,7 @@ public class SlitterServiceImpl implements SlitterService {
public JSONObject acsSendSubVolume(JSONObject param) {
JSONObject res = new JSONObject();
String deviceCode = param.getString("device_code");
BstIvtShafttubeivt device = shafttubeivtService.getByPointCode(deviceCode, false);
// 气涨轴编码
String qzzNo = param.getString("qzz_no");
String direction = param.getString("direction");
@@ -572,12 +573,14 @@ public class SlitterServiceImpl implements SlitterService {
log.error("设备{}, 找不到气胀轴编码{}对应的分切计划!参数:{}", deviceCode, qzzNo, param);
throw new BadRequestException("找不到气胀轴编码{ " + qzzNo + " }的分切计划!");
}
// 查找终点 todo: 如何确认是废箔还是成品
// todo: 暂时写死去成品称重
// BstIvtShafttubeivt one = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
// .eq(BstIvtShafttubeivt::getPoint_type, "4").eq(BstIvtShafttubeivt::getPoint_location, "0"));
String point_type = "5".equals(plan.getLevel()) ? "5" : "4";
// 查找终点 确认是废箔还是成品: 根据分切计划的子卷等级来区分5为报废
BstIvtShafttubeivt one = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
.eq(BstIvtShafttubeivt::getPoint_type, point_type)
.eq(BstIvtShafttubeivt::getPoint_location, device.getPoint_location())
.eq(BstIvtShafttubeivt::getIs_used, SlitterConstant.SLITTER_YES));
JSONObject taskParam = new JSONObject();
taskParam.put("point_code2", "B_CZW01");
taskParam.put("point_code2", one.getPoint_code());
taskParam.put("material_code", plan.getContainer_name());
res.put("code", HttpStatus.HTTP_OK);
res.put("message", "请求成功!");