|
@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.nl.config.ConfigParam; |
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.modules.common.utils.SecurityUtils; |
|
|
import org.nl.modules.common.utils.SecurityUtils; |
|
|
import org.nl.modules.system.util.CodeUtil; |
|
|
import org.nl.modules.system.util.CodeUtil; |
|
@ -116,6 +117,7 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
|
|
|
|
|
|
JSONObject requestObj = task.getJSONObject("request_param"); |
|
|
JSONObject requestObj = task.getJSONObject("request_param"); |
|
|
|
|
|
|
|
|
|
|
|
插入区域表:{ |
|
|
//区域出入表【st_ivt_regionIO】
|
|
|
//区域出入表【st_ivt_regionIO】
|
|
|
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO"); |
|
|
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO"); |
|
|
JSONObject regionIoObj = new JSONObject(); |
|
|
JSONObject regionIoObj = new JSONObject(); |
|
@ -138,7 +140,7 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
regionIoObj.put("create_name", SecurityUtils.getCurrentNickName()); |
|
|
regionIoObj.put("create_name", SecurityUtils.getCurrentNickName()); |
|
|
regionIoObj.put("create_time", DateUtil.now()); |
|
|
regionIoObj.put("create_time", DateUtil.now()); |
|
|
regionIoTab.insert(regionIoObj); |
|
|
regionIoTab.insert(regionIoObj); |
|
|
|
|
|
} |
|
|
//完成后
|
|
|
//完成后
|
|
|
// 物料点位解锁 并设置空位
|
|
|
// 物料点位解锁 并设置空位
|
|
|
material_point.put("lock_type", "1"); |
|
|
material_point.put("lock_type", "1"); |
|
@ -179,7 +181,7 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
String device_code = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0).getString("device_code"); |
|
|
String device_code = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0).getString("device_code"); |
|
|
JSONObject workOrderObj = workOrderTab.query("device_code = '" + device_code + "' and order_status = '3' and is_delete ='0'").uniqueResult(0); |
|
|
JSONObject workOrderObj = workOrderTab.query("device_code = '" + device_code + "' and order_status = '3' and is_delete ='0'").uniqueResult(0); |
|
|
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除"); |
|
|
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除"); |
|
|
String oldMatSendPoint = YZJ_OLD_POINT.get(point_code2);//旧料盅终点
|
|
|
String oldMatSendPoint = ConfigParam.YZJ_OLD_POINT.get(point_code2);//旧料盅终点
|
|
|
if (StringUtils.isNotEmpty(oldMatSendPoint)){ |
|
|
if (StringUtils.isNotEmpty(oldMatSendPoint)){ |
|
|
point_code2=oldMatSendPoint; |
|
|
point_code2=oldMatSendPoint; |
|
|
} |
|
|
} |
|
@ -220,9 +222,17 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
*/ |
|
|
*/ |
|
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
|
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
|
|
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
|
|
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
|
|
|
|
|
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder"); // 工单表
|
|
|
|
|
|
|
|
|
JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '" + TaskStatusEnum.SURE_END.getCode() + "'").getResultJSONArray(0); |
|
|
JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '" + TaskStatusEnum.SURE_END.getCode() + "'").getResultJSONArray(0); |
|
|
for (int i = 0; i < taskArr.size(); i++) { |
|
|
for (int i = 0; i < taskArr.size(); i++) { |
|
|
JSONObject taskObj = taskArr.getJSONObject(i); |
|
|
JSONObject taskObj = taskArr.getJSONObject(i); |
|
|
|
|
|
// 获取工单
|
|
|
|
|
|
String point_code2 = taskObj.getString("point_code2"); |
|
|
|
|
|
String device_code = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0).getString("device_code"); |
|
|
|
|
|
|
|
|
|
|
|
JSONObject workOrderObj = workOrderTab.query("device_code = '" + device_code + "' and order_status = '3' and is_delete ='0'").uniqueResult(0); |
|
|
|
|
|
|
|
|
String material_id = taskObj.getString("material_id"); |
|
|
String material_id = taskObj.getString("material_id"); |
|
|
String vehicle_type = taskObj.getString("vehicle_type"); |
|
|
String vehicle_type = taskObj.getString("vehicle_type"); |
|
|
JSONObject queryParam = new JSONObject(); |
|
|
JSONObject queryParam = new JSONObject(); |
|
@ -230,7 +240,8 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
queryParam.put("material_id", material_id); |
|
|
queryParam.put("material_id", material_id); |
|
|
queryParam.put("region_code", "KLHJ"); |
|
|
queryParam.put("region_code", "KLHJ"); |
|
|
queryParam.put("vehicle_type", "%" + vehicle_type + "%"); |
|
|
queryParam.put("vehicle_type", "%" + vehicle_type + "%"); |
|
|
//1、
|
|
|
queryParam.put("is_new", workOrderObj.getString("is_new")); |
|
|
|
|
|
//TODO: 如果点位表载具类型没有维护新旧盅,就从载具表关联
|
|
|
JSONObject json1 = WQL.getWO("QSCH_yzjCallMaterial_01").addParamMap(queryParam).process().uniqueResult(0); |
|
|
JSONObject json1 = WQL.getWO("QSCH_yzjCallMaterial_01").addParamMap(queryParam).process().uniqueResult(0); |
|
|
if (ObjectUtil.isNotEmpty(json1)) { |
|
|
if (ObjectUtil.isNotEmpty(json1)) { |
|
|
// 拿到点位
|
|
|
// 拿到点位
|
|
|