diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index fa80ce7..7db5358 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -178,12 +178,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { String material_id = (String) produceInfoByCode.get("material_id"); String cust_id = (String) produceInfoByCode.get("cust_id"); String producetask_id = (String) produceInfoByCode.get("producetask_id"); + WQLObject.getWQLObject("st_buss_vehiclegroup").delete("vehicle_code ='"+vehicle_code+"'"); + //如果上报不了,则去点位上取(木托盘情况) + if (StrUtil.equals("0", vehicle_code)) { + vehicle_code = produceInfoByCode.getString("vehicle_code"); + } JSONObject materialObj = WQLObject .getWQLObject("MD_ME_Material") .query("material_id='" + material_id + "'") .uniqueResult(0); JSONObject groubObj = new JSONObject(); groubObj.put("group_id", IdUtil.getSnowflake(1, 1).nextId()); + groubObj.put("vehicle_code", vehicle_code); groubObj.put("material_uuid", material_id); groubObj.put("material_code", materialObj.getString("material_code")); @@ -352,7 +358,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } JSONObject vehicleObj = WQLObject.getWQLObject("st_buss_vehiclegroup").query("vehicle_code='" + vehicle_code + "' AND is_delete='0'").uniqueResult(0); if (ObjectUtil.isEmpty(vehicleObj)) { - throw new BadRequestException("未找到托盘号为'" + vehicle_code + "'的托盘信息!"); + //去找对应排产单物料的垛型参数 + WQLObject infoTable = WQLObject.getWQLObject("MD_ME_CribbingInfo"); + JSONObject produceInfoByCodeObj = this.getProduceInfoByCode(device_code); + String material_id = produceInfoByCodeObj.getString("material_id"); + vehicleObj = infoTable.query("material_id='" + material_id + "'").uniqueResult(0); } JSONObject result = new JSONObject(); result.put("status", HttpStatus.OK.value()); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java index 74ef986..de85b93 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java @@ -44,7 +44,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { public JSONObject queryPointStatus(JSONArray arr) { String api = "api/wms/querydevice"; return AcsUtil.notifyAcs(api, arr); - } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java index 05f03b3..a55362c 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/service/impl/SendMaterialServiceImpl.java @@ -11,6 +11,7 @@ import org.nl.exception.BadRequestException; import org.nl.wms.pda.exception.PdaRequestException; import org.nl.wms.pda.sendMaterial.service.SendMaterialService; import org.nl.wms.sch.manage.buss.SendMaterialTask; +import org.nl.wql.WQL; import org.nl.wql.core.bean.WQLObject; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -28,19 +29,19 @@ public class SendMaterialServiceImpl implements SendMaterialService { public Map queryDevice(Map jsonObject) { JSONObject returnjo = new JSONObject(); //查询工序 - JSONArray workprocedureArr = WQLObject.getWQLObject("pdm_base_workprocedure").query("1=1").getResultJSONArray(0); + JSONArray workprocedureArr = WQL.getWO("QPADSERVICE").addParam("flag", "16").process().getResultJSONArray(0); //根据工序查询设备 - JSONArray deviceja = new JSONArray(); JSONArray workprocedureja = new JSONArray(); for (int i = 0; i < workprocedureArr.size(); i++) { JSONObject workprocedureObj = workprocedureArr.getJSONObject(i); String workprocedure_id = workprocedureObj.getString("workprocedure_id"); - JSONArray deviceArr = WQLObject.getWQLObject("pdm_base_device").query("workprocedure_id='" + workprocedure_id + "'").getResultJSONArray(0); + JSONArray deviceArr = WQL.getWO("QPADSERVICE").addParam("flag", "17").addParam("workprocedure_id", workprocedure_id).process().getResultJSONArray(0); + JSONArray deviceja = new JSONArray(); for (int j = 0; j < deviceArr.size(); j++) { JSONObject deviceObj = deviceArr.getJSONObject(j); //根据设备查询点位 String device_id = deviceObj.getString("device_id"); - JSONArray pointArr = WQLObject.getWQLObject("sch_base_point").query("device_id='" + device_id + "'").getResultJSONArray(0); + JSONArray pointArr = WQL.getWO("QPADSERVICE").addParam("flag", "18").addParam("device_id", device_id).process().getResultJSONArray(0); deviceObj.put("pointArr", pointArr); deviceja.add(deviceObj); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/wql/QPADSERVICE.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/wql/QPADSERVICE.wql index ce130b1..b561c46 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/wql/QPADSERVICE.wql +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendMaterial/wql/QPADSERVICE.wql @@ -28,6 +28,8 @@ 输入.search_bar TYPEAS s_string 输入.buss_area_type TYPEAS s_string 输入.height TYPEAS s_string + 输入.workprocedure_id TYPEAS s_string + 输入.device_id TYPEAS s_string [临时表] @@ -386,4 +388,55 @@ IF 输入.flag = "13" md_me_material material ENDSELECT ENDPAGEQUERY - ENDIF \ No newline at end of file + ENDIF + +IF 输入.flag = "16" + PAGEQUERY + SELECT + workpro.workprocedure_id, + workpro.workprocedure_code, + workpro.workprocedure_name + FROM + pdm_base_workprocedure workpro + WHERE + workprocedure_code < '05' + ORDER BY + seq_no + ENDSELECT + ENDPAGEQUERY +ENDIF + +IF 输入.flag = "17" + PAGEQUERY + SELECT + device.device_id, + device.device_code, + device.device_name + FROM + pdm_base_device device + WHERE + 1 = 1 + OPTION 输入.workprocedure_id <> "" + device.workprocedure_id = 输入.workprocedure_id + ENDOPTION + ENDSELECT + ENDPAGEQUERY +ENDIF + +IF 输入.flag = "18" + PAGEQUERY + SELECT + point.point_id, + point.point_code, + point.point_name + FROM + sch_base_point point + WHERE + 1 = 1 + OPTION 输入.device_id <> "" + point.device_id = 输入.device_id + ENDOPTION + + ENDSELECT + ENDPAGEQUERY +ENDIF \ No newline at end of file diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls index 3793063..908e4ab 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls differ diff --git a/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml b/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml index a37d777..0a3d6de 100644 --- a/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml +++ b/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml @@ -8,12 +8,12 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy -# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:llsh_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:llsh_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:llsh_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + #url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:llsh_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} #password: ${DB_PWD:P@ssw0rd} -# password: ${DB_PWD:Root.123456} - password: ${DB_PWD:zjw123} + password: ${DB_PWD:Root.123456} + #password: ${DB_PWD:zjw123} # 初始连接数 initial-size: 5 # 最小连接数