|
|
@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.nl.config.ConfigParam; |
|
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
|
import org.nl.modules.common.utils.SecurityUtils; |
|
|
|
import org.nl.modules.system.util.CodeUtil; |
|
|
@ -116,29 +117,30 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
|
|
|
|
|
JSONObject requestObj = task.getJSONObject("request_param"); |
|
|
|
|
|
|
|
//区域出入表【st_ivt_regionIO】
|
|
|
|
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO"); |
|
|
|
JSONObject regionIoObj = new JSONObject(); |
|
|
|
regionIoObj.put("iostorinv_id", IdUtil.getLongId()); |
|
|
|
regionIoObj.put("bill_code", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
|
regionIoObj.put("buss_date", DateUtil.today()); |
|
|
|
regionIoObj.put("io_type", "2"); // 出库
|
|
|
|
regionIoObj.put("region_id", material_point.getString("region_id")); |
|
|
|
regionIoObj.put("region_code", material_point.getString("region_code")); |
|
|
|
regionIoObj.put("region_name", material_point.getString("region_name")); |
|
|
|
regionIoObj.put("material_id", taskObj.getString("material_id")); |
|
|
|
regionIoObj.put("vehicle_code", taskObj.getString("vehicle_code")); |
|
|
|
regionIoObj.put("qty", requestObj.getString("qty")); |
|
|
|
regionIoObj.put("bill_status", "3"); |
|
|
|
regionIoObj.put("start_point_code", taskObj.getString("point_code1")); |
|
|
|
regionIoObj.put("end_point_code", taskObj.getString("point_code2")); |
|
|
|
regionIoObj.put("create_mode", "2"); |
|
|
|
regionIoObj.put("pcsn", DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyyMMdd")); |
|
|
|
regionIoObj.put("create_id", SecurityUtils.getCurrentUserId()); |
|
|
|
regionIoObj.put("create_name", SecurityUtils.getCurrentNickName()); |
|
|
|
regionIoObj.put("create_time", DateUtil.now()); |
|
|
|
regionIoTab.insert(regionIoObj); |
|
|
|
|
|
|
|
插入区域表:{ |
|
|
|
//区域出入表【st_ivt_regionIO】
|
|
|
|
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO"); |
|
|
|
JSONObject regionIoObj = new JSONObject(); |
|
|
|
regionIoObj.put("iostorinv_id", IdUtil.getLongId()); |
|
|
|
regionIoObj.put("bill_code", CodeUtil.getNewCode("IN_STORE_CODE")); |
|
|
|
regionIoObj.put("buss_date", DateUtil.today()); |
|
|
|
regionIoObj.put("io_type", "2"); // 出库
|
|
|
|
regionIoObj.put("region_id", material_point.getString("region_id")); |
|
|
|
regionIoObj.put("region_code", material_point.getString("region_code")); |
|
|
|
regionIoObj.put("region_name", material_point.getString("region_name")); |
|
|
|
regionIoObj.put("material_id", taskObj.getString("material_id")); |
|
|
|
regionIoObj.put("vehicle_code", taskObj.getString("vehicle_code")); |
|
|
|
regionIoObj.put("qty", requestObj.getString("qty")); |
|
|
|
regionIoObj.put("bill_status", "3"); |
|
|
|
regionIoObj.put("start_point_code", taskObj.getString("point_code1")); |
|
|
|
regionIoObj.put("end_point_code", taskObj.getString("point_code2")); |
|
|
|
regionIoObj.put("create_mode", "2"); |
|
|
|
regionIoObj.put("pcsn", DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyyMMdd")); |
|
|
|
regionIoObj.put("create_id", SecurityUtils.getCurrentUserId()); |
|
|
|
regionIoObj.put("create_name", SecurityUtils.getCurrentNickName()); |
|
|
|
regionIoObj.put("create_time", DateUtil.now()); |
|
|
|
regionIoTab.insert(regionIoObj); |
|
|
|
} |
|
|
|
//完成后
|
|
|
|
// 物料点位解锁 并设置空位
|
|
|
|
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"); |
|
|
|
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("该设备当前未生产或者已删除"); |
|
|
|
String oldMatSendPoint = YZJ_OLD_POINT.get(point_code2);//旧料盅终点
|
|
|
|
String oldMatSendPoint = ConfigParam.YZJ_OLD_POINT.get(point_code2);//旧料盅终点
|
|
|
|
if (StringUtils.isNotEmpty(oldMatSendPoint)){ |
|
|
|
point_code2=oldMatSendPoint; |
|
|
|
} |
|
|
@ -220,9 +222,17 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
|
*/ |
|
|
|
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
|
|
|
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); |
|
|
|
for (int i = 0; i < taskArr.size(); 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 vehicle_type = taskObj.getString("vehicle_type"); |
|
|
|
JSONObject queryParam = new JSONObject(); |
|
|
@ -230,7 +240,8 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
|
queryParam.put("material_id", material_id); |
|
|
|
queryParam.put("region_code", "KLHJ"); |
|
|
|
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); |
|
|
|
if (ObjectUtil.isNotEmpty(json1)) { |
|
|
|
// 拿到点位
|
|
|
|