|
|
|
@ -55,6 +55,10 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
|
|
|
|
|
ArrayList<BaseMaterialInfo> baseMaterialInfoArrayList = new ArrayList<>();
|
|
|
|
|
List<HashMap<String, String>> itemList = resultVo.getO_TAB().get("item");
|
|
|
|
|
for (HashMap<String, String> map : itemList) {
|
|
|
|
|
BaseMaterialInfo baseMaterialInfo = new BaseMaterialInfo();
|
|
|
|
|
baseMaterialInfo.setMaterialCode(map.get("MATNR"));
|
|
|
|
|
List<BaseMaterialInfo> baseMaterialInfoList = baseMaterialInfoService.selectBaseMaterialInfoList(baseMaterialInfo);
|
|
|
|
|
if (!baseMaterialInfoList.isEmpty()){
|
|
|
|
|
BaseMaterialInfo materialInfo = new BaseMaterialInfo();
|
|
|
|
|
materialInfo.setMaterialCode(map.get("MATNR"));
|
|
|
|
|
materialInfo.setMaterialName(map.get("MAKTX"));
|
|
|
|
@ -64,6 +68,7 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
|
|
|
|
|
baseMaterialInfoService.insertBaseMaterialInfo(materialInfo);
|
|
|
|
|
baseMaterialInfoArrayList.add(materialInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return baseMaterialInfoArrayList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -76,7 +81,7 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
|
|
|
|
|
ArrayList<BaseOrderInfo> baseOrderInfoList = new ArrayList<>();
|
|
|
|
|
List<HashMap<String, String>> itemList = resultVo.getO_TAB().get("item");
|
|
|
|
|
for (HashMap<String, String> map : itemList) {
|
|
|
|
|
int item = 0;
|
|
|
|
|
|
|
|
|
|
String aufnr = map.get("AUFNR");
|
|
|
|
|
BaseOrderInfo boInfo = new BaseOrderInfo();
|
|
|
|
|
boInfo.setOrderCode(aufnr);
|
|
|
|
@ -116,23 +121,12 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
|
|
|
|
|
public ArrayList<BaseDeviceLedger> insertSAPDeviceLedger(SAPResultVo resultVo) throws ParseException {
|
|
|
|
|
ArrayList<BaseDeviceLedger> baseDeviceLedgerArrayList = new ArrayList<>();
|
|
|
|
|
List<HashMap<String, String>> itemList = resultVo.getO_TAB().get("item");
|
|
|
|
|
BaseDeviceLedger device = new BaseDeviceLedger();
|
|
|
|
|
for (HashMap<String, String> map : itemList) {
|
|
|
|
|
int item = 0;
|
|
|
|
|
BaseDeviceLedger device = new BaseDeviceLedger();
|
|
|
|
|
device.setDeviceCode(map.get("EQUNR"));
|
|
|
|
|
List<BaseDeviceLedger> baseDeviceLedgers = baseDeviceLedgerService.selectBaseDeviceLedgerList(device);
|
|
|
|
|
//查出值进行比对 如果数据库中已有该字段则忽略本次数据
|
|
|
|
|
for (int i=0;i<baseDeviceLedgers.size();i++){
|
|
|
|
|
if (baseDeviceLedgers.get(i).getCostCenter().equals(map.get("KOSTL"))&&
|
|
|
|
|
baseDeviceLedgers.get(i).getDeviceCode().equals(map.get("EQUNR"))
|
|
|
|
|
&&baseDeviceLedgers.get(i).getFactoryCode().equals(map.get("IWERK"))
|
|
|
|
|
&&baseDeviceLedgers.get(i).getCostCenter()!=null
|
|
|
|
|
&&baseDeviceLedgers.get(i).getFactoryCode()!=null
|
|
|
|
|
&&baseDeviceLedgers.get(i).getDeviceCode()!=null){
|
|
|
|
|
//忽略标识
|
|
|
|
|
item = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (item==0){
|
|
|
|
|
|
|
|
|
|
if (!baseDeviceLedgers.isEmpty()){
|
|
|
|
|
BaseDeviceLedger deviceLedger = new BaseDeviceLedger();
|
|
|
|
|
deviceLedger.setCostCenter(map.get("KOSTL"));//
|
|
|
|
|
deviceLedger.setFactoryCode(map.get("IWERK"));
|
|
|
|
@ -157,20 +151,26 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService {
|
|
|
|
|
List<HashMap<String, String>> itemList = resultVo.getO_TAB().get("item");
|
|
|
|
|
|
|
|
|
|
for (HashMap<String, String> map : itemList) {
|
|
|
|
|
OrderBomInfo orderBomInfo = new OrderBomInfo();
|
|
|
|
|
orderBomInfo.setFactoryCode(map.get("WERKS"));
|
|
|
|
|
orderBomInfo.setParentId(map.get("MATNR"));
|
|
|
|
|
orderBomInfo.setMaterialCode(map.get("IDNRK"));
|
|
|
|
|
if (!map.get("MENGE").isEmpty()){
|
|
|
|
|
orderBomInfo.setStandardAmount(Long.parseLong(map.get("MENGE")));
|
|
|
|
|
}
|
|
|
|
|
orderBomInfo.setCreatedTime(DateUtils.getNowDate());
|
|
|
|
|
OrderBomInfo orderBomInfo1 = new OrderBomInfo();
|
|
|
|
|
orderBomInfo1.setBomCode(map.get("IDNRK"));
|
|
|
|
|
List<OrderBomInfo> orderBomInfos = orderBomInfoService.selectOrderBomInfoList(orderBomInfo1);
|
|
|
|
|
if (!orderBomInfos.isEmpty()) {
|
|
|
|
|
OrderBomInfo orderBomInfo = new OrderBomInfo();
|
|
|
|
|
orderBomInfo.setFactoryCode(map.get("WERKS"));
|
|
|
|
|
orderBomInfo.setParentId(map.get("MATNR"));
|
|
|
|
|
orderBomInfo.setMaterialCode(map.get("IDNRK"));
|
|
|
|
|
if (!map.get("MENGE").isEmpty()) {
|
|
|
|
|
orderBomInfo.setStandardAmount(Long.parseLong(map.get("MENGE")));
|
|
|
|
|
}
|
|
|
|
|
orderBomInfo.setVbeln(map.get("VBELN"));
|
|
|
|
|
orderBomInfo.setVbpos(map.get("VBPOS"));
|
|
|
|
|
orderBomInfo.setCreatedTime(DateUtils.getNowDate());
|
|
|
|
|
// baseBomInfo.setCreatedBy(SecurityUtils.getLoginUser().getUsername());
|
|
|
|
|
orderBomInfoService.insertOrderBomInfo(orderBomInfo);
|
|
|
|
|
orderBomInfoList.add(orderBomInfo);
|
|
|
|
|
orderBomInfoService.insertOrderBomInfo(orderBomInfo);
|
|
|
|
|
orderBomInfoList.add(orderBomInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return orderBomInfoList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|