|
|
@@ -500,7 +500,84 @@ public class StockDescController extends BladeController {
|
|
|
if ("0".equals(stockDesc.getWhether())) {
|
|
|
lambdaQueryWrapper.ne(PjStockDesc::getBalanceQuantity, 0);
|
|
|
}
|
|
|
+ List<PjProductLaunch> pjProductLaunchList = new ArrayList<>();
|
|
|
if (ObjectUtil.isNotEmpty(stockDesc.getCname())) {
|
|
|
+ List<PjGoodsDesc> pjGoodsDescs = new ArrayList<>();
|
|
|
+ if (stockDesc.getCname().contains(",")) {
|
|
|
+ String brandName = stockDesc.getCname().substring(0, stockDesc.getCname().indexOf(","));
|
|
|
+ String cname = stockDesc.getCname().substring(stockDesc.getCname().indexOf(",") + 1);
|
|
|
+ pjGoodsDescs = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
|
|
|
+ .eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
+ .like(PjGoodsDesc::getBrandName, brandName)
|
|
|
+ .and(i -> i.like(PjGoodsDesc::getCname, cname)
|
|
|
+ .or().like(PjGoodsDesc::getCnameInt, cname))
|
|
|
+ .or().like(PjGoodsDesc::getCname, stockDesc.getCname())
|
|
|
+ .or().like(PjGoodsDesc::getCnameInt, stockDesc.getCname())
|
|
|
+ );
|
|
|
+ lambdaQueryWrapper.like(PjStockDesc::getBrandName, brandName);
|
|
|
+ } else {
|
|
|
+ String[] chineseWords = stockDesc.getCname().split("[^一-龥]");
|
|
|
+ if (chineseWords.length > 0) {
|
|
|
+ String cname = stockDesc.getCname().substring(chineseWords[0].length());
|
|
|
+ pjGoodsDescs = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
|
|
|
+ .eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
+ .like(PjGoodsDesc::getBrandName, chineseWords[0])
|
|
|
+ .and(i -> i.like(PjGoodsDesc::getCname, cname)
|
|
|
+ .or().like(PjGoodsDesc::getCnameInt, cname)
|
|
|
+ .or().like(PjGoodsDesc::getCname, stockDesc.getCname())
|
|
|
+ .or().like(PjGoodsDesc::getCnameInt, stockDesc.getCname())
|
|
|
+ ));
|
|
|
+ } else {
|
|
|
+ pjGoodsDescs = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
|
|
|
+ .eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
+ .and(i -> i.like(PjGoodsDesc::getCname, stockDesc.getCname()).or().like(PjGoodsDesc::getCnameInt, stockDesc.getCname())));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!pjGoodsDescs.isEmpty()) {
|
|
|
+ List<Long> ids = pjGoodsDescs.stream().map(PjGoodsDesc::getId).collect(Collectors.toList());
|
|
|
+ pjProductLaunchList = productLaunchService.list(new LambdaQueryWrapper<PjProductLaunch>()
|
|
|
+ .eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
+ .in(PjProductLaunch::getGoodsId, ids)
|
|
|
+ .eq(PjProductLaunch::getSalesCompanyId, AuthUtil.getDeptId()));
|
|
|
+ if ("0".equals(stockDesc.getIfGrounding()) || "1".equals(stockDesc.getIfGrounding())) {
|
|
|
+ if (!pjProductLaunchList.isEmpty()) {
|
|
|
+ List<Long> goodIds = pjProductLaunchList.stream().map(PjProductLaunch::getGoodsId).collect(Collectors.toList());
|
|
|
+ if ("0".equals(stockDesc.getIfGrounding())) {
|
|
|
+ lambdaQueryWrapper.like(PjStockDesc::getCname, stockDesc.getCname())
|
|
|
+ .notIn(PjStockDesc::getGoodsId, goodIds);
|
|
|
+ } else {
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(PjStockDesc::getCname, stockDesc.getCname())
|
|
|
+ .or().in(PjStockDesc::getGoodsId, goodIds));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(PjStockDesc::getCname, stockDesc.getCname())
|
|
|
+ .or().in(PjStockDesc::getGoodsId, ids));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ lambdaQueryWrapper.like(PjStockDesc::getCname, stockDesc.getCname());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ pjProductLaunchList = productLaunchService.list(new LambdaQueryWrapper<PjProductLaunch>()
|
|
|
+ .eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
+ .eq(PjProductLaunch::getSalesCompanyId, AuthUtil.getDeptId()));
|
|
|
+ if ("0".equals(stockDesc.getIfGrounding()) || "1".equals(stockDesc.getIfGrounding())) {
|
|
|
+ if (!pjProductLaunchList.isEmpty()) {
|
|
|
+ List<Long> ids = pjProductLaunchList.stream().map(PjProductLaunch::getGoodsId).collect(Collectors.toList());
|
|
|
+ if ("0".equals(stockDesc.getIfGrounding())) {
|
|
|
+ lambdaQueryWrapper.notIn(PjStockDesc::getGoodsId, ids);
|
|
|
+ } else {
|
|
|
+ lambdaQueryWrapper.in(PjStockDesc::getGoodsId, ids);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+/* if (ObjectUtil.isNotEmpty(stockDesc.getCname())) {
|
|
|
List<PjGoodsDesc> pjGoodsDescs = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
|
|
|
.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
@@ -544,7 +621,7 @@ public class StockDescController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
List<PjStockDesc> list = stockDescService.list(lambdaQueryWrapper);
|
|
|
Map<String, BigDecimal> map = new HashMap<>();
|
|
|
if (!list.isEmpty()) {
|