代码更新:
1. 修改叫料逻辑
This commit is contained in:
parent
dcf4a87204
commit
ff41e06716
|
|
@ -15,15 +15,12 @@ import com.wms.service.WorkFlowService;
|
|||
import com.wms.service.WorkSummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -166,7 +163,7 @@ public class MonitorController {
|
|||
List<WorkFlow> allWorkFlows = workFlowService.list();
|
||||
List<Stand> stands = standService.list(new LambdaQueryWrapper<Stand>()
|
||||
.eq(Stand::getStandType, 2)
|
||||
.orderByAsc(Stand::getStandId));
|
||||
.orderByDesc(Stand::getStandId));
|
||||
for (Stand workStation : stands) {
|
||||
// 查询到当前的工作量
|
||||
List<WorkFlow> currentStationWorkFlowList = allWorkFlows.stream().filter(workFlow -> Objects.equals(workFlow.getWorkStation(), workStation.getStandId())).toList();
|
||||
|
|
@ -177,7 +174,7 @@ public class MonitorController {
|
|||
}
|
||||
}
|
||||
total.add(currentStationWorkFlowList.size());
|
||||
complete.add(finishingRows);
|
||||
complete.add(finishingRows/currentStationWorkFlowList.size());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
total = Collections.emptyList();
|
||||
|
|
|
|||
|
|
@ -370,6 +370,13 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
|
|||
public BigDecimal callStocks(String goodsId, BigDecimal needNum, String workStation) {
|
||||
BigDecimal originNum = needNum;// 原始数量
|
||||
try {
|
||||
// 判断当前这个料是否已经有outsideVehicles
|
||||
List<OutsideVehicles> outsideVehiclesList = outsideVehiclesService.list(new LambdaQueryWrapper<OutsideVehicles>()
|
||||
.eq(OutsideVehicles::getGoodsId, goodsId)
|
||||
.ne(OutsideVehicles::getOutStatus, 2));
|
||||
if (!outsideVehiclesList.isEmpty()) {
|
||||
return needNum;
|
||||
}
|
||||
// 查询库存,判断数量是否充足
|
||||
List<Stock> stockList = stockService.list(new LambdaQueryWrapper<Stock>()
|
||||
.eq(Stock::getStockStatus, StockStatus.OK.getCode())
|
||||
|
|
@ -390,8 +397,6 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
|
|||
StockDetailInfo goodsRelated = tempStock.getGoodsRelated();
|
||||
goodsRelated.setRemainNum(goodsRelated.getRemainNum().subtract(needNum));
|
||||
tempStock.setGoodsRelated(goodsRelated);
|
||||
waitForOutStockList.add(tempStock);
|
||||
break;
|
||||
} else {
|
||||
// 当前箱子物料剩余数量少于需求数量
|
||||
needNum = needNum.subtract(tempStock.getGoodsRelated().getRemainNum());
|
||||
|
|
@ -399,8 +404,9 @@ public class WmsTaskServiceImplements implements IWmsTaskService {
|
|||
StockDetailInfo goodsRelated = tempStock.getGoodsRelated();
|
||||
goodsRelated.setRemainNum(BigDecimal.ZERO);
|
||||
tempStock.setGoodsRelated(goodsRelated);
|
||||
waitForOutStockList.add(tempStock);
|
||||
}
|
||||
waitForOutStockList.add(tempStock);
|
||||
break;
|
||||
}
|
||||
createVehicleOutTaskAndPickTask(waitForOutStockList, workStation);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@ public class WorkServiceImplements implements IWorkService {
|
|||
private final List<String> workDoingStations = new ArrayList<>();// 当前正在执行任务的站台
|
||||
private final List<String> workFinishingStations = new ArrayList<>();// 当前正在完成任务的站台
|
||||
|
||||
// /**
|
||||
// * 新版创建工作
|
||||
// * @param workStation 工作站台
|
||||
// * @throws Exception 异常
|
||||
// */
|
||||
// @Override
|
||||
// @Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
||||
// public void createWork(String workStation) throws Exception {
|
||||
|
|
@ -294,6 +299,11 @@ public class WorkServiceImplements implements IWorkService {
|
|||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 新版开始工作
|
||||
// * @param workStation 工作站台
|
||||
// * @throws Exception 异常
|
||||
// */
|
||||
// @Override
|
||||
// @Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
|
||||
// public void doWork(String workStation) throws Exception {
|
||||
|
|
@ -572,6 +582,12 @@ public class WorkServiceImplements implements IWorkService {
|
|||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 新版完成工作
|
||||
// * @param workStation 工作站台
|
||||
// * @return 结果
|
||||
// * @throws Exception 异常
|
||||
// */
|
||||
// @Override
|
||||
// public String finishWork(String workStation) throws Exception {
|
||||
// if (workFinishingStations.contains(workStation)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user