Browse Source

add: acs添加定时删除日志文件功能,修改叫空逻辑不需要区域

master
yanps 2 months ago
parent
commit
31dea7a46d
  1. 71
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCleanFile.java
  2. 37
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java
  3. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java
  4. 43
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  5. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java
  6. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java
  7. 173
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/AtTask.java
  8. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java
  9. 11
      lms/nladmin-ui/src/views/wms/sch/point/index.vue

71
acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCleanFile.java

@ -0,0 +1,71 @@
package org.nl.quartz.task;
import cn.hutool.core.util.ObjectUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.config.SpringContextHolder;
import org.nl.system.service.param.dao.Param;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import java.io.File;
import java.util.concurrent.TimeUnit;
/**
* @author LENOVO
* 定时清理日志文件
*/
@Slf4j
@Component
@Profile("prod")
public class AutoCleanFile {
private static long DAYS_TO_MILLIS = TimeUnit.DAYS.toMillis(14);
@Value("${logging.file.path}")
private String logPath;
@SneakyThrows
public void run() {
log.info("定时清理日志文件AutoCleanFile开始:");
File directory = new File(logPath);
if (directory.exists() && directory.isDirectory()) {
cleanDirectory(directory);
} else {
System.out.println("指定的路径不存在或不是一个目录。");
}
}
// 递归清理文件夹内的过期文件
private static void cleanDirectory(File directory) {
File[] files = directory.listFiles();
if (files != null) {
long currentTime = System.currentTimeMillis();
for (File file : files) {
if (file.isDirectory()) {
// 如果是目录,递归调用
cleanDirectory(file);
} else if (file.isFile()) {
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
Param byCode = sysParamService.findByCode("log_time");
if (ObjectUtil.isNotNull(byCode)) {
DAYS_TO_MILLIS = TimeUnit.DAYS.toMillis(Long.parseLong(byCode.getValue()));
}
if (currentTime - file.lastModified() > DAYS_TO_MILLIS) {
boolean deleted = file.delete();
if (deleted) {
log.info("已删除文件: " + file.getAbsolutePath());
} else {
log.info("无法删除文件: " + file.getAbsolutePath());
}
} else {
log.info("文件未超过七天, 不做任何修改: " + file.getAbsolutePath());
}
}
}
}
}
}

37
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java

@ -87,6 +87,7 @@ public class HandheldServiceImpl implements HandheldService {
semiAutomaticBending(vehicle, device_code, param); semiAutomaticBending(vehicle, device_code, param);
break; break;
case "3": case "3":
interiorAisle(vehicle, device_code, param);
break; break;
default: default:
break; break;
@ -94,6 +95,31 @@ public class HandheldServiceImpl implements HandheldService {
} }
/**
* 内部过道送托盘
* @param vehicle
* @param device_code
* @param param
*/
private void interiorAisle(String vehicle, String device_code, JSONObject param) {
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle);
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具不存在!");
SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(device_code);
if (ObjectUtil.isEmpty(schBasePoint)) throw new BadRequestException("设备点位不存在!");
AbstractTask connectorTask = taskFactory.getTask("ATTask");
// 准备参数:设备编码
JSONObject jo = new JSONObject();
jo.put("device_code", device_code);
jo.put("config_code", "ATTask");
jo.put("create_mode", GeneralDefinition.AUTO_CREATION);
jo.put("vehicle_code", vehicle);
jo.put("vehicle_type", mdBaseVehicle.getVehicle_type());
jo.put("region_code", RegionEnum.NBGD.getRegion_code());
param.put("region_code", RegionEnum.NBGD.getRegion_code());
jo.put("ext_data", param);
connectorTask.apply(jo);
}
/** /**
* 空料架送回 * 空料架送回
* *
@ -137,8 +163,8 @@ public class HandheldServiceImpl implements HandheldService {
if (CollUtil.isEmpty(Arrays.asList(vehicle_list))) { if (CollUtil.isEmpty(Arrays.asList(vehicle_list))) {
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle); MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle);
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具不存在!"); if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具不存在!");
if (!mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.RACKS_S04.getVehicleCode()) if (!mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.FRAME_R01.getVehicleCode())
&& !mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.RACKS_S06.getVehicleCode())) { && !mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.FRAME_R02.getVehicleCode())) {
throw new BadRequestException("托盘类型不匹配,,生成搬运任务失败!"); throw new BadRequestException("托盘类型不匹配,,生成搬运任务失败!");
} }
} else { } else {
@ -616,13 +642,6 @@ public class HandheldServiceImpl implements HandheldService {
jsonObject.put("pointCode", isConnectConnector.getValue()); jsonObject.put("pointCode", isConnectConnector.getValue());
jsonObject.put("status", json.getString("status")); jsonObject.put("status", json.getString("status"));
wmsToAcsService.notifyAcs1(jsonObject); wmsToAcsService.notifyAcs1(jsonObject);
Param isConnectConnector1 = sysParamService.findByCode(GeneralDefinition.ADD_ROUTE_DOOR);
if ("1".equals(json.getString("status"))) {
isConnectConnector1.setValue(json.getString("type"));
} else {
isConnectConnector1.setValue("0");
}
sysParamService.update(isConnectConnector1);
} }
@Override @Override

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java

@ -100,7 +100,7 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
* *
* @param region_code,vehicleType托盘类型允许多种类型 * @param region_code,vehicleType托盘类型允许多种类型
*/ */
SchBasePoint selectEmpVehicleByRegionCode(String region_code, String... vehicleType); SchBasePoint selectEmpVehicleByRegionCode(String region_code, String vehicleType);
/** /**
@ -212,4 +212,13 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
* @return * @return
*/ */
List<JSONObject> selectPointByRegion(String regionCode); List<JSONObject> selectPointByRegion(String regionCode);
/**
* 根据载具类型和区域获取点位
* @param region_code
* @param vehicle_code
* @param s
* @return
*/
SchBasePoint selectPointByEmpAndRegion(String region_code, String vehicle_code, String s);
} }

