代码更新

This commit is contained in:
lyd
2022-10-25 15:48:22 +08:00
parent 363ae0695e
commit f5a1543952
8 changed files with 19 additions and 109 deletions

View File

@@ -1,7 +1,6 @@
package org.nl.wms.ext.acs.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
@@ -9,21 +8,16 @@ import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.log.LokiLog;
import org.nl.wms.log.LokiLogType;
import org.nl.wms.pdm.service.DeviceService;
import org.nl.wms.pdm.service.dto.DeviceDto;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.service.TaskService;
import org.nl.wms.sch.tasks.callEmpty.GjxCallEmpVehicleTask;
import org.nl.wms.sch.tasks.callMaterial.YqxCallMaterial;
import org.nl.wms.sch.tasks.callEmpty.YqxCallEmpVehicleTask;
import org.nl.wms.sch.tasks.callMaterial.YqxCallMaterial;
import org.nl.wms.sch.tasks.sendEmpty.HtSendEmpVehicleTask;
import org.nl.wms.sch.tasks.sendEmpty.YqxSendEmpVehicleTask;
import org.nl.wms.sch.tasks.sendMaterial.GjxSendMaterialTask;
@@ -183,10 +177,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isEmpty(type)) throw new BadRequestException("类型不能为空");
if (ObjectUtil.isEmpty(point_code)) throw new BadRequestException("点位不能为空");
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");// 任务表
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_regionIO"); // 区域出入库表
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位表
/*
* 根据type判断是什么业务类型
* 1.共挤线申请空盘
@@ -289,57 +279,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 8.豪凯自动线下料入库
JSONObject param = new JSONObject();
param.put("point_code1", point_code);
param.put("vehicle_code", vehicle_code);
param.put("vehicle_type", vehicle_type);
param.put("qty", qty);
HkxSendMaterialTask taskBean = SpringContextHolder.getBean(HkxSendMaterialTask.class);
String task_id = taskBean.createTask(param);
}
return null;
}
@Transactional(rollbackFor = Exception.class)
public JSONObject outCreateRegion(JSONObject json) {
String point_code2 = json.getString("point_code2");
String io_type = json.getString("io_type");
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_regionIO");
WQLObject orderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
JSONObject jsonRegion = new JSONObject();
jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonRegion.put("bill_code", CodeUtil.getNewCode("OUT_STORE_CODE"));
jsonRegion.put("io_type", io_type);
jsonRegion.put("bill_status", "20");
// 根据起点点位找到起点设备,根据设备找到对应工单, 根据工单找到对应物料及托盘类型
String device_code = point_code2.substring(0, point_code2.indexOf("_"));
DeviceService deviceBean = SpringContextHolder.getBean(DeviceService.class);
DeviceDto deviceDto = deviceBean.findByCode(device_code);
if (ObjectUtil.isEmpty(deviceDto)) throw new BadRequestException("此设备不存在");
JSONObject jsonOrder = orderTab.query("device_id = '" + deviceDto.getDevice_id() + "' and order_status = '02' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonOrder)) throw new BadRequestException("此设备未在生产中或不存在");
jsonRegion.put("material_id", jsonOrder.getString("material_id"));
jsonRegion.put("qty", "100"); // 暂时先按照100
JSONObject jsonMater = materTab.query("material_id ='" + jsonOrder.getString("material_id") + "'").uniqueResult(0);
jsonRegion.put("qty_unit_id", jsonMater.getString("base_unit_id"));
jsonRegion.put("end_point_code", point_code2);
Long end_region_id = SpringContextHolder.getBean(PointService.class).findByCode(point_code2).getRegion_id();
jsonRegion.put("end_region_id", String.valueOf(end_region_id));
jsonRegion.put("create_mode", "2");
jsonRegion.put("create_id", SecurityUtils.getCurrentUserId());
jsonRegion.put("create_name", SecurityUtils.getCurrentNickName());
jsonRegion.put("create_time", DateUtil.now());
regionTab.insert(jsonRegion);
// 需回显起始点位、起始区域、任务id
JSONObject resuft = new JSONObject();
resuft.put("iostorinv_id", jsonRegion.getString("iostorinv_id"));
resuft.put("vehicle_type", jsonOrder.getString("vehicle_type"));
resuft.put("create_mode", jsonRegion.getString("create_mode"));
resuft.put("material_id", jsonOrder.getString("material_id"));
return resuft;
}
}

View File

@@ -17,7 +17,6 @@
输入.jockey_id TYPEAS s_string
输入.workorder_id TYPEAS s_string
输入.workprocedure_id TYPEAS s_string
输入.order_type_scode TYPEAS s_string
输入.order_status TYPEAS s_string
输入.workorder_procedure TYPEAS s_string
输入.shift_type_scode TYPEAS s_string
@@ -70,9 +69,6 @@
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = material.product_series
WHERE
ShiftOrder.is_delete = '0'
OPTION 输入.order_type_scode <> ""
ShiftOrder.order_type_scode = 输入.order_type_scode
ENDOPTION
OPTION 输入.unFinish <> ""
ShiftOrder.order_status <> '5'
ENDOPTION

View File

@@ -126,6 +126,13 @@ public class HkxSendMaterialTask extends AbstractAcsTask {
ivtObj.put("standing_time", workorderObj.getString("standing_time"));
ivtObj.put("material_id", workorderObj.getString("material_id"));
ivtTab.insert(ivtObj);
// 终点解锁
point2Obj.put("lock_type", "1");
point2Obj.put("point_status", "3");
// 载具类型
point2Obj.put("vehicle_type", taskObj.getString("vehicle_type"));
pointTab.update(point2Obj);
}
}

View File

@@ -53,6 +53,7 @@
lock_type = '1'
AND is_used = '1'
AND is_delete = '0'
AND point_status = '1'
OPTION 输入.vehicle_type <> ""
p.can_vehicle_type like 输入.vehicle_type
ENDOPTION