更新
This commit is contained in:
@@ -352,37 +352,28 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
*/
|
||||
@Override
|
||||
public void manipulatorApply(JSONObject jsonObject) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject groupTab = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||
//组盘
|
||||
JSONObject produceInfoByCode = new JSONObject();
|
||||
String device_code = jsonObject.getString("device_code"); // 对接位
|
||||
// vehicle_code:不一定有,分拣码垛会提供木托盘载具号、压制码垛是不提供载具号
|
||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||
// vehicle_code 载具编码
|
||||
String vehicle_code = String.format("%04d", jsonObject.getIntValue("vehicle_code"));
|
||||
String qty = String.valueOf(jsonObject.get("qty"));
|
||||
produceInfoByCode = this.getProduceInfoByCode(device_code); // 获取设备的
|
||||
String material_id = (String) produceInfoByCode.get("material_id");
|
||||
String cust_id = (String) produceInfoByCode.get("cust_id");
|
||||
String producetask_id = (String) produceInfoByCode.get("workorder_id");
|
||||
String material_id = produceInfoByCode.getString("material_id");
|
||||
String cust_id = produceInfoByCode.getString("cust_id");
|
||||
String producetask_id = produceInfoByCode.getString("workorder_id");
|
||||
// 物料
|
||||
JSONObject materialObj = WQLObject
|
||||
.getWQLObject("MD_ME_MaterialBase")
|
||||
.query("material_id = '" + material_id + "'")
|
||||
.uniqueResult(0);
|
||||
// 机械手下料位
|
||||
JSONObject pointObj = pointTab.query("point_code = '" + device_code + "'").uniqueResult(0);
|
||||
|
||||
groupTab.delete("vehicle_code = '" + vehicle_code + "'");
|
||||
|
||||
JSONObject groupObj = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(pointObj.getString("group_id"))) { // 存在组盘id,表示是半托
|
||||
// 半托只需要修改参数即可
|
||||
groupObj = groupTab.query("group_id = '" + pointObj.getString("group_id") + "'").uniqueResult(0);
|
||||
jsonObject.put("group_id", pointObj.getString("group_id")); // 组盘标识
|
||||
} else {
|
||||
long nextId = IdUtil.getSnowflake(1, 1).nextId();
|
||||
groupObj.put("group_id", nextId);
|
||||
jsonObject.put("group_id", nextId); // 组盘标识
|
||||
}
|
||||
if (device_code.startsWith("FJ"))
|
||||
groupObj.put("vehicle_code", String.format("%04d", Integer.parseInt(vehicle_code)));
|
||||
groupObj.put("group_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
groupObj.put("vehicle_code", vehicle_code);
|
||||
groupObj.put("material_uuid", material_id);
|
||||
groupObj.put("material_code", materialObj.getString("material_code"));
|
||||
groupObj.put("material_name", materialObj.getString("material_name"));
|
||||
@@ -446,14 +437,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
groupObj.put("create_id", "22");
|
||||
groupObj.put("create_name", "ACS系统");
|
||||
groupObj.put("create_time", DateUtil.now());
|
||||
if (ObjectUtil.isNotEmpty(pointObj.getString("group_id"))) {
|
||||
groupTab.update(groupObj);
|
||||
// 清除对接位的组盘标识
|
||||
pointObj.put("group_id", null);
|
||||
pointTab.update(pointObj);
|
||||
} else {
|
||||
groupTab.insert(groupObj);
|
||||
}
|
||||
groupTab.insert(groupObj);
|
||||
// 入库
|
||||
jsonObject.put("type", "1");
|
||||
this.apply(jsonObject);
|
||||
|
||||
@@ -162,7 +162,7 @@ public class YzjSendMaterialTask extends AbstractAcsTask {
|
||||
point2Obj.put("vehicle_code", taskObj.getString("vehicle_code"));
|
||||
point2Obj.put("vehicle_qty", "1"); // 入库为1个载具
|
||||
point2Obj.put("is_full", requestObj.getString("is_full"));
|
||||
point2Obj.put("group_id", taskObj.getString("group_id")); // 组盘标识
|
||||
// point2Obj.put("group_id", taskObj.getString("group_id")); // 组盘标识
|
||||
// 解锁终点
|
||||
point2Obj.put("lock_type", PointEnum.LOCK_TYPE_FALSE.getCode());
|
||||
point2Obj.put("point_status", PointEnum.POINT_STATUS_HAVE_MATERIAL.getCode());
|
||||
|
||||
Reference in New Issue
Block a user