|
@ -11,6 +11,7 @@ import org.nl.exception.BadRequestException; |
|
|
import org.nl.wms.pda.exception.PdaRequestException; |
|
|
import org.nl.wms.pda.exception.PdaRequestException; |
|
|
import org.nl.wms.pda.sendMaterial.service.SendMaterialService; |
|
|
import org.nl.wms.pda.sendMaterial.service.SendMaterialService; |
|
|
import org.nl.wms.sch.manage.buss.SendMaterialTask; |
|
|
import org.nl.wms.sch.manage.buss.SendMaterialTask; |
|
|
|
|
|
import org.nl.wql.WQL; |
|
|
import org.nl.wql.core.bean.WQLObject; |
|
|
import org.nl.wql.core.bean.WQLObject; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
@ -28,19 +29,19 @@ public class SendMaterialServiceImpl implements SendMaterialService { |
|
|
public Map<String, Object> queryDevice(Map<String, String> jsonObject) { |
|
|
public Map<String, Object> queryDevice(Map<String, String> jsonObject) { |
|
|
JSONObject returnjo = new 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(); |
|
|
JSONArray workprocedureja = new JSONArray(); |
|
|
for (int i = 0; i < workprocedureArr.size(); i++) { |
|
|
for (int i = 0; i < workprocedureArr.size(); i++) { |
|
|
JSONObject workprocedureObj = workprocedureArr.getJSONObject(i); |
|
|
JSONObject workprocedureObj = workprocedureArr.getJSONObject(i); |
|
|
String workprocedure_id = workprocedureObj.getString("workprocedure_id"); |
|
|
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++) { |
|
|
for (int j = 0; j < deviceArr.size(); j++) { |
|
|
JSONObject deviceObj = deviceArr.getJSONObject(j); |
|
|
JSONObject deviceObj = deviceArr.getJSONObject(j); |
|
|
//根据设备查询点位
|
|
|
//根据设备查询点位
|
|
|
String device_id = deviceObj.getString("device_id"); |
|
|
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); |
|
|
deviceObj.put("pointArr", pointArr); |
|
|
deviceja.add(deviceObj); |
|
|
deviceja.add(deviceObj); |
|
|
} |
|
|
} |
|
|