|
|
@ -117,15 +117,24 @@ public class MesPackageRoundnessService implements IRoundnessStrategy {
|
|
|
|
if (qty < roundQty) {
|
|
|
|
if (qty < roundQty) {
|
|
|
|
//4.查看客户排序信息钟的最早的一条过点时间 + 生产组最晚生成时间是否已到达当前时间
|
|
|
|
//4.查看客户排序信息钟的最早的一条过点时间 + 生产组最晚生成时间是否已到达当前时间
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
sortInfoList = sortInfoList.stream().sorted((sortInfo1, sortInfo2) -> {
|
|
|
|
// sortInfoList = sortInfoList.stream().sorted((sortInfo1, sortInfo2) -> {
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
if (sdf.parse(sortInfo1.getMatchTime()).after(sdf.parse(sortInfo2.getMatchTime()))) {
|
|
|
|
// if (sdf.parse(sortInfo1.getMatchTime()).after(sdf.parse(sortInfo2.getMatchTime()))) {
|
|
|
|
return 1;
|
|
|
|
// return 1;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
} catch (ParseException e) {
|
|
|
|
// } catch (ParseException e) {
|
|
|
|
log.error("解析匹配时间报错:{}", e.getMessage());
|
|
|
|
// log.error("解析匹配时间报错:{}", e.getMessage());
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
return -1;
|
|
|
|
// return -1;
|
|
|
|
|
|
|
|
// }).collect(Collectors.toList());
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 2024/10/24 by Castle需要根据custOrderNo升序设置productSeq
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
sortInfoList = sortInfoList.stream().sorted((sortInfo1, sortInfo2) -> {
|
|
|
|
|
|
|
|
if (Long.parseLong(sortInfo1.getCustOrderCode().substring(3)) > Long.parseLong(sortInfo2.getCustOrderCode().substring(3))) {
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
sortInfo = sortInfoList.get(0);
|
|
|
|
sortInfo = sortInfoList.get(0);
|
|
|
@ -187,7 +196,6 @@ public class MesPackageRoundnessService implements IRoundnessStrategy {
|
|
|
|
log.error("按包装圆整出错:MesPackageRoundnessService:{}", e.getMessage());
|
|
|
|
log.error("按包装圆整出错:MesPackageRoundnessService:{}", e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void doCreateWorkOrder(MesPartProdGroup partProdGroup, MesPartProdGroupDetail mesPartProdGroupDetail, MesPartSap partSap, MesCustSortInfo sortInfo) throws ParseException {
|
|
|
|
private void doCreateWorkOrder(MesPartProdGroup partProdGroup, MesPartProdGroupDetail mesPartProdGroupDetail, MesPartSap partSap, MesCustSortInfo sortInfo) throws ParseException {
|
|
|
|
|
|
|
|
|
|
|
|
String organizeCode = partProdGroup.getOrganizeCode();
|
|
|
|
String organizeCode = partProdGroup.getOrganizeCode();
|
|
|
@ -245,15 +253,21 @@ public class MesPackageRoundnessService implements IRoundnessStrategy {
|
|
|
|
int hours = calendar.get(Calendar.HOUR_OF_DAY);
|
|
|
|
int hours = calendar.get(Calendar.HOUR_OF_DAY);
|
|
|
|
|
|
|
|
|
|
|
|
int minutes = calendar.get(Calendar.MINUTE);
|
|
|
|
int minutes = calendar.get(Calendar.MINUTE);
|
|
|
|
String shiftTime = String.format("%02d:%02d", hours, minutes);
|
|
|
|
long shiftTime = Long.parseLong(String.format("%02d:%02d:00", hours, minutes).replaceAll(":",""));
|
|
|
|
if (!shiftList.isEmpty()) {
|
|
|
|
if (!shiftList.isEmpty()) {
|
|
|
|
for (MesShift shift : shiftList) {
|
|
|
|
for (MesShift shift : shiftList) {
|
|
|
|
String startTime = shift.getStartTime().replace(":", "");
|
|
|
|
long startTime = Long.parseLong(shift.getStartTime().replaceAll(":", ""));
|
|
|
|
String endTime = shift.getEndTime().replace(":", "");
|
|
|
|
long endTime = Long.parseLong(shift.getEndTime().replaceAll(":", ""));
|
|
|
|
if ((shiftTime.compareTo(startTime) >= 0) && (shiftTime.compareTo(endTime) <= 0)) {
|
|
|
|
if (startTime < endTime){
|
|
|
|
mesWorkOrder.setShiftName(shift.getShiftName());
|
|
|
|
if (shiftTime > startTime && shiftTime < endTime) {
|
|
|
|
mesWorkOrder.setShiftCode(shift.getShiftCode());
|
|
|
|
mesWorkOrder.setShiftName(shift.getShiftName());
|
|
|
|
break;
|
|
|
|
mesWorkOrder.setShiftCode(shift.getShiftCode());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
if (shiftTime < startTime && shiftTime > endTime) {
|
|
|
|
|
|
|
|
mesWorkOrder.setShiftName(shift.getShiftName());
|
|
|
|
|
|
|
|
mesWorkOrder.setShiftCode(shift.getShiftCode());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|