表结构更新
This commit is contained in:
@@ -22,12 +22,13 @@ 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.service.dto.TaskDto;
|
||||
import org.nl.wms.sch.tasks.*;
|
||||
import org.nl.wms.sch.tasks.PointToPointTask;
|
||||
import org.nl.wms.sch.tasks.callEmpty.CallEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.callEmpty.GjxCallEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.callMaterial.CallMaterialTask;
|
||||
import org.nl.wms.sch.tasks.sendEmpty.HtSendEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.sendEmpty.YqxSendEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.sendMaterial.GjxSendMaterial;
|
||||
import org.nl.wms.sch.tasks.sendMaterial.YqxSendMaterialTask;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -217,21 +218,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", point_code); // 满料位
|
||||
param.put("task_type", "gjxl"); // 任务类型 - 共挤下料
|
||||
param.put("qty", qty); // 满料位
|
||||
|
||||
YqxSendMaterialTask taskBean = SpringContextHolder.getBean(YqxSendMaterialTask.class);
|
||||
GjxSendMaterial taskBean = SpringContextHolder.getBean(GjxSendMaterial.class);
|
||||
String task_id = taskBean.createTask(param); // 创建任务
|
||||
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
// 插入区域出入库表
|
||||
param.put("point_code2", jsonTask.getString("point_code2"));
|
||||
param.put("qty", qty);
|
||||
param.put("task_id", task_id);
|
||||
param.put("io_type", "0");
|
||||
JSONObject json = this.inCreateRegion(param);
|
||||
// 回显任务载具类型
|
||||
jsonTask.put("vehicle_type", json.getString("vehicle_type"));
|
||||
taskTab.update(jsonTask);
|
||||
} else if (StrUtil.equals(type, "3")) {
|
||||
// 3.油漆线申请空盘: 调用空托盘出库处理类创建任务
|
||||
if (ObjectUtil.isEmpty(vehicle_num)) throw new BadRequestException("数量不能为空");
|
||||
@@ -314,79 +304,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
YqxSendMaterialTask taskBean = SpringContextHolder.getBean(YqxSendMaterialTask.class);
|
||||
String task_id = taskBean.createTask(param);
|
||||
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
// 插入区域出入库表
|
||||
param.put("point_code2", jsonTask.getString("point_code2"));
|
||||
if (ObjectUtil.isEmpty(qty)) {
|
||||
param.put("qty", "1"); // 为空先写死1
|
||||
} else {
|
||||
param.put("qty", qty);
|
||||
}
|
||||
param.put("task_id", task_id);
|
||||
param.put("io_type", "0");
|
||||
JSONObject json = this.inCreateRegion(param);
|
||||
// 回显任务载具类型
|
||||
jsonTask.put("vehicle_type", json.getString("vehicle_type"));
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@LokiLog(type = LokiLogType.ACS_TO_LMS)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject inCreateRegion(JSONObject json) {
|
||||
String point_code1 = json.getString("point_code1");
|
||||
String point_code2 = json.getString("point_code2");
|
||||
String qty = json.getString("qty");
|
||||
Long task_id = json.getLongValue("task_id");
|
||||
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("IN_STORE_CODE"));
|
||||
jsonRegion.put("io_type", io_type);
|
||||
jsonRegion.put("bill_status", "20");
|
||||
// 根据起点点位找到起点设备,根据设备找到对应工单, 根据工单找到对应物料及托盘类型
|
||||
String device_code = point_code1.substring(0, point_code1.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", qty);
|
||||
JSONObject jsonMater = materTab.query("material_id ='" + jsonOrder.getString("material_id") + "'").uniqueResult(0);
|
||||
jsonRegion.put("qty_unit_id", jsonMater.getString("base_unit_id"));
|
||||
|
||||
jsonRegion.put("point_code1", point_code1);
|
||||
Long start_region_id = SpringContextHolder.getBean(PointService.class).findByCode(point_code1).getRegion_id();
|
||||
jsonRegion.put("start_region_id", String.valueOf(start_region_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", "02");
|
||||
jsonRegion.put("task_id", task_id);
|
||||
jsonRegion.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
jsonRegion.put("create_name", SecurityUtils.getCurrentNickName());
|
||||
jsonRegion.put("create_time", DateUtil.now());
|
||||
regionTab.insert(jsonRegion);
|
||||
|
||||
JSONObject resuft = new JSONObject();
|
||||
resuft.put("vehicle_type", jsonOrder.getString("vehicle_type"));
|
||||
resuft.put("material_id", jsonRegion.getString("material_id"));
|
||||
resuft.put("create_mode", jsonRegion.getString("create_mode"));
|
||||
return resuft;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject outCreateRegion(JSONObject json) {
|
||||
String point_code2 = json.getString("point_code2");
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SchTaskDto implements Serializable {
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private Long material_id;
|
||||
private Long material_info_id;
|
||||
|
||||
/**
|
||||
* 载具类型
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.sch.manage;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
@@ -106,9 +107,13 @@ public abstract class AbstractAcsTask {
|
||||
*
|
||||
*/
|
||||
public JSONObject immediateNotifyAcs() {
|
||||
List<AcsTaskDto> schedule = this.schedule();
|
||||
JSONArray arr = JSONArray.parseArray(schedule.toString());
|
||||
return AcsUtil.notifyAcs("api/wms/task", arr);
|
||||
List<AcsTaskDto> taskList = this.schedule();
|
||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
JSONArray arr = JSONArray.parseArray(taskList.toString());
|
||||
return AcsUtil.notifyAcs("api/wms/task", arr);
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.nl.wms.basedata.service.dto.ClassstandardDto;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.RegionService;
|
||||
import org.nl.wms.sch.service.TaskService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.sch.service.dto.TaskDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -90,13 +89,23 @@ public class TaskServiceImpl implements TaskService {
|
||||
JSONObject json = WQL.getWO("QSCH_TASK_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "task.update_time desc");
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
JSONArray res = new JSONArray();
|
||||
|
||||
//点位基础表【SCH_BASE_Point】
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
for ( int i = 0; i < content.size(); i++) {
|
||||
JSONObject object = content.getJSONObject(i);
|
||||
String point1_region_name = regionService.findByCode(pointService.findByCode(object.getString("point_code1")).getRegion_code()).getRegion_name();
|
||||
String point2_region_name = regionService.findByCode(pointService.findByCode(object.getString("point_code2")).getRegion_code()).getRegion_name();
|
||||
object.put("point1_region_name", point1_region_name);
|
||||
object.put("point2_region_name", point2_region_name);
|
||||
res.add(object);
|
||||
JSONObject taskObj = content.getJSONObject(i);
|
||||
String point_code1 = taskObj.getString("point_code1");
|
||||
if (ObjectUtil.isNotEmpty(point_code1)){
|
||||
JSONObject point1 = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
taskObj.put("point1_region_name", point1.getString("region_name"));
|
||||
}
|
||||
|
||||
String point_code2 = taskObj.getString("point_code2");
|
||||
if (ObjectUtil.isNotEmpty(point_code2)){
|
||||
JSONObject point2 = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
taskObj.put("point2_region_name", point2.getString("region_name"));
|
||||
}
|
||||
res.add(taskObj);
|
||||
}
|
||||
json.put("content", res);
|
||||
return json;
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package org.nl.wms.sch.tasks.sendMaterial;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.SchTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.AcsTaskDto;
|
||||
import org.nl.wms.util.IdUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,7 +22,11 @@ import java.util.List;
|
||||
/**
|
||||
* 共挤线送料任务服务
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class GjxSendMaterial extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = GjxSendMaterial.class.getName();
|
||||
|
||||
|
||||
@Override
|
||||
@@ -36,20 +46,31 @@ public class GjxSendMaterial extends AbstractAcsTask {
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
String point_code1 = whereJson.getString("point_code1");
|
||||
String vehicle_type = whereJson.getString("vehicle_type");
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String qty = whereJson.getString("qty");
|
||||
|
||||
//生产工单表【PDM_BD_WorkOrder】
|
||||
WQLObject workOrderTab = WQLObject.getWQLObject("PDM_BD_WorkOrder");
|
||||
//点位基础表【SCH_BASE_Point】
|
||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
String device_code = pointTab.query("point_code = '" + point_code1 + "'").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("该设备当前未生产或者已删除");
|
||||
|
||||
SchTaskDto dto = SchTaskDto.builder()
|
||||
.task_id(IdUtil.getLongId())
|
||||
.task_code(CodeUtil.getNewCode(""))
|
||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||
.task_type("task_type")
|
||||
.point_code1(point_code)
|
||||
.vehicle_code("")
|
||||
.handle_class("")
|
||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||
.point_code1(point_code1)
|
||||
.vehicle_code(vehicle_code)
|
||||
.material_info_id(workOrderObj.getLong("workorder_id"))
|
||||
.vehicle_type(vehicle_type)
|
||||
.handle_class(THIS_CLASS)
|
||||
.create_time(DateUtil.now())
|
||||
.point_code1("")
|
||||
.request_param(whereJson.toJSONString())
|
||||
.build();
|
||||
//任务表【SCH_BASE_Task】
|
||||
|
||||
Binary file not shown.
@@ -114,16 +114,17 @@
|
||||
>
|
||||
<el-table-column type="selection" width="50" />
|
||||
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
||||
<el-table-column prop="task_code" label="任务编码" />
|
||||
<el-table-column prop="task_code" label="任务编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column v-if="false" prop="task_type" label="任务类型" />
|
||||
<el-table-column prop="task_type_name" label="任务类型" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column v-if="false" prop="task_status" label="任务状态" />
|
||||
<el-table-column prop="task_status_name" label="任务状态" width="95px" :formatter="formatTaskStatusName" />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="point_code1" label="点位1" width="85" />
|
||||
<el-table-column prop="point1_region_name" label="区域1" width="85" />
|
||||
<el-table-column prop="point_code2" label="点位2" width="85" />
|
||||
<el-table-column prop="point2_region_name" label="区域2" width="85" />
|
||||
<el-table-column prop="point2_region_name" label="区域2" min-width="120" show-overflow-tooltip />
|
||||
<!--<el-table-column prop="point_code3" label="点位3" width="85" />
|
||||
<el-table-column prop="point_code4" label="点位4" width="85" />-->
|
||||
<el-table-column prop="remark" label="备注" width="120" show-overflow-tooltip />
|
||||
|
||||
Reference in New Issue
Block a user