Browse Source

add: 添加取消任务功能

master
yanps 1 month ago
parent
commit
1c6f8a3e97
  1. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  2. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java
  3. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java
  4. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java
  5. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml
  6. 36
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  7. 55
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java
  8. 46
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java
  9. 40
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/AtTask.java
  10. 38
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/BlankingTask.java
  11. 37
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/CallEmptyTask.java
  12. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/EmptyCageTask.java
  13. 38
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/MtTask.java
  14. 39
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/RackTask.java
  15. 45
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/handheld/ToStoreHouseTask.java
  16. 34
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java
  17. 47
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCNTask.java
  18. 40
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java
  19. 50
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java
  20. 34
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/ProcessingSMTTask.java
  21. 56
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java
  22. 49
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java
  23. 42
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java
  24. 47
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java
  25. 52
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingTwoCNTTask.java

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -443,7 +443,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (CollectionUtils.isEmpty(list)) {
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getOne(new QueryWrapper<MdBaseVehicle>().eq("vehicle_code", vehicle_code));
AbstractTask connectorTask = taskFactory.getTask("FTGTask");
// 准备参数:设备编码
JSONObject param = new JSONObject();
param.put("device_code", schBaseTask.getPoint_code1());
param.put("config_code", "FTGTask");
@ -458,7 +457,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
json.put("status", status);
json.put("device_code", schBaseTask.getPoint_code1());
json.put("task_code", schBaseTask.getTask_code());
AcsResponse acsResponse = connectorService.feedAgvTaskStatus(json);
//AcsResponse acsResponse = connectorService.feedAgvTaskStatus(json);
}
if ("2".equals(is_connector)) {
JSONObject json = new JSONObject();
@ -627,5 +626,4 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
}

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java

@ -93,9 +93,10 @@ public class FabServiceImpl {
pcOperationCMTask.apply(param);
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, callMaterVo.getDevice_code())
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getIs_lock, true));
iSchBaseVehiclematerialgroupService.update(Wrappers.lambdaUpdate(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, callMaterVo.getVehicle_code())
.set(SchBaseVehiclematerialgroup::getIs_delete, true));
break;
case "cnt":
Assert.noNullElements(new Object[]{form.getString("device_code"), form.getString("vehicle_type")}, "参数不能为空!");

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

@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import nl.basjes.shaded.org.springframework.util.Assert;
import org.nl.common.enums.GoodsEnum;
import org.nl.common.enums.VehicleEnum;
import org.nl.common.enums.VehicleTypeEnum;
import org.nl.common.enums.region.RegionEnum;
import org.nl.common.exception.BadRequestException;
@ -106,10 +107,11 @@ public class HandheldServiceImpl implements HandheldService {
* @param param
*/
private void applyDeliveryRacks(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("设备点位不存在!");
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle);
if (ObjectUtil.isEmpty(mdBaseVehicle))
throw new BadRequestException("载具不存在或载具号与点位不匹配!");
AbstractTask connectorTask = taskFactory.getTask("RACKTask");
// 准备参数:设备编码
JSONObject jo = new JSONObject();
@ -120,6 +122,7 @@ public class HandheldServiceImpl implements HandheldService {
jo.put("vehicle_type", mdBaseVehicle.getVehicle_type());
jo.put("ext_data", param);
connectorTask.apply(jo);
}
/**
@ -284,6 +287,7 @@ public class HandheldServiceImpl implements HandheldService {
*/
private void connectorBlanking(JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) {
JSONObject jo = new JSONObject();
param.put("region_code", region_code);
jo.put("device_code", device_code);
jo.put("config_code", "ProcessingSMTTask");
jo.put("create_mode", GeneralDefinition.AUTO_CREATION);
@ -309,6 +313,7 @@ public class HandheldServiceImpl implements HandheldService {
* @param connectorTask
*/
private void goShelves(SchBasePoint schBasePoint, JSONObject param, String region_code, String device_code, String vehicle_code, AbstractTask connectorTask) {
//TODO:是否需要加上是否有无货校验
Assert.noNullElements(param.getJSONArray("material"), "参数不能为空!");
JSONArray materials = param.getJSONArray("material");
if (materials.size() < 1) {
@ -362,9 +367,7 @@ public class HandheldServiceImpl implements HandheldService {
jo.put("ext_data", param);
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, device_code)
.set(SchBasePoint::getIs_lock, true)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getVehicle_code, null));
.set(SchBasePoint::getIs_lock, true));
connectorTask.apply(jo);
iSchBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicle_code));
@ -408,6 +411,9 @@ public class HandheldServiceImpl implements HandheldService {
if (materials.size() < 1) {
throw new BadRequestException("物料下料数量不能为空!");
}
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle_code);
if(mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.TRAY.getVehicleCode())) throw new BadRequestException("钢托盘不能存放加工区!");
param.put("region_code", region_code);
jo.put("device_code", device_code);
jo.put("config_code", "ProcessingSMTTask");
jo.put("create_mode", GeneralDefinition.AUTO_CREATION);
@ -506,8 +512,7 @@ public class HandheldServiceImpl implements HandheldService {
connectorTask.apply(jo);
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, device_code)
.set(SchBasePoint::getIs_lock, true)
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()));
.set(SchBasePoint::getIs_lock, true));
}
@Override

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

