提交
This commit is contained in:
@@ -610,7 +610,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (StrUtil.isEmpty(material_code)) {
|
if (StrUtil.isEmpty(material_code)) {
|
||||||
throw new BadRequestException("物料编码不能为空!");
|
throw new BadRequestException("物料编码不能为空!");
|
||||||
}
|
}
|
||||||
String device_id = WQLObject.getWQLObject("pdm_base_device").query("device_code ='" + device_code + "'").uniqueResult(0).getString("device_id");
|
//根据设备去找设备id
|
||||||
|
String device_id = "";
|
||||||
|
if (StrUtil.equals("FJJXS1", device_code) || StrUtil.equals("FJJXS2", device_code) || StrUtil.equals("FJJXS3", device_code)) {
|
||||||
|
device_id = WQLObject.getWQLObject("pdm_base_device").query("device_code ='" + device_code + "'").uniqueResult(0).getString("device_id");
|
||||||
|
} else {
|
||||||
|
device_id = WQLObject.getWQLObject("sch_base_point").query("point_code='" + device_code + "'").uniqueResult(0).getString("device_id");
|
||||||
|
|
||||||
|
}
|
||||||
//根据物料code 去找物料id
|
//根据物料code 去找物料id
|
||||||
JSONObject materiObj = WQLObject.getWQLObject("MD_ME_Material").query("material_code='" + material_code + "'").uniqueResult(0);
|
JSONObject materiObj = WQLObject.getWQLObject("MD_ME_Material").query("material_code='" + material_code + "'").uniqueResult(0);
|
||||||
if (!StrUtil.equals(device_id, taskObj.getString("device_id"))) {
|
if (!StrUtil.equals(device_id, taskObj.getString("device_id"))) {
|
||||||
|
|||||||
@@ -283,7 +283,15 @@ public class ProducetaskServiceImpl implements ProducetaskService {
|
|||||||
if (ObjectUtil.isNotEmpty(jo)) {
|
if (ObjectUtil.isNotEmpty(jo)) {
|
||||||
throw new BadRequestException("该设备存在未完成的工单,不能下发!");
|
throw new BadRequestException("该设备存在未完成的工单,不能下发!");
|
||||||
}
|
}
|
||||||
JSONObject taskObj = WQL.getWO("PDM_ProduceTask_01").addParam("flag", "3").addParam("producetask_id", producetask_id).process().uniqueResult(0);
|
JSONObject taskObj = new JSONObject();
|
||||||
|
//假如是包装的三台机械手,是将设备当作工单设备
|
||||||
|
//假如是压机下料的机械手,则是将对接为当作工单设备
|
||||||
|
if (StrUtil.equals(device_id, "1518136519804719104") || StrUtil.equals("1518136611341209600", device_id) || StrUtil.equals("1544608176471674880", device_id)) {
|
||||||
|
taskObj = WQL.getWO("PDM_ProduceTask_01").addParam("flag", "4").addParam("producetask_id", producetask_id).process().uniqueResult(0);
|
||||||
|
} else {
|
||||||
|
taskObj = WQL.getWO("PDM_ProduceTask_01").addParam("flag", "3").addParam("producetask_id", producetask_id).process().uniqueResult(0);
|
||||||
|
}
|
||||||
|
|
||||||
taskObj.put("product_code", "wms");
|
taskObj.put("product_code", "wms");
|
||||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
JSONArray arr = new JSONArray();
|
JSONArray arr = new JSONArray();
|
||||||
|
|||||||
@@ -126,4 +126,27 @@
|
|||||||
ENDOPTION
|
ENDOPTION
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
IF 输入.flag = "4"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
point.point_code as device_code,
|
||||||
|
task.*,
|
||||||
|
material.material_code,
|
||||||
|
material.material_name,
|
||||||
|
material.material_spec,
|
||||||
|
material.material_model
|
||||||
|
FROM
|
||||||
|
pdm_mg_producetask task
|
||||||
|
LEFT JOIN sch_base_point point ON point.device_id = task.device_id
|
||||||
|
AND point.point_code <> 'MDJXS101'
|
||||||
|
LEFT JOIN md_me_material material ON material.material_id = task.material_id
|
||||||
|
WHERE
|
||||||
|
1 =1
|
||||||
|
OPTION 输入.producetask_id <> ""
|
||||||
|
(task.producetask_id = 输入.producetask_id)
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
Reference in New Issue
Block a user