|
|
@@ -115,7 +115,7 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
|
|
|
|
|
|
List<RegionRule> regionRuleList = regionRuleService.list();
|
|
|
- Map<String, RegionRule> regionRules = regionRuleList.stream().collect(Collectors.toMap(RegionRule::getSuffix, i -> i));
|
|
|
+ Map<String, RegionRule> regionRules = regionRuleList.stream().collect(Collectors.toMap(RegionRule::getShipToName, i -> i));
|
|
|
List<DestRule> destRuleList = destRuleService.list();
|
|
|
Map<String, String> destRules = destRuleList.stream().collect(Collectors.toMap(DestRule::getDestination, DestRule::getSchedule));
|
|
|
List<ReasonRule> reasonRuleList = reasonRuleService.list();
|
|
|
@@ -130,7 +130,7 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
//通过后缀匹配国别规则
|
|
|
String model = delayProduct.getModel().trim();
|
|
|
String suffix = model.substring(model.length() - 3);
|
|
|
- RegionRule regionRule = regionRules.get(suffix);
|
|
|
+ RegionRule regionRule = regionRules.get(delayProduct.getShipToName());
|
|
|
if(regionRule==null) continue;
|
|
|
delayProduct.setRegion(regionRule.getRegion());
|
|
|
|
|
|
@@ -152,7 +152,11 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
delayProduct.setOverdueDays(days);
|
|
|
}
|
|
|
// 计算要求完成周别
|
|
|
- String week = "W" + delayProduct.getDueDate().get(WeekFields.ISO.weekOfYear());
|
|
|
+// String week = "W" + delayProduct.getDueDate().get(WeekFields.ISO.weekOfYear());
|
|
|
+// delayProduct.setWeek(week);
|
|
|
+
|
|
|
+ // 根据bucket计算周别
|
|
|
+ String week = "W" + Integer.valueOf(delayProduct.getBucket().substring(4));
|
|
|
delayProduct.setWeek(week);
|
|
|
|
|
|
reasonRules.forEach((reason,rule)->{
|
|
|
@@ -162,6 +166,7 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
delayProduct.setDept(rule.getDept());
|
|
|
String newRemark = matcher.replaceAll(rule.getRemark());
|
|
|
delayProduct.setRemark(newRemark);
|
|
|
+ delayProduct.setCategory(rule.getCategory());
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -169,6 +174,7 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
if(delayProduct.getRemark() == null && delayProduct.getOverdueDays() != null && delayProduct.getOverdueDays() > 0) {
|
|
|
delayProduct.setRemark("生产");
|
|
|
delayProduct.setDept("生产");
|
|
|
+ delayProduct.setCategory("Production");
|
|
|
}
|
|
|
|
|
|
if(toolRules.get(delayProduct.getTool())!=null){
|
|
|
@@ -204,7 +210,7 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
for (int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) {
|
|
|
sheet = workbook.getSheetAt(sheetNum);
|
|
|
//第二行为表头
|
|
|
- Row headerRow = sheet.getRow(1);
|
|
|
+ Row headerRow = sheet.getRow(0);
|
|
|
if (headerRow == null) {
|
|
|
throw new RuntimeException("未找到表头行");
|
|
|
}
|
|
|
@@ -288,6 +294,7 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
String finalDest = getCellValueAsString(row.getCell(columnIndices.get("Final Dest.")));
|
|
|
String comment1 = getCellValueAsString(row.getCell(columnIndices.get("Comment1")));
|
|
|
String comment2 = getCellValueAsString(row.getCell(columnIndices.get("Comment2")));
|
|
|
+ String shipToName = getCellValueAsString(row.getCell(columnIndices.get("Ship To Name")));
|
|
|
|
|
|
dateColumnIndices.forEach((date, columnIndex) -> {
|
|
|
Cell cell = row.getCell(columnIndex);
|
|
|
@@ -304,6 +311,7 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
.setModel(model)
|
|
|
.setBucket(bucket)
|
|
|
.setFinalDest(finalDest)
|
|
|
+ .setShipToName(shipToName)
|
|
|
.setComment1(comment1)
|
|
|
.setComment2(comment2)
|
|
|
.setPst(getDateFromMonthDayStr(date))
|
|
|
@@ -694,8 +702,10 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
detailVo.setDueDate(delayProduct.getDueDate().format(DateTimeFormatter.ofPattern("MM/dd")));
|
|
|
LocalDate endDate = delayProduct.getPst();
|
|
|
LocalDate startDate = delayProduct.getDueDate();
|
|
|
- while(endDate.isAfter(startDate)){
|
|
|
- int startWeek = startDate.get(WeekFields.ISO.weekOfYear());
|
|
|
+ //不通过生产日期判断影响周别,通过订单bucket对应周别来判断起始影响周
|
|
|
+ int startWeek = Integer.valueOf(delayProduct.getBucket().substring(4));
|
|
|
+ do{
|
|
|
+// int startWeek = startDate.get(WeekFields.ISO.weekOfYear());
|
|
|
if(startWeek== currentWeek -3){
|
|
|
detailVo.setWeek1(detailVo.getPo());
|
|
|
} else if (startWeek== currentWeek -2) {
|
|
|
@@ -710,7 +720,8 @@ public class ProdPlanServiceImpl extends ServiceImpl<ProdPlanMapper, ProdPlan> i
|
|
|
detailVo.setWeek6(detailVo.getPo());
|
|
|
}
|
|
|
startDate = startDate.plusWeeks(1l);
|
|
|
- }
|
|
|
+ startWeek++;
|
|
|
+ }while(endDate.isAfter(startDate));
|
|
|
detailVoList.add(detailVo);
|
|
|
});
|
|
|
|