Browse Source

1.干线bug修复

dist.1.3.0
zhenghaoyu 6 months ago
parent
commit
9de3d450d3
  1. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml
  2. 42
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataClientMapper.xml

@ -101,6 +101,8 @@
from logpm_basicdata_client lbc
left join logpm_basicdata_store_contact lbsc on lbsc.shop_id = lbc.id
where lbc.id = #{clientId}
order by lbsc.default_type desc
limit 1
</select>
<select id="pageList" resultType="com.logpm.basicdata.vo.BasicdataClientVO">
SELECT

42
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -1787,18 +1787,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Set<String> importStandardOuPaiDTOSet = importStandardOuPaiDTOS.stream().map(ImportStandardOuPaiDTO::getOrderPackageCode).collect(Collectors.toSet());
//把pacakgeDetailExcelDTOS中的元素的orderPackageCode属性分组
Map<String, Long> orderPackageCodeCounts = importStandardOuPaiDTOS.stream()
.collect(Collectors.groupingBy(ImportStandardOuPaiDTO::getOrderPackageCode, Collectors.counting()));
Set<String> duplicateOrderPackageCodes = orderPackageCodeCounts.entrySet().stream()
.filter(entry -> entry.getValue() > 1)
.map(Map.Entry::getKey)
.collect(Collectors.toSet());
if(!duplicateOrderPackageCodes.isEmpty()){
log.warn("#################importStandardOuPai: 包条码重复 {}",duplicateOrderPackageCodes);
return R.fail(405, "包条码重复"+duplicateOrderPackageCodes);
}
// Map<String, Long> orderPackageCodeCounts = importStandardOuPaiDTOS.stream()
// .collect(Collectors.groupingBy(ImportStandardOuPaiDTO::getOrderPackageCode, Collectors.counting()));
//
// Set<String> duplicateOrderPackageCodes = orderPackageCodeCounts.entrySet().stream()
// .filter(entry -> entry.getValue() > 1)
// .map(Map.Entry::getKey)
// .collect(Collectors.toSet());
//
// if(!duplicateOrderPackageCodes.isEmpty()){
// log.warn("#################importStandardOuPai: 包条码重复 {}",duplicateOrderPackageCodes);
// return R.fail(405, "包条码重复"+duplicateOrderPackageCodes);
// }
List<String> orderPackageCodeKeys = new ArrayList<>(importStandardOuPaiDTOSet);
@ -1818,6 +1818,20 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
hasOrderPackageCodeList.addAll(hasOrderPackageCodes);
});
List<TrunklineAdvanceDetailEntity> updateMaterialList = new ArrayList<>();
//把importStandardOuPaiDTOS转化成orderPackageCode为key的Map
Map<String, ImportStandardOuPaiDTO> importStandardOuPaiDTOMap = importStandardOuPaiDTOS.stream().collect(Collectors.toMap(ImportStandardOuPaiDTO::getOrderPackageCode, Function.identity(), (a, b) -> a));
List<TrunklineAdvanceDetailEntity> hasAdvanceDetailList = advanceDetailService.findListByOrderPackageCodeList(hasOrderPackageCodeList);
hasAdvanceDetailList.forEach(advanceDetailEntity -> {
ImportStandardOuPaiDTO importStandardOuPaiDTO = importStandardOuPaiDTOMap.get(advanceDetailEntity.getOrderPackageCode());
TrunklineAdvanceDetailEntity updateMaterialEntity = new TrunklineAdvanceDetailEntity();
updateMaterialEntity.setId(advanceDetailEntity.getId());
updateMaterialEntity.setMaterialCode(importStandardOuPaiDTO.getMaterialCode());
updateMaterialEntity.setMaterialName(importStandardOuPaiDTO.getMaterialName());
updateMaterialList.add(updateMaterialEntity);
});
//排除importStandardOuPaiDTOS中orderPackageCode在hasOrderPackageCodeList中存在的元素
importStandardOuPaiDTOS = importStandardOuPaiDTOS.stream().filter(item -> !hasOrderPackageCodeList.contains(item.getOrderPackageCode())).collect(Collectors.toList());
@ -2077,6 +2091,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
carsLoadAsyncService.sendRabbitMessageLoadScanData(advanceEntityList);
}
if(CollUtil.isNotEmpty(updateMaterialList)){
advanceDetailService.updateBatchById(updateMaterialList);
}
int successNum = advanceDetailEntities.size();
return R.success("成功导入"+successNum+"条");

Loading…
Cancel
Save