|
|
|
@ -42,5 +42,70 @@ public class SAPTask {
|
|
|
|
|
portService.getSAPMaterialData(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生产工单定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
*/
|
|
|
|
|
public void SAPProduceWorkTicketsDataTask(String factoryCode, Long days) {
|
|
|
|
|
String startDate = DateUtils.convertDaysToDateString(days);
|
|
|
|
|
String endDate = DateUtils.getDate();
|
|
|
|
|
SAPPortDto sapPortDto = new SAPPortDto();
|
|
|
|
|
WERKSDto werksDto = new WERKSDto();
|
|
|
|
|
List<HashMap<String, String>> factoryList = new ArrayList<>();
|
|
|
|
|
HashMap<String, String> hashMap = new HashMap<>();
|
|
|
|
|
sapPortDto.setStartDate(startDate);
|
|
|
|
|
sapPortDto.setEndDate(endDate);
|
|
|
|
|
hashMap.put("WERKS", factoryCode);
|
|
|
|
|
factoryList.add(hashMap);
|
|
|
|
|
werksDto.setItem(factoryList);
|
|
|
|
|
sapPortDto.setFactoryCodes(werksDto);
|
|
|
|
|
// System.out.println("调用2");
|
|
|
|
|
portService.getSapBaseOrderInfo(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
*设备台账定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
*/
|
|
|
|
|
public void SAPDeviceLedgerDataTask(String factoryCode, Long days) {
|
|
|
|
|
String startDate = DateUtils.convertDaysToDateString(days);
|
|
|
|
|
String endDate = DateUtils.getDate();
|
|
|
|
|
SAPPortDto sapPortDto = new SAPPortDto();
|
|
|
|
|
WERKSDto werksDto = new WERKSDto();
|
|
|
|
|
List<HashMap<String, String>> factoryList = new ArrayList<>();
|
|
|
|
|
HashMap<String, String> hashMap = new HashMap<>();
|
|
|
|
|
sapPortDto.setStartDate(startDate);
|
|
|
|
|
sapPortDto.setEndDate(endDate);
|
|
|
|
|
hashMap.put("WERKS", factoryCode);
|
|
|
|
|
factoryList.add(hashMap);
|
|
|
|
|
werksDto.setItem(factoryList);
|
|
|
|
|
sapPortDto.setFactoryCodes(werksDto);
|
|
|
|
|
// System.out.println("调用3");
|
|
|
|
|
portService.getSapDeviceLedgers(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 产品bom信息定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
*/
|
|
|
|
|
public void SAPBaseBomInfoDataTask(String factoryCode, Long days) {
|
|
|
|
|
String startDate = DateUtils.convertDaysToDateString(days);
|
|
|
|
|
String endDate = DateUtils.getDate();
|
|
|
|
|
SAPPortDto sapPortDto = new SAPPortDto();
|
|
|
|
|
WERKSDto werksDto = new WERKSDto();
|
|
|
|
|
List<HashMap<String, String>> factoryList = new ArrayList<>();
|
|
|
|
|
HashMap<String, String> hashMap = new HashMap<>();
|
|
|
|
|
sapPortDto.setStartDate(startDate);
|
|
|
|
|
sapPortDto.setEndDate(endDate);
|
|
|
|
|
hashMap.put("WERKS", factoryCode);
|
|
|
|
|
factoryList.add(hashMap);
|
|
|
|
|
werksDto.setItem(factoryList);
|
|
|
|
|
sapPortDto.setFactoryCodes(werksDto);
|
|
|
|
|
// System.out.println("调用4");
|
|
|
|
|
portService.getSapOrderBomInfo(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|