Browse Source

rev 更新下发工单叫料

master
周俊杰 1 year ago
parent
commit
8d827ef1ee
  1. 15
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java
  2. 1
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java
  3. 6
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/WmstoAcsData/createOrder/OrderDto.java
  4. 40
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

15
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java

@ -302,7 +302,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
this.writing(200); this.writing(101);
this.setRequireSucess(true); this.setRequireSucess(true);
} else { } else {
this.writing(400); this.writing(400);
@ -328,13 +328,13 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
this.writing(200); this.writing(102);
this.setRequireSucess(true); this.setRequireSucess(true);
} else { } else {
this.writing(400); this.writing(400);
message = RequestMethodEnum.getName("order_finish") + "order_finish 接口请求失败" + resp.getMessage();; message = RequestMethodEnum.getName("order_finish") + "order_finish 接口请求失败" + resp.getMessage();;
} }
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
} }
return true; return true;
} }
@ -343,7 +343,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
* 压机叫料 * 压机叫料
* @return * @return
*/ */
public synchronized boolean press_request_material(){ public synchronized boolean pressRequestMaterial(){
ApplyTaskRequest request = new ApplyTaskRequest(); ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code()); request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
@ -351,7 +351,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
request.setOrder_code(String.valueOf(order_No)); request.setOrder_code(String.valueOf(order_No));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplyTaskResponse.class);
message = RequestMethodEnum.getName("pressRequestMaterial") + "pressRequestMaterial 接口请求LMS..."; message = RequestMethodEnum.getName("pressRequestMaterial") + "pressRequestMaterial 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "请求参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
this.writing(200); this.writing(200);
@ -359,8 +359,9 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
} else { } else {
this.writing(400); this.writing(400);
message = RequestMethodEnum.getName("pressRequestMaterial") + "pressRequestMaterial 接口请求失败" + resp.getMessage(); message = RequestMethodEnum.getName("pressRequestMaterial") + "pressRequestMaterial 接口请求失败" + resp.getMessage();
this.setRequireSucess(true);
} }
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
return true; return true;
} }
/** /**
@ -384,8 +385,8 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
} else { } else {
this.writing(400); this.writing(400);
message = RequestMethodEnum.getName("apply_feedback_weight") + "apply_feedback_weight 接口请求失败" + resp.getMessage(); message = RequestMethodEnum.getName("apply_feedback_weight") + "apply_feedback_weight 接口请求失败" + resp.getMessage();
;
} }
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
return true; return true;
} }

1
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java

@ -497,6 +497,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
jo.put("isOnline", isonline); jo.put("isOnline", isonline);
jo.put("hasGoods", hasGoods); jo.put("hasGoods", hasGoods);
jo.put("message", message); jo.put("message", message);
jo.put("hasGoods",hasGoods);
return jo; return jo;
} }

6
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/WmstoAcsData/createOrder/OrderDto.java

@ -8,9 +8,9 @@ public class OrderDto {
private String workorder_code; // 工单编码 private String workorder_code; // 工单编码
private String device_code; // 设备编码 private String device_code; // 设备编码
private String material_code; // 半成品物料编码 - 工单物料编码 private String material_code; // 半成品物料编码 - 工单物料编码
private String product_code; // 产品代号 - 成品 private String product_code; // 产品代号 - 数字
private String formula; // 配方-泥料 private String formula; // 配方-型号
private String brick_code; // 砖型编码 private String brick_code; // 砖型编码- 物料规格
private String plan_qty; // 计划数量 private String plan_qty; // 计划数量
private String a; // a边 private String a; // a边
private String b; // private String b; //

40
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -338,7 +338,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
Boolean is_flag = false; Boolean is_flag = false;
OrderDto orderDto = orders.getList().get(i); OrderDto orderDto = orders.getList().get(i);
String produce_code = orderDto.getProduct_code(); String order_code = orderDto.getWorkorder_code();
String device_code = orderDto.getDevice_code(); String device_code = orderDto.getDevice_code();
String material_code = orderDto.getMaterial_code(); String material_code = orderDto.getMaterial_code();
String qty = orderDto.getPlan_qty(); String qty = orderDto.getPlan_qty();
@ -360,9 +360,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String detection_error = orderDto.getDetection_error(); String detection_error = orderDto.getDetection_error();
if (StrUtil.isEmpty(produce_code)) { if (StrUtil.isEmpty(order_code)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","工单编码不能为空"); json.put("message","工单编码不能为空");
errArr.add(json); errArr.add(json);
@ -372,7 +372,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
Device device = DeviceAppService.findDeviceByCode(device_code); Device device = DeviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) { if (ObjectUtil.isEmpty(device)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","未找到对应设备"); json.put("message","未找到对应设备");
errArr.add(json); errArr.add(json);
@ -387,7 +387,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver(); lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver();
if (lnshMixingMillDeviceDriver.getMode() == 0) { if (lnshMixingMillDeviceDriver.getMode() == 0) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","设备未联机"); json.put("message","设备未联机");
errArr.add(json); errArr.add(json);
@ -395,7 +395,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(qty)) { if (StrUtil.isEmpty(qty)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","重量不能为空"); json.put("message","重量不能为空");
errArr.add(json); errArr.add(json);
@ -403,13 +403,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(material_code)) { if (StrUtil.isEmpty(material_code)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","物料编号不能为空"); json.put("message","物料编号不能为空");
errArr.add(json); errArr.add(json);
continue; continue;
} }
lnshMixingMillDeviceDriver.writing("to_order_No", produce_code); lnshMixingMillDeviceDriver.writing("to_order_No", order_code);
lnshMixingMillDeviceDriver.writing("to_weight", qty); lnshMixingMillDeviceDriver.writing("to_weight", qty);
lnshMixingMillDeviceDriver.writing("to_material_code", material_code); lnshMixingMillDeviceDriver.writing("to_material_code", material_code);
lnshMixingMillDeviceDriver.writing(100); lnshMixingMillDeviceDriver.writing(100);
@ -419,7 +419,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
lnshPressDeviceDriver = (LnshPressDeviceDriver) device.getDeviceDriver(); lnshPressDeviceDriver = (LnshPressDeviceDriver) device.getDeviceDriver();
if (lnshPressDeviceDriver.getMode() == 0) { if (lnshPressDeviceDriver.getMode() == 0) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","设备未联机"); json.put("message","设备未联机");
errArr.add(json); errArr.add(json);
@ -427,7 +427,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(qty)) { if (StrUtil.isEmpty(qty)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","重量不能为空"); json.put("message","重量不能为空");
errArr.add(json); errArr.add(json);
@ -435,13 +435,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(material_code)) { if (StrUtil.isEmpty(material_code)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","物料编号不能为空"); json.put("message","物料编号不能为空");
errArr.add(json); errArr.add(json);
continue; continue;
} }
lnshPressDeviceDriver.writing("to_order_No", produce_code); lnshPressDeviceDriver.writing("to_order_No", order_code);
lnshPressDeviceDriver.writing("to_qty", qty); lnshPressDeviceDriver.writing("to_qty", qty);
lnshPressDeviceDriver.writing("to_material_code", material_code); lnshPressDeviceDriver.writing("to_material_code", material_code);
lnshPressDeviceDriver.writing("to_product_code", product_code); lnshPressDeviceDriver.writing("to_product_code", product_code);
@ -467,7 +467,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
lnshPackagePalletManipulatorDeviceDriver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver(); lnshPackagePalletManipulatorDeviceDriver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver();
if (lnshPackagePalletManipulatorDeviceDriver.getMode() == 0) { if (lnshPackagePalletManipulatorDeviceDriver.getMode() == 0) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","设备未联机"); json.put("message","设备未联机");
errArr.add(json); errArr.add(json);
@ -475,7 +475,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(qty)) { if (StrUtil.isEmpty(qty)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","重量不能为空"); json.put("message","重量不能为空");
errArr.add(json); errArr.add(json);
@ -483,13 +483,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(material_code)) { if (StrUtil.isEmpty(material_code)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","物料编号不能为空"); json.put("message","物料编号不能为空");
errArr.add(json); errArr.add(json);
continue; continue;
} }
lnshPackagePalletManipulatorDeviceDriver.writing("to_order_No", produce_code); lnshPackagePalletManipulatorDeviceDriver.writing("to_order_No", order_code);
lnshPackagePalletManipulatorDeviceDriver.writing("to_material", material_code); lnshPackagePalletManipulatorDeviceDriver.writing("to_material", material_code);
lnshPackagePalletManipulatorDeviceDriver.writing("to_product_code", product_code); lnshPackagePalletManipulatorDeviceDriver.writing("to_product_code", product_code);
lnshPackagePalletManipulatorDeviceDriver.writing("to_AlongSide", AlongSide); lnshPackagePalletManipulatorDeviceDriver.writing("to_AlongSide", AlongSide);
@ -503,7 +503,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
lnshSplitManipulatorDeviceDriver = (LnshSplitManipulatorDeviceDriver) device.getDeviceDriver(); lnshSplitManipulatorDeviceDriver = (LnshSplitManipulatorDeviceDriver) device.getDeviceDriver();
if (lnshSplitManipulatorDeviceDriver.getMode() == 0) { if (lnshSplitManipulatorDeviceDriver.getMode() == 0) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","设备未联机"); json.put("message","设备未联机");
errArr.add(json); errArr.add(json);
@ -511,7 +511,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(qty)) { if (StrUtil.isEmpty(qty)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","重量不能为空"); json.put("message","重量不能为空");
errArr.add(json); errArr.add(json);
@ -519,13 +519,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (StrUtil.isEmpty(material_code)) { if (StrUtil.isEmpty(material_code)) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("produce_code", produce_code); json.put("order_code", order_code);
json.put("devicie_code", device_code); json.put("devicie_code", device_code);
json.put("message","物料编号不能为空"); json.put("message","物料编号不能为空");
errArr.add(json); errArr.add(json);
continue; continue;
} }
lnshSplitManipulatorDeviceDriver.writing("to_order_No", produce_code); lnshSplitManipulatorDeviceDriver.writing("to_order_No", order_code);
lnshSplitManipulatorDeviceDriver.writing("to_material_qty", qty); lnshSplitManipulatorDeviceDriver.writing("to_material_qty", qty);
lnshSplitManipulatorDeviceDriver.writing("to_material_code", material_code); lnshSplitManipulatorDeviceDriver.writing("to_material_code", material_code);
lnshSplitManipulatorDeviceDriver.writing("to_product_code", product_code); lnshSplitManipulatorDeviceDriver.writing("to_product_code", product_code);

Loading…
Cancel
Save