@ -201,7 +201,6 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, entity.get("point_code2"))
.eq(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getIs_lock, true));
vehiclematerialgroupMapper.delete(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, entity.get("vehicle_code")));

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/mapper/SchBasePointMapper.xml

@ -36,6 +36,7 @@
is_lock = FALSE
AND sch_base_point.vehicle_code IS NOT NULL
and sch_base_point.point_status = '2'
and sch_base_vehiclematerialgroup.is_delete = false
<if test="vehicle_type != null and vehicle_type != ''">
and sch_base_point.can_vehicle_type = #{vehicle_type}
</if>
@ -59,8 +60,9 @@
</select>
<select id="selectPointByRegion" resultType="com.alibaba.fastjson.JSONObject"
parameterType="java.lang.String">
select point_code, point_name,point_status
select point_code, point_name, point_status
from sch_base_point
where region_code = #{regionCode} and point_type is null
where region_code = #{regionCode}
and point_type is null
</select>
</mapper>

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

@ -265,9 +265,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
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));
PointUtils.setUpdateByAcs(schBasePoint);
pointMapper.updateById(schBasePoint);
return schBasePoint;
}
SchBasePoint schBasePoint1 = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, region_code)).get(0);
@ -284,9 +283,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
schBasePoints1.stream().sorted(Comparator.comparingInt(schBasePoint -> Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq())));
SchBasePoint schBasePoint = schBasePoints1.get(0);
schBasePoint.setIs_lock(true);
update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code())
.set(SchBasePoint::getIs_lock, true));
PointUtils.setUpdateByAcs(schBasePoint);
pointMapper.updateById(schBasePoint);
return schBasePoint;
}
return null;
@ -396,8 +394,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.eq(SchBasePoint::getIs_lock, false)
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getPoint_status, pointStatus)
.eq(!vehicle_type.equals("G01"),SchBasePoint::getPoint_type, "1")
.eq(vehicle_type.equals("G01"),SchBasePoint::getPoint_type, "0")
.eq(!vehicle_type.equals("G01"), SchBasePoint::getPoint_type, "1")
.eq(vehicle_type.equals("G01"), SchBasePoint::getPoint_type, "0")
.eq(StrUtil.isNotBlank(vehicle_type), SchBasePoint::getCan_vehicle_type, vehicle_type)
.isNull(seq == 2, SchBasePoint::getVehicles)
.isNull(seq == 1, SchBasePoint::getVehicle_code)
@ -417,7 +415,11 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.eq(SchBasePoint::getCan_vehicle_type, vehicle_type)
.isNotNull(SchBasePoint::getVehicle_code));
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
return schBasePoints.get(0);
SchBasePoint schBasePoint = schBasePoints.get(0);
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
updateById(schBasePoint);
return schBasePoint;
}
schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class)
.eq(SchBasePoint::getIs_lock, false)
@ -462,6 +464,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
}
if (ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("该货位不存在!");
schBasePoint1.setVehicle_code(s);
schBasePoint1.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint1);
updateById(schBasePoint1);
return schBasePoint1;
}
return null;
@ -526,7 +531,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
if (jsonObject.get("point_status").equals(GoodsEnum.EMPTY_PALLETS.getValue()) || jsonObject.get("point_status").equals(GoodsEnum.IN_STOCK.getValue())) {
jsonObject.put("point_status", "1");
}
}else{
} else {
jsonObject.put("point_status", "0");
}
});
@ -550,9 +555,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
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));
PointUtils.setUpdateByAcs(schBasePoint);
updateById(schBasePoint);
return schBasePoint;
}
return null;
@ -612,9 +616,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
return null;
}
SchBasePoint schBasePoint = schBasePoints.get(0);
this.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock", true)
.eq("point_code", schBasePoint.getPoint_code()));
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointMapper.updateById(schBasePoint);
return schBasePoint;
}
}

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

