opt: 测试优化
This commit is contained in:
@@ -492,6 +492,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
|
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
|
if(connector_and_sorting == 1){
|
||||||
|
try {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
log.info("指令号:{},phase:{},acs反馈wms失败:{}", inst.getInstruction_code(), phase, httpResponse);
|
log.info("指令号:{},phase:{},acs反馈wms失败:{}", inst.getInstruction_code(), phase, httpResponse);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("点位不存在!device_code:" + device_code);
|
if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("点位不存在!device_code:" + device_code);
|
||||||
SchBasePoint schBasePoint1 = pointService.selectByNextWaitPoint(device_code, schBaseTask.getVehicle_code());
|
SchBasePoint schBasePoint1 = pointService.selectByNextWaitPoint(device_code, schBaseTask.getVehicle_code());
|
||||||
if (ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("未查询到可用点位!等待点位:" + device_code);
|
if (ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("未查询到可用点位!等待点位:" + device_code);
|
||||||
return schBasePoint;
|
return schBasePoint1;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -489,6 +489,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
schBaseVehiclematerialgroup.setExtend(connectorDto.toString());
|
schBaseVehiclematerialgroup.setExtend(connectorDto.toString());
|
||||||
schBaseVehiclematerialgroup.setOrder_code(connectorDto.getProductionOrder());
|
schBaseVehiclematerialgroup.setOrder_code(connectorDto.getProductionOrder());
|
||||||
iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
|
iSchBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);
|
||||||
|
taskService.update(Wrappers.lambdaUpdate(SchBaseTask.class).eq(SchBaseTask::getTask_code, schBaseTask.getTask_code())
|
||||||
|
.set(SchBaseTask::getJob_name, connectorDto.getJobname()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ public class SortingServiceImpl implements SortingService {
|
|||||||
@Override
|
@Override
|
||||||
public Map createAgvTask(JSONObject jsonObject) {
|
public Map createAgvTask(JSONObject jsonObject) {
|
||||||
try {
|
try {
|
||||||
Assert.noNullElements(new Object[]{jsonObject,jsonObject.getString("pointCode"),jsonObject.getString("vehicle_code")},"请求参数不能为空");
|
Assert.noNullElements(new Object[]{jsonObject,jsonObject.getString("pointCode"),jsonObject.getString("vehicle_code")
|
||||||
|
,jsonObject.getString("task_type"),jsonObject.getString("is_empty")},"请求参数不能为空");
|
||||||
//任务号
|
//任务号
|
||||||
String task_code = jsonObject.getString("task_code");
|
String task_code = jsonObject.getString("task_code");
|
||||||
String pointCode = jsonObject.getString("pointCode");
|
String pointCode = jsonObject.getString("pointCode");
|
||||||
@@ -58,21 +59,22 @@ public class SortingServiceImpl implements SortingService {
|
|||||||
//托盘上的堆垛信息
|
//托盘上的堆垛信息
|
||||||
JSONArray jsonArray = JSONUtil.parseArray(jsonObject.get("pallet_detail"));
|
JSONArray jsonArray = JSONUtil.parseArray(jsonObject.get("pallet_detail"));
|
||||||
// TODO:呼叫空托
|
// TODO:呼叫空托
|
||||||
JSONObject taskParam = new JSONObject(MapOf.of("task_code",task_code,"job_name",jobname,"device_code",pointCode,"requestNo", "sorting_"+IdUtil.getStringId(),"ext_data",jsonObject));
|
JSONObject taskParam = new JSONObject(MapOf.of("task_code",task_code,"job_name",jobname,"device_code",pointCode,"requestNo"
|
||||||
|
, "sorting_"+IdUtil.getStringId(),"ext_data",jsonObject,"vehicle_code",vehicle_code,"ext_data",jsonObject));
|
||||||
if(SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)){
|
if(SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)){
|
||||||
taskParam.put("config_code","sortingCNTTask");
|
taskParam.put("config_code","SortingCNTTask");
|
||||||
sortingCNTTask.apply(taskParam);
|
sortingCNTTask.apply(taskParam);
|
||||||
//TODO:叫料
|
//TODO:叫料
|
||||||
}else if(SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)){
|
}else if(SortingEnum.TASK_TYPE_ONE.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)){
|
||||||
taskParam.put("config_code","sortingCMTTask");
|
taskParam.put("config_code","SortingCMTTask");
|
||||||
sortingCMTTask.apply(taskParam);
|
sortingCMTTask.apply(taskParam);
|
||||||
//TODO:将空托盘放到线边库
|
//TODO:将空托盘放到线边库
|
||||||
}else if(SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)){
|
}else if(SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.IS_EMPTY.getValue().equals(is_empty)){
|
||||||
taskParam.put("config_code","sortingSNTTask");
|
taskParam.put("config_code","SortingSNTTask");
|
||||||
sortingSNTTask.apply(taskParam);
|
sortingSNTTask.apply(taskParam);
|
||||||
//TODO:将满料放到线边库
|
//TODO:将满料放到线边库
|
||||||
}else if(SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)){
|
}else if(SortingEnum.TASK_TYPE_TWO.getValue().equals(task_type) && SortingEnum.NOT_EMPTY.getValue().equals(is_empty)){
|
||||||
taskParam.put("config_code","sortingCMTTask");
|
taskParam.put("config_code","SortingSMTTask");
|
||||||
sortingSMTTask.apply(taskParam);
|
sortingSMTTask.apply(taskParam);
|
||||||
}
|
}
|
||||||
return MapOf.of("status", 200,"msg", "sucess");
|
return MapOf.of("status", 200,"msg", "sucess");
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ public class SchBasePoint implements Serializable {
|
|||||||
@ApiModelProperty(value = "层")
|
@ApiModelProperty(value = "层")
|
||||||
private Integer layer_num;
|
private Integer layer_num;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工序顺序")
|
||||||
|
private Integer region_seq;
|
||||||
|
|
||||||
@ApiModelProperty(value = "入库顺序")
|
@ApiModelProperty(value = "入库顺序")
|
||||||
private Integer in_order_seq;
|
private Integer in_order_seq;
|
||||||
|
|
||||||
|
|||||||
@@ -35,10 +35,7 @@ import org.springframework.transaction.annotation.Propagation;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -232,41 +229,44 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public SchBasePoint selectByRegionCode(String region_code,String vehicleCode) {
|
public SchBasePoint selectByRegionCode(String region_code,String vehicleCode) {
|
||||||
//查询载具的类型
|
//查询载具的类型
|
||||||
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode);
|
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode);
|
||||||
if(ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");
|
if(ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");
|
||||||
//查询满足条件的站点
|
//查询满足条件的站点
|
||||||
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false).
|
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||||
isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getRegion_code, region_code).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
|
.eq(SchBasePoint::getIs_lock, false)
|
||||||
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type()).eq(SchBasePoint::getIs_used, true));
|
.isNull(SchBasePoint::getVehicle_code)
|
||||||
|
.eq(SchBasePoint::getRegion_code, region_code)
|
||||||
|
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
|
||||||
|
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
|
||||||
|
.eq(SchBasePoint::getIs_used, true));
|
||||||
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){
|
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){
|
||||||
SchBasePoint schBasePoint = schBasePoints.get(0);
|
SchBasePoint schBasePoint = schBasePoints.get(0);
|
||||||
schBasePoint.setVehicle_code(vehicleCode);
|
schBasePoint.setVehicle_code(vehicleCode);
|
||||||
schBasePoint.setIs_lock(true);
|
schBasePoint.setIs_lock(true);
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
PointUtils.setUpdateByAcs(schBasePoint);
|
||||||
String now = DateUtil.now();
|
|
||||||
schBasePoint.setUpdate_id(currentUserId);
|
|
||||||
schBasePoint.setUpdate_name(nickName);
|
|
||||||
schBasePoint.setUpdate_time(now);
|
|
||||||
updateById(schBasePoint);
|
updateById(schBasePoint);
|
||||||
return schBasePoint;
|
return schBasePoint;
|
||||||
}
|
}
|
||||||
|
SchBasePoint schBasePoint1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code)).get(0);
|
||||||
|
if(ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("不存在该区域!");
|
||||||
//分配载具类型相同的站点
|
//分配载具类型相同的站点
|
||||||
List<SchBasePoint> schBasePoints1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false).
|
List<SchBasePoint> schBasePoints1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||||
isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
|
.eq(SchBasePoint::getIs_lock, false)
|
||||||
.eq(SchBasePoint::getIs_used, true).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
.isNull(SchBasePoint::getVehicle_code)
|
||||||
|
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
|
||||||
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
|
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
||||||
|
schBasePoints1.stream().sorted(Comparator.comparingInt(schBasePoint -> Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq())));
|
||||||
if(CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0){
|
if(CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0){
|
||||||
SchBasePoint schBasePoint = schBasePoints.get(0);
|
SchBasePoint schBasePoint = schBasePoints1.get(0);
|
||||||
schBasePoint.setVehicle_code(vehicleCode);
|
schBasePoint.setVehicle_code(vehicleCode);
|
||||||
schBasePoint.setIs_lock(true);
|
schBasePoint.setIs_lock(true);
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
PointUtils.setUpdateByAcs(schBasePoint);
|
||||||
String now = DateUtil.now();
|
|
||||||
schBasePoint.setUpdate_id(currentUserId);
|
|
||||||
schBasePoint.setUpdate_name(nickName);
|
|
||||||
schBasePoint.setUpdate_time(now);
|
|
||||||
updateById(schBasePoint);
|
updateById(schBasePoint);
|
||||||
return schBasePoint;
|
return schBasePoint;
|
||||||
}
|
}
|
||||||
@@ -285,40 +285,39 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode);
|
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicleCode);
|
||||||
if(ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");
|
if(ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");
|
||||||
//查询满足条件的站点
|
//查询满足条件的站点
|
||||||
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false).
|
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||||
isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getRegion_code, region_code).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
|
.eq(SchBasePoint::getIs_lock, false)
|
||||||
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type()).eq(SchBasePoint::getIs_used, true));
|
.isNull(SchBasePoint::getVehicle_code)
|
||||||
|
.eq(SchBasePoint::getRegion_code, region_code)
|
||||||
|
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
|
||||||
|
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
|
||||||
|
.eq(SchBasePoint::getIs_used, true));
|
||||||
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){
|
if(CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0){
|
||||||
SchBasePoint schBasePoint1 = schBasePoints.get(0);
|
SchBasePoint schBasePoint1 = schBasePoints.get(0);
|
||||||
SchBasePoint schBasePoint = pointMapper.selectById(schBasePoint1.getNext_wait_point());
|
SchBasePoint schBasePoint = pointMapper.selectById(schBasePoint1.getNext_wait_point());
|
||||||
if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!");
|
if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!");
|
||||||
schBasePoint1.setVehicle_code(vehicleCode);
|
schBasePoint1.setVehicle_code(vehicleCode);
|
||||||
schBasePoint1.setIs_lock(true);
|
schBasePoint1.setIs_lock(true);
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
PointUtils.setUpdateByAcs(schBasePoint);
|
||||||
String now = DateUtil.now();
|
|
||||||
schBasePoint1.setUpdate_id(currentUserId);
|
|
||||||
schBasePoint1.setUpdate_name(nickName);
|
|
||||||
schBasePoint1.setUpdate_time(now);
|
|
||||||
updateById(schBasePoint1);
|
updateById(schBasePoint1);
|
||||||
return schBasePoint;
|
return schBasePoint;
|
||||||
}
|
}
|
||||||
//分配载具类型相同的站点
|
//分配载具类型相同的站点
|
||||||
List<SchBasePoint> schBasePoints1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false).
|
List<SchBasePoint> schBasePoints1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
|
||||||
isNull(SchBasePoint::getVehicle_code).eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
|
.eq(SchBasePoint::getIs_lock, false)
|
||||||
.eq(SchBasePoint::getIs_used, true).eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
.isNull(SchBasePoint::getVehicle_code)
|
||||||
|
.eq(SchBasePoint::getCan_vehicle_type, mdBaseVehicle.getVehicle_type())
|
||||||
|
.eq(SchBasePoint::getIs_used, true)
|
||||||
|
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
|
||||||
if(CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0){
|
if(CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0){
|
||||||
SchBasePoint schBasePoint1 = schBasePoints.get(0);
|
SchBasePoint schBasePoint1 = schBasePoints1.get(0);
|
||||||
SchBasePoint schBasePoint = pointMapper.selectById(schBasePoint1.getNext_wait_point());
|
SchBasePoint schBasePoint = pointMapper.selectById(schBasePoint1.getNext_wait_point());
|
||||||
if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!");
|
if(ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("没有找到等待点!");
|
||||||
schBasePoint1.setVehicle_code(vehicleCode);
|
schBasePoint1.setVehicle_code(vehicleCode);
|
||||||
schBasePoint1.setIs_lock(true);
|
schBasePoint1.setIs_lock(true);
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
PointUtils.setUpdateByAcs(schBasePoint);
|
||||||
String now = DateUtil.now();
|
|
||||||
schBasePoint1.setUpdate_id(currentUserId);
|
|
||||||
schBasePoint1.setUpdate_name(nickName);
|
|
||||||
schBasePoint1.setUpdate_time(now);
|
|
||||||
updateById(schBasePoint1);
|
updateById(schBasePoint1);
|
||||||
return schBasePoint;
|
return schBasePoint;
|
||||||
}
|
}
|
||||||
@@ -334,12 +333,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
SchBasePoint schBasePoint = schBasePoints.get(0);
|
SchBasePoint schBasePoint = schBasePoints.get(0);
|
||||||
schBasePoint.setVehicle_code(vehicleCode);
|
schBasePoint.setVehicle_code(vehicleCode);
|
||||||
schBasePoint.setIs_lock(true);
|
schBasePoint.setIs_lock(true);
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
PointUtils.setUpdateByAcs(schBasePoint);
|
||||||
String now = DateUtil.now();
|
|
||||||
schBasePoint.setUpdate_id(currentUserId);
|
|
||||||
schBasePoint.setUpdate_name(nickName);
|
|
||||||
schBasePoint.setUpdate_time(now);
|
|
||||||
updateById(schBasePoint);
|
updateById(schBasePoint);
|
||||||
return schBasePoint;
|
return schBasePoint;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
import org.nl.wms.database.material.service.IMdBaseMaterialService;
|
||||||
@@ -113,6 +114,7 @@ public abstract class AbstractTask {
|
|||||||
if (HttpStatus.OK.value() == result.getInteger("status")) {
|
if (HttpStatus.OK.value() == result.getInteger("status")) {
|
||||||
for (SchBaseTask schBaseTask : taskList) {
|
for (SchBaseTask schBaseTask : taskList) {
|
||||||
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
|
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
|
||||||
|
schBaseTask.setRemark(" ");
|
||||||
taskService.update(schBaseTask);
|
taskService.update(schBaseTask);
|
||||||
}
|
}
|
||||||
} else if (HttpStatus.BAD_REQUEST.value() == result.getInteger("status")) {
|
} else if (HttpStatus.BAD_REQUEST.value() == result.getInteger("status")) {
|
||||||
@@ -287,7 +289,13 @@ public abstract class AbstractTask {
|
|||||||
task.setGroup_id(bean.setGroupPlate(param));
|
task.setGroup_id(bean.setGroupPlate(param));
|
||||||
// 创建一条单点任务。
|
// 创建一条单点任务。
|
||||||
taskService.save(task);
|
taskService.save(task);
|
||||||
bean.create();
|
try{
|
||||||
|
bean.create();
|
||||||
|
}catch (Exception e){
|
||||||
|
taskService.update(Wrappers.lambdaUpdate(SchBaseTask.class)
|
||||||
|
.set(SchBaseTask::getRemark,"下发任务失败"+ e.getMessage())
|
||||||
|
.eq(SchBaseTask::getTask_code,task.getTask_code()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,21 +77,12 @@ public class CNTTask extends AbstractTask {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup();
|
|
||||||
schBaseVehiclematerialgroup.setVehicle_code(task.getVehicle_code());
|
|
||||||
schBaseVehiclematerialgroup.setPoint_code(schBasePoint.getPoint_code());
|
|
||||||
schBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);*/
|
|
||||||
|
|
||||||
// 设置终点并修改创建成功状态
|
// 设置终点并修改创建成功状态
|
||||||
task.setPoint_code2(schBasePoint.getPoint_code());
|
task.setPoint_code2(schBasePoint.getPoint_code());
|
||||||
task.setVehicle_type(schBasePoint.getCan_vehicle_type());
|
task.setVehicle_type(schBasePoint.getCan_vehicle_type());
|
||||||
task.setRemark("");
|
task.setRemark("");
|
||||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||||
taskService.updateById(task);
|
taskService.updateById(task);
|
||||||
|
|
||||||
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
|
|
||||||
PointUtils.setUpdateByAcs(schBasePoint);
|
|
||||||
pointService.updateById(schBasePoint);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,14 +124,14 @@ public class CNTTask extends AbstractTask {
|
|||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
PointUtils.updateByIngTaskCode(schBasePoint);
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
.set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null));
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
PointUtils.updateByIngTaskCode(schBasePoint2);
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
.set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null));
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
// 任务完成
|
// 任务完成
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
@@ -158,14 +149,14 @@ public class CNTTask extends AbstractTask {
|
|||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
PointUtils.updateByIngTaskCode(schBasePoint);
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
.set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null));
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
PointUtils.updateByIngTaskCode(schBasePoint2);
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
.set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null));
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||||
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
|
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
|
||||||
|
|||||||
@@ -128,14 +128,14 @@ public class FTGTask extends AbstractTask {
|
|||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
PointUtils.updateByIngTaskCode(schBasePoint);
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
.set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null));
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
PointUtils.updateByIngTaskCode(schBasePoint2);
|
||||||
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
.set(SchBasePoint::getIs_lock, false).set(SchBasePoint::getVehicle_code, null));
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
// 任务完成
|
// 任务完成
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.enums.region.RegionEnum;
|
import org.nl.common.enums.region.RegionEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
@@ -31,14 +32,14 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sorting补空托盘
|
* sorting呼叫满料
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component(value = "SortingCMTTask")
|
@Component(value = "SortingCMTTask")
|
||||||
public class SortingCMTTask extends AbstractTask {
|
public class SortingCMTTask extends AbstractTask {
|
||||||
|
|
||||||
|
|
||||||
private static final String TASK_CONFIG_CODE = "sortingCMTTask";
|
private static final String TASK_CONFIG_CODE = "SortingCMTTask";
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService pointService;
|
private ISchBasePointService pointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -118,13 +119,15 @@ public class SortingCMTTask extends AbstractTask {
|
|||||||
// 起点清空
|
// 起点清空
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
PointUtils.updateByIngTaskCode(schBasePoint);
|
||||||
pointService.updateById(schBasePoint);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
PointUtils.updateByIngTaskCode(schBasePoint2);
|
||||||
pointService.updateById(schBasePoint2);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
// 任务完成
|
// 任务完成
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.nl.wms.sch.task_manage.task.tasks.sorting;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.enums.VehicleEnum;
|
import org.nl.common.enums.VehicleEnum;
|
||||||
import org.nl.common.enums.region.RegionEnum;
|
import org.nl.common.enums.region.RegionEnum;
|
||||||
@@ -27,7 +28,7 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sorting补空托盘
|
* sorting呼叫空托
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component(value = "SortingCNTTask")
|
@Component(value = "SortingCNTTask")
|
||||||
@@ -35,7 +36,7 @@ public class SortingCNTTask extends AbstractTask {
|
|||||||
|
|
||||||
private static String Vehicle_Type = VehicleEnum.S.getCode();
|
private static String Vehicle_Type = VehicleEnum.S.getCode();
|
||||||
|
|
||||||
private static final String TASK_CONFIG_CODE = "sortingCNTTask";
|
private static final String TASK_CONFIG_CODE = "SortingCNTTask";
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService pointService;
|
private ISchBasePointService pointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -107,13 +108,15 @@ public class SortingCNTTask extends AbstractTask {
|
|||||||
// 起点清空
|
// 起点清空
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
PointUtils.updateByIngTaskCode(schBasePoint);
|
||||||
pointService.updateById(schBasePoint);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
PointUtils.updateByIngTaskCode(schBasePoint2);
|
||||||
pointService.updateById(schBasePoint2);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
// 任务完成
|
// 任务完成
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jdk.nashorn.internal.scripts.JS;
|
import jdk.nashorn.internal.scripts.JS;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.enums.region.RegionEnum;
|
import org.nl.common.enums.region.RegionEnum;
|
||||||
@@ -31,14 +32,14 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sorting补空托盘
|
* sorting将满料放到线边库
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component(value = "SortingSMTTask")
|
@Component(value = "SortingSMTTask")
|
||||||
public class SortingSMTTask extends AbstractTask {
|
public class SortingSMTTask extends AbstractTask {
|
||||||
|
|
||||||
|
|
||||||
private static final String TASK_CONFIG_CODE = "sortingSMTTask";
|
private static final String TASK_CONFIG_CODE = "SortingSMTTask";
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService pointService;
|
private ISchBasePointService pointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -76,8 +77,7 @@ public class SortingSMTTask extends AbstractTask {
|
|||||||
NoticeTypeEnum.WARN.getCode());
|
NoticeTypeEnum.WARN.getCode());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
JSONObject ext_data = jsonObject.getJSONObject("ext_data");
|
JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail");
|
||||||
JSONArray pallet_detail = ext_data.getJSONArray("pallet_detail");
|
|
||||||
for (Object o : pallet_detail) {
|
for (Object o : pallet_detail) {
|
||||||
JSONObject jO = (JSONObject)JSONObject.toJSON(o);
|
JSONObject jO = (JSONObject)JSONObject.toJSON(o);
|
||||||
String workorder = jO.getString("ProductionOrder");
|
String workorder = jO.getString("ProductionOrder");
|
||||||
@@ -145,13 +145,15 @@ public class SortingSMTTask extends AbstractTask {
|
|||||||
// 起点清空
|
// 起点清空
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
PointUtils.updateByIngTaskCode(schBasePoint);
|
||||||
pointService.updateById(schBasePoint);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
PointUtils.updateByIngTaskCode(schBasePoint2);
|
||||||
pointService.updateById(schBasePoint2);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
// 任务完成
|
// 任务完成
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.enums.region.RegionEnum;
|
import org.nl.common.enums.region.RegionEnum;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
@@ -27,18 +28,19 @@ import org.nl.wms.util.PointUtils;
|
|||||||
import org.nl.wms.util.TaskUtils;
|
import org.nl.wms.util.TaskUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sorting补空托盘
|
* sorting将空托盘放到线边库
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component(value = "SortingSNTTask")
|
@Component(value = "SortingSNTTask")
|
||||||
public class SortingSNTTask extends AbstractTask {
|
public class SortingSNTTask extends AbstractTask {
|
||||||
|
|
||||||
|
|
||||||
private static final String TASK_CONFIG_CODE = "sortingSNTTask";
|
private static final String TASK_CONFIG_CODE = "SortingSNTTask";
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBasePointService pointService;
|
private ISchBasePointService pointService;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -53,6 +55,7 @@ public class SortingSNTTask extends AbstractTask {
|
|||||||
private ISchBaseVehiclematerialgroupService schBaseVehiclematerialgroupService;
|
private ISchBaseVehiclematerialgroupService schBaseVehiclematerialgroupService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
protected void create() throws BadRequestException {
|
protected void create() throws BadRequestException {
|
||||||
// 获取任务
|
// 获取任务
|
||||||
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
|
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
|
||||||
@@ -78,7 +81,7 @@ public class SortingSNTTask extends AbstractTask {
|
|||||||
}
|
}
|
||||||
//删除组盘信息
|
//删除组盘信息
|
||||||
schBaseVehiclematerialgroupService.remove(new QueryWrapper<SchBaseVehiclematerialgroup>()
|
schBaseVehiclematerialgroupService.remove(new QueryWrapper<SchBaseVehiclematerialgroup>()
|
||||||
.eq("vehiicle_code",schBasePoint.getVehicle_code()));
|
.eq("vehicle_code",schBasePoint.getVehicle_code()));
|
||||||
taskService.update(new UpdateWrapper<SchBaseTask>()
|
taskService.update(new UpdateWrapper<SchBaseTask>()
|
||||||
.set("task_status",TaskStatus.CREATED.getCode())
|
.set("task_status",TaskStatus.CREATED.getCode())
|
||||||
.set("point_code2",schBasePoint.getPoint_code())
|
.set("point_code2",schBasePoint.getPoint_code())
|
||||||
@@ -126,13 +129,15 @@ public class SortingSNTTask extends AbstractTask {
|
|||||||
// 起点清空
|
// 起点清空
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint);
|
PointUtils.updateByIngTaskCode(schBasePoint);
|
||||||
pointService.updateById(schBasePoint);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
String point_code2 = taskObj.getPoint_code2();
|
String point_code2 = taskObj.getPoint_code2();
|
||||||
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
|
||||||
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
|
||||||
PointUtils.updateByIngTaskCode(schBasePoint2);
|
PointUtils.updateByIngTaskCode(schBasePoint2);
|
||||||
pointService.updateById(schBasePoint2);
|
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
|
||||||
|
.set(SchBasePoint::getIs_lock, false));
|
||||||
}
|
}
|
||||||
// 任务完成
|
// 任务完成
|
||||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user