代码更新:
1.修复入库和出库的问题
This commit is contained in:
parent
f596f46b72
commit
8b658cd2c0
|
|
@ -232,7 +232,7 @@ public class TaskController {
|
|||
TaskDetailInfo goodsRelatedInfo = new TaskDetailInfo();
|
||||
// TODO 物料信息需要完善
|
||||
goodsRelatedInfo.setGoodsId(goodsInRequest.getGoodsId());
|
||||
goodsRelatedInfo.setGoodsName("");
|
||||
goodsRelatedInfo.setGoodsName(goodsInRequest.getGoodsName());
|
||||
goodsRelatedInfo.setOpNum(goodsInRequest.getGoodsNum());
|
||||
goodsRelatedInfo.setOriginNum(BigDecimal.ZERO);
|
||||
tempInTask.setGoodsRelated(goodsRelatedInfo);
|
||||
|
|
@ -308,11 +308,12 @@ public class TaskController {
|
|||
// 验证物料编号
|
||||
if (StringUtils.isEmpty(goodsInRequest.getGoodsId())) {
|
||||
return TaskInValidationEnum.NO_GOODS_ID.getErrorMessage();
|
||||
} else {
|
||||
if (!goodsService.validateGoodsId(goodsInRequest.getGoodsId())) {
|
||||
return TaskInValidationEnum.ERROR_GOODS_ID.getErrorMessage();
|
||||
}
|
||||
}
|
||||
// } else {
|
||||
// if (!goodsService.validateGoodsId(goodsInRequest.getGoodsId())) {
|
||||
// return TaskInValidationEnum.ERROR_GOODS_ID.getErrorMessage();
|
||||
// }
|
||||
// }
|
||||
// 验证数量
|
||||
if (goodsInRequest.getGoodsNum() == null || goodsInRequest.getGoodsNum().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return TaskInValidationEnum.ERROR_GOODS_NUM.getErrorMessage();
|
||||
|
|
@ -483,7 +484,7 @@ public class TaskController {
|
|||
boolean lockVehicleFlag = vehicleService.update(new LambdaUpdateWrapper<Vehicle>()
|
||||
.set(Vehicle::getVehicleStatus, VehicleStatus.OUT.getCode())
|
||||
.eq(Vehicle::getVehicleId, stock.getVehicleId())
|
||||
.eq(Vehicle::getVehicleStatus, VehicleStatus.ON));
|
||||
.eq(Vehicle::getVehicleStatus, VehicleStatus.ON.getCode()));
|
||||
if (!lockStocksFlag || !lockVehicleFlag) {
|
||||
// 释放锁
|
||||
stockService.update(new LambdaUpdateWrapper<Stock>()
|
||||
|
|
@ -603,21 +604,21 @@ public class TaskController {
|
|||
}
|
||||
// 验证载具号
|
||||
if (StringUtils.isNotEmpty(taskOutRequest.getVehicleId())
|
||||
&& vehicleService.exists(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getVehicleId, taskOutRequest.getVehicleId()))) {
|
||||
&& !vehicleService.exists(new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getAreaId, taskOutRequest.getAreaId()).eq(Vehicle::getVehicleId, taskOutRequest.getVehicleId()))) {
|
||||
return TaskOutValidationEnum.ERROR_VEHICLE_ID.getErrorMessage();
|
||||
}
|
||||
// 验证库位
|
||||
if (StringUtils.isNotEmpty(taskOutRequest.getOriginPoint())
|
||||
&& locationService.exists(new LambdaQueryWrapper<Location>().eq(Location::getLocationId, taskOutRequest.getOriginPoint()))) {
|
||||
&& !locationService.exists(new LambdaQueryWrapper<Location>().eq(Location::getAreaId, taskOutRequest.getAreaId()).eq(Location::getLocationId, taskOutRequest.getOriginPoint()))) {
|
||||
return TaskOutValidationEnum.ERROR_ORIGIN_POINT.getErrorMessage();
|
||||
}
|
||||
// 验证终点站台
|
||||
if (taskOutRequest.getIsPicking() == 0) {// 出库
|
||||
if (!standService.validateStand(taskOutRequest.getDestinationPoint(), 2)) {
|
||||
if (!standService.validateStand(taskOutRequest.getDestinationPoint(), TaskType.OUT.getCode())) {
|
||||
return TaskOutValidationEnum.ERROR_DESTINATION_POINT.getErrorMessage();
|
||||
}
|
||||
} else {// 拣选出库
|
||||
if (!standService.validateStand(taskOutRequest.getDestinationPoint(), 3)) {
|
||||
if (!standService.validateStand(taskOutRequest.getDestinationPoint(), TaskType.INVENTORY.getCode())) {
|
||||
return TaskOutValidationEnum.ERROR_PICK_STAND.getErrorMessage();
|
||||
}
|
||||
}
|
||||
|
|
@ -628,6 +629,7 @@ public class TaskController {
|
|||
}
|
||||
// 查询库存信息
|
||||
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())
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ public class TaskServiceImplements extends ServiceImpl<TaskMapper, Task> impleme
|
|||
|
||||
/**
|
||||
* 生成一个移库任务
|
||||
*
|
||||
* @param originLocation 原库位
|
||||
* @return 生成的移库任务
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user