@ -68,9 +68,7 @@ public class CNTTask extends AbstractTask {
SchBasePoint schBasePoint = null;
if (TaskType.CARRY_TASK.getValue().equals(task.getTask_type())) {
schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(), "1");
}/* else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) {
schBasePoint = schBasePointService.selectByReassign(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code());
}*/
}
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
@ -89,11 +87,6 @@ public class CNTTask extends AbstractTask {
task.setAcs_trace_id("4");
}
taskService.updateById(task);
schBasePoint.setIng_task_code(task.getTask_code());
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
}
}
@ -123,6 +116,18 @@ public class CNTTask extends AbstractTask {
public void cancel(String task_code) {
//TODO:取消任务的时候将int_task_code的清除
SchBaseTask taskObj = taskService.getByCode(task_code);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("该任务不存在");
}
@ -140,16 +145,18 @@ public class CNTTask extends AbstractTask {
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));
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
String endPoint = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false));
schBasePoint2.setIs_lock(false);
schBasePoint2.setPoint_status(GoodsEnum.IN_STOCK.getValue());
schBasePoint2.setVehicle_code(taskObj.getVehicle_code());
PointUtils.setUpdateByAcs(schBasePoint2);
schBasePointService.updateById(schBasePoint2);
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
@ -160,22 +167,6 @@ public class CNTTask extends AbstractTask {
}
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.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
}
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));
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
taskObj.setTask_status(TaskStatus.CANCELED.getCode());

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

