|
|
|
@ -3,6 +3,7 @@ package com.op.sap.service.impl;
|
|
|
|
|
import com.op.common.core.domain.R;
|
|
|
|
|
import com.op.common.core.utils.DateUtils;
|
|
|
|
|
import com.op.common.core.utils.StringUtils;
|
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
import com.op.sap.domain.vo.SapSupplierQuery;
|
|
|
|
|
import com.op.sap.domain.vo.SapWorkCenterQuery;
|
|
|
|
|
import com.op.sap.mapper.SapBomMapper;
|
|
|
|
@ -269,7 +270,8 @@ public class SapWorkCenterServiceImpl implements SapWorkCenterService {
|
|
|
|
|
|
|
|
|
|
List<SapWorkCenter> updates = new ArrayList<>();
|
|
|
|
|
for(String exsitCode:exsitCodes){
|
|
|
|
|
updates = dtos.stream().filter(dto -> dto.getArbpl().equals(exsitCode)).collect(Collectors.toList());
|
|
|
|
|
List<SapWorkCenter> updates0 = dtos.stream().filter(dto -> dto.getArbpl().equals(exsitCode)).collect(Collectors.toList());
|
|
|
|
|
updates.addAll(updates0);
|
|
|
|
|
}
|
|
|
|
|
if(!CollectionUtils.isEmpty(updates)){
|
|
|
|
|
int m = sapBomMapper.updateFactoryBatchs(updates);
|
|
|
|
@ -305,22 +307,23 @@ public class SapWorkCenterServiceImpl implements SapWorkCenterService {
|
|
|
|
|
|
|
|
|
|
List<SapSupplier> updates = new ArrayList<>();
|
|
|
|
|
for(String exsitCode:exsitCodes){
|
|
|
|
|
updates = dtos.stream().filter(dto -> dto.getLifnr().equals(exsitCode)).collect(Collectors.toList());
|
|
|
|
|
List<SapSupplier> updates0 = dtos.stream().filter(dto -> dto.getLifnr().equals(exsitCode)).collect(Collectors.toList());
|
|
|
|
|
updates.addAll(updates0);
|
|
|
|
|
}
|
|
|
|
|
if(CollectionUtils.isEmpty(updates)){
|
|
|
|
|
if(!CollectionUtils.isEmpty(updates)){
|
|
|
|
|
int m = sapBomMapper.updateSupplierBatchs(updates);
|
|
|
|
|
System.out.println("供应商更新成功条数:"+m);
|
|
|
|
|
}
|
|
|
|
|
List<SapSupplier> adds = new ArrayList<>();
|
|
|
|
|
for(String noExsitCode:noExsitCodes){
|
|
|
|
|
adds = dtos.stream().filter(dto -> dto.getLifnr().equals(noExsitCode)).collect(Collectors.toList());
|
|
|
|
|
List<SapSupplier> adds0 = dtos.stream().filter(dto -> dto.getLifnr().equals(noExsitCode)).collect(Collectors.toList());
|
|
|
|
|
adds.addAll(adds0);
|
|
|
|
|
}
|
|
|
|
|
if(CollectionUtils.isEmpty(adds)){
|
|
|
|
|
//工厂parentId
|
|
|
|
|
/*String parentId = sapBomMapper.getParentId(adds.get(0).getBukrs());
|
|
|
|
|
if(!CollectionUtils.isEmpty(adds)){
|
|
|
|
|
|
|
|
|
|
adds.stream().forEach(e->{
|
|
|
|
|
e.setParentId(parentId);
|
|
|
|
|
});*/
|
|
|
|
|
e.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
|
});
|
|
|
|
|
int n = sapBomMapper.addSupplierBatchs(adds);
|
|
|
|
|
System.out.println("供应商新增成功条数:"+ n);
|
|
|
|
|
}
|
|
|
|
|