43
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -77,6 +77,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
private final Object lock2 = new Object(); private final Object lock2 = new Object();
private final Object lock3 = new Object();
@Override @Override
public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page) { public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page) {
@ -85,6 +87,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
String region_code = ObjectUtil.isNotEmpty(whereJson.get("region_code")) ? whereJson.get("region_code").toString() : null; String region_code = ObjectUtil.isNotEmpty(whereJson.get("region_code")) ? whereJson.get("region_code").toString() : null;
String point_type = ObjectUtil.isNotEmpty(whereJson.get("point_type")) ? whereJson.get("point_type").toString() : null; String point_type = ObjectUtil.isNotEmpty(whereJson.get("point_type")) ? whereJson.get("point_type").toString() : null;
String point_status = ObjectUtil.isNotEmpty(whereJson.get("point_status")) ? whereJson.get("point_status").toString() : null; String point_status = ObjectUtil.isNotEmpty(whereJson.get("point_status")) ? whereJson.get("point_status").toString() : null;
String vehicleCode = ObjectUtil.isNotEmpty(whereJson.get("vehicle_code")) ? whereJson.get("vehicle_code").toString() : null;
Boolean is_used = ObjectUtil.isNotEmpty(whereJson.get("is_used")) ? Boolean.valueOf(whereJson.get("is_used").toString()) : null; Boolean is_used = ObjectUtil.isNotEmpty(whereJson.get("is_used")) ? Boolean.valueOf(whereJson.get("is_used").toString()) : null;
Boolean lock_type = ObjectUtil.isNotEmpty(whereJson.get("lock_type")) ? Boolean.valueOf(whereJson.get("lock_type").toString()) : false; Boolean lock_type = ObjectUtil.isNotEmpty(whereJson.get("lock_type")) ? Boolean.valueOf(whereJson.get("lock_type").toString()) : false;
Boolean parent_point = ObjectUtil.isNotEmpty(whereJson.get("parent_point")) ? Boolean.valueOf(whereJson.get("parent_point").toString()) : false; Boolean parent_point = ObjectUtil.isNotEmpty(whereJson.get("parent_point")) ? Boolean.valueOf(whereJson.get("parent_point").toString()) : false;
@ -97,6 +100,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.eq(ObjectUtil.isNotEmpty(point_status), SchBasePoint::getPoint_status, point_status) .eq(ObjectUtil.isNotEmpty(point_status), SchBasePoint::getPoint_status, point_status)
.eq(ObjectUtil.isNotEmpty(is_used), SchBasePoint::getIs_used, is_used) .eq(ObjectUtil.isNotEmpty(is_used), SchBasePoint::getIs_used, is_used)
.eq(ObjectUtil.isNotEmpty(lock_type), SchBasePoint::getIs_lock, lock_type) .eq(ObjectUtil.isNotEmpty(lock_type), SchBasePoint::getIs_lock, lock_type)
.eq(ObjectUtil.isNotEmpty(vehicleCode), SchBasePoint::getVehicle_code, vehicleCode)
.orderByAsc(SchBasePoint::getRegion_code) .orderByAsc(SchBasePoint::getRegion_code)
.orderByAsc(SchBasePoint::getPoint_type) .orderByAsc(SchBasePoint::getPoint_type)
.orderByAsc(SchBasePoint::getPoint_code) .orderByAsc(SchBasePoint::getPoint_code)
@ -519,6 +523,32 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
return pointMapper.selectPointByRegion(regionCode); return pointMapper.selectPointByRegion(regionCode);
} }
@Override
public SchBasePoint selectPointByEmpAndRegion(String region_code, String vehicle_code, String s) {
synchronized (lock2) {
//查询载具的类型
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getById(vehicle_code);
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具类型不存在!");
//查询满足条件的站点
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
.eq(SchBasePoint::getIs_lock, false)
.isNull(SchBasePoint::getVehicle_code)
.eq(SchBasePoint::getPoint_type, s)
.eq(SchBasePoint::getRegion_code, region_code)
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.eq(SchBasePoint::getIs_used, true));
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
SchBasePoint schBasePoint = schBasePoints.get(0);
schBasePoint.setIs_lock(true);
update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code())
.set(SchBasePoint::getIs_lock, true));
return schBasePoint;
}
return null;
}
}
@Override @Override
public List<OrderMater> getStructList(String region_code, String vehicle_type) { public List<OrderMater> getStructList(String region_code, String vehicle_type) {
//1.查询的结果一个托盘有多个800,PC需要怎么展示? //1.查询的结果一个托盘有多个800,PC需要怎么展示?
@ -552,16 +582,23 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
@Override @Override
@Transactional(propagation = Propagation.REQUIRES_NEW) @Transactional(propagation = Propagation.REQUIRES_NEW)
public SchBasePoint selectEmpVehicleByRegionCode(String region_code, String... vehicleType) { public SchBasePoint selectEmpVehicleByRegionCode(String region_code, String vehicleType) {
synchronized (region_code) { synchronized (lock3) {
//查询满足条件的站点 //查询满足条件的站点
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false). List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false).
isNotNull(SchBasePoint::getVehicle_code) isNotNull(SchBasePoint::getVehicle_code)
.eq(StrUtil.isNotEmpty(region_code), SchBasePoint::getRegion_code, region_code) .eq(StrUtil.isNotEmpty(region_code), SchBasePoint::getRegion_code, region_code)
.eq(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()) .eq(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.in(SchBasePoint::getCan_vehicle_type, vehicleType) .eq(SchBasePoint::getCan_vehicle_type, vehicleType)
.eq(SchBasePoint::getIs_used, true)); .eq(SchBasePoint::getIs_used, true));
if (CollectionUtils.isEmpty(schBasePoints)) { if (CollectionUtils.isEmpty(schBasePoints)) {
schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false)
.isNotNull(SchBasePoint::getVehicle_code)
.eq(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.eq(SchBasePoint::getCan_vehicle_type, vehicleType)
.eq(SchBasePoint::getIs_used, true));
}
if (schBasePoints.size() == 0) {
return null; return null;
} }
SchBasePoint schBasePoint = schBasePoints.get(0); SchBasePoint schBasePoint = schBasePoints.get(0);

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java

@ -85,7 +85,7 @@ public class CNTTask extends AbstractTask {
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());
if (task.getPoint_code1().endsWith("2")) { if (task.getPoint_code1().endsWith("1")) {
task.setAcs_trace_id("4"); task.setAcs_trace_id("4");
} }
taskService.updateById(task); taskService.updateById(task);

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java

@ -30,6 +30,10 @@ import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* @author LENOVO
* connector补空托任务
*/
@Slf4j @Slf4j
@Component(value = "FTGTask") @Component(value = "FTGTask")
public class FTGTask extends AbstractTask { public class FTGTask extends AbstractTask {
@ -54,12 +58,6 @@ public class FTGTask extends AbstractTask {
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);
/*Comparator<SchBaseTask> numericSuffixComparator = (s1, s2) -> {
Integer suffix1 = getNumericSuffix(s1.getPoint_code1());
Integer suffix2 = getNumericSuffix(s2.getPoint_code1());
return suffix1.compareTo(suffix2);
};
List<SchBaseTask> collect = tasks.stream().sorted(numericSuffixComparator).collect(Collectors.toList());*/
for (SchBaseTask task : tasks) { for (SchBaseTask task : tasks) {
// 查找空载具点位 // 查找空载具点位
SchBasePoint schBasePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(),task.getVehicle_type()); SchBasePoint schBasePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(),task.getVehicle_type());

173
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/AtTask.java

@ -0,0 +1,173 @@
package org.nl.wms.sch.task_manage.task.tasks.handheld;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.enums.GoodsEnum;
import org.nl.common.exception.BadRequestException;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
import org.nl.wms.ext.fab.service.dto.SendVehicleVo;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
import org.nl.wms.sch.task.service.dao.SchBaseTask;
import org.nl.wms.sch.task_manage.AbstractTask;
import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum;
import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.nl.wms.util.PointUtils;
import org.nl.wms.util.TaskUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author LENOVO
* 空托盘送回
*/
@Slf4j
@Component(value = "ATTask")
public class AtTask extends AbstractTask {
private static final String TASK_CONFIG_CODE = "ATTask";
@Autowired
private ISchBasePointService pointService;
@Autowired
private ISchBaseTaskService taskService;
@Autowired
private ISchBaseTaskconfigService taskConfigService;
@Autowired
private ISysNoticeService noticeService;
@Autowired
private ISchBasePointService schBasePointService;
@Autowired
private ISchBaseVehiclematerialgroupService schBaseVehiclematerialgroupService;
@Override
@Transactional(rollbackFor = Exception.class)
protected void create() throws BadRequestException {
// 获取任务
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task);
SendVehicleVo sendVehicleVo = JSONObject.parseObject(task.getRequest_param(), SendVehicleVo.class);
//查询地面点位的载具编码
// 根据对接位查找对应的载具类型
SchBasePoint schBasePoint = schBasePointService.selectPointByEmpAndRegion(sendVehicleVo.getRegion_code(), task.getVehicle_code(), "0");
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
// 消息通知
noticeService.createNotice("未找到所需点位!", TASK_CONFIG_CODE + task.getTask_code(),
NoticeTypeEnum.WARN.getCode());
continue;
}
//删除组盘信息
schBaseVehiclematerialgroupService.remove(new QueryWrapper<SchBaseVehiclematerialgroup>()
.eq("vehicle_code", schBasePoint.getVehicle_code()));
taskService.update(new UpdateWrapper<SchBaseTask>()
.set("task_status", TaskStatus.CREATED.getCode())
.set("point_code2", schBasePoint.getPoint_code())
.eq("task_id", task.getTask_id()));
//更新点位信息
schBasePoint.setIng_task_code(task.getTask_code());
schBasePoint.setIs_lock(true);
schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue());
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
}
}
@Override
protected void updateStatus(String task_code, TaskStatus status) {
//TODO:完成任务的时候将int_task_code的清除
}
@Override
public void forceFinish(String task_code) {
SchBaseTask taskObj = taskService.getByCode(task_code);
if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("该任务不存在");
}
this.finishTask(taskObj, TaskFinishedTypeEnum.MANUAL_CONNECTOR);
}
@Override
public void cancel(String task_code) {
//TODO:取消任务的时候将int_task_code的清除
SchBaseTask taskObj = taskService.getByCode(task_code);
if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("该任务不存在");
}
this.cancelTask(taskObj, TaskFinishedTypeEnum.MANUAL_CONNECTOR);
}
@Override
protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) {
}
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
// 获取参数
String startPoint = taskObj.getPoint_code1();
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
// 起点清空
if (ObjectUtil.isNotEmpty(schBasePoint)) {
PointUtils.updateByIngTaskCode(schBasePoint);
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, null));
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()));
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_FINISH);
taskObj.setFinished_type(taskFinishedType.getCode());
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
taskService.updateById(taskObj);
}
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
// 获取参数
String startPoint = taskObj.getPoint_code1();
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
// 起点清空
if (ObjectUtil.isNotEmpty(schBasePoint)) {
PointUtils.updateByIngTaskCode(schBasePoint);
pointService.updateById(schBasePoint);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setFinished_type(taskFinishedType.getCode());
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
taskService.updateById(taskObj);
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java

@ -59,7 +59,7 @@ public class SortingCNTTask extends AbstractTask {
for (SchBaseTask task : tasks) { for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task); TaskUtils.setUpdateByAcs(task);
// 找起点 // 找起点
SchBasePoint basePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.ZDFJ.getRegion_code(), task.getVehicle_type()); SchBasePoint basePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_type());
if (basePoint==null){ if (basePoint==null){
task.setRemark("未找到所需点位!"); task.setRemark("未找到所需点位!");
taskService.updateById(task); taskService.updateById(task);

11
lms/nladmin-ui/src/views/wms/sch/point/index.vue

@ -90,6 +90,17 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="载具号">
<el-input
v-model="query.vehicle_code"
clearable
filterable
size="mini"
placeholder="载具号"
class="filter-item"
@change="hand"
/>
</el-form-item>
<el-form-item label="锁定类型"> <el-form-item label="锁定类型">
<el-switch <el-switch
v-model="query.lock_type" v-model="query.lock_type"

Loading…
Cancel
Save