|
@ -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,109 +256,104 @@ 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 { |
|
|
JSONArray orders = JSONArray.parseArray(param); |
|
|
MDC.put(log_file_type, log_type); |
|
|
log.info("createOrder--------------:输入参数:" + orders.toString()); |
|
|
JSONArray orders = JSONArray.parseArray(param); |
|
|
|
|
|
log.info("createOrder--------------:输入参数:" + orders.toString()); |
|
|
for (int i = 0; i < orders.size(); i++) { |
|
|
|
|
|
Boolean is_flag = false; |
|
|
for (int i = 0; i < orders.size(); i++) { |
|
|
|
|
|
Boolean is_flag = false; |
|
|
JSONObject json = orders.getJSONObject(i); |
|
|
|
|
|
String producetask_code = json.getString("producetask_code"); |
|
|
JSONObject json = orders.getJSONObject(i); |
|
|
String device_code = json.getString("device_code"); |
|
|
String producetask_code = json.getString("producetask_code"); |
|
|
String material_code = json.getString("material_code"); |
|
|
String device_code = json.getString("device_code"); |
|
|
String material_name = json.getString("material_name"); |
|
|
String product_code = json.getString("product_code"); |
|
|
String cust_code = json.getString("cust_code"); |
|
|
String material_code = json.getString("material_code"); |
|
|
String cust_name = json.getString("cust_name"); |
|
|
String material_name = json.getString("material_name"); |
|
|
String model = json.getString("model"); |
|
|
String cust_code = json.getString("cust_code"); |
|
|
String molten_pool = json.getString("molten_pool"); |
|
|
String cust_name = json.getString("cust_name"); |
|
|
String weight = json.getString("weight"); |
|
|
String model = json.getString("model"); |
|
|
String qty = json.getString("plan_qty"); |
|
|
String molten_pool = json.getString("molten_pool"); |
|
|
String product_code = json.getString("product_code"); |
|
|
String weight = json.getString("weight"); |
|
|
|
|
|
String qty = json.getString("plan_qty"); |
|
|
if (StrUtil.isEmpty(producetask_code)) { |
|
|
|
|
|
throw new WDKException("工单号不能为空"); |
|
|
if (StrUtil.isEmpty(producetask_code)) { |
|
|
} |
|
|
throw new WDKException("工单号不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Device device = DeviceAppService.findDeviceByCode(device_code); |
|
|
Device device = DeviceAppService.findDeviceByCode(device_code); |
|
|
if (ObjectUtil.isEmpty(device)) { |
|
|
if (ObjectUtil.isEmpty(device)) { |
|
|
throw new Exception("未找到对应设备:" + device_code); |
|
|
throw new Exception("未找到对应设备:" + device_code); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
LnshPackagePalletManipulatorDeviceDriver lnshPackagePalletManipulatorDeviceDriver; |
|
|
LnshMixingMillDeviceDriver lnshMixingMillDeviceDriver; |
|
|
LnshPalletizingManipulatorDeviceDriver lnshPalletizingManipulatorDeviceDriver; |
|
|
LnshPressDeviceDriver lnshPressDeviceDriver; |
|
|
RljnPackagePalletSplitManipulatorDeviceDriver rljnPackagePalletSplitManipulatorDeviceDriver; |
|
|
LnshPackagePalletManipulatorDeviceDriver lnshPackagePalletManipulatorDeviceDriver; |
|
|
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorDeviceDriver) { |
|
|
if (device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver) { |
|
|
lnshPalletizingManipulatorDeviceDriver = (LnshPalletizingManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver(); |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
throw new WDKException("数量不能为空"); |
|
|
throw new WDKException("重量不能为空"); |
|
|
} |
|
|
|
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
|
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
|
|
|
} |
|
|
|
|
|
lnshPalletizingManipulatorDeviceDriver.writing("to_order_No", producetask_code); |
|
|
|
|
|
lnshPalletizingManipulatorDeviceDriver.writing("to_material_qty", qty); |
|
|
|
|
|
lnshPalletizingManipulatorDeviceDriver.writing("to_material_code", material_code); |
|
|
|
|
|
is_flag = true; |
|
|
|
|
|
} |
|
|
} |
|
|
if (device.getDeviceDriver() instanceof LnshPackagePalletManipulatorDeviceDriver) { |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
lnshPackagePalletManipulatorDeviceDriver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
|
|
|
throw new WDKException("数量不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
|
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
|
|
|
} |
|
|
|
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_order_No", producetask_code); |
|
|
|
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_qty", qty); |
|
|
|
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_code", material_code); |
|
|
|
|
|
is_flag = true; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
lnshMixingMillDeviceDriver.writing("to_order_No",producetask_code); |
|
|
if (device.getDeviceDriver() instanceof RljnPackagePalletSplitManipulatorDeviceDriver) { |
|
|
lnshMixingMillDeviceDriver.writing("to_weight",qty); |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver = (RljnPackagePalletSplitManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
lnshMixingMillDeviceDriver.writing("to_material_code",material_code); |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
is_flag = true; |
|
|
throw new WDKException("数量不能为空"); |
|
|
} |
|
|
} |
|
|
if (device.getDeviceDriver() instanceof LnshPressDeviceDriver) { |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
lnshPressDeviceDriver = (LnshPressDeviceDriver) device.getDeviceDriver(); |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
} |
|
|
throw new WDKException("数量不能为空"); |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver.writing("to_order_No", producetask_code); |
|
|
} |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver.writing("to_material_qty", qty); |
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
rljnPackagePalletSplitManipulatorDeviceDriver.writing("to_material_code", material_code); |
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
is_flag = true; |
|
|
|
|
|
} |
|
|
} |
|
|
//下发成功后,写入工单信息表记录
|
|
|
lnshPressDeviceDriver.writing("to_order_No",producetask_code); |
|
|
ProduceshiftorderDto dto = new ProduceshiftorderDto(); |
|
|
lnshPressDeviceDriver.writing("to_qty",qty); |
|
|
dto.setOrder_code(producetask_code); |
|
|
lnshPressDeviceDriver.writing("to_material_code",material_code); |
|
|
dto.setProduct_code(product_code); |
|
|
is_flag = true; |
|
|
dto.setDevice_code(device_code); |
|
|
|
|
|
dto.setOrder_status("1"); |
|
|
|
|
|
dto.setMaterial_code(material_code); |
|
|
|
|
|
dto.setMaterial_name(material_name); |
|
|
|
|
|
dto.setCust_code(cust_code); |
|
|
|
|
|
dto.setCust_name(cust_name); |
|
|
|
|
|
dto.setModel(model); |
|
|
|
|
|
dto.setMolten_pool(molten_pool); |
|
|
|
|
|
dto.setWeight(weight); |
|
|
|
|
|
dto.setQty(qty); |
|
|
|
|
|
produceshiftorderService.create(dto); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
if (device.getDeviceDriver() instanceof LnshPackagePalletManipulatorDeviceDriver) { |
|
|
|
|
|
lnshPackagePalletManipulatorDeviceDriver = (LnshPackagePalletManipulatorDeviceDriver) device.getDeviceDriver(); |
|
|
|
|
|
if (StrUtil.isEmpty(qty)) { |
|
|
|
|
|
throw new WDKException("数量不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
if (StrUtil.isEmpty(material_code)) { |
|
|
|
|
|
throw new WDKException("物料编号不能为空!"); |
|
|
|
|
|
} |
|
|
|
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_order_No",producetask_code); |
|
|
|
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_qty",qty); |
|
|
|
|
|
lnshPackagePalletManipulatorDeviceDriver.writing("to_material_code",material_code); |
|
|
|
|
|
is_flag = true; |
|
|
|
|
|
} |
|
|
|
|
|
//下发成功后,写入工单信息表记录
|
|
|
|
|
|
|
|
|
|
|
|
ProduceshiftorderDto dto = new ProduceshiftorderDto(); |
|
|
|
|
|
dto.setDevice_code(device_code); |
|
|
|
|
|
dto.setOrder_code(producetask_code); |
|
|
|
|
|
dto.setOrder_status("1"); |
|
|
|
|
|
dto.setMaterial_code(material_code); |
|
|
|
|
|
dto.setMaterial_name(material_name); |
|
|
|
|
|
dto.setCust_code(cust_code); |
|
|
|
|
|
dto.setCust_name(cust_name); |
|
|
|
|
|
dto.setModel(model); |
|
|
|
|
|
dto.setMolten_pool(molten_pool); |
|
|
|
|
|
dto.setWeight(weight); |
|
|
|
|
|
dto.setQty(qty); |
|
|
|
|
|
dto.setProduct_code(product_code); |
|
|
|
|
|
produceshiftorderService.create(dto); |
|
|
|
|
|
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
|
|
resultJson.put("status", HttpStatus.OK); |
|
|
|
|
|
resultJson.put("message", "操作成功"); |
|
|
|
|
|
resultJson.put("data", new JSONObject()); |
|
|
|
|
|
log.info("createOrder--------------:输出参数" + resultJson.toString()); |
|
|
|
|
|
return resultJson; |
|
|
|
|
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
MDC.remove(log_file_type); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
|
|
resultJson.put("status", HttpStatus.OK); |
|
|
|
|
|
resultJson.put("message", "操作成功"); |
|
|
|
|
|
resultJson.put("data", new JSONObject()); |
|
|
|
|
|
log.info("createOrder--------------:输出参数" + resultJson.toString()); |
|
|
|
|
|
return resultJson; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Map<String, Object> updateDeviceGoodsFromWms(String param) { |
|
|
public Map<String, Object> updateDeviceGoodsFromWms(String param) { |
|
|
try { |
|
|
try { |
|
|