|
|
|
@ -0,0 +1,46 @@
|
|
|
|
|
package com.aucma.api.task;
|
|
|
|
|
|
|
|
|
|
import com.aucma.api.domain.dto.SAPPortDto;
|
|
|
|
|
import com.aucma.api.domain.dto.WERKSDto;
|
|
|
|
|
import com.aucma.api.service.ISAPPortService;
|
|
|
|
|
import com.aucma.common.utils.DateUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author YinQ
|
|
|
|
|
* @create 2023-10-08 9:11
|
|
|
|
|
*/
|
|
|
|
|
@Component("SAPTask")
|
|
|
|
|
public class SAPTask {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISAPPortService portService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SAP物料主数据定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
*/
|
|
|
|
|
public void SAPMaterialDataTask(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);
|
|
|
|
|
portService.getSAPMaterialData(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|