agv交互更新

This commit is contained in:
loujf
2022-09-19 15:31:01 +08:00
parent 0dac23d40c
commit 0af7f51fb7
4 changed files with 59 additions and 55 deletions

View File

@@ -92,7 +92,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
//如果是出窑输送线 要从组盘表里面去找物料
if (StrUtil.equals(device_code, "CYSSX101")) {
String vehicle_code = (String) jsonObject.get("vehicle_code");
String vehicle_code = jsonObject.get("vehicle_code").toString();
if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("载具不能为空!");
}
@@ -284,9 +284,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (StrUtil.isEmpty(device_code)) {
throw new BadRequestException("设备点位不能为空!");
}
String vehicle_code = "";
JSONObject produceInfoByCode = new JSONObject();
String is_full = (String) jsonObject.get("is_full");
String vehicle_code = (String) jsonObject.get("vehicle_code");
if (ObjectUtil.isNotEmpty(jsonObject.get("vehicle_code"))) {
vehicle_code = jsonObject.get("vehicle_code").toString();
}
String qty = String.valueOf(jsonObject.get("qty"));
//String material_code = (String) jsonObject.get("material_code");
produceInfoByCode = this.getProduceInfoByCode(device_code);
@@ -416,7 +419,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
groupTable.delete("vehicle_code='" + vehicle_code + "' and task_id <>'" + task_id + "'");
JSONObject groupObj = groupTable.query("task_id='" + task_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(groupObj)) {
throw new BadRequestException("未找到指令为'" + task_id + "'的组盘信息!");
throw new BadRequestException("未找到指令为'" + task_id + "'的组盘信息!");
}
groupObj.put("vehicle_code", vehicle_code);
groupObj.put("update_optid", SecurityUtils.getCurrentUserId());
@@ -484,7 +487,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, Object> ispackage(Map jsonObject) {
String vehicle_code = (String) jsonObject.get("vehicle_code");
String vehicle_code = jsonObject.get("vehicle_code").toString();
if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("托盘条码不能为空!");
}
@@ -499,13 +502,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String is_autopackage = groupObj.getString("is_autopackage");
//code的值 1自动码垛2人工码垛
String code = "";
if (StrUtil.equals("1", is_autopackage)) {
if (StrUtil.equals("0", is_autopackage)) {
code = "1";
} else {
code = "2";
}
//更新窑的信息
KilnUtil.outKiln(vehicle_code);
// KilnUtil.outKiln(vehicle_code);
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "任务状态反馈成功!");
@@ -637,7 +640,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public void updateVehicleType(Map jsonObject) {
String vehicle_type = (String) jsonObject.get("vehicle_type");
String device_code = (String) jsonObject.get("device_code");
String vehicle_code = (String) jsonObject.get("vehicle_code");
String vehicle_code = jsonObject.get("vehicle_code").toString();
if (StrUtil.isEmpty(vehicle_type)) {
throw new BadRequestException("托盘类型不能为空!");
}