Merge remote-tracking branch 'origin/b_lms' into b_lms

This commit is contained in:
zhouz
2024-06-29 19:09:52 +08:00
2 changed files with 8 additions and 2 deletions

View File

@@ -756,7 +756,13 @@ public class SlitterServiceImpl implements SlitterService {
updateWrapper.eq("vehicle_code", device.getVehicle_code())
.eq("row_num", param.getString("row_num"))
.setSql("qty=qty-1");
papervehicleService.update(updateWrapper);
// 检查更新后的 qty 是否为 0然后删除相应的记录
QueryWrapper<MdPbPapervehicle> deleteWrapper = new QueryWrapper<>();
deleteWrapper.eq("vehicle_code", device.getVehicle_code())
.eq("row_num", param.getString("row_num"))
.eq("qty", "0");
papervehicleService.remove(deleteWrapper);
JSONObject res = new JSONObject();
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "请求成功!");

View File

@@ -239,7 +239,7 @@ public class SlitterTaskUtil {
.mapToObj(String::valueOf)
.toArray(String[]::new);
param.put("to_material", String.join(",", material_codes));
param.put("to_spec", String.join(",", material_codes));
param.put("to_spec", String.join(",", material_specs));
param.put("to_qty", String.join(",", qtysStr));
param.put("device_code", material_specs);
}