rev:发货任务二次分配修改

This commit is contained in:
2024-06-20 09:39:22 +08:00
parent 5bb695619e
commit 3c2da9058f
5 changed files with 323 additions and 23 deletions

View File

@@ -1943,21 +1943,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Transactional(rollbackFor = Exception.class)
public JSONObject applySendOutTwo(JSONObject whereJson) {
log.info("applySendOutTwo输入参数---------------------------------------------" + whereJson.toString());
// 校验
if (ObjectUtil.isEmpty(whereJson.getString("device_code"))) {
throw new BadRequestException("设备号不能为空!");
}
if (ObjectUtil.isEmpty(whereJson.getString("vehicle_code"))) {
throw new BadRequestException("载具号不能为空!");
}
JSONObject result = new JSONObject();
try {
// 调用服务
sendOutManageService.createSendOutTask(whereJson);
try{
// 校验是否是二次分配
if (ObjectUtil.isEmpty(whereJson.getString("task_code"))) {
// 第一次申请
if (ObjectUtil.isEmpty(whereJson.getString("device_code"))) {
throw new BadRequestException("设备号不能为空!");
}
if (ObjectUtil.isEmpty(whereJson.getString("vehicle_code"))) {
throw new BadRequestException("载具号不能为空!");
}
// 调用服务
sendOutManageService.createSendOutTaskOne(whereJson);
} else {
// 第二次申请
sendOutManageService.createSendOutTaskTwo(whereJson);
}
result.put("status", HttpStatus.OK.value());
result.put("message", "下发成功!");
return result;