|
|
|
@ -5,6 +5,8 @@ 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 com.aucma.production.domain.BaseBomInfo;
|
|
|
|
|
import com.aucma.production.service.IBaseBomInfoService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
@ -22,42 +24,53 @@ public class SAPTask {
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISAPPortService portService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IBaseBomInfoService baseBomInfoService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SAP物料主数据定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
* @param factoryCode
|
|
|
|
|
* @param startDays
|
|
|
|
|
* @param endDays
|
|
|
|
|
*/
|
|
|
|
|
public void SAPMaterialDataTask(String factoryCode, Long days) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
|
|
|
|
|
public void SAPMaterialDataTask(String factoryCode, Long startDays, Long endDays) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
|
|
|
|
|
portService.getSAPMaterialData(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生产工单定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
* @param factoryCode
|
|
|
|
|
* @param startDays
|
|
|
|
|
* @param endDays
|
|
|
|
|
*/
|
|
|
|
|
public void SAPProduceWorkTicketsDataTask(String factoryCode, Long days) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
|
|
|
|
|
public void SAPProduceWorkTicketsDataTask(String factoryCode, Long startDays, Long endDays) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
|
|
|
|
|
portService.getSapBaseOrderInfo(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*设备台账定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
* @param factoryCode
|
|
|
|
|
* @param startDays
|
|
|
|
|
* @param endDays
|
|
|
|
|
*/
|
|
|
|
|
public void SAPDeviceLedgerDataTask(String factoryCode, Long days) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
|
|
|
|
|
public void SAPDeviceLedgerDataTask(String factoryCode, Long startDays, Long endDays) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
|
|
|
|
|
portService.getSapDeviceLedgers(sapPortDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 产品bom信息定时任务
|
|
|
|
|
*
|
|
|
|
|
* @param days 开始时间(天)
|
|
|
|
|
* @param factoryCode
|
|
|
|
|
* @param startDays
|
|
|
|
|
* @param endDays
|
|
|
|
|
*/
|
|
|
|
|
public void SAPBaseBomInfoDataTask(String factoryCode, Long days) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days);
|
|
|
|
|
public void SAPBaseBomInfoDataTask(String factoryCode, Long startDays, Long endDays) {
|
|
|
|
|
SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, startDays, endDays);
|
|
|
|
|
SAPBOMPortDto sapbomPortDto = new SAPBOMPortDto();
|
|
|
|
|
sapbomPortDto.setStartDate(sapPortDto.getStartDate());
|
|
|
|
|
sapbomPortDto.setEndDate(sapPortDto.getEndDate());
|
|
|
|
@ -66,15 +79,25 @@ public class SAPTask {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 自动同步生产BOM定时任务
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public void automaticSynchronizationBOM() {
|
|
|
|
|
baseBomInfoService.addAutomaticSynchronizationBOM(new BaseBomInfo());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 定时任务:SAP请求数据组装
|
|
|
|
|
* @param factoryCode
|
|
|
|
|
* @param days
|
|
|
|
|
* @param startDays
|
|
|
|
|
* @param endDays
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public SAPPortDto SAPRequestDataAssembly(String factoryCode, Long days) {
|
|
|
|
|
String startDate = DateUtils.convertDaysToDateString(days);
|
|
|
|
|
String endDate = DateUtils.getDate();
|
|
|
|
|
public SAPPortDto SAPRequestDataAssembly(String factoryCode, Long startDays, Long endDays) {
|
|
|
|
|
String startDate = DateUtils.convertDaysToDateString(startDays,0);
|
|
|
|
|
String endDate = DateUtils.convertDaysToDateString(endDays,1);
|
|
|
|
|
SAPPortDto sapPortDto = new SAPPortDto();
|
|
|
|
|
WERKSDto werksDto = new WERKSDto();
|
|
|
|
|
List<HashMap<String, String>> factoryList = new ArrayList<>();
|
|
|
|
|