fix: 手持维护重量

This commit is contained in:
2024-08-16 11:12:31 +08:00
parent 66d7a01574
commit f19fd77be6
3 changed files with 32 additions and 0 deletions

View File

@@ -157,4 +157,10 @@ public class SlitterPdaController {
public ResponseEntity<Object> doStockAreaUnbinding(@RequestBody JSONObject param) {
return new ResponseEntity<>(slitterDevices.doStockAreaUnbinding(param), HttpStatus.OK);
}
@PostMapping("/doSubRollWeightBinding")
@Log("手持子卷重量绑定")
@SaIgnore
public ResponseEntity<Object> doSubRollWeightBinding(@RequestBody JSONObject param) {
return new ResponseEntity<>(slitterDevices.doSubRollWeightBinding(param), HttpStatus.OK);
}
}

View File

@@ -249,4 +249,6 @@ public interface SlitterService {
* @return /
*/
JSONObject markingFoilSlittingToCache(JSONObject param);
JSONObject doSubRollWeightBinding(JSONObject param);
}

View File

@@ -1,6 +1,7 @@
package org.nl.b_lms.sch.tasks.slitter.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpStatus;
@@ -1563,4 +1564,27 @@ public class SlitterServiceImpl implements SlitterService {
}
return res;
}
@Override
public JSONObject doSubRollWeightBinding(JSONObject param) {
log.info("手持维护重量 - {}", param);
//container_name: 子卷号, roll_weight: 子卷重量, paper_weight纸管重量
String containerName = param.getString("container_name");
Assert.notBlank(containerName, "子卷号不能为空!");
String rollWeight = param.getString("roll_weight");
String paperWeight = param.getString("paper_weight");
PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(containerName);
if (ObjectUtil.isNotEmpty(rollWeight)) {
plan.setWeight(rollWeight);
}
if (ObjectUtil.isNotEmpty(paperWeight)) {
plan.setPaper_weight(paperWeight);
}
TaskUtils.updateOptMessageBySlitterPlan(plan);
slittingproductionplanService.updateById(plan);
JSONObject res = new JSONObject();
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "重量更新成功!");
return res;
}
}