Commit 919d2268 authored by Smile's avatar Smile
parents e9b7e996 5ccd2dc9
...@@ -438,29 +438,23 @@ public class CustomerController { ...@@ -438,29 +438,23 @@ public class CustomerController {
respVO.setPromoterName(customer1.getName()); respVO.setPromoterName(customer1.getName());
} }
} }
if (CollectionUtil.isNotEmpty(respVO.getProductList())) { // 主营类别是必须的
// 对商品数据进行分组返回
Map<Long, List<ProductRespVO>> productRespVOMap = respVO.getProductList().stream().collect(Collectors.groupingBy(ProductRespVO::getTypeId));
List<CustomerProductTypeGroupVO> products = productRespVOMap.entrySet().stream().map(entry -> {
CustomerProductTypeGroupVO productTypeGroupVO = new CustomerProductTypeGroupVO();
productTypeGroupVO.setTypeId(entry.getKey());
productTypeGroupVO.setProductIds(entry.getValue().stream().map(ProductRespVO::getId).collect(Collectors.toList()));
return productTypeGroupVO;
}).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(respVO.getProductTypeList())){ if (CollectionUtil.isNotEmpty(respVO.getProductTypeList())){
// 允许选择了主营类别,但是该主营类别下面没有对应的商品 // 允许选择了主营类别,但是该主营类别下面没有对应的商品
List<CustomerProductTypeGroupVO> products = new ArrayList<>();
for (ProductTypeRespVO typeRespVO : respVO.getProductTypeList()) { for (ProductTypeRespVO typeRespVO : respVO.getProductTypeList()) {
if (!productRespVOMap.containsKey(typeRespVO.getId())) {
CustomerProductTypeGroupVO productTypeGroupVO = new CustomerProductTypeGroupVO(); CustomerProductTypeGroupVO productTypeGroupVO = new CustomerProductTypeGroupVO();
productTypeGroupVO.setTypeId(typeRespVO.getId()); productTypeGroupVO.setTypeId(typeRespVO.getId());
if (CollectionUtil.isNotEmpty(respVO.getProductList())) {
List<Long> prodIds = respVO.getProductList().stream().filter(p -> p.getTypeId() == typeRespVO.getId()).map(ProductRespVO::getId).collect(Collectors.toList());
productTypeGroupVO.setProductIds(CollectionUtil.isEmpty(prodIds) ? new ArrayList<>() : prodIds);
} else {
productTypeGroupVO.setProductIds(new ArrayList<>()); productTypeGroupVO.setProductIds(new ArrayList<>());
products.add(productTypeGroupVO);
}
} }
products.add(productTypeGroupVO);
} }
respVO.setProducts(products); respVO.setProducts(products);
} }
//设置银行账号 //设置银行账号
CustomerBankQueryVO customerBankQueryVO = new CustomerBankQueryVO(); CustomerBankQueryVO customerBankQueryVO = new CustomerBankQueryVO();
customerBankQueryVO.setCustomerId(id); customerBankQueryVO.setCustomerId(id);
...@@ -501,25 +495,20 @@ public class CustomerController { ...@@ -501,25 +495,20 @@ public class CustomerController {
if (Objects.isNull(respVO)) { if (Objects.isNull(respVO)) {
throw exception(CUSTOMER_NOT_EXISTS); throw exception(CUSTOMER_NOT_EXISTS);
} }
if (CollectionUtil.isNotEmpty(respVO.getProductList())) { // 主营类别是必须的
// 对商品数据进行分组返回
Map<Long, List<ProductRespVO>> productRespVOMap = respVO.getProductList().stream().collect(Collectors.groupingBy(ProductRespVO::getTypeId));
List<CustomerProductTypeGroupVO> products = productRespVOMap.entrySet().stream().map(entry -> {
CustomerProductTypeGroupVO productTypeGroupVO = new CustomerProductTypeGroupVO();
productTypeGroupVO.setTypeId(entry.getKey());
productTypeGroupVO.setProductIds(entry.getValue().stream().map(ProductRespVO::getId).collect(Collectors.toList()));
return productTypeGroupVO;
}).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(respVO.getProductTypeList())){ if (CollectionUtil.isNotEmpty(respVO.getProductTypeList())){
// 允许选择了主营类别,但是该主营类别下面没有对应的商品 // 允许选择了主营类别,但是该主营类别下面没有对应的商品
List<CustomerProductTypeGroupVO> products = new ArrayList<>();
for (ProductTypeRespVO typeRespVO : respVO.getProductTypeList()) { for (ProductTypeRespVO typeRespVO : respVO.getProductTypeList()) {
if (!productRespVOMap.containsKey(typeRespVO.getId())) {
CustomerProductTypeGroupVO productTypeGroupVO = new CustomerProductTypeGroupVO(); CustomerProductTypeGroupVO productTypeGroupVO = new CustomerProductTypeGroupVO();
productTypeGroupVO.setTypeId(typeRespVO.getId()); productTypeGroupVO.setTypeId(typeRespVO.getId());
if (CollectionUtil.isNotEmpty(respVO.getProductList())) {
List<Long> prodIds = respVO.getProductList().stream().filter(p -> p.getTypeId() == typeRespVO.getId()).map(ProductRespVO::getId).collect(Collectors.toList());
productTypeGroupVO.setProductIds(CollectionUtil.isEmpty(prodIds) ? new ArrayList<>() : prodIds);
} else {
productTypeGroupVO.setProductIds(new ArrayList<>()); productTypeGroupVO.setProductIds(new ArrayList<>());
products.add(productTypeGroupVO);
}
} }
products.add(productTypeGroupVO);
} }
respVO.setProducts(products); respVO.setProducts(products);
} }
......
...@@ -2766,6 +2766,10 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -2766,6 +2766,10 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 处理未报价时,如果是已入仓产品去生成应收 // 处理未报价时,如果是已入仓产品去生成应收
isPayAdvanceException = this.addOrderReceivable(orderDO, isPayAdvanceException = this.addOrderReceivable(orderDO,
1); 1);
} else if (orderDO.getShipmentState() > 0) {
// 已出货订单修改计价都需要更新应收单
isPayAdvanceException = this.addOrderReceivable(orderDO,
1);
} else { } else {
isPayAdvanceException = this.addOrderReceivable(orderDO, isPayAdvanceException = this.addOrderReceivable(orderDO,
2); 2);
......
...@@ -905,6 +905,10 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin ...@@ -905,6 +905,10 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
// .map(BoxPreloadGoodsBackVO::getWeight) // .map(BoxPreloadGoodsBackVO::getWeight)
// .reduce(BigDecimal.ZERO, BigDecimal::add); // .reduce(BigDecimal.ZERO, BigDecimal::add);
} }
if (CollectionUtil.isNotEmpty(list) && list.size() > 0){
// 重新排序
list = list.stream().sorted(Comparator.comparing(MakeBillOfLadingListBackVO::getTidanNo)).collect(Collectors.toList());
}
map.put("totalNum", totalNum); map.put("totalNum", totalNum);
map.put("totalVolume", totalVolume); map.put("totalVolume", totalVolume);
map.put("totalWeight", totalWeight); map.put("totalWeight", totalWeight);
......
...@@ -163,6 +163,7 @@ public class BoxPreloadGoodsController { ...@@ -163,6 +163,7 @@ public class BoxPreloadGoodsController {
@PostMapping("/createAir") @PostMapping("/createAir")
@ApiOperation("创建预装货物-空运, use this") @ApiOperation("创建预装货物-空运, use this")
@Idempotent(timeout = 5)
public CommonResult<PreloadResultVO> createBoxPreloadGoodsAir(@Valid @RequestBody BoxPreloadGoodsCreateReqVO createReqVO) { public CommonResult<PreloadResultVO> createBoxPreloadGoodsAir(@Valid @RequestBody BoxPreloadGoodsCreateReqVO createReqVO) {
return success(boxPreloadGoodsService.createBoxPreloadGoodsAir(createReqVO)); return success(boxPreloadGoodsService.createBoxPreloadGoodsAir(createReqVO));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment