|
@@ -189,8 +189,12 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
BigDecimal qualifiedQuantity = BigDecimal.ZERO;
|
|
|
BigDecimal purchaseQuantity = BigDecimal.ZERO;
|
|
|
if(ObjectUtil.isNotEmpty(qualityDetailsVo)){
|
|
|
- qualifiedQuantity = qualityDetailsVo.getQualifiedQuantity();
|
|
|
- purchaseQuantity = qualityDetailsVo.getPurchaseQuantity();
|
|
|
+ if(ObjectUtil.isNotEmpty(qualityDetailsVo.getQualifiedQuantity())) {
|
|
|
+ qualifiedQuantity = qualityDetailsVo.getQualifiedQuantity();
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(qualityDetailsVo.getPurchaseQuantity())) {
|
|
|
+ purchaseQuantity = qualityDetailsVo.getPurchaseQuantity();
|
|
|
+ }
|
|
|
}
|
|
|
if(item.getShipmentQuantity().add(qualifiedQuantity).compareTo(purchaseQuantity)> 0){
|
|
|
throw new ServiceException("发货数量 + 质检合格数量 不能大于“已采购数量”");
|
|
@@ -468,13 +472,15 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
//过滤出采购数据赋值流程id
|
|
|
List<DataInfoPageVo> collect = records.stream().filter(item -> 1 == item.getBusinessType()).collect(Collectors.toList());
|
|
|
List<Long> ids = collect.stream().map(DataInfoPageVo::getBusinessId).collect(Collectors.toList());
|
|
|
- List<Purchase> purchases = purchaseService.listByIds(ids);
|
|
|
- Map<Long, Purchase> collect1 = purchases.stream().collect(Collectors.groupingBy(Purchase::getId,
|
|
|
- Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))));
|
|
|
- for (DataInfoPageVo dataInfoPageVo:collect){
|
|
|
- Purchase purchase = collect1.get(dataInfoPageVo.getBusinessId());
|
|
|
- if(ObjectUtil.isNotEmpty(purchase)) {
|
|
|
- dataInfoPageVo.setFlowId(purchase.getFlowId());
|
|
|
+ if(ObjectUtil.isNotEmpty(ids)) {
|
|
|
+ List<Purchase> purchases = purchaseService.listByIds(ids);
|
|
|
+ Map<Long, Purchase> collect1 = purchases.stream().collect(Collectors.groupingBy(Purchase::getId,
|
|
|
+ Collectors.collectingAndThen(Collectors.toList(), value -> value.get(0))));
|
|
|
+ for (DataInfoPageVo dataInfoPageVo : collect) {
|
|
|
+ Purchase purchase = collect1.get(dataInfoPageVo.getBusinessId());
|
|
|
+ if (ObjectUtil.isNotEmpty(purchase)) {
|
|
|
+ dataInfoPageVo.setFlowId(purchase.getFlowId());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return dataInfoPageVoPage;
|
|
@@ -524,6 +530,7 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
IWrapper<Object> wrapper = IWrapper.getWrapper(condition);
|
|
|
wrapper.ne("in_stock_status", 30);
|
|
|
wrapper.eq(ObjectUtil.isNotEmpty(condition.get("type")), "logistics_info.business_type", condition.get("type"));
|
|
|
+ wrapper.eq("logistics_info.status",1);
|
|
|
wrapper.like("logistics_info.`code`", condition.get("keyword"));
|
|
|
|
|
|
Page<LogisticsInfoEx> page = baseMapper.issuePage(condition.getPage(), wrapper);
|