|
@ -12,9 +12,11 @@ import org.nl.acs.device.service.DeviceService; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_Laminating_machine.LnshLaminatingMachineDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_kiln_lane.LnshKilnLaneDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_kiln_lane.LnshKilnLaneDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_labeling_machine.LnshLabelingMachineDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_labeling_machine.LnshLabelingMachineDeviceDriver; |
|
|
|
|
|
import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_package_pallet_manipulator.LnshPackagePalletManipulatorDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_package_pallet_manipulator.LnshPackagePalletManipulatorDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator.LnshPalletizingManipulatorDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator.LnshPalletizingManipulatorDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator_site.LnshPalletizingManipulatorSiteDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator_site.LnshPalletizingManipulatorSiteDeviceDriver; |
|
|
|
|
|
import org.nl.acs.device_driver.lnsh.lnsh_press.LnshPressDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_rgv.LnshRGVDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_rgv.LnshRGVDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_split_manipulator.LnshSplitManipulatorDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_split_manipulator.LnshSplitManipulatorDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver; |
|
|
import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver; |
|
@ -254,8 +256,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Map<String, Object> createOrder(String param) throws Exception { |
|
|
public Map<String, Object> createOrder(String param) throws Exception { |
|
|
try { |
|
|
|
|
|
MDC.put(log_file_type, log_type); |
|
|
|
|
|
JSONArray orders = JSONArray.parseArray(param); |
|
|
JSONArray orders = JSONArray.parseArray(param); |
|
|
log.info("createOrder--------------:输入参数:" + orders.toString()); |
|
|
log.info("createOrder--------------:输入参数:" + orders.toString()); |
|
|
|
|
|
|
|
@ -265,7 +265,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
JSONObject json = orders.getJSONObject(i); |
|
|
JSONObject json = orders.getJSONObject(i); |
|
|
String producetask_code = json.getString("producetask_code"); |
|
|
String producetask_code = json.getString("producetask_code"); |
|
|
String device_code = json.getString("device_code"); |
|
|
String device_code = json.getString("device_code"); |
|
|
String product_code = json.getString("product_code"); |
|
|
|
|
|
String material_code = json.getString("material_code"); |
|
|
String material_code = json.getString("material_code"); |
|
|
String material_name = json.getString("material_name"); |
|
|
String material_name = json.getString("material_name"); |
|
|
String cust_code = json.getString("cust_code"); |
|
|
String cust_code = json.getString("cust_code"); |
|
@ -274,6 +273,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
String molten_pool = json.getString("molten_pool"); |
|
|
String molten_pool = json.getString("molten_pool"); |
|
|
String weight = json.getString("weight"); |
|
|
String weight = json.getString("weight"); |
|
|
String qty = json.getString("plan_qty"); |
|
|
String qty = json.getString("plan_qty"); |
|
|
|
|
|
String product_code = json.getString("product_code"); |
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(producetask_code)) { |
|
|
if (StrUtil.isEmpty(producetask_code)) { |
|
|
throw new WDKException("工单号不能为空"); |
|
|
throw new WDKException("工单号不能为空"); |
|
@ -284,54 +284,53 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
throw new Exception("未找到对应设备:" + device_code); |
|
|
throw new Exception("未找到对应设备:" + device_code); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LnshMixingMillDeviceDriver lnshMixingMillDeviceDriver; |
|
|
|
|
|
LnshPressDeviceDriver lnshPressDeviceDriver; |
|
|
LnshPackagePalletManipulatorDeviceDriver lnshPackagePalletManipulatorDeviceDriver; |
|
|
LnshPackagePalletManipulatorDeviceDriver lnshPackagePalletManipulatorDeviceDriver; |
|
|
LnshPalletizingManipulatorDeviceDriver lnshPalletizingManipulatorDeviceDriver; |
|
|
if (device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver) { |
|
|
RljnPackagePalletSplitManipulatorDeviceDriver rljnPackagePalletSplitManipulatorDeviceDriver; |
|
|
lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver(); |
|
|
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorDeviceDriver) { |
|
|
|
|
|
lnshPalletizingManipulatorDeviceDriver = (LnshPalletizingManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
throw new WDKException("数量不能为空"); |
|
|
throw new WDKException("重量不能为空"); |
|
|
} |
|
|
} |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
} |
|
|
} |
|
|
lnshPalletizingManipulatorDeviceDriver.writing("to_order_No", producetask_code); |
|
|
lnshMixingMillDeviceDriver.writing("to_order_No",producetask_code); |
|
|
lnshPalletizingManipulatorDeviceDriver.writing("to_material_qty", qty); |
|
|
lnshMixingMillDeviceDriver.writing("to_weight",qty); |
|
|
lnshPalletizingManipulatorDeviceDriver.writing("to_material_code", material_code); |
|
|
lnshMixingMillDeviceDriver.writing("to_material_code",material_code); |
|
|
is_flag = true; |
|
|
is_flag = true; |
|
|
} |
|
|
} |
|
|
if (device.getDeviceDriver() instanceof LnshPackagePalletManipulatorDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof LnshPressDeviceDriver) { |
|
|
lnshPackagePalletManipulatorDeviceDriver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
lnshPressDeviceDriver = (LnshPressDeviceDriver) device.getDeviceDriver(); |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
throw new WDKException("数量不能为空"); |
|
|
throw new WDKException("数量不能为空"); |
|
|
} |
|
|
} |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
} |
|
|
} |
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_order_No", producetask_code); |
|
|
lnshPressDeviceDriver.writing("to_order_No",producetask_code); |
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_qty", qty); |
|
|
lnshPressDeviceDriver.writing("to_qty",qty); |
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_code", material_code); |
|
|
lnshPressDeviceDriver.writing("to_material_code",material_code); |
|
|
is_flag = true; |
|
|
is_flag = true; |
|
|
} |
|
|
} |
|
|
|
|
|
if (device.getDeviceDriver() instanceof LnshPackagePalletManipulatorDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof RljnPackagePalletSplitManipulatorDeviceDriver) { |
|
|
lnshPackagePalletManipulatorDeviceDriver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver = (RljnPackagePalletSplitManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
throw new WDKException("数量不能为空"); |
|
|
throw new WDKException("数量不能为空"); |
|
|
} |
|
|
} |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
} |
|
|
} |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver.writing("to_order_No", producetask_code); |
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_order_No",producetask_code); |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver.writing("to_material_qty", qty); |
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_qty",qty); |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver.writing("to_material_code", material_code); |
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_code",material_code); |
|
|
is_flag = true; |
|
|
is_flag = true; |
|
|
} |
|
|
} |
|
|
//下发成功后,写入工单信息表记录
|
|
|
//下发成功后,写入工单信息表记录
|
|
|
|
|
|
|
|
|
ProduceshiftorderDto dto = new ProduceshiftorderDto(); |
|
|
ProduceshiftorderDto dto = new ProduceshiftorderDto(); |
|
|
dto.setOrder_code(producetask_code); |
|
|
|
|
|
dto.setProduct_code(product_code); |
|
|
|
|
|
dto.setDevice_code(device_code); |
|
|
dto.setDevice_code(device_code); |
|
|
|
|
|
dto.setOrder_code(producetask_code); |
|
|
dto.setOrder_status("1"); |
|
|
dto.setOrder_status("1"); |
|
|
dto.setMaterial_code(material_code); |
|
|
dto.setMaterial_code(material_code); |
|
|
dto.setMaterial_name(material_name); |
|
|
dto.setMaterial_name(material_name); |
|
@ -341,7 +340,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
dto.setMolten_pool(molten_pool); |
|
|
dto.setMolten_pool(molten_pool); |
|
|
dto.setWeight(weight); |
|
|
dto.setWeight(weight); |
|
|
dto.setQty(qty); |
|
|
dto.setQty(qty); |
|
|
|
|
|
dto.setProduct_code(product_code); |
|
|
produceshiftorderService.create(dto); |
|
|
produceshiftorderService.create(dto); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
JSONObject resultJson = new JSONObject(); |
|
@ -350,12 +351,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
resultJson.put("data", new JSONObject()); |
|
|
resultJson.put("data", new JSONObject()); |
|
|
log.info("createOrder--------------:输出参数" + resultJson.toString()); |
|
|
log.info("createOrder--------------:输出参数" + resultJson.toString()); |
|
|
return resultJson; |
|
|
return resultJson; |
|
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
MDC.remove(log_file_type); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Map<String, Object> updateDeviceGoodsFromWms(String param) { |
|
|
public Map<String, Object> updateDeviceGoodsFromWms(String param) { |
|
|