add: 手持备货区管理

This commit is contained in:
2024-07-23 10:13:30 +08:00
parent 4309424e3f
commit ed14ab3723
3 changed files with 63 additions and 0 deletions

View File

@@ -139,4 +139,16 @@ public class SlitterPdaController {
public ResponseEntity<Object> queryCacheDownSubVolumeInfos(@RequestBody JSONObject param) {
return new ResponseEntity<>(slitterDevices.queryCacheDownSubVolumeInfos(param), HttpStatus.OK);
}
@PostMapping("/doStockAreaBinding")
@Log("手持备货区绑定")
@SaIgnore
public ResponseEntity<Object> doStockAreaBinding(@RequestBody JSONObject param) {
return new ResponseEntity<>(slitterDevices.doStockAreaBinding(param), HttpStatus.OK);
}
@PostMapping("/doStockAreaUnbinding")
@Log("手持备货区解除绑定")
@SaIgnore
public ResponseEntity<Object> doStockAreaUnbinding(@RequestBody JSONObject param) {
return new ResponseEntity<>(slitterDevices.doStockAreaUnbinding(param), HttpStatus.OK);
}
}

View File

@@ -228,4 +228,18 @@ public interface SlitterService {
* @return /
*/
JSONObject queryCacheDownSubVolumeInfos(JSONObject param);
/**
* 手持备货区绑定
* @param param /
* @return /
*/
JSONObject doStockAreaBinding(JSONObject param);
/**
* 手持备货区解除绑定
* @param param /
* @return /
*/
JSONObject doStockAreaUnbinding(JSONObject param);
}

View File

@@ -1452,4 +1452,41 @@ public class SlitterServiceImpl implements SlitterService {
}
return res;
}
@Override
public JSONObject doStockAreaBinding(JSONObject param) {
// param: point_code vehicle_code
log.info("手持备货区绑定的数据:{}", param);
String pointCode = param.getString("point_code");
String vehicleCode = param.getString("vehicle_code");
BstIvtStockingivt pointByCode = stockingivtService.getPointByCode(pointCode, true);
if (ObjectUtil.isEmpty(pointByCode)) {
throw new BadRequestException("点位 [" + pointCode + "] 不存在或者已被禁用!");
}
pointByCode.setVehicle_code(vehicleCode);
pointByCode.setIvt_status("1");
TaskUtils.updateOptMessageByBStockingPoint(pointByCode);
JSONObject res = new JSONObject();
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "备货区绑定成功!");
return res;
}
@Override
public JSONObject doStockAreaUnbinding(JSONObject param) {
// param: point_code
log.info("手持备货区解除绑定的数据:{}", param);
String pointCode = param.getString("point_code");
BstIvtStockingivt pointByCode = stockingivtService.getPointByCode(pointCode, true);
if (ObjectUtil.isEmpty(pointByCode)) {
throw new BadRequestException("点位 [" + pointCode + "] 不存在或者已被禁用!");
}
pointByCode.setVehicle_code("");
pointByCode.setIvt_status("0");
TaskUtils.updateOptMessageByBStockingPoint(pointByCode);
JSONObject res = new JSONObject();
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "备货区解绑成功!");
return res;
}
}