@ -60,7 +60,7 @@ public class FTGTask extends AbstractTask {
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
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());
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
@ -78,13 +78,9 @@ public class FTGTask extends AbstractTask {
task.setTask_status(TaskStatus.CREATED.getCode());
TaskUtils.setUpdateByAcs(task);
taskService.updateById(task);
schBasePoint.setIs_lock(true);
schBasePoint.setPoint_status(GoodsEnum.OUT_OF_STOCK.getValue());
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
}
}
private static Integer getNumericSuffix(String filename) {
// 提取数字后缀
String suffix = filename.replaceAll(".*?(\\d+)$", "$1");
@ -126,17 +122,18 @@ public class FTGTask extends AbstractTask {
// 获取参数
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));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getVehicle_code, null));
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
String endPoint = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint);
if (ObjectUtil.isNotEmpty(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, endPoint)
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -148,20 +145,19 @@ public class FTGTask extends AbstractTask {
}
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
// 获取参数
String startPoint = taskObj.getPoint_code1();
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
// 起点清空
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
PointUtils.updateByIngTaskCode(schBasePoint);
pointService.updateById(schBasePoint);
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
// 获取参数
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
taskObj.setTask_status(TaskStatus.CANCELED.getCode());

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

@ -80,13 +80,6 @@ public class AtTask extends AbstractTask {
.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);
}
}
@ -126,18 +119,20 @@ public class AtTask extends AbstractTask {
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
// 起点清空
if (ObjectUtil.isNotEmpty(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::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()));
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue()));
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
@ -149,18 +144,17 @@ public class AtTask extends AbstractTask {
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
// 获取参数
String startPoint = taskObj.getPoint_code1();
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
// 起点清空
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
PointUtils.updateByIngTaskCode(schBasePoint);
pointService.updateById(schBasePoint);
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -89,9 +89,6 @@ public class BlankingTask extends AbstractTask {
taskService.updateById(task);
schBasePoint.setVehicle_code(task.getVehicle_code());
schBasePoint.setIng_task_code(task.getTask_code());
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
@ -135,14 +132,20 @@ public class BlankingTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(schBasePoint)) {
PointUtils.updateByIngTaskCode(schBasePoint);
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -155,20 +158,17 @@ public class BlankingTask extends AbstractTask {
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.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
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));
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -80,10 +80,6 @@ public class CallEmptyTask extends AbstractTask {
TaskUtils.setUpdateByAcs(task);
taskService.updateById(task);
schBasePoint.setVehicle_code(task.getVehicle_code());
schBasePoint.setIng_task_code(task.getTask_code());
schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue());
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
@ -127,14 +123,20 @@ public class CallEmptyTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(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::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -147,20 +149,17 @@ public class CallEmptyTask extends AbstractTask {
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.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
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));
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -142,6 +142,22 @@ public class EmptyCageTask extends AbstractTask {
public void cancel(String task_code) {
//TODO:取消任务的时候将int_task_code的清除
SchBaseTask taskObj = taskService.getByCode(task_code);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setVehicle_code(null);
schBasePoint1.setPoint_status(GoodsEnum.OUT_OF_STOCK.getValue());
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setVehicle_code(taskObj.getVehicle_code());
schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue());
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
if (ObjectUtil.isEmpty(taskObj)) {
throw new BadRequestException("该任务不存在");
}

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

@ -58,7 +58,7 @@ public class MtTask extends AbstractTask {
for (SchBaseTask task : tasks) {
String vehicle_type = task.getVehicle_type();
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(RegionEnum.NBJG.getRegion_code(),
GoodsEnum.OUT_OF_STOCK.getValue(),null, 2);
GoodsEnum.OUT_OF_STOCK.getValue(), null, 2);
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
@ -75,9 +75,6 @@ public class MtTask extends AbstractTask {
TaskUtils.setUpdateByAcs(task);
taskService.updateById(task);
schBasePoint.setVehicles(task.getVehicle_code());
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
@ -121,14 +118,20 @@ public class MtTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(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::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -141,20 +144,17 @@ public class MtTask extends AbstractTask {
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.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
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));
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -64,11 +64,11 @@ public class RackTask extends AbstractTask {
String vehicle_type = task.getVehicle_type();
String regionCode = RegionEnum.ZDZWQ.getRegion_code();
if(StrUtil.isNotBlank(vehicle_type) && VehicleTypeEnum.TRAY.getVehicleCode().equals(vehicle_type)){
if (StrUtil.isNotBlank(vehicle_type) && VehicleTypeEnum.TRAY.getVehicleCode().equals(vehicle_type)) {
regionCode = RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code();
}
SchBasePoint schBasePoint = schBasePointService.selectByGroundPoint(regionCode,
GoodsEnum.OUT_OF_STOCK.getValue(),vehicle_type, 1);
GoodsEnum.OUT_OF_STOCK.getValue(), vehicle_type, 1);
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
@ -86,8 +86,6 @@ public class RackTask extends AbstractTask {
taskService.updateById(task);
schBasePoint.setVehicles(task.getVehicle_code());
schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue());
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
@ -131,14 +129,20 @@ public class RackTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(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::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -151,20 +155,17 @@ public class RackTask extends AbstractTask {
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.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
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));
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -60,7 +60,7 @@ public class ToStoreHouseTask extends AbstractTask {
SchBasePoint schBasePoint = null;
if (task.getVehicle_type().equals(VehicleTypeEnum.FRAME_R02.getVehicleCode()) || task.getVehicle_type().equals(VehicleTypeEnum.FRAME_R01.getVehicleCode())) {
schBasePoint = schBasePointService.selectByEmptyCage(RegionEnum.DDLK.getRegion_code(),
task.getVehicle_type(),GoodsEnum.EMPTY_PALLETS.getValue(),true,task);
task.getVehicle_type(), GoodsEnum.EMPTY_PALLETS.getValue(), true, task);
} else {
schBasePoint = schBasePointService.selectByVehicleQty(task.getVehicle_type());
}
@ -79,14 +79,6 @@ public class ToStoreHouseTask extends AbstractTask {
task.setRemark("");
task.setTask_status(TaskStatus.CREATED.getCode());
taskService.updateById(task);
/*schBasePoint.setVehicle_code(task.getVehicle_code());
schBasePoint.setIng_task_code(task.getTask_code());*/
schBasePoint.setPoint_status(GoodsEnum.OUT_OF_STOCK.getValue());
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
}
}
@ -127,17 +119,21 @@ public class ToStoreHouseTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(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::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code,taskObj.getVehicle_code()));
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()));
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
@ -149,20 +145,17 @@ public class ToStoreHouseTask extends AbstractTask {
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.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
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));
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

34
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCMTask.java

