1 无工单补报工JOB针对多生产版本场景,默认使用SAP 主数据0001进行补报工
2 无工单报工,根据产线物料号为一个事务去校验生产版本是否存在
dev_temp_xw_202503310000_45843
xiangwei.zhang 4 months ago
parent f70b94e327
commit 40ad390f91

@ -828,17 +828,21 @@ public class MesWorkOrderService implements IMesWorkOrderService {
MesShift currentShift = shiftList.stream().filter(shift -> { MesShift currentShift = shiftList.stream().filter(shift -> {
String startTime = lotNo + " " + shift.getStartTime(); String startTime = lotNo + " " + shift.getStartTime();
String endTime = lotNo + " " + shift.getEndTime(); String endTime = lotNo + " " + shift.getEndTime();
if (Objects.equals(shift.getShiftCode(), "20")) { // 如果是晚班12点前结束时间要加一天如果是12点后开始时间要减一天
if (Objects.equals(shift.getShiftCode(),"20")) {
if (hours < 12) {
startTime = getDateTime(lotNo, 1) + " " + shift.getStartTime();
} else {
endTime = getDateTime(lotNo, 2) + " " + shift.getEndTime(); endTime = getDateTime(lotNo, 2) + " " + shift.getEndTime();
} }
}
Date startDate = DateUtil.parse(startTime); Date startDate = DateUtil.parse(startTime);
Date endDate = DateUtil.parse(endTime); Date endDate = DateUtil.parse(endTime);
return currentDate.getTime() > startDate.getTime() && currentDate.getTime() < endDate.getTime(); return currentDate.getTime() >= startDate.getTime() && currentDate.getTime() <= endDate.getTime();
}).findFirst().orElse(null); }).findFirst().orElse(null);
String orderDate = productionRecord.getLotNo(); String orderDate = productionRecord.getLotNo();
if (currentShift.getStartTime().compareTo(currentShift.getEndTime()) > 0) { if (currentShift.getStartTime().compareTo(currentShift.getEndTime()) > 0) {
// 如果比0点大需要找日期前一天的班次的工单号,如果是0点前date =lotNO 如果是0点后则找lot的前一天 // 如果比0点大需要找日期前一天的班次的工单号,如果是0点前date =lotNO 如果是0点后则找lot的前一天

Loading…
Cancel
Save