Merge branch 'master' of http://121.40.234.130:8899/root/rongLiJiaNai
This commit is contained in:
@@ -1272,7 +1272,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
||||
this.writing(this.mode);
|
||||
this.writing(8);
|
||||
this.setResultSucess(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
}
|
||||
//前工位申请任务
|
||||
if (mode == 2 && move_2 == 0 && action_2 == 0 && move_1 == 0 && task2 == 0 && !requireSucess1) {
|
||||
System.out.println("move_2:" + move_2 + ",action_2:" + action_2 + ",move_1:" + move_1 + ",task2:" + task2 + ",requireSucess1:" + requireSucess1);
|
||||
// System.out.println("move_2:" + move_2 + ",action_2:" + action_2 + ",move_1:" + move_1 + ",task2:" + task2 + ",requireSucess1:" + requireSucess1);
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1498,7 +1498,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
||||
this.writing(this.mode);
|
||||
this.writing(8);
|
||||
this.setResultSucess(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +79,34 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
jsonObject.put("start_point_code", device_code);
|
||||
jsonObject.put("create_mode", "01");
|
||||
jsonObject.put("group_id", group_id);
|
||||
//假如是半托缓存的几个位置,强制去包装
|
||||
String area_type = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("area_type");
|
||||
if (StrUtil.equals(area_type, AreaEnum.MTPQ.getCode())) {
|
||||
fmjToPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject));
|
||||
//生成到包装位的任务时,下发托盘类型给RGV
|
||||
String point_id = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("point_id");
|
||||
String material_id = structivtTable.query("point_id ='" + point_id + "'").uniqueResult(0).getString("material_id");
|
||||
JSONObject materiralObj1 = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||
String vehicle_type = materiralObj1.getString("vehicle_type");
|
||||
if (vehicle_type.equals("03")) {
|
||||
vehicle_type = "1";
|
||||
} else if (vehicle_type.equals("04")) {
|
||||
vehicle_type = "2";
|
||||
} else if (vehicle_type.equals("05")) {
|
||||
vehicle_type = "3";
|
||||
} else if (vehicle_type.equals("06")) {
|
||||
vehicle_type = "4";
|
||||
} else if (vehicle_type.equals("07")) {
|
||||
vehicle_type = "5";
|
||||
}
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
JSONArray array = new JSONArray();
|
||||
jsonObject1.put("device_code", "RGV2");
|
||||
jsonObject1.put("code", "to_container_type");
|
||||
jsonObject1.put("value", vehicle_type);
|
||||
array.add(jsonObject1);
|
||||
wmsToAcsServiceImpl.action(array);
|
||||
}
|
||||
if (StrUtil.isEmpty(is_full)) {
|
||||
throw new BadRequestException("托盘是否满托不能为空!");
|
||||
}
|
||||
@@ -86,10 +114,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String producetask_id = (String) jsonObject.get("producetask_id");
|
||||
String material_id = "";
|
||||
JSONObject materialObj = WQLObject.getWQLObject("md_me_material").query("material_code ='" + material_code + "'").uniqueResult(0);
|
||||
if (StrUtil.isEmpty(material_code) && (!StrUtil.equals(device_code, "CYSSX101"))) {
|
||||
if (StrUtil.isEmpty(material_code) && (!StrUtil.equals(device_code, "CYSSX101"))
|
||||
&& !StrUtil.equals(device_code.substring(0, 4), "BTHC")) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
if (!StrUtil.equals(device_code, "CYSSX101")) {
|
||||
if (!StrUtil.equals(device_code, "CYSSX101") && !StrUtil.equals(device_code.substring(0, 4), "BTHC")) {
|
||||
material_id = materialObj.getString("material_id");
|
||||
}
|
||||
//如果是出窑输送线 要从组盘表里面去找物料
|
||||
@@ -112,7 +141,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject materiralObj = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||
Double stewing_time = materiralObj.getDouble("stewing_time");
|
||||
jsonObject.put("stewing_time", stewing_time);
|
||||
String area_type = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("area_type");
|
||||
//假如是压制下料的几个位置,则要考虑是入输送线 还是入立体库
|
||||
if (StrUtil.equals(area_type, AreaEnum.YZQY.getCode()) && stewing_time <= 0) {
|
||||
//1.首先更新所有输送线的点位状态
|
||||
@@ -142,13 +170,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (StrUtil.equals("1", is_full) && StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) {
|
||||
String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code");
|
||||
jsonObject.put("vehicle_code", vehicle_code);
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("当前点位载具号为空!");
|
||||
}
|
||||
toPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject));
|
||||
|
||||
//生成到包装位的任务时,下发托盘类型给RGV
|
||||
JSONObject vehicleObj = WQLObject.getWQLObject("st_buss_vehiclegroup").query("vehicle_code='" + vehicle_code + "'", "create_time desc").uniqueResult(0);
|
||||
String material_id1 = vehicleObj.getString("material_id");
|
||||
JSONObject materiralObj1 = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id1 + "'").uniqueResult(0);
|
||||
String vehicle_type = materiralObj1.getString("vehicle_type");
|
||||
JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'", "create_time desc").uniqueResult(0);
|
||||
String vehicle_type = vehicleObj.getString("vehicle_type");
|
||||
if (vehicle_type.equals("03")) {
|
||||
vehicle_type = "1";
|
||||
} else if (vehicle_type.equals("04")) {
|
||||
@@ -162,9 +191,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
JSONArray array = new JSONArray();
|
||||
jsonObject1.put("device_code","RGV2");
|
||||
jsonObject1.put("code","to_container_type");
|
||||
jsonObject1.put("value",vehicle_type);
|
||||
jsonObject1.put("device_code", "RGV2");
|
||||
jsonObject1.put("code", "to_container_type");
|
||||
jsonObject1.put("value", vehicle_type);
|
||||
array.add(jsonObject1);
|
||||
try {
|
||||
wmsToAcsServiceImpl.action(array);
|
||||
@@ -173,33 +202,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
break;
|
||||
}
|
||||
//假如是半托缓存的几个位置,强制去包装
|
||||
if (StrUtil.equals(area_type, AreaEnum.MTPQ.getCode())) {
|
||||
fmjToPackIngTask.createTask((JSONObject) JSON.toJSON(jsonObject));
|
||||
//生成到包装位的任务时,下发托盘类型给RGV
|
||||
String point_id = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("point_id");
|
||||
material_id = structivtTable.query("point_id ='" + point_id + "'").uniqueResult(0).getString("material_id");
|
||||
JSONObject materiralObj1 = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||
String vehicle_type = materiralObj1.getString("vehicle_type");
|
||||
if (vehicle_type.equals("03")) {
|
||||
vehicle_type = "1";
|
||||
} else if (vehicle_type.equals("04")) {
|
||||
vehicle_type = "2";
|
||||
} else if (vehicle_type.equals("05")) {
|
||||
vehicle_type = "3";
|
||||
} else if (vehicle_type.equals("06")) {
|
||||
vehicle_type = "4";
|
||||
} else if (vehicle_type.equals("07")) {
|
||||
vehicle_type = "5";
|
||||
}
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
JSONArray array = new JSONArray();
|
||||
jsonObject1.put("device_code","RGV2");
|
||||
jsonObject1.put("code","to_container_type");
|
||||
jsonObject1.put("value",vehicle_type);
|
||||
array.add(jsonObject1);
|
||||
wmsToAcsServiceImpl.action(array);
|
||||
}
|
||||
|
||||
//假如是分拣机械手的下料位置,则需要将点位上的托盘号写入
|
||||
if (StrUtil.equals(area_type, AreaEnum.FJQY.getCode())) {
|
||||
String vehicle_code = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0).getString("vehicle_code");
|
||||
@@ -924,7 +927,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
task_table.delete(taskObj);
|
||||
JSONObject groupObj = group_table.query("task_id ='" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(groupObj)) {
|
||||
throw new BadRequestException("找不到task_id为" + taskObj.getString("task_id") +"的盘信息");
|
||||
throw new BadRequestException("找不到task_id为" + taskObj.getString("task_id") + "的盘信息");
|
||||
}
|
||||
group_table.delete(groupObj);
|
||||
|
||||
|
||||
@@ -139,6 +139,9 @@ public class ProducetaskServiceImpl implements ProducetaskService {
|
||||
//根据物料去找木托盘类型
|
||||
JSONObject materialObj = WQLObject.getWQLObject("md_me_material").query("material_id = '" + material_id + "'").uniqueResult(0);
|
||||
String vehicle_type = materialObj.getString("vehicle_type");
|
||||
if (StrUtil.isEmpty(vehicle_type)) {
|
||||
throw new RuntimeException("木托盘类型不可为空!");
|
||||
}
|
||||
dto.setVehicle_type(vehicle_type);
|
||||
dto.setProducetask_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setProducetask_code(CodeUtil.getNewCode("PRODUCE_CODE"));
|
||||
|
||||
@@ -72,7 +72,7 @@ public class AutoOutStructTask {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("flag", "9");
|
||||
param.put("area_type", "01");
|
||||
// param.put("if_full", "1");
|
||||
param.put("if_full", "1");
|
||||
param.put("material_type", line.getString("material_type"));
|
||||
String lineMaterialCode = line.getString("material_code");
|
||||
if (StrUtil.isNotEmpty(lineMaterialCode) && !StrUtil.equals(lineMaterialCode, "0")) {
|
||||
|
||||
Reference in New Issue
Block a user