update - 缺陷接口

master
yinq 12 months ago
parent 96ea56545f
commit 6dc7d4ac7c

@ -99,6 +99,7 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
boInfo.setMaterialCode(map.get("MATNR")); boInfo.setMaterialCode(map.get("MATNR"));
boInfo.setFactoryCode(map.get("WERKS")); boInfo.setFactoryCode(map.get("WERKS"));
List<BaseOrderInfo> baseOrderInfos = baseOrderInfoService.selectBaseOrderInfoList(boInfo); List<BaseOrderInfo> baseOrderInfos = baseOrderInfoService.selectBaseOrderInfoList(boInfo);
//首次存SAP计划
if (baseOrderInfos.isEmpty()) { if (baseOrderInfos.isEmpty()) {
BaseOrderInfo baseOrderInfo = new BaseOrderInfo(); BaseOrderInfo baseOrderInfo = new BaseOrderInfo();
baseOrderInfo.setOrderCode(map.get("AUFNR")); baseOrderInfo.setOrderCode(map.get("AUFNR"));
@ -124,14 +125,42 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
calendarInfo.setSchedulingDate(baseOrderInfo.getBeginDate()); calendarInfo.setSchedulingDate(baseOrderInfo.getBeginDate());
calendarInfo.setPlanAmount(baseOrderInfo.getOrderAmount()); calendarInfo.setPlanAmount(baseOrderInfo.getOrderAmount());
calendarInfoService.insertCalendarInfo(calendarInfo); calendarInfoService.insertCalendarInfo(calendarInfo);
baseOrderInfoService.insertBaseOrderInfo(baseOrderInfo); baseOrderInfoService.insertBaseOrderInfo(baseOrderInfo);
baseOrderInfoList.add(baseOrderInfo); baseOrderInfoList.add(baseOrderInfo);
} }else {
//更新SAP计划
BaseOrderInfo baseOrderInfo = baseOrderInfos.get(0);
if (baseOrderInfo.getIsRelease() == 0){
//SAP计划已下达到工位不更新数据
continue;
}
baseOrderInfo.setOrderStatus(map.get("STTXT"));
baseOrderInfo.setSaleOrderCode(map.get("KDAUF"));
baseOrderInfo.setMaterialName(map.get("MAKTX"));
if (!map.get("GAMNG").equals(null)) {
baseOrderInfo.setOrderAmount(new BigDecimal(map.get("GAMNG")));
}
baseOrderInfo.setOrderType(map.get("AUART"));
baseOrderInfo.setBeginDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("GLTRP")));
baseOrderInfo.setEndDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("GSTRP")));
baseOrderInfoService.updateBaseOrderInfo(baseOrderInfo);
// 同步生产日历
CalendarInfo calendar = new CalendarInfo();
calendar.setSapPlanCode(baseOrderInfo.getOrderCode());
List<CalendarInfo> calendarInfos = calendarInfoService.selectCalendarInfoList(calendar);
if (calendarInfos.size() == 1){
CalendarInfo calendarInfo = calendarInfos.get(0);
calendarInfo.setMaterialName(baseOrderInfo.getMaterialName());
calendarInfo.setPlanStartDate(baseOrderInfo.getBeginDate());
calendarInfo.setPlanEndDate(baseOrderInfo.getEndDate());
calendarInfo.setSchedulingDate(baseOrderInfo.getBeginDate());
calendarInfo.setPlanAmount(baseOrderInfo.getOrderAmount());
baseOrderInfoService.updateBaseOrderInfo(baseOrderInfo);
}
}
} }
return baseOrderInfoList; return baseOrderInfoList;
} }

Loading…
Cancel
Save