add:增加手持子卷装箱功能
This commit is contained in:
@@ -30,6 +30,7 @@ import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
|
||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.dto.SchBaseTaskDto;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.DjqTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
|
||||
@@ -52,7 +53,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
@@ -92,8 +92,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
private IPdmBiOrderbominfoService iPdmBiOrderbominfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private DjqTask djqTask;
|
||||
|
||||
|
||||
@Resource
|
||||
@@ -153,36 +151,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询订单装箱信息
|
||||
*
|
||||
* @param whereJson 查询条件
|
||||
* @param pageable 分页参数
|
||||
*/
|
||||
public IPage<PdmBiSubpackagerelation> queryContainerization1(Map whereJson, PageQuery pageable) {
|
||||
IPage<PdmBiSubpackagerelation> resultPage = new Page<>(pageable.getPage(), pageable.getSize());
|
||||
LambdaQueryWrapper<PdmBiSubpackagerelation> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (whereJson.containsKey("customer_description")) {
|
||||
queryWrapper.like(PdmBiSubpackagerelation::getCustomer_description, whereJson.get("customer_description"));
|
||||
}
|
||||
if (whereJson.containsKey("sale_order_name")) {
|
||||
queryWrapper.like(PdmBiSubpackagerelation::getSale_order_name, whereJson.get("sale_order_name"));
|
||||
}
|
||||
if (whereJson.containsKey("customer_name")) {
|
||||
queryWrapper.like(PdmBiSubpackagerelation::getCustomer_name, whereJson.get("customer_name"));
|
||||
}
|
||||
if (whereJson.containsKey("status")) {
|
||||
if ("99".equals(whereJson.get("status"))) {
|
||||
queryWrapper.eq(PdmBiSubpackagerelation::getStatus, whereJson.get("status"));
|
||||
} else {
|
||||
queryWrapper.lt(PdmBiSubpackagerelation::getStatus, "99");
|
||||
}
|
||||
}
|
||||
queryWrapper.groupBy(PdmBiSubpackagerelation::getSale_order_name)
|
||||
.orderByDesc(PdmBiSubpackagerelation::getCreate_time);
|
||||
return pdmBiSubpackagerelationMapper.selectPage(resultPage, queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据订单号查询子卷信息
|
||||
@@ -261,10 +229,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
*/
|
||||
@Override
|
||||
public void update(PdmBiSubpackagerelation entity) {
|
||||
// PdmBiSubpackagerelation dto = pdmBiSubpackagerelationMapper.selectById(entity.getId);
|
||||
// if (dto == null) {
|
||||
// throw new BadRequestException("不存在该数据!");
|
||||
// }
|
||||
pdmBiSubpackagerelationMapper.updateById(getBasicInfo(entity, false));
|
||||
}
|
||||
|
||||
@@ -277,47 +241,27 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateEntityList(JSONObject whereJson) {
|
||||
List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
|
||||
if (CollectionUtils.isEmpty(packagerelationList)) {
|
||||
throw new BadRequestException("无选中子卷信息");
|
||||
}
|
||||
//检查是否存在已分配规格的子卷号
|
||||
List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> !r.getStatus().equals("99")).collect(Collectors.toList());
|
||||
if (isOutBox.size() > 0) {
|
||||
throw new BadRequestException("标记为黄色的子卷号为已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷");
|
||||
}
|
||||
JSONArray jsonArray = whereJson.getJSONArray("tableMater");
|
||||
if (jsonArray == null || jsonArray.size() == 0) {
|
||||
throw new BadRequestException("无选中子卷信息");
|
||||
}
|
||||
//子卷信息校验
|
||||
checkEntityList(whereJson, packagerelationList);
|
||||
//均衡获取木箱出库装箱区对接位
|
||||
String deviceCode = getPointCode();
|
||||
Integer taskCount = bstIvtPackageinfoivtMapper.getZxqTaskCount(deviceCode.substring(deviceCode.lastIndexOf("_") + 1));
|
||||
//每个装箱区只能搬10个子卷
|
||||
if (taskCount + packagerelationList.size() > 10) {
|
||||
throw new BadRequestException("子卷搬运任务数已达上限!");
|
||||
}
|
||||
List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper
|
||||
.selectList(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getSale_order_name, packagerelationList.get(0).getSale_order_name()));
|
||||
Integer maxBoxGroup = pdmBiSubpackagerelationList.stream()
|
||||
.map(PdmBiSubpackagerelation::getBox_group)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Integer::parseInt)
|
||||
.max(Integer::compareTo)
|
||||
.orElse(0) + 1;
|
||||
try {
|
||||
List<String> workIdList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
|
||||
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
if (workIdList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
//根据分切计划获取子卷重量计算理论毛重
|
||||
Set<String> containerNameList = packagerelationList.stream()
|
||||
.map(PdmBiSubpackagerelation::getContainer_name)
|
||||
.collect(Collectors.toSet());
|
||||
List<PdmBiSlittingproductionplan> planList = iPdmBiSlittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>().in(PdmBiSlittingproductionplan::getContainer_name, containerNameList));
|
||||
if (CollectionUtils.isEmpty(planList)) {
|
||||
throw new BadRequestException("存在查询不到分切计划的子卷号");
|
||||
throw new BadRequestException("子卷查询不到分切计划,请检查!");
|
||||
}
|
||||
BigDecimal totalWeight;
|
||||
totalWeight = planList.stream()
|
||||
@@ -329,66 +273,64 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
|
||||
throw new BadRequestException("分切计划的子卷重量不能为0");
|
||||
}
|
||||
outBox(workIdList, containerNameList, deviceCode, maxBoxGroup,whereJson,totalWeight);
|
||||
//获取子卷组号
|
||||
List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper
|
||||
.selectList(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getSale_order_name, packagerelationList.get(0).getSale_order_name()));
|
||||
Integer maxBoxGroup = pdmBiSubpackagerelationList.stream()
|
||||
.map(PdmBiSubpackagerelation::getBox_group)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Integer::parseInt)
|
||||
.max(Integer::compareTo)
|
||||
.orElse(0) + 1;
|
||||
outBox(workIdList, containerNameList, deviceCode, maxBoxGroup, whereJson, totalWeight);
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 子卷装箱
|
||||
*
|
||||
* @param whereJson 分配信息
|
||||
*/
|
||||
// @Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateEntityList8(JSONObject whereJson) {
|
||||
List<PdmBiSubpackagerelation> packagerelationList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class);
|
||||
private void checkEntityList(JSONObject whereJson, List<PdmBiSubpackagerelation> packagerelationList) {
|
||||
JSONArray jsonArray = whereJson.getJSONArray("tableMater");
|
||||
if (jsonArray == null || jsonArray.size() == 0) {
|
||||
throw new BadRequestException("无选中子卷信息");
|
||||
}
|
||||
if (CollectionUtils.isEmpty(packagerelationList)) {
|
||||
throw new BadRequestException("无选中子卷信息");
|
||||
}
|
||||
//检查是否存在已分配规格的子卷号
|
||||
List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> r.getStatus().equals("0")).collect(Collectors.toList());
|
||||
if (isOutBox.size() > 0) {
|
||||
throw new BadRequestException("标记为黄色的子卷号已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷");
|
||||
if (packagerelationList.stream()
|
||||
.anyMatch(r -> !r.getStatus().equals("99"))) {
|
||||
throw new BadRequestException("标记为黄色的子卷号为已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷!");
|
||||
}
|
||||
//均衡获取木箱出库装箱区对接位
|
||||
String deviceCode = getPointCode();
|
||||
Integer taskCount = bstIvtPackageinfoivtMapper.getZxqTaskCount(deviceCode.substring(deviceCode.lastIndexOf("_") + 1));
|
||||
if (taskCount + packagerelationList.size() > 10) {
|
||||
throw new BadRequestException("子卷搬运任务数已达上限!");
|
||||
if (packagerelationList.stream()
|
||||
.anyMatch(r -> !r.getSale_order_name().equals(packagerelationList.get(0).getSale_order_name()))) {
|
||||
throw new BadRequestException("子卷的订单号不一致,请检查!");
|
||||
}
|
||||
List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList = pdmBiSubpackagerelationMapper
|
||||
.selectList(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getSale_order_name, packagerelationList.get(0).getSale_order_name()));
|
||||
Integer maxBoxGroup = pdmBiSubpackagerelationList.stream()
|
||||
.map(PdmBiSubpackagerelation::getBox_group)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Integer::parseInt)
|
||||
.max(Integer::compareTo)
|
||||
.orElse(0) + 1;
|
||||
List<String> workIdList = JSONObject.parseArray(whereJson.getJSONArray("tableMater").toJSONString(), PdmBiSubpackagerelation.class).stream()
|
||||
.map(PdmBiSubpackagerelation::getWorkorder_id)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
if (workIdList.isEmpty()) {
|
||||
return;
|
||||
if (packagerelationList.stream()
|
||||
.anyMatch(r -> StringUtils.isBlank(r.getPaper_tube_description()))) {
|
||||
throw new BadRequestException("存在子卷规格信息为空的子卷号,请检查!");
|
||||
}
|
||||
//根据分切计划获取子卷重量计算理论毛重
|
||||
Set<String> containerNameList = packagerelationList.stream()
|
||||
.map(PdmBiSubpackagerelation::getContainer_name)
|
||||
.collect(Collectors.toSet());
|
||||
outBox8(workIdList, containerNameList, deviceCode, maxBoxGroup, whereJson.getString("checked"));
|
||||
if (packagerelationList.stream()
|
||||
.anyMatch(r -> StringUtils.isBlank(r.getWeight()))) {
|
||||
throw new BadRequestException("存在子卷重量为空的子卷号,请检查!");
|
||||
}
|
||||
if (packagerelationList.stream()
|
||||
.anyMatch(r -> !r.getPaper_tube_description().equals(packagerelationList.get(0).getPaper_tube_description()))) {
|
||||
throw new BadRequestException("子卷规格不一致,请检查!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 空木箱出库
|
||||
*/
|
||||
private void outBox(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer maxBoxGroup, JSONObject whereJson, BigDecimal totalWeight) {
|
||||
JSONObject boxInfo = new JSONObject();
|
||||
//确定装箱区终点
|
||||
//确定木箱出库装箱区
|
||||
boxInfo.put("device_code", deviceCode);
|
||||
boxInfo.put("material_code",whereJson.getString("checked"));
|
||||
boxInfo.put("material_code", whereJson.getString("checked"));
|
||||
boxInfo.put("num", workIdList.size());
|
||||
String boxSn = outBoxManageService.outBox(boxInfo);
|
||||
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
|
||||
@@ -398,6 +340,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
if (StringUtils.isBlank(boxDao.getBox_weight())) {
|
||||
throw new BadRequestException("木箱的重量不能为空!");
|
||||
}
|
||||
if (workIdList.size() > Integer.parseInt(boxDao.getNum())) {
|
||||
throw new BadRequestException("子卷数量超过木箱的最大装卷数!");
|
||||
}
|
||||
//木箱重量
|
||||
BigDecimal boxWeight = new BigDecimal(boxDao.getBox_weight());
|
||||
if (boxWeight.compareTo(new BigDecimal(0)) == 0) {
|
||||
@@ -413,7 +358,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
try {
|
||||
updateBoxGroup(maxBoxGroup, workIdList, boxSn, whereJson.getString("checked"), weightTotal);
|
||||
} catch (Exception e) {
|
||||
log.error("子卷装箱异常,更新子卷包装关系异常:" + e);
|
||||
log.error("子卷装箱异常,updateBoxGroup更新子卷包装关系异常,木箱号为:" + boxSn + ",异常信息:" + e);
|
||||
}
|
||||
}, pool);
|
||||
//给MES传输子卷包装关系
|
||||
@@ -421,7 +366,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
try {
|
||||
transferBoxPackageToMes(false, whereJson, containerNameList, boxSn, weightTotal);
|
||||
} catch (Exception e) {
|
||||
log.error("子卷装箱异常,给MES传输子卷包装关系异常:" + e);
|
||||
log.error("子卷装箱异常,transferBoxPackageToMes给MES传输子卷包装关系异常,木箱号为:" + boxSn + ",异常信息:" + e);
|
||||
}
|
||||
}, pool);
|
||||
//待检区->装箱区agv任务
|
||||
@@ -429,43 +374,13 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
try {
|
||||
agvTransfer(containerNameList, deviceCode, boxSn);
|
||||
} catch (Exception e) {
|
||||
log.error("子卷装箱异常,待检区->装箱区agv确定起点任务创建异常:" + e);
|
||||
}
|
||||
}, pool);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 空木箱出库
|
||||
*/
|
||||
private void outBox8(List<String> workIdList, Set<String> containerNameList, String deviceCode, Integer
|
||||
maxBoxGroup, String boxType) {
|
||||
//均衡获取装箱对接位
|
||||
JSONObject boxInfo = new JSONObject();
|
||||
//确定装箱区终点
|
||||
boxInfo.put("device_code", deviceCode);
|
||||
boxInfo.put("material_code", boxType);
|
||||
boxInfo.put("num", workIdList.size());
|
||||
String boxSn = outBoxManageService.outBox(boxInfo);
|
||||
//更新及子卷包装状态已分配规格及木箱规格组
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
// updateBoxGroup(maxBoxGroup, workIdList, boxSn, boxType);
|
||||
} catch (Exception e) {
|
||||
log.error("updateBoxGroup接口更新及子卷包装状态已分配规格及木箱规格组异常:" + e);
|
||||
}
|
||||
}, pool);
|
||||
//待检区->装箱区agv任务
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
agvTransfer(containerNameList, deviceCode, boxSn);
|
||||
} catch (Exception e) {
|
||||
log.error("agvTransfer接口待检区->装箱区agv任务异常:" + e);
|
||||
log.error("子卷装箱异常,agvTransfer待检区->装箱区agv确定起点任务创建异常,木箱号为:" + boxSn + ",异常信息:" + e);
|
||||
}
|
||||
}, pool);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void updateBoxGroup(Integer maxBoxGroup, List<String> entityList, String boxSn, String boxType, String totalWeight) {
|
||||
UpdateWrapper<PdmBiSubpackagerelation> updateWrapper = new UpdateWrapper<>();
|
||||
//理论毛重
|
||||
@@ -510,42 +425,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
}
|
||||
|
||||
|
||||
protected void agvTransfer8(Set<String> containerNameList, String deviceCode, String boxSn) {
|
||||
//待检区点位
|
||||
List<BstIvtPackageinfoivt> djqPointList = packageinfoivtService
|
||||
.list(new LambdaUpdateWrapper<BstIvtPackageinfoivt>()
|
||||
.eq(BstIvtPackageinfoivt::getPoint_status, PackageInfoIvtEnum.POINT_STATUS.code("待检区"))
|
||||
.eq(BstIvtPackageinfoivt::getIs_used, PackageInfoIvtEnum.IS_USED.code("启用"))
|
||||
.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("合格品"))
|
||||
//.eq(BstIvtPackageinfoivt::getIvt_status, PackageInfoIvtEnum.IVT_STATUS.code("有子卷"))
|
||||
.orderByAsc(BstIvtPackageinfoivt::getSort_seq));
|
||||
List<BstIvtPackageinfoivt> djqPoints = djqPointList.stream()
|
||||
.filter(r -> containerNameList.contains(r.getContainer_name()))
|
||||
.collect(Collectors.toList());
|
||||
//任务组id
|
||||
String groupId = deviceCode.substring(deviceCode.lastIndexOf("_") + 1);
|
||||
List<SchBaseTask> schBaseTaskList = new ArrayList<>();
|
||||
//确定起点,安装装箱组标识加入任务队列
|
||||
djqPoints.forEach(r -> {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
|
||||
jo.put("vehicle_code", r.getContainer_name());
|
||||
jo.put("point_code1", r.getPoint_code());
|
||||
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
|
||||
//木箱号
|
||||
jo.put("vehicle_code2", groupId);
|
||||
//任务组id
|
||||
//jo.put("car_no", deviceCode);
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(zxqTask.createTask(jo));
|
||||
//增加任务到队列
|
||||
schBaseTaskList.add(task);
|
||||
});
|
||||
//taskQueueManager.addTasksToQueue(groupId, schBaseTaskList);
|
||||
if (CollectionUtils.isNotEmpty(schBaseTaskList)) {
|
||||
taskQueue.addTasksToQueue(groupId, schBaseTaskList);
|
||||
}
|
||||
}
|
||||
|
||||
private String getPointCode() {
|
||||
//均衡获取木箱出库装箱区对接位
|
||||
@@ -679,7 +558,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
List<SchBaseTask> schBaseTaskList = new ArrayList<>();
|
||||
List<SchBaseTaskDto> schBaseTaskList = new ArrayList<>();
|
||||
//确定起点,安装装箱组标识加入任务队列
|
||||
djqPoints.forEach(r -> {
|
||||
//校验重复任务
|
||||
@@ -687,6 +566,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code("否")).lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode()));
|
||||
if (CollectionUtils.isEmpty(taskList)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
//确定搬运任务不执行
|
||||
jo.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("待检区->装箱区"));
|
||||
jo.put("vehicle_code", r.getContainer_name());
|
||||
jo.put("point_code1", r.getPoint_code());
|
||||
@@ -694,7 +574,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
||||
//木箱号
|
||||
jo.put("vehicle_code2", groupId);
|
||||
//任务组id
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
SchBaseTaskDto task = new SchBaseTaskDto();
|
||||
//保存任务子卷号
|
||||
SchBaseTask taskDto = zxqTask.createTaskReturnTask(jo);
|
||||
task.setTask_id(taskDto.getTask_id());
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.nl.b_lms.sch.task.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* {@code @Description:} 任务表(SchBaseTask)实体类
|
||||
* {@code @Author:} gbx
|
||||
*
|
||||
* @since 2024-01-23 16:07:13
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
public class SchBaseTaskDto implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String task_code;
|
||||
|
||||
/**
|
||||
* 子卷号
|
||||
*/
|
||||
private String vehicle_code;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
package org.nl.b_lms.sch.tasks.first_floor_area.auto;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.dto.SchBaseTaskDto;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.ZxqTask;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@@ -25,8 +22,6 @@ public class TaskQueue {
|
||||
@Resource
|
||||
private IschBaseTaskService taskService;
|
||||
|
||||
@Resource
|
||||
private PdmBiSubpackagerelationMapper pdmBiSubpackagerelationMapper;
|
||||
@Resource
|
||||
private ZxqTask zxqTask;
|
||||
|
||||
@@ -38,11 +33,11 @@ public class TaskQueue {
|
||||
/**
|
||||
* 添加任务
|
||||
*/
|
||||
public void addTasksToQueue(String groupId, List<SchBaseTask> tasks) {
|
||||
public void addTasksToQueue(String groupId, List<SchBaseTaskDto> tasks) {
|
||||
tasks.forEach(task -> {
|
||||
redisUtils.pushToList(TASK_QUEUE_PREFIX + groupId, task);
|
||||
//redisUtils.pushToList(TASK_QUEUE_PREFIX + groupId, task,3,TimeUnit.HOURS);
|
||||
log.info("待检区->装箱区agv任务组为:" + groupId + ",任务编号为:" + task.getTask_code() + "成功添加到任务队列。");
|
||||
log.info("子卷装箱:待检区->装箱区agv任务组为:" + groupId + ",任务编号为:" + task.getTask_code() + "成功添加到任务队列。");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,15 +62,11 @@ public class TaskQueue {
|
||||
private void executeTask(SchBaseTask task, String pointCode) {
|
||||
if (task != null) {
|
||||
task.setPoint_code2(pointCode);
|
||||
log.info("待检区->装箱区agv任务编号为:"+task.getTask_code()+",任务状态为:"+task.getTask_status()+"任务开始下发。");
|
||||
log.info("子卷装箱:待检区->装箱区agv任务编号为:"+task.getTask_code()+",任务状态为:"+task.getTask_status()+"任务开始下发。");
|
||||
task.setTask_status(TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskService.updateById(task);
|
||||
zxqTask.immediateNotifyAcs(null);
|
||||
log.info("待检区->装箱区agv任务编号为:"+task.getTask_code()+",任务状态为:"+task.getTask_status()+"下发完成。");
|
||||
//同步删除子卷包装关系
|
||||
//LambdaQueryWrapper<PdmBiSubpackagerelation> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//queryWrapper.eq(PdmBiSubpackagerelation::getContainer_name, task.getVehicle_code());
|
||||
//pdmBiSubpackagerelationMapper.delete(queryWrapper);
|
||||
log.info("子卷装箱:待检区->装箱区agv任务编号为:"+task.getTask_code()+",任务状态为:"+task.getTask_status()+"下发完成。");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user