代码更新:增加库区
This commit is contained in:
parent
97c0e80317
commit
f596f46b72
|
|
@ -7,6 +7,7 @@ public enum TaskInValidationEnum {
|
|||
OK(""),
|
||||
NO_REQUEST_BODY("请求参数为空"),
|
||||
NO_VEHICLE_ID("载具号为空"),
|
||||
NO_AREA_ID("未选择入库库区"),
|
||||
DUPLICATE_VEHICLE_ID("载具号重复入库"),
|
||||
NO_IN_POINT("起点站台为空"),
|
||||
ERROR_IN_POINT("错误的起点站台"),
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ package com.wms.constants.enums;
|
|||
public enum TaskOutValidationEnum {
|
||||
OK(""),
|
||||
NO_REQUEST_BODY("请求参数为空"),
|
||||
NO_AREA_ID("未选择入库库区"),
|
||||
LACK_REQUIRED_PARAM("缺少必须参数:物料、载具、起始库位至少需要一个"),
|
||||
ERROR_VEHICLE_ID("不存在的载具号"),
|
||||
ERROR_VEHICLE_STATUS("载具不是在库状态,不可出库"),
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.wms.controller;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.wms.constants.enums.*;
|
||||
import com.wms.entity.app.ResponseEntity;
|
||||
import com.wms.entity.app.dto.TaskDto;
|
||||
|
|
@ -61,13 +62,13 @@ public class JobComponent {
|
|||
// 检索任务表---新建未下发的任务
|
||||
LambdaQueryWrapper<Task> waitForDistributeTaskQuery = new LambdaQueryWrapper<Task>()
|
||||
.eq(Task::getTaskStatus, WmsTaskStatus.NEW.getCode());
|
||||
List<TaskDto> allTasks = BeanUtil.copyToList(taskService.list(waitForDistributeTaskQuery), TaskDto.class);
|
||||
List<Task> allTasks = taskService.list(waitForDistributeTaskQuery);
|
||||
// 需要发送给wcs的任务列表
|
||||
List<WcsTaskRequest> request = new ArrayList<>();
|
||||
// 已经下发的任务组列表
|
||||
List<String> taskGroupIds = new ArrayList<>();
|
||||
if (!allTasks.isEmpty()) {
|
||||
for (TaskDto task : allTasks) {
|
||||
for (Task task : allTasks) {
|
||||
if (StringUtils.isNotEmpty(task.getPreTask())) {// 当前任务具有前置任务
|
||||
// 查询一下前置的任务有没有存在,存在则不下发
|
||||
if (taskService.exists(new LambdaQueryWrapper<Task>().eq(Task::getTaskId, task.getPreTask()))) {
|
||||
|
|
@ -76,7 +77,7 @@ public class JobComponent {
|
|||
}
|
||||
if (taskGroupIds.contains(task.getTaskGroup())) {
|
||||
// 已经发送过的任务组,直接设置状态
|
||||
task.setTaskStatus(WmsTaskStatus.WAIT.getCode());
|
||||
continue;
|
||||
}
|
||||
// 创建发送的任务
|
||||
WcsTaskRequest tempTask = new WcsTaskRequest();
|
||||
|
|
@ -93,7 +94,6 @@ public class JobComponent {
|
|||
tempTask.setWeight(task.getWeight());
|
||||
tempTask.setPriority(task.getTaskPriority());
|
||||
request.add(tempTask);
|
||||
task.setTaskStatus(WmsTaskStatus.WAIT.getCode());
|
||||
// 已经发送过的任务组
|
||||
taskGroupIds.add(task.getTaskGroup());
|
||||
}
|
||||
|
|
@ -111,13 +111,12 @@ public class JobComponent {
|
|||
logger.error("插入日志错误");
|
||||
}
|
||||
if (result != null && Objects.equals(ResponseCode.OK.getCode(), result.getCode())) {
|
||||
taskService.saveBatch(BeanUtil.copyToList(allTasks, Task.class));
|
||||
taskService.update(new LambdaUpdateWrapper<Task>()
|
||||
.set(Task::getTaskStatus, WmsTaskStatus.WAIT.getCode())
|
||||
.in(Task::getTaskGroup, taskGroupIds)
|
||||
.eq(Task::getTaskStatus, WmsTaskStatus.NEW.getCode()));
|
||||
} else {
|
||||
if (result != null) {
|
||||
logger.error("存在错误:{}", result.getMessage());
|
||||
} else {
|
||||
logger.error("请求无返回");
|
||||
}
|
||||
logger.error("发送任务错误:{}", convertJsonString(result));
|
||||
}
|
||||
} else {
|
||||
logger.error("WCS发送任务地址为空");
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ public class RecordController {
|
|||
//更新条件
|
||||
LambdaQueryWrapper<TaskRecord> lambdaQueryWrapper = new LambdaQueryWrapper<TaskRecord>()
|
||||
.eq(taskRecordQuery.getTaskType() != null, TaskRecord::getTaskType, taskRecordQuery.getTaskType())
|
||||
.eq(taskRecordQuery.getAreaId() != null && taskRecordQuery.getAreaId() != 0, TaskRecord::getAreaId, taskRecordQuery.getAreaId())
|
||||
.like(StringUtils.isNotEmpty(taskRecordQuery.getVehicleId()), TaskRecord::getVehicleId, taskRecordQuery.getVehicleId())
|
||||
.apply(StringUtils.isNotEmpty(taskRecordQuery.getGoodsId()), "goods_related ->> '$.goodsId' like concat('%', {0}, '%')", taskRecordQuery.getGoodsId())
|
||||
.apply(StringUtils.isNotEmpty(taskRecordQuery.getGoodsName()), "goods_related ->> '$.goodsName' like concat('%', {0}, '%')", taskRecordQuery.getGoodsName());
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ public class StockController {
|
|||
.like(StringUtils.isNotEmpty(stockQuery.getVehicleId()), Stock::getVehicleId, stockQuery.getVehicleId())
|
||||
.eq(StringUtils.isNotEmpty(stockQuery.getLocationId()), Stock::getLocationId, stockQuery.getLocationId())
|
||||
.eq(stockQuery.getStockStatus() != null, Stock::getStockStatus, stockQuery.getStockStatus())
|
||||
.eq(stockQuery.getAreaId() != null && stockQuery.getAreaId() != 0, Stock::getAreaId, stockQuery.getAreaId())
|
||||
.apply(StringUtils.isNotEmpty(stockQuery.getGoodsId()), "goods_related ->> '$.goodsId' like concat('%', {0}, '%')", stockQuery.getGoodsId())
|
||||
.apply(StringUtils.isNotEmpty(stockQuery.getGoodsName()), "goods_related ->> '$.goodsId' like concat('%', {0}, '%')", stockQuery.getGoodsName()));
|
||||
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ public class TaskController {
|
|||
}
|
||||
Map<String, String> nextLocationMap = new HashMap<>();
|
||||
// 请求可用库位
|
||||
for (int i = 0; i < locationService.count(new LambdaQueryWrapper<Location>().eq(Location::getLocationStatus, LocationStatus.EMPTY.getCode())); i++) {
|
||||
Map<String, String> resultMap = locationService.getOneLocation(taskInRequest.getOriginPoint(), null);
|
||||
for (int i = 0; i < locationService.count(new LambdaQueryWrapper<Location>().eq(Location::getAreaId, taskInRequest.getAreaId()).eq(Location::getLocationStatus, LocationStatus.EMPTY.getCode())); i++) {
|
||||
Map<String, String> resultMap = locationService.getOneLocation(taskInRequest.getOriginPoint(), null, taskInRequest.getAreaId());
|
||||
if (resultMap.isEmpty() || !resultMap.containsKey("nextLocationId")) {
|
||||
logger.error("暂无可用库位");
|
||||
response.setCode(ResponseCode.ERROR.getCode());
|
||||
|
|
@ -189,6 +189,7 @@ public class TaskController {
|
|||
tempInTask.setCreateTime(LocalDateTime.now());
|
||||
tempInTask.setUserName(taskInRequest.getUserName());
|
||||
tempInTask.setPreTask(preTaskId);
|
||||
tempInTask.setAreaId(taskInRequest.getAreaId());
|
||||
try {
|
||||
if (!taskService.save(tempInTask)) {
|
||||
return "添加空入库任务失败";
|
||||
|
|
@ -235,10 +236,9 @@ public class TaskController {
|
|||
goodsRelatedInfo.setOpNum(goodsInRequest.getGoodsNum());
|
||||
goodsRelatedInfo.setOriginNum(BigDecimal.ZERO);
|
||||
tempInTask.setGoodsRelated(goodsRelatedInfo);
|
||||
|
||||
tempInTask.setAreaId(taskInRequest.getAreaId());
|
||||
tempTasks.add(tempInTask);
|
||||
}
|
||||
|
||||
try {
|
||||
if (!taskService.saveBatch(tempTasks)) {
|
||||
return "添加入库任务失败";
|
||||
|
|
@ -265,6 +265,10 @@ public class TaskController {
|
|||
if (StringUtils.isEmpty(taskInRequest.getVehicleId())) {
|
||||
return TaskInValidationEnum.NO_VEHICLE_ID.getErrorMessage();
|
||||
}
|
||||
// 验证库区
|
||||
if (taskInRequest.getAreaId() == null || taskInRequest.getAreaId() <= 0) {
|
||||
return TaskInValidationEnum.NO_AREA_ID.getErrorMessage();
|
||||
}
|
||||
// 验证载具号是否重复入库
|
||||
if (vehicleService.exists(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getVehicleId, taskInRequest.getVehicleId())
|
||||
.and(wrapper -> wrapper.eq(Vehicle::getVehicleStatus, VehicleStatus.ON.getCode())
|
||||
|
|
@ -380,15 +384,16 @@ public class TaskController {
|
|||
private String genVehicleLocationOutTask(TaskOutRequest taskOutRequest) {
|
||||
// 查询对应载具
|
||||
if (StringUtils.isNotEmpty(taskOutRequest.getVehicleId())) {
|
||||
Vehicle currentVehicle = vehicleService.getOne(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getVehicleId, taskOutRequest.getVehicleId()));
|
||||
Vehicle currentVehicle = vehicleService.getOne(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getAreaId, taskOutRequest.getAreaId()).eq(Vehicle::getVehicleId, taskOutRequest.getVehicleId()));
|
||||
// 创建空出库任务
|
||||
Task vehicleOutTask = new Task();
|
||||
vehicleOutTask.setTaskId(generateId("CK_"));
|
||||
vehicleOutTask.setAreaId(taskOutRequest.getAreaId());
|
||||
vehicleOutTask.setTaskType(TaskType.OUT.getCode());
|
||||
vehicleOutTask.setTaskGroup(generateId(""));
|
||||
vehicleOutTask.setTaskStatus(WmsTaskStatus.NEW.getCode());
|
||||
vehicleOutTask.setTaskPriority(1);
|
||||
TaskDto moveTask = taskService.genMoveTask(currentVehicle.getCurrentLocation());
|
||||
TaskDto moveTask = taskService.genMoveTask(currentVehicle.getCurrentLocation(), currentVehicle.getAreaId());
|
||||
if (moveTask != null) {
|
||||
if (moveTask.getTaskId().equals("LOCKED")) {
|
||||
return "外层库位上锁,无法出库";
|
||||
|
|
@ -413,15 +418,16 @@ public class TaskController {
|
|||
.eq(Vehicle::getVehicleId, taskOutRequest.getVehicleId()));
|
||||
} else {
|
||||
// 查找对应库位
|
||||
Location currentLocation = locationService.getOne(new LambdaQueryWrapper<Location>().eq(Location::getLocationId, taskOutRequest.getOriginPoint()));
|
||||
Location currentLocation = locationService.getOne(new LambdaQueryWrapper<Location>().eq(Location::getAreaId, taskOutRequest.getAreaId()).eq(Location::getLocationId, taskOutRequest.getOriginPoint()));
|
||||
// 创建空出库任务
|
||||
Task vehicleOutTask = new Task();
|
||||
vehicleOutTask.setTaskId(generateId("CK_"));
|
||||
vehicleOutTask.setAreaId(taskOutRequest.getAreaId());
|
||||
vehicleOutTask.setTaskType(TaskType.OUT.getCode());
|
||||
vehicleOutTask.setTaskGroup(generateId(""));
|
||||
vehicleOutTask.setTaskStatus(WmsTaskStatus.NEW.getCode());
|
||||
vehicleOutTask.setTaskPriority(1);
|
||||
TaskDto moveTask = taskService.genMoveTask(currentLocation.getLocationId());
|
||||
TaskDto moveTask = taskService.genMoveTask(currentLocation.getLocationId(), currentLocation.getAreaId());
|
||||
if (moveTask != null) {
|
||||
if (moveTask.getTaskId().equals("LOCKED")) {
|
||||
return "外层库位上锁,无法出库";
|
||||
|
|
@ -457,6 +463,7 @@ public class TaskController {
|
|||
private String genGoodsOutTask(TaskOutRequest taskOutRequest) {
|
||||
// 查询库存
|
||||
LambdaQueryWrapper<Stock> stockQueryWrapper = new LambdaQueryWrapper<Stock>()
|
||||
.eq(Stock::getAreaId, taskOutRequest.getAreaId())
|
||||
.apply("goods_related -> '$.goodsId' = {0}", taskOutRequest.getGoodsId())
|
||||
.apply("goods_related -> '$.remainNum' > 0")
|
||||
.eq(StringUtils.isNotEmpty(taskOutRequest.getVehicleId()), Stock::getVehicleId, taskOutRequest.getVehicleId())
|
||||
|
|
@ -491,11 +498,12 @@ public class TaskController {
|
|||
// 创建出库任务
|
||||
Task vehicleOutTask = new Task();
|
||||
vehicleOutTask.setTaskId(generateId("CK_"));
|
||||
vehicleOutTask.setAreaId(stock.getAreaId());
|
||||
vehicleOutTask.setTaskType(TaskType.OUT.getCode());
|
||||
vehicleOutTask.setTaskGroup(generateId(""));
|
||||
vehicleOutTask.setTaskStatus(WmsTaskStatus.NEW.getCode());
|
||||
vehicleOutTask.setTaskPriority(1);
|
||||
TaskDto moveTask = taskService.genMoveTask(stock.getLocationId());
|
||||
TaskDto moveTask = taskService.genMoveTask(stock.getLocationId(), stock.getAreaId());
|
||||
if (moveTask != null) {
|
||||
if (moveTask.getTaskId().equals("LOCKED")) {
|
||||
continue;
|
||||
|
|
@ -526,6 +534,7 @@ public class TaskController {
|
|||
Task vehicleOutTask = new Task();
|
||||
vehicleOutTask.setTaskId(generateId("CK_"));
|
||||
vehicleOutTask.setTaskType(TaskType.OUT.getCode());
|
||||
vehicleOutTask.setAreaId(stock.getAreaId());
|
||||
if (sameVehicleTask != null) {
|
||||
vehicleOutTask.setTaskGroup(sameVehicleTask.getTaskGroup());
|
||||
vehicleOutTask.setTaskStatus(sameVehicleTask.getTaskStatus());
|
||||
|
|
@ -535,7 +544,7 @@ public class TaskController {
|
|||
vehicleOutTask.setTaskGroup(generateId(""));
|
||||
vehicleOutTask.setTaskStatus(WmsTaskStatus.NEW.getCode());
|
||||
vehicleOutTask.setTaskPriority(1);
|
||||
TaskDto moveTask = taskService.genMoveTask(stock.getLocationId());
|
||||
TaskDto moveTask = taskService.genMoveTask(stock.getLocationId(), stock.getAreaId());
|
||||
if (moveTask != null) {
|
||||
if (moveTask.getTaskId().equals("LOCKED")) {
|
||||
continue;
|
||||
|
|
@ -582,6 +591,10 @@ public class TaskController {
|
|||
if (taskOutRequest == null) {
|
||||
return TaskOutValidationEnum.NO_REQUEST_BODY.getErrorMessage();
|
||||
}
|
||||
// 库区号必填
|
||||
if (taskOutRequest.getAreaId() == null || taskOutRequest.getAreaId() <= 0) {
|
||||
return TaskOutValidationEnum.NO_AREA_ID.getErrorMessage();
|
||||
}
|
||||
// 验证是否包含请求信息
|
||||
if (StringUtils.isEmpty(taskOutRequest.getGoodsId())
|
||||
&& StringUtils.isEmpty(taskOutRequest.getVehicleId())
|
||||
|
|
@ -695,6 +708,7 @@ public class TaskController {
|
|||
// 查询这个物料有没有库存
|
||||
// TODO 查询条件根据项目要求调整
|
||||
Stock existStock = stockService.getOne(new LambdaQueryWrapper<Stock>()
|
||||
.eq(Stock::getAreaId, inTask.getAreaId())
|
||||
.apply("goods_related -> '$.goodsId' = {0}", inTask.getGoodsRelated().getGoodsId())
|
||||
.eq(Stock::getVehicleId, inTask.getVehicleId()));
|
||||
if (existStock != null) {
|
||||
|
|
@ -708,6 +722,7 @@ public class TaskController {
|
|||
} else {
|
||||
Stock newStock = new Stock();
|
||||
newStock.setStockId(generateId("ST_"));
|
||||
newStock.setAreaId(inTask.getAreaId());
|
||||
newStock.setVehicleId(inTask.getVehicleId());
|
||||
newStock.setLocationId(inTask.getDestination());
|
||||
newStock.setNoUseDays(0);
|
||||
|
|
@ -746,6 +761,7 @@ public class TaskController {
|
|||
if (currentVehicle == null) {
|
||||
// 添加载具
|
||||
Vehicle newVehicle = new Vehicle();
|
||||
newVehicle.setAreaId(inTask.getAreaId());
|
||||
newVehicle.setVehicleId(inTask.getVehicleId());
|
||||
newVehicle.setVehicleType(1);
|
||||
newVehicle.setVehicleStatus(VehicleStatus.ON.getCode());
|
||||
|
|
@ -802,11 +818,13 @@ public class TaskController {
|
|||
// 当前载具上所有库存状态设置为拣选
|
||||
stockService.update(new LambdaUpdateWrapper<Stock>()
|
||||
.set(Stock::getStockStatus, StockStatus.PICKING.getCode())
|
||||
.eq(Stock::getAreaId, outTask.getAreaId())
|
||||
.eq(Stock::getVehicleId, outTask.getVehicleId())
|
||||
.ne(Stock::getStockStatus, StockStatus.PICKING.getCode()));
|
||||
// 当前载具设置为出库中状态
|
||||
vehicleService.update(new LambdaUpdateWrapper<Vehicle>()
|
||||
.set(Vehicle::getVehicleStatus, VehicleStatus.OUT.getCode())
|
||||
.eq(Vehicle::getAreaId, outTask.getAreaId())
|
||||
.eq(Vehicle::getVehicleId, outTask.getVehicleId())
|
||||
.ne(Vehicle::getVehicleStatus, VehicleStatus.OUT.getCode()));
|
||||
} else {
|
||||
|
|
@ -817,13 +835,14 @@ public class TaskController {
|
|||
// 删除移库任务
|
||||
taskService.remove(new LambdaQueryWrapper<Task>().eq(Task::getTaskId, outTask.getTaskId()));
|
||||
// 删除当前载具上所有库存
|
||||
stockService.remove(new LambdaQueryWrapper<Stock>().eq(Stock::getVehicleId, outTask.getVehicleId()));
|
||||
stockService.remove(new LambdaQueryWrapper<Stock>().eq(Stock::getAreaId, outTask.getAreaId()).eq(Stock::getVehicleId, outTask.getVehicleId()));
|
||||
// 删除载具
|
||||
vehicleService.remove(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getVehicleId, outTask.getVehicleId()));
|
||||
vehicleService.remove(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getAreaId, outTask.getAreaId()).eq(Vehicle::getVehicleId, outTask.getVehicleId()));
|
||||
}
|
||||
// 释放原来的库位
|
||||
locationService.update(new LambdaUpdateWrapper<Location>()
|
||||
.set(Location::getLocationStatus, LocationStatus.EMPTY.getCode())
|
||||
.eq(Location::getAreaId, outTask.getAreaId())
|
||||
.eq(Location::getLocationId, outTask.getOrigin()));
|
||||
}
|
||||
}
|
||||
|
|
@ -841,6 +860,7 @@ public class TaskController {
|
|||
.set(Stock::getStockStatus, StockStatus.OK.getCode())
|
||||
.set(Stock::getLastUpdateTime, LocalDateTime.now())
|
||||
.set(Stock::getLastUpdateUser, moveTask.getUserName())
|
||||
.eq(Stock::getAreaId, moveTask.getAreaId())
|
||||
.eq(Stock::getVehicleId, moveTask.getVehicleId())
|
||||
.eq(Stock::getStockStatus, StockStatus.MOVE.getCode());
|
||||
stockService.update(lambdaUpdateWrapperOfStock);
|
||||
|
|
@ -937,6 +957,7 @@ public class TaskController {
|
|||
//更新条件
|
||||
LambdaQueryWrapper<Task> lambdaQueryWrapper = new LambdaQueryWrapper<Task>()
|
||||
.eq(taskQuery.getTaskType() != null, Task::getTaskType, taskQuery.getTaskType())
|
||||
.eq(taskQuery.getAreaId() != null && taskQuery.getAreaId() != 0, Task::getAreaId, taskQuery.getAreaId())
|
||||
.eq(taskQuery.getTaskStatus() != null, Task::getTaskStatus, taskQuery.getTaskStatus())
|
||||
.like(StringUtils.isNotEmpty(taskQuery.getVehicleId()), Task::getVehicleId, taskQuery.getVehicleId())
|
||||
.apply(StringUtils.isNotEmpty(taskQuery.getGoodsId()), "goods_related ->> '$.goodsId' like concat('%', {0}, '%')", taskQuery.getGoodsId())
|
||||
|
|
@ -969,6 +990,7 @@ public class TaskController {
|
|||
try {
|
||||
//更新条件
|
||||
LambdaQueryWrapper<Task> lambdaQueryWrapper = new LambdaQueryWrapper<Task>()
|
||||
.eq(taskQuery.getAreaId() != null && taskQuery.getAreaId() != 0, Task::getAreaId, taskQuery.getAreaId())
|
||||
.eq(taskQuery.getTaskType() != null, Task::getTaskType, taskQuery.getTaskType())
|
||||
.eq(taskQuery.getTaskStatus() != null, Task::getTaskStatus, taskQuery.getTaskStatus())
|
||||
.eq(taskQuery.getIsPicking() != null, Task::getIsPicking, taskQuery.getIsPicking())
|
||||
|
|
@ -1021,6 +1043,7 @@ public class TaskController {
|
|||
}
|
||||
// 查询对应库存
|
||||
Stock stock = stockService.getOne(new LambdaQueryWrapper<Stock>()
|
||||
.eq(Stock::getAreaId, finishPickingRequest.getAreaId())
|
||||
.eq(Stock::getVehicleId, finishPickingRequest.getVehicleId())
|
||||
.apply("goods_related ->> '$.goodsId' = {0}", finishPickingRequest.getGoodsId()));
|
||||
// 删除当前任务,并生成任务记录
|
||||
|
|
@ -1042,7 +1065,7 @@ public class TaskController {
|
|||
Map<String, String> nextLocationMap = new HashMap<>();
|
||||
// 请求可用库位
|
||||
for (int i = 0; i < locationService.count(new LambdaQueryWrapper<Location>().eq(Location::getLocationStatus, LocationStatus.EMPTY.getCode())); i++) {
|
||||
Map<String, String> resultMap = locationService.getOneLocation(task.getDestination(), null);
|
||||
Map<String, String> resultMap = locationService.getOneLocation(task.getDestination(), null, finishPickingRequest.getAreaId());
|
||||
if (resultMap.isEmpty() || !resultMap.containsKey("nextLocationId")) {
|
||||
logger.error("暂无可用库位");
|
||||
response.setCode(ResponseCode.ERROR.getCode());
|
||||
|
|
@ -1070,6 +1093,7 @@ public class TaskController {
|
|||
// 生成入库任务
|
||||
Task tempInTask = new Task();
|
||||
tempInTask.setTaskId(generateId("HK_"));
|
||||
tempInTask.setAreaId(finishPickingRequest.getAreaId());
|
||||
tempInTask.setTaskType(TaskType.IN.getCode());
|
||||
tempInTask.setTaskStatus(WmsTaskStatus.NEW.getCode());
|
||||
tempInTask.setTaskGroup(generateId(""));
|
||||
|
|
@ -1115,6 +1139,9 @@ public class TaskController {
|
|||
|| StringUtils.isEmpty(finishPickingRequest.getGoodsId())) {
|
||||
return "请求缺少必须信息,请检查任务号+载具+物料组合是否齐全。";
|
||||
}
|
||||
if (finishPickingRequest.getAreaId() == null || finishPickingRequest.getAreaId() <= 0) {
|
||||
return "缺少库区编号";
|
||||
}
|
||||
LambdaQueryWrapper<Task> taskLambdaQueryWrapperById = new LambdaQueryWrapper<Task>()
|
||||
.eq(Task::getTaskId, finishPickingRequest.getTaskId())
|
||||
.eq(Task::getVehicleId, finishPickingRequest.getVehicleId())
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ public class StockDto {
|
|||
* 库位ID
|
||||
*/
|
||||
private String locationId;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
private Integer areaId;
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -79,4 +79,8 @@ public class TaskDto {
|
|||
* 拣选站台
|
||||
*/
|
||||
private String pickStand;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,4 +76,8 @@ public class TaskRecordDto {
|
|||
* 拣选站台
|
||||
*/
|
||||
private String pickStand;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,4 +32,8 @@ public class VehicleDto {
|
|||
* 额外信息
|
||||
*/
|
||||
private VehicleDetailInfo details;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,4 +38,9 @@ public class FinishPickingRequest {
|
|||
*/
|
||||
@JsonProperty("userName")
|
||||
private String userName;
|
||||
/**
|
||||
* 库区
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ public class StandQuery extends PageQuery {
|
|||
*/
|
||||
@JsonProperty("standId")
|
||||
private String standId;
|
||||
/**
|
||||
* 区域号
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
/**
|
||||
* 站台是否锁定
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ public class StockQuery extends PageQuery {
|
|||
private String goodsId;
|
||||
@JsonProperty("goodsName")
|
||||
private String goodsName;
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
|
||||
/**
|
||||
* 根据客户端查询生成数据库查询条件
|
||||
|
|
@ -34,6 +36,7 @@ public class StockQuery extends PageQuery {
|
|||
stockPO.setLocationId(locationId);// 库位号
|
||||
stockPO.setStockStatus(stockStatus);// 库存状态
|
||||
stockPO.setVehicleId(vehicleId);// 载具号
|
||||
stockPO.setAreaId(areaId);// 区域号
|
||||
if (StringUtils.isNotEmpty(goodsId) || StringUtils.isNotEmpty(goodsName) || goodsStatus != null) {// 包含物料详细信息
|
||||
StockDetailInfo goodsRelatedPO = new StockDetailInfo();
|
||||
goodsRelatedPO.setGoodsId(goodsId);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ public class TaskInRequest {
|
|||
*/
|
||||
@JsonProperty("vehicleId")
|
||||
private String vehicleId;
|
||||
/**
|
||||
* 区域号
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
/**
|
||||
* 起点
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,28 +1,55 @@
|
|||
package com.wms.entity.app.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TaskOutRequest {
|
||||
/**
|
||||
* 料号
|
||||
*/
|
||||
@JsonProperty("goodsId")
|
||||
private String goodsId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@JsonProperty("goodsNum")
|
||||
private BigDecimal goodsNum;
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
@JsonProperty("vehicleId")
|
||||
private String vehicleId;
|
||||
/**
|
||||
* 起点
|
||||
*/
|
||||
@JsonProperty("originPoint")
|
||||
private String originPoint;
|
||||
/**
|
||||
* 终点
|
||||
*/
|
||||
@JsonProperty("destinationPoint")
|
||||
private String destinationPoint;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@JsonProperty("userName")
|
||||
private String userName;
|
||||
/**
|
||||
* 是否拣选
|
||||
*/
|
||||
@JsonProperty("isPicking")
|
||||
private Integer isPicking;
|
||||
/**
|
||||
* 拣选站台
|
||||
*/
|
||||
@JsonProperty("pickStand")
|
||||
private String pickStand;
|
||||
/**
|
||||
* 区域号
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ public class TaskQuery extends PageQuery {
|
|||
private Integer taskStatus;
|
||||
@JsonProperty("isPicking")
|
||||
private Integer isPicking;
|
||||
/**
|
||||
* 区域号
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
|
||||
/**
|
||||
* 根据客户端查询生成数据库查询条件
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ public class TaskRecordQuery extends PageQuery {
|
|||
private String goodsId;
|
||||
@JsonProperty("goodsName")
|
||||
private String goodsName;
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
|
||||
/**
|
||||
* 根据客户端查询生成数据库查询条件
|
||||
|
|
@ -29,6 +31,7 @@ public class TaskRecordQuery extends PageQuery {
|
|||
TaskRecord recordPO = new TaskRecord();
|
||||
recordPO.setTaskType(taskType);// 任务类型
|
||||
recordPO.setVehicleId(vehicleId);// 载具号
|
||||
recordPO.setAreaId(areaId);
|
||||
if (StringUtils.isNotEmpty(goodsId) || StringUtils.isNotEmpty(goodsName)) {// 包含物料详细信息
|
||||
TaskDetailInfo goodsRelatedPO = new TaskDetailInfo();
|
||||
goodsRelatedPO.setGoodsId(goodsId);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ public class StockVo {
|
|||
*/
|
||||
@JsonProperty("stockId")
|
||||
private String stockId;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
/**
|
||||
* 库位ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.wms.entity.app.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.wms.entity.app.dto.extend.TaskDetailInfo;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -79,4 +80,9 @@ public class TaskRecordVO {
|
|||
* 拣选站台
|
||||
*/
|
||||
private String pickStand;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.wms.entity.app.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.wms.entity.app.dto.extend.TaskDetailInfo;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -79,4 +80,9 @@ public class TaskVO {
|
|||
* 拣选站台
|
||||
*/
|
||||
private String pickStand;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.wms.entity.app.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.wms.entity.app.dto.extend.VehicleDetailInfo;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -11,25 +12,36 @@ public class VehicleVO {
|
|||
/**
|
||||
* 载具编号
|
||||
*/
|
||||
@JsonProperty("vehicleId")
|
||||
private String vehicleId;
|
||||
/**
|
||||
* 当前所在位置
|
||||
*/
|
||||
@JsonProperty("currentLocation")
|
||||
private String currentLocation;
|
||||
/**
|
||||
* 载具状态
|
||||
*/
|
||||
@JsonProperty("vehicleStatus")
|
||||
private Integer vehicleStatus;
|
||||
/**
|
||||
* 是否是空箱
|
||||
*/
|
||||
@JsonProperty("isEmpty")
|
||||
private Integer isEmpty;
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
@JsonProperty("vehicleType")
|
||||
private Integer vehicleType;
|
||||
/**
|
||||
* 额外信息
|
||||
*/
|
||||
@JsonProperty("details")
|
||||
private VehicleDetailInfo details;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@JsonProperty("areaId")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ public class Stock {
|
|||
*/
|
||||
@TableField(value = "location_id")
|
||||
private String locationId;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@TableField(value = "area_id")
|
||||
private Integer areaId;
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -101,4 +101,9 @@ public class Task {
|
|||
*/
|
||||
@TableField(value = "pick_stand")
|
||||
private String pickStand;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@TableField(value = "area_id")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,4 +98,9 @@ public class TaskRecord {
|
|||
*/
|
||||
@TableField(value = "pick_stand")
|
||||
private String pickStand;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@TableField(value = "area_id")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,4 +43,9 @@ public class Vehicle {
|
|||
*/
|
||||
@TableField(value = "details", typeHandler = Fastjson2TypeHandler.class)
|
||||
private VehicleDetailInfo details;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@TableField(value = "area_id")
|
||||
private Integer areaId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ public interface LocationService extends IService<Location> {
|
|||
* 查找一个可用库位
|
||||
* @param inPoint 入库站点
|
||||
* @param goodsId 物料编号--可选
|
||||
* @param areaId 库区
|
||||
* @return 结果 nextLocationId, preTaskId
|
||||
*/
|
||||
Map<String, String> getOneLocation(String inPoint, String goodsId);
|
||||
Map<String, String> getOneLocation(String inPoint, String goodsId, int areaId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ public interface TaskService extends IService<Task> {
|
|||
/**
|
||||
* 生成移库任务
|
||||
* @param locationId 要出库的库位号
|
||||
* @param areaId 库区
|
||||
* @return 深度-1的移库任务
|
||||
*/
|
||||
TaskDto genMoveTask(String locationId);
|
||||
TaskDto genMoveTask(String locationId, int areaId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ public class LocationServiceImplements extends ServiceImpl<LocationMapper, Locat
|
|||
* nextLocationId, preTaskId
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> getOneLocation(String inPoint, String goodsId) {
|
||||
public Map<String, String> getOneLocation(String inPoint, String goodsId, int areaId) {
|
||||
Map<String, String> resultMap = new HashMap<>();
|
||||
// 查找对应站台
|
||||
LambdaQueryWrapper<Location> locationQueryWrapper = new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getAreaId, 2)
|
||||
.eq(Location::getAreaId, areaId)
|
||||
.eq(Location::getLocationStatus, 0)
|
||||
.eq(Location::getLocationType, 1)
|
||||
.eq(Location::getIsLock, 0);
|
||||
|
|
@ -74,6 +74,7 @@ public class LocationServiceImplements extends ServiceImpl<LocationMapper, Locat
|
|||
// 选择最近未使用的设备
|
||||
LambdaQueryWrapper<Stand> LRUStandQueryWrapper = new LambdaQueryWrapper<Stand>()
|
||||
.select(Stand::getStandId, Stand::getEquipmentId)
|
||||
.eq(Stand::getAreaId, areaId)
|
||||
.eq(Stand::getStandStatus, 0)
|
||||
.eq(Stand::getIsLock, 0)
|
||||
.eq(Stand::getStandType, 3)
|
||||
|
|
|
|||
|
|
@ -48,15 +48,20 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
private final VehicleMapper vehicleMapper;
|
||||
|
||||
@Override
|
||||
public TaskDto genMoveTask(String locationId) {
|
||||
Location outLocation = locationMapper.selectOne(new LambdaQueryWrapper<Location>().eq(Location::getLocationId, locationId));
|
||||
public TaskDto genMoveTask(String locationId, int areaId) {
|
||||
Location outLocation = locationMapper.selectOne(new LambdaQueryWrapper<Location>().eq(Location::getAreaId, areaId).eq(Location::getLocationId, locationId));
|
||||
if (outLocation != null) {
|
||||
if (outLocation.getWDepth() == 1) {
|
||||
return null;
|
||||
} else {
|
||||
// 生成当前深度-1的库位的移库任务
|
||||
TaskDto depthMinus1MoveTask = new TaskDto();
|
||||
Location depthMinus1Location = locationMapper.selectOne(new LambdaQueryWrapper<Location>().eq(Location::getLocationId, outLocation.getLocationId()));
|
||||
Location depthMinus1Location = locationMapper.selectOne(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getAreaId, outLocation.getAreaId())
|
||||
.eq(Location::getWRow, outLocation.getWRow())
|
||||
.eq(Location::getWCol, outLocation.getWCol())
|
||||
.eq(Location::getWLayer, outLocation.getWLayer())
|
||||
.eq(Location::getWDepth, outLocation.getWDepth() - 1));
|
||||
if (depthMinus1Location.getIsLock() == 1) {// 外层库位锁定
|
||||
depthMinus1MoveTask.setTaskId("LOCKED");
|
||||
return depthMinus1MoveTask;
|
||||
|
|
@ -66,6 +71,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
// 查看这个库位是否有入库任务
|
||||
Task depthMinusIn1Task = taskMapper.selectOne(new LambdaQueryWrapper<Task>()
|
||||
.eq(Task::getTaskType, TaskType.IN.getCode())
|
||||
.eq(Task::getAreaId, depthMinus1Location.getAreaId())
|
||||
.eq(Task::getDestination, depthMinus1Location.getLocationId()));
|
||||
if (depthMinusIn1Task != null) {
|
||||
// 生成移库任务,并把移库任务的前置任务设置为该入库任务
|
||||
|
|
@ -75,16 +81,19 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
// 对应载具所有库存上锁
|
||||
stockMapper.update(new LambdaUpdateWrapper<Stock>()
|
||||
.set(Stock::getStockStatus, StockStatus.MOVE.getCode())
|
||||
.eq(Stock::getAreaId, depthMinus1Location.getAreaId())
|
||||
.eq(Stock::getLocationId, depthMinus1Location.getLocationId()));
|
||||
// 对应载具状态设置
|
||||
vehicleMapper.update(new LambdaUpdateWrapper<Vehicle>()
|
||||
.set(Vehicle::getVehicleStatus, VehicleStatus.MOVE.getCode())
|
||||
.eq(Vehicle::getAreaId, depthMinus1Location.getAreaId())
|
||||
.eq(Vehicle::getCurrentLocation, depthMinus1Location.getLocationId()));
|
||||
depthMinus1MoveTask.setTaskId(moveTask.getTaskId());
|
||||
return depthMinus1MoveTask;
|
||||
} else {
|
||||
// 判断是否有出库、移库、盘点、拣选等任务
|
||||
Task depthMinusOut1Task = taskMapper.selectOne(new LambdaQueryWrapper<Task>()
|
||||
.eq(Task::getAreaId, depthMinus1Location.getAreaId())
|
||||
.eq(Task::getOrigin, depthMinus1Location.getLocationId()));
|
||||
if (depthMinusOut1Task != null) {
|
||||
depthMinus1MoveTask.setTaskId(depthMinusOut1Task.getTaskId());
|
||||
|
|
@ -92,7 +101,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
// 生成移库任务,并把移库任务的前置任务设置为该入库任务
|
||||
Task moveTask = genMoveTask(depthMinus1Location);
|
||||
// 判断当前深度-2的库位是否有移库任务
|
||||
TaskDto depthMinus2MoveTask = genMoveTask(depthMinus1Location.getLocationId());
|
||||
TaskDto depthMinus2MoveTask = genMoveTask(depthMinus1Location.getLocationId(), areaId);
|
||||
if (depthMinus2MoveTask.getTaskId().equals("LOCKED")) {
|
||||
depthMinus1MoveTask.setTaskId("LOCKED");
|
||||
return depthMinus1MoveTask;
|
||||
|
|
@ -102,10 +111,12 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
// 对应载具所有库存上锁
|
||||
stockMapper.update(new LambdaUpdateWrapper<Stock>()
|
||||
.set(Stock::getStockStatus, StockStatus.MOVE.getCode())
|
||||
.eq(Stock::getAreaId, depthMinus1Location.getAreaId())
|
||||
.eq(Stock::getLocationId, depthMinus1Location.getLocationId()));
|
||||
// 对应载具状态设置
|
||||
vehicleMapper.update(new LambdaUpdateWrapper<Vehicle>()
|
||||
.set(Vehicle::getVehicleStatus, VehicleStatus.MOVE.getCode())
|
||||
.eq(Vehicle::getAreaId, depthMinus1Location.getAreaId())
|
||||
.eq(Vehicle::getCurrentLocation, depthMinus1Location.getLocationId()));
|
||||
depthMinus1MoveTask.setTaskId(moveTask.getTaskId());
|
||||
}
|
||||
|
|
@ -113,7 +124,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
}
|
||||
} else {
|
||||
// 生成当前深度-2的库位的移库任务,即当前深度-1的库位作为参数
|
||||
TaskDto depthMinus2MoveTask = genMoveTask(depthMinus1Location.getLocationId());
|
||||
TaskDto depthMinus2MoveTask = genMoveTask(depthMinus1Location.getLocationId(), areaId);
|
||||
return StringUtils.isNotEmpty(depthMinus1MoveTask.getTaskId()) ? depthMinus1MoveTask : depthMinus2MoveTask;
|
||||
}
|
||||
}
|
||||
|
|
@ -131,6 +142,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
// 先找一个新库位,同一个设备号,但是不同的排列层
|
||||
Location newLocation = new Location();
|
||||
List<Location> availableLocations = locationMapper.selectList(new LambdaQueryWrapper<Location>()
|
||||
.eq(Location::getAreaId, originLocation.getAreaId())
|
||||
.eq(Location::getEquipmentId, originLocation.getEquipmentId())
|
||||
.eq(Location::getLocationType, originLocation.getLocationType())
|
||||
.eq(Location::getIsLock, 0)
|
||||
|
|
@ -141,6 +153,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
for (Location oneAvailableLocation : availableLocations) {
|
||||
LambdaQueryWrapper<Location> haveTaskQueryWrapper = new LambdaQueryWrapper<Location>()
|
||||
.select(Location::getLocationId)
|
||||
.eq(Location::getAreaId, oneAvailableLocation.getAreaId())
|
||||
.eq(Location::getWRow, oneAvailableLocation.getWRow())
|
||||
.eq(Location::getWCol, oneAvailableLocation.getWCol())
|
||||
.eq(Location::getWLayer, oneAvailableLocation.getWLayer());
|
||||
|
|
@ -150,9 +163,11 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
for (Location havaTaskLocation : haveTaskLocations) {
|
||||
LambdaQueryWrapper<Task> taskOutQueryWrapper = new LambdaQueryWrapper<Task>()
|
||||
.select(Task::getTaskId)
|
||||
.eq(Task::getAreaId, havaTaskLocation.getAreaId())
|
||||
.eq(Task::getOrigin, havaTaskLocation.getLocationId());
|
||||
LambdaQueryWrapper<Task> taskInQueryWrapper = new LambdaQueryWrapper<Task>()
|
||||
.select(Task::getTaskId)
|
||||
.eq(Task::getAreaId, havaTaskLocation.getAreaId())
|
||||
.eq(Task::getDestination, havaTaskLocation.getLocationId());
|
||||
if (super.count(taskOutQueryWrapper) > 0 || super.count(taskInQueryWrapper) > 0) {
|
||||
hasTasksFlag = true;
|
||||
|
|
@ -164,6 +179,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
LambdaUpdateWrapper<Location> updateLocationWrapper = new LambdaUpdateWrapper<Location>()
|
||||
.set(Location::getLocationStatus, LocationStatus.OCCUPY.getCode())
|
||||
.set(Location::getVehicleId, originLocation.getVehicleId())
|
||||
.eq(Location::getAreaId, oneAvailableLocation.getAreaId())
|
||||
.eq(Location::getLocationId, oneAvailableLocation.getLocationId())
|
||||
.eq(Location::getLocationStatus, LocationStatus.EMPTY.getCode());
|
||||
if (locationMapper.update(updateLocationWrapper) > 0) {
|
||||
|
|
@ -174,6 +190,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
if (StringUtils.isNotEmpty(newLocation.getLocationId())) {
|
||||
// 生成移库任务
|
||||
moveTask.setTaskId(WmsUtils.generateId("MOVE_"));
|
||||
moveTask.setAreaId(newLocation.getAreaId());
|
||||
moveTask.setTaskType(TaskType.MOVE.getCode());
|
||||
moveTask.setTaskPriority(1);
|
||||
moveTask.setTaskGroup(WmsUtils.generateId(""));
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ spring:
|
|||
# password: coder
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 宝开服务器--内网
|
||||
url: jdbc:mysql://192.168.3.254:3306/wms_miniload_bk7?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
username: coder
|
||||
password: coder
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 测试环境
|
||||
# url: jdbc:mysql://192.168.3.254:3306/wms_miniload_bk7_test?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
# url: jdbc:mysql://192.168.3.254:3306/wms_miniload_bk7?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
# username: coder
|
||||
# password: coder
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 测试环境
|
||||
url: jdbc:mysql://192.168.3.254:3306/wms_miniload_bk7_test?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
username: coder
|
||||
password: coder
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 从库
|
||||
# slave_1:
|
||||
# url: jdbc:mysql://localhost:3306/wms_miniload_bk7?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user