|
@ -96,9 +96,23 @@ public class TzcPolicyApplicationServiceImpl implements TzcPolicyApplicationServ |
|
|
private final BmsRegionMapper regionMapper; |
|
|
private final BmsRegionMapper regionMapper; |
|
|
private final BmsRegion2Mapper region2Mapper; |
|
|
private final BmsRegion2Mapper region2Mapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void syncPolicy(Long policyId) { |
|
|
|
|
|
LambdaQueryWrapper<TzcPolicyItem> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(TzcPolicyItem::getPolicyId,policyId); |
|
|
|
|
|
wrapper.select(TzcPolicyItem::getId); |
|
|
|
|
|
List<TzcPolicyItem> list = tzcPolicyItemService.list(wrapper); |
|
|
|
|
|
for (TzcPolicyItem policyItem : list) { |
|
|
|
|
|
this.syncPolicyItem(policyItem.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void syncPolicyItem(Long policyItemId) { |
|
|
public void syncPolicyItem(Long policyItemId) { |
|
|
TzcPolicyItem policyItem = tzcPolicyItemService.getById(policyItemId); |
|
|
TzcPolicyItem policyItem = tzcPolicyItemService.getById(policyItemId); |
|
|
|
|
|
if(policyItem==null||!policyItem.getPolicyItemStatus().equals(TzPolicyItemStatus.Status_1_PassSuccess)){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
PolicyItemDto policyItemDto = new PolicyItemDto(); |
|
|
PolicyItemDto policyItemDto = new PolicyItemDto(); |
|
|
policyItemDto.setTitle(policyItem.getTitle()); |
|
|
policyItemDto.setTitle(policyItem.getTitle()); |
|
|
policyItemDto.setCusCode(policyItem.getSupplierCode()); |
|
|
policyItemDto.setCusCode(policyItem.getSupplierCode()); |
|
@ -111,7 +125,7 @@ public class TzcPolicyApplicationServiceImpl implements TzcPolicyApplicationServ |
|
|
//加载InvCode
|
|
|
//加载InvCode
|
|
|
List<TzcPolicyGoods> policyGoods = tzcPolicyGoodsService.listByItemId(policyItemId); |
|
|
List<TzcPolicyGoods> policyGoods = tzcPolicyGoodsService.listByItemId(policyItemId); |
|
|
Map<String,List<TzcPolicyGoods>> policyGoodsMap = policyGoods.stream().collect(Collectors.groupingBy(TzcPolicyGoods::getTargetType)); |
|
|
Map<String,List<TzcPolicyGoods>> policyGoodsMap = policyGoods.stream().collect(Collectors.groupingBy(TzcPolicyGoods::getTargetType)); |
|
|
List<String> invCodes = new ArrayList<>(); |
|
|
Set<String> invCodes = new HashSet<>(); |
|
|
for (String goodType : policyGoodsMap.keySet()) { |
|
|
for (String goodType : policyGoodsMap.keySet()) { |
|
|
List<TzcPolicyGoods> policyGoodsList = policyGoodsMap.get(goodType); |
|
|
List<TzcPolicyGoods> policyGoodsList = policyGoodsMap.get(goodType); |
|
|
List<Long> targetIds = policyGoodsList.stream().map(TzcPolicyGoods::getTargetId).collect(Collectors.toList()); |
|
|
List<Long> targetIds = policyGoodsList.stream().map(TzcPolicyGoods::getTargetId).collect(Collectors.toList()); |
|
@ -136,6 +150,9 @@ public class TzcPolicyApplicationServiceImpl implements TzcPolicyApplicationServ |
|
|
invCodes.addAll(invCodeList); |
|
|
invCodes.addAll(invCodeList); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if(invCodes.size()<1){ |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
policyItemDto.setInvCodeList(invCodes); |
|
|
policyItemDto.setInvCodeList(invCodes); |
|
|
//保存异步处理的
|
|
|
//保存异步处理的
|
|
|
R<String> result = xiaoLuTonService.savePolicyItem(policyItemDto); |
|
|
R<String> result = xiaoLuTonService.savePolicyItem(policyItemDto); |
|
|