@ -78,9 +78,7 @@ public class PcOperationCMTask extends AbstractTask {
.set("remark", null)
.eq("task_id", task.getTask_id()));
pointService.update(new UpdateWrapper<SchBasePoint>()
.set("ing_task_code", task.getTask_code())
.set("is_lock", true)
.set("point_status", GoodsEnum.OUT_OF_STOCK.getValue())
.eq("point_code", structPoint.getPoint_code()));
}
}
@ -121,14 +119,15 @@ public class PcOperationCMTask extends AbstractTask {
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));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.set(SchBasePoint::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false)
.eq(SchBasePoint::getPoint_code, startPoint));
}
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)
@ -144,20 +143,19 @@ public class PcOperationCMTask extends AbstractTask {
}
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
// 获取参数
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
taskObj.setTask_status(TaskStatus.CANCELED.getCode());

47
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationCNTask.java

@ -62,7 +62,6 @@ public class PcOperationCNTask extends AbstractTask {
TaskUtils.setUpdateByAcs(task);
// 找起点
CallEmpVo callMaterVo = JSONObject.parseObject(task.getRequest_param(), CallEmpVo.class);
SchBasePoint basePoint = schBasePointService.selectByEmptyCage(RegionEnum.DDLK.getRegion_code(),
callMaterVo.getVehicle_type(),GoodsEnum.EMPTY_PALLETS.getValue(),false,task);
if (basePoint==null){
@ -72,12 +71,8 @@ public class PcOperationCNTask extends AbstractTask {
}
taskService.update(new UpdateWrapper<SchBaseTask>()
.set("task_status",TaskStatus.CREATED.getCode())
.set("point_code1",basePoint.getPoint_code()).eq("task_id",task.getTask_id()));
pointService.update(new UpdateWrapper<SchBasePoint>()
.set("ing_task_code",task.getTask_code())
.set("is_lock",true)
.set("point_status", GoodsEnum.OUT_OF_STOCK.getValue())
.eq("point_code",basePoint.getPoint_code()));
.set("point_code1",basePoint.getPoint_code())
.eq("task_id",task.getTask_id()));
}
}
@ -117,15 +112,20 @@ public class PcOperationCNTask extends AbstractTask {
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));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code,null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
);
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getVehicle_code,taskObj.getVehicle_code())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -137,20 +137,19 @@ public class PcOperationCNTask extends AbstractTask {
}
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
// 获取参数
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
taskObj.setTask_status(TaskStatus.CANCELED.getCode());

40
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java

@ -122,13 +122,6 @@ public class PcOperationSMTTask extends AbstractTask {
task.setTask_status(TaskStatus.CREATED.getCode());
TaskUtils.setUpdateByAcs(task);
taskService.updateById(task);
//更新点位
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
schBasePoint.setIng_task_code(task.getTask_code());
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
}
}
@ -169,14 +162,20 @@ public class PcOperationSMTTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(schBasePoint)) {
PointUtils.updateByIngTaskCode(schBasePoint);
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -189,18 +188,17 @@ public class PcOperationSMTTask extends AbstractTask {
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

50
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSNTTask.java

@ -68,7 +68,7 @@ public class PcOperationSNTTask extends AbstractTask {
SendVehicleVo sendVehicleVo = JSONObject.parseObject(task.getRequest_param(), SendVehicleVo.class);
//查询地面点位的载具编码
// 根据对接位查找对应的载具类型
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(sendVehicleVo.getRegion_code(),task.getVehicle_code(),"0");
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(sendVehicleVo.getRegion_code(), task.getVehicle_code(), "0");
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
@ -79,18 +79,11 @@ public class PcOperationSNTTask extends AbstractTask {
}
//删除组盘信息
schBaseVehiclematerialgroupService.remove(new QueryWrapper<SchBaseVehiclematerialgroup>()
.eq("vehicle_code",schBasePoint.getVehicle_code()));
.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);
.set("task_status", TaskStatus.CREATED.getCode())
.set("point_code2", schBasePoint.getPoint_code())
.eq("task_id", task.getTask_id()));
}
}
@ -131,17 +124,21 @@ public class PcOperationSNTTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(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::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue()));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code,taskObj.getVehicle_code()));
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code()));
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
@ -153,18 +150,17 @@ public class PcOperationSNTTask extends AbstractTask {
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

34
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/ProcessingSMTTask.java

@ -92,9 +92,6 @@ public class ProcessingSMTTask extends AbstractTask {
taskService.updateById(task);
//更新点位
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
schBasePoint.setVehicle_code(task.getVehicle_code());
schBasePoint.setIng_task_code(task.getTask_code());
schBasePoint.setIs_lock(true);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
@ -138,14 +135,20 @@ public class ProcessingSMTTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(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::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -158,18 +161,17 @@ public class ProcessingSMTTask extends AbstractTask {
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -80,11 +80,11 @@ public class SortingCMTTask extends AbstractTask {
//载具托盘号
String vehicle_code = jsonObject.getString("vehicle_code");
MdBaseVehicle vehicle_code1 = iMdBaseVehicleService.getOne(new QueryWrapper<MdBaseVehicle>().eq("vehicle_code", vehicle_code));
if(ObjectUtil.isEmpty(vehicle_code1)) throw new BadRequestException("载具不存在");
if (ObjectUtil.isEmpty(vehicle_code1)) throw new BadRequestException("载具不存在");
SchBasePoint structPoint = schBasePointService.getOne(new QueryWrapper<SchBasePoint>()
.eq("vehicle_code", vehicle_code)
.eq("point_status","2")
.eq("is_lock",false));
.eq("point_status", "2")
.eq("is_lock", false));
if (ObjectUtil.isEmpty(structPoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
@ -94,14 +94,13 @@ public class SortingCMTTask extends AbstractTask {
continue;
}
taskService.update(new UpdateWrapper<SchBaseTask>()
.set("task_status",TaskStatus.CREATED.getCode())
.set("point_code1",structPoint.getPoint_code())
.eq("task_id",task.getTask_id()));
.set("task_status", TaskStatus.CREATED.getCode())
.set("point_code1", structPoint.getPoint_code())
.set("remark", null)
.eq("task_id", task.getTask_id()));
pointService.update(new UpdateWrapper<SchBasePoint>()
.set("ing_task_code",task.getTask_code())
.set("is_lock",true)
.set("point_status", GoodsEnum.OUT_OF_STOCK.getValue())
.eq("point_code",structPoint.getPoint_code()));
.set("is_lock", true)
.eq("point_code", structPoint.getPoint_code()));
}
}
@ -141,15 +140,17 @@ public class SortingCMTTask extends AbstractTask {
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));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getVehicle_code, null));
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
String endPoint = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint);
if (ObjectUtil.isNotEmpty(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, endPoint)
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -162,18 +163,17 @@ public class SortingCMTTask extends AbstractTask {
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -60,19 +60,17 @@ public class SortingCNTTask extends AbstractTask {
TaskUtils.setUpdateByAcs(task);
// 找起点
SchBasePoint basePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_type());
if (basePoint==null){
if (basePoint == null) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
continue;
}
taskService.update(new UpdateWrapper<SchBaseTask>()
.set("task_status",TaskStatus.CREATED.getCode())
.set("point_code1",basePoint.getPoint_code()).eq("task_id",task.getTask_id()));
pointService.update(new UpdateWrapper<SchBasePoint>()
.set("ing_task_code",task.getTask_code())
.set("is_lock",true)
.set("point_status", GoodsEnum.OUT_OF_STOCK.getValue())
.eq("point_code",basePoint.getPoint_code()));
.set("task_status", TaskStatus.CREATED.getCode())
.set("point_code1", basePoint.getPoint_code())
.set("vehicle_code", basePoint.getVehicle_code())
.set("remark", null)
.eq("task_id", task.getTask_id()));
}
}
@ -113,14 +111,18 @@ public class SortingCNTTask extends AbstractTask {
// 起点清空
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));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, startPoint)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getVehicle_code, null));
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
String endPoint = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(endPoint);
if (ObjectUtil.isNotEmpty(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, endPoint)
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -133,18 +135,17 @@ public class SortingCNTTask extends AbstractTask {
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -72,8 +72,6 @@ public class SortingSMTTask extends AbstractTask {
// 获取任务
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
// 配置信息
/*SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));*/
tasks = tasks.stream().sorted(Comparator.comparing(SchBaseTask::getAcs_trace_id, Comparator.nullsLast(Comparator.naturalOrder())).reversed()).collect(Collectors.toList());
for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task);
@ -132,12 +130,6 @@ public class SortingSMTTask extends AbstractTask {
task.setRemark("");
task.setTask_status(TaskStatus.CREATED.getCode());
taskService.updateById(task);
//更新点位
schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue());
schBasePoint.setIng_task_code(task.getTask_code());
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
}
}
@ -200,16 +192,19 @@ public class SortingSMTTask extends AbstractTask {
SchBasePoint schBasePoint = pointService.selectByPointCode(startPoint);
// 起点清空
if (ObjectUtil.isNotEmpty(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));
}
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));
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.IN_STOCK.getValue())
);
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
@ -221,18 +216,17 @@ public class SortingSMTTask extends AbstractTask {
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -69,8 +69,8 @@ public class SortingSNTTask extends AbstractTask {
String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
// 根据对接位查找对应的载具类型
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(),task.getVehicle_code(),"0");
if(ObjectUtil.isEmpty(schBasePoint)) continue;
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(), "0");
if (ObjectUtil.isEmpty(schBasePoint)) continue;
jsonObject.put("vehicle_type", schBasePoint.getCan_vehicle_type());
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
@ -82,17 +82,11 @@ public class SortingSNTTask extends AbstractTask {
}
//删除组盘信息
schBaseVehiclematerialgroupService.remove(new QueryWrapper<SchBaseVehiclematerialgroup>()
.eq("vehicle_code",schBasePoint.getVehicle_code()));
.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.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue());
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
.set("task_status", TaskStatus.CREATED.getCode())
.set("point_code2", schBasePoint.getPoint_code())
.eq("task_id", task.getTask_id()));
}
}
@ -133,14 +127,18 @@ public class SortingSNTTask extends AbstractTask {
// 起点清空
if (ObjectUtil.isNotEmpty(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));
}
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)
pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code2)
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
.set(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.set(SchBasePoint::getIs_lock, false));
}
// 任务完成
@ -153,18 +151,17 @@ public class SortingSNTTask extends AbstractTask {
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code2());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
String point_code2 = taskObj.getPoint_code2();
SchBasePoint schBasePoint2 = pointService.selectByPointCode(point_code2);
if (ObjectUtil.isNotEmpty(schBasePoint2)) {
PointUtils.updateByIngTaskCode(schBasePoint2);
pointService.updateById(schBasePoint2);
SchBasePoint schBasePoint = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint)) {
schBasePoint.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint);
schBasePointService.updateById(schBasePoint);
}
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);

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

@ -63,8 +63,8 @@ public class SortingTwoCNTTask extends AbstractTask {
for (SchBaseTask task : tasks) {
// 找起点
SchBasePoint basePoint = schBasePointService.selectByEmptyCage(RegionEnum.DDLK.getRegion_code(),
VehicleTypeEnum.FRAME_R02.getVehicleCode(),GoodsEnum.EMPTY_PALLETS.getValue(),true,task);
if (basePoint==null){
VehicleTypeEnum.FRAME_R02.getVehicleCode(), GoodsEnum.EMPTY_PALLETS.getValue(), true, task);
if (basePoint == null) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
continue;
@ -75,14 +75,10 @@ public class SortingTwoCNTTask extends AbstractTask {
task.setVehicle_code(basePoint.getVehicle_code());
task.setRemark(" ");
taskService.update(task);
schBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code,basePoint.getPoint_code())
.set(SchBasePoint::getIs_lock,true)
.set(SchBasePoint::getPoint_status,GoodsEnum.OUT_OF_STOCK.getValue()));
}
}
private Long getTime(String dateString){
private Long getTime(String dateString) {
String pattern = "yyyy-MM-dd HH:mm:ss";
java.util.Date date = DateUtil.parse(dateString, pattern);
long timestamp = date.getTime();
@ -136,20 +132,15 @@ public class SortingTwoCNTTask extends AbstractTask {
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));
String point_code1 = taskObj.getPoint_code1();
SchBasePoint schBasePoint1 = pointService.selectByPointCode(point_code1);
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, point_code1)
.set(SchBasePoint::getVehicle_code, null)
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getIs_lock, false)
.set(SchBasePoint::getUpdate_time, DateUtil.now()));
}
// 任务完成
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
@ -160,20 +151,13 @@ public class SortingTwoCNTTask extends AbstractTask {
}
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);
SchBasePoint schBasePoint1 = schBasePointService.selectByPointCode(taskObj.getPoint_code1());
if (ObjectUtil.isNotEmpty(schBasePoint1)) {
schBasePoint1.setIs_lock(false);
PointUtils.setUpdateByAcs(schBasePoint1);
schBasePointService.updateById(schBasePoint1);
}
// 获取参数
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
taskObj.setTask_status(TaskStatus.CANCELED.getCode());

Loading…
Cancel
Save