|
|
@@ -42,7 +42,6 @@ import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
-import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.mocha.feign.ISalesPolicyClient;
|
|
|
import org.springblade.purchase.sales.entity.OrderItems;
|
|
|
import org.springblade.purchase.sales.feign.IOrderItemsClient;
|
|
|
@@ -58,6 +57,7 @@ import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -165,8 +165,8 @@ public class GoodsDescController extends BladeController {
|
|
|
goodsDescLambdaQueryWrapper.like(!StringUtils.isBlank(code), GoodsDesc::getCode, code);
|
|
|
goodsDescLambdaQueryWrapper.eq(GoodsDesc::getTenantId, AuthUtil.getTenantId());
|
|
|
goodsDescLambdaQueryWrapper.eq(GoodsDesc::getType, 0);
|
|
|
- if (StringUtils.isNotEmpty(artsVision)){
|
|
|
- goodsDescLambdaQueryWrapper.and(i -> i.like(GoodsDesc::getArtsVision,artsVision).or().isNull(GoodsDesc::getArtsVision));
|
|
|
+ if (StringUtils.isNotEmpty(artsVision)) {
|
|
|
+ goodsDescLambdaQueryWrapper.and(i -> i.like(GoodsDesc::getArtsVision, artsVision).or().isNull(GoodsDesc::getArtsVision));
|
|
|
}
|
|
|
goodsDescLambdaQueryWrapper.orderByDesc(GoodsDesc::getCreateTime);
|
|
|
Page<GoodsDesc> page = new Page<>(current, size);
|
|
|
@@ -190,6 +190,11 @@ public class GoodsDescController extends BladeController {
|
|
|
return R.data(iPage);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/product")
|
|
|
+ public R<?> product(GoodsDesc goodsDesc) {
|
|
|
+ return R.data(goodsDescService.getProductList(goodsDesc));
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/findById")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "分页", notes = "传入goodsDesc")
|
|
|
@@ -209,12 +214,12 @@ public class GoodsDescController extends BladeController {
|
|
|
specificationWrapper.eq(GoodsSpecification::getTenantId, SecureUtil.getTenantId());
|
|
|
List<GoodsSpecification> goodsSpecificationList = goodsSpecificationService.list(specificationWrapper);
|
|
|
if (!CollectionUtils.isEmpty(priceList)) {
|
|
|
- List<GoodsPrice> sale = priceList.stream().filter(e -> e.getBillType().equals("0")).collect(Collectors.toList());
|
|
|
- List<GoodsPrice> buy = priceList.stream().filter(e -> e.getBillType().equals("1")).collect(Collectors.toList());
|
|
|
+ List<GoodsPrice> sale = priceList.stream().filter(e -> "0".equals(e.getBillType())).collect(Collectors.toList());
|
|
|
+ List<GoodsPrice> buy = priceList.stream().filter(e -> "1".equals(e.getBillType())).collect(Collectors.toList());
|
|
|
goodsDesc.setSaleGoodsPrice(sale);
|
|
|
goodsDesc.setBuyGoodsPrice(buy);
|
|
|
- goodsDesc.setFilesList(filesList);
|
|
|
}
|
|
|
+ goodsDesc.setFilesList(filesList);
|
|
|
goodsDesc.setGoodsSpecificationList(goodsSpecificationList);
|
|
|
return R.data(goodsDesc);
|
|
|
}
|
|
|
@@ -338,7 +343,7 @@ public class GoodsDescController extends BladeController {
|
|
|
selectChildById(goodsId, goodsIdList);
|
|
|
goodsIdList.add(goodsId);
|
|
|
}
|
|
|
- if (CollectionUtils.isNotEmpty(goodsIdList)){
|
|
|
+ if (CollectionUtils.isNotEmpty(goodsIdList)) {
|
|
|
goodsDesc.setGoodsTypeIdList(goodsIdList);
|
|
|
}
|
|
|
IPage<GoodsDescVO> goodsDescVOIPage = goodsDescService.selectGoods(Condition.getPage(query), goodsDesc);
|
|
|
@@ -350,9 +355,9 @@ public class GoodsDescController extends BladeController {
|
|
|
specificationWrapper.eq(GoodsSpecification::getTenantId, SecureUtil.getTenantId());
|
|
|
List<GoodsSpecification> goodsSpecificationList = goodsSpecificationService.list(specificationWrapper);
|
|
|
e.setGoodsSpecificationList(goodsSpecificationList);
|
|
|
- if (e.getCorpId() != null){
|
|
|
+ if (e.getCorpId() != null) {
|
|
|
CorpsDesc desc = corpsDescService.getById(e.getCorpId());
|
|
|
- if (desc != null){
|
|
|
+ if (desc != null) {
|
|
|
e.setCorpCode(desc.getCode());
|
|
|
}
|
|
|
}
|
|
|
@@ -440,7 +445,7 @@ public class GoodsDescController extends BladeController {
|
|
|
stockGoods.setTenantId(SecureUtil.getTenantId());
|
|
|
List<StockGoods> stockGoodsList = stockGoodsClient.postListStockByCondition(stockGoods);
|
|
|
if (CollectionUtils.isNotEmpty(stockGoodsList)) {
|
|
|
- goodsOutExcel.setStorageQuantity(stockGoodsList.stream().filter(ei -> ei.getSurplusRouteQuantity() != null).map(StockGoods::getSurplusRouteQuantity).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
+ goodsOutExcel.setStorageQuantity(stockGoodsList.stream().map(StockGoods::getSurplusRouteQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
} else {
|
|
|
goodsOutExcel.setStorageQuantity(BigDecimal.ZERO);
|
|
|
}
|