|
|
@@ -115,41 +115,10 @@ public class StockDescController extends BladeController {
|
|
|
}
|
|
|
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())
|
|
|
- ));
|
|
|
-// lambdaQueryWrapper.like(PjStockDesc::getBrandName, chineseWords[0]);
|
|
|
- } 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())));
|
|
|
- }
|
|
|
- }
|
|
|
+ List<PjGoodsDesc> 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>()
|
|
|
@@ -339,16 +308,16 @@ public class StockDescController extends BladeController {
|
|
|
stockDesc.setSalesCompanyIds(AuthUtil.getDeptId());
|
|
|
if ("0".equals(stockDesc.getWhether())) {
|
|
|
IPage<PjStockDesc> pages = stockDescService.selectStockDescPage(Condition.getPage(query), stockDesc);
|
|
|
- for (PjStockDesc item : pages.getRecords()){
|
|
|
- if (ObjectUtils.isNotNull(item.getIntegral()) && new BigDecimal("0.00").compareTo(item.getIntegral()) == 0){
|
|
|
+ for (PjStockDesc item : pages.getRecords()) {
|
|
|
+ if (ObjectUtils.isNotNull(item.getIntegral()) && new BigDecimal("0.00").compareTo(item.getIntegral()) == 0) {
|
|
|
item.setIntegral(null);
|
|
|
}
|
|
|
}
|
|
|
return R.data(pages);
|
|
|
} else {
|
|
|
IPage<PjStockDesc> pages = stockDescService.selectStockDescPageZero(Condition.getPage(query), stockDesc);
|
|
|
- for (PjStockDesc item : pages.getRecords()){
|
|
|
- if (ObjectUtils.isNotNull(item.getIntegral()) && new BigDecimal("0.00").compareTo(item.getIntegral()) == 0){
|
|
|
+ for (PjStockDesc item : pages.getRecords()) {
|
|
|
+ if (ObjectUtils.isNotNull(item.getIntegral()) && new BigDecimal("0.00").compareTo(item.getIntegral()) == 0) {
|
|
|
item.setIntegral(null);
|
|
|
}
|
|
|
}
|