代码更新
This commit is contained in:
parent
cfd2c9ba90
commit
cb54c0fdea
|
|
@ -9,6 +9,7 @@ public enum StockStatus {
|
|||
INVENTORY(2, "盘点中"),
|
||||
MOVE(3, "移库中"),
|
||||
PICKING(4, "拣选中"),
|
||||
BACK(5, "回库中"),
|
||||
LOCK(9, "库存锁定");
|
||||
|
||||
private final Integer code;
|
||||
|
|
|
|||
|
|
@ -335,6 +335,10 @@ public class TaskController {
|
|||
List<Stock> backStocks = stockService.list(new LambdaQueryWrapper<Stock>()
|
||||
.eq(Stock::getVehicleId, inTask.getVehicleId()));
|
||||
backStocks.forEach(stock -> {
|
||||
if (stock.getGoodsRelated().getRemainNum().compareTo(BigDecimal.ZERO) == 0) {
|
||||
// 库存数量为0时要删除当前库存
|
||||
stockService.removeById(stock.getStockId());
|
||||
}
|
||||
if (haveMoveTask) {
|
||||
// 后续有移库
|
||||
stock.setStockStatus(StockStatus.MOVE.getCode());
|
||||
|
|
@ -890,7 +894,7 @@ public class TaskController {
|
|||
eTaskData.setLocation(eConfig.getELocationId());
|
||||
eTaskDataList.add(eTaskData);
|
||||
// 设置工作流更新信息
|
||||
tempWork.setPickedNum(tempWork.getPickedNum().add(thisPickNum));
|
||||
// tempWork.setPickedNum(tempWork.getPickedNum().add(thisPickNum));
|
||||
tempWork.setLightStatus(1);
|
||||
realNum = realNum.subtract(thisPickNum);
|
||||
}
|
||||
|
|
@ -993,7 +997,11 @@ public class TaskController {
|
|||
return convertJsonString(response);
|
||||
}
|
||||
// 更新实际拣选数量
|
||||
workFlow.setPickedNum(workFlow.getPickedNum().add(BigDecimal.valueOf(eTaskFeedbackRequest.getConfirmNum() - eTaskFeedbackRequest.getNeedNum())));
|
||||
workFlow.setPickedNum(workFlow.getPickedNum().add(BigDecimal.valueOf(eTaskFeedbackRequest.getConfirmNum())));
|
||||
if (eTaskFeedbackRequest.getConfirmNum() < eTaskFeedbackRequest.getNeedNum()) {
|
||||
// 数量不够时,向库存要料
|
||||
// TODO
|
||||
}
|
||||
if (workFlow.getPickedNum().compareTo(workFlow.getNeedNum()) < 0) {
|
||||
// 判断后续有无物料进此站台
|
||||
List<PickTask> pickedTasks = pickTaskService.list(new LambdaQueryWrapper<PickTask>()
|
||||
|
|
@ -1105,6 +1113,25 @@ public class TaskController {
|
|||
response.setCode(ResponseCode.OK.getCode());
|
||||
response.setMessage("确认成功,放行");
|
||||
} else {
|
||||
// 处理库存偏差
|
||||
if (workConfirmRequest.getRemainNumReal().compareTo(workConfirmRequest.getRemainNumOrigin()) != 0) {
|
||||
if (workConfirmRequest.getRemainNumReal().compareTo(BigDecimal.ZERO) == 0) {// 实际剩余数量为0
|
||||
// 删除库存
|
||||
stockService.remove(new LambdaQueryWrapper<Stock>()
|
||||
.apply("goods_related -> '$.goodsId' = {0}", workConfirmRequest.getGoodsId())
|
||||
.eq(Stock::getVehicleId, pickTask.getVehicleId()));
|
||||
//
|
||||
} else {
|
||||
// 更新库存数量
|
||||
Stock existStock = stockService.getOne(new LambdaQueryWrapper<Stock>()
|
||||
.apply("goods_related -> '$.goodsId' = {0}", workConfirmRequest.getGoodsId())
|
||||
.eq(Stock::getVehicleId, pickTask.getVehicleId()));
|
||||
StockDetailInfo goodsRelated = existStock.getGoodsRelated();
|
||||
goodsRelated.setRemainNum(workConfirmRequest.getRemainNumReal());
|
||||
existStock.setGoodsRelated(goodsRelated);
|
||||
stockService.updateById(existStock);
|
||||
}
|
||||
}
|
||||
// 查询当前载具上的流转中的物料
|
||||
List<OutsideVehicles> outsideVehicles = outsideVehiclesService.list(new LambdaQueryWrapper<OutsideVehicles>()
|
||||
.eq(OutsideVehicles::getVehicleId, pickTask.getVehicleId()));
|
||||
|
|
@ -1121,7 +1148,7 @@ public class TaskController {
|
|||
}
|
||||
}
|
||||
if (goodsIdList.size() > 0) {
|
||||
// 判断这些物料是不是当前站台的工作流中人否需要
|
||||
// 判断这些物料是不是当前站台的工作流中仍然需要
|
||||
if (workFlowService.exists(new LambdaQueryWrapper<WorkFlow>()
|
||||
.eq(WorkFlow::getWorkStation, standId)
|
||||
.in(WorkFlow::getGoodsId, goodsIdList)
|
||||
|
|
@ -1636,7 +1663,14 @@ public class TaskController {
|
|||
backTask.setTaskPriority(1);
|
||||
backTask.setUserName("WMS");
|
||||
backTask.setCreateTime(LocalDateTime.now());
|
||||
if (!taskService.save(backTask)) {
|
||||
if (taskService.save(backTask)) {
|
||||
// 删除outsideVehicle表
|
||||
outsideVehiclesService.remove(new LambdaQueryWrapper<OutsideVehicles>().eq(OutsideVehicles::getVehicleId, requestBackQuery.getVehicleId()));
|
||||
// 设置库存状态为回库中
|
||||
stockService.update(new LambdaUpdateWrapper<Stock>()
|
||||
.set(Stock::getStockStatus, StockStatus.BACK.getCode())
|
||||
.eq(Stock::getVehicleId, requestBackQuery.getVehicleId()));
|
||||
} else {
|
||||
// 回退库位锁定
|
||||
locationService.update(new LambdaUpdateWrapper<Location>()
|
||||
.set(Location::getLocationStatus, LocationStatus.EMPTY.getCode())
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ public class WorkServiceImplements implements IWorkService {
|
|||
// 查找当前站台未开始的工作流
|
||||
List<WorkFlow> currentWorkFlowList = workFlowService.list(new LambdaQueryWrapper<WorkFlow>()
|
||||
.eq(WorkFlow::getWorkStation, workStation)
|
||||
.eq(WorkFlow::getWorkStatus, 0));
|
||||
.ne(WorkFlow::getWorkStatus, 2));
|
||||
// 没有可做的任务
|
||||
if (currentWorkFlowList == null || currentWorkFlowList.isEmpty()) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user