|
@@ -41,9 +41,7 @@ import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
-import org.springblade.salesPart.entity.PjBrandDesc;
|
|
|
|
|
-import org.springblade.salesPart.entity.PjGoodsType;
|
|
|
|
|
-import org.springblade.salesPart.entity.PjShoppingCart;
|
|
|
|
|
|
|
+import org.springblade.salesPart.entity.*;
|
|
|
import org.springblade.salesPart.excel.CorpsDescExportExcel;
|
|
import org.springblade.salesPart.excel.CorpsDescExportExcel;
|
|
|
import org.springblade.salesPart.excel.GoodsDescExportExcel;
|
|
import org.springblade.salesPart.excel.GoodsDescExportExcel;
|
|
|
import org.springblade.salesPart.excel.GoodsExcel;
|
|
import org.springblade.salesPart.excel.GoodsExcel;
|
|
@@ -52,7 +50,6 @@ import org.springblade.system.entity.Dept;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import org.springblade.salesPart.entity.PjGoodsDesc;
|
|
|
|
|
import org.springblade.salesPart.vo.GoodsDescVO;
|
|
import org.springblade.salesPart.vo.GoodsDescVO;
|
|
|
import org.springblade.salesPart.goods.service.IGoodsDescService;
|
|
import org.springblade.salesPart.goods.service.IGoodsDescService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
@@ -117,13 +114,14 @@ public class GoodsDescController extends BladeController {
|
|
|
.eq(PjGoodsDesc::getSalesCompanyId, AuthUtil.getDeptId())//公司
|
|
.eq(PjGoodsDesc::getSalesCompanyId, AuthUtil.getDeptId())//公司
|
|
|
.like(StringUtils.isNotBlank(goods.getSpecificationAndModel()), PjGoodsDesc::getSpecificationAndModel, goods.getSpecificationAndModel())//规格型号
|
|
.like(StringUtils.isNotBlank(goods.getSpecificationAndModel()), PjGoodsDesc::getSpecificationAndModel, goods.getSpecificationAndModel())//规格型号
|
|
|
.like(StringUtils.isNotBlank(goods.getBrandItem()), PjGoodsDesc::getBrandItem, goods.getBrandItem())//花纹
|
|
.like(StringUtils.isNotBlank(goods.getBrandItem()), PjGoodsDesc::getBrandItem, goods.getBrandItem())//花纹
|
|
|
- .like(StringUtils.isNotBlank(goods.getCname()), PjGoodsDesc::getCname, goods.getCname())//商品名称
|
|
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getBrandId()), PjGoodsDesc::getBrandId, goods.getBrandId())//品牌
|
|
.eq(ObjectUtils.isNotEmpty(goods.getBrandId()), PjGoodsDesc::getBrandId, goods.getBrandId())//品牌
|
|
|
.like(ObjectUtils.isNotEmpty(goods.getBrandName()), PjGoodsDesc::getBrandName, goods.getBrandName())
|
|
.like(ObjectUtils.isNotEmpty(goods.getBrandName()), PjGoodsDesc::getBrandName, goods.getBrandName())
|
|
|
.like(ObjectUtils.isNotEmpty(goods.getCode()), PjGoodsDesc::getCode, goods.getCode())//编码
|
|
.like(ObjectUtils.isNotEmpty(goods.getCode()), PjGoodsDesc::getCode, goods.getCode())//编码
|
|
|
- .like(ObjectUtils.isNotEmpty(goods.getCnameInt()), PjGoodsDesc::getCnameInt, goods.getCnameInt())//快捷拼命查询
|
|
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
|
|
.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getExplosionProof()), PjGoodsDesc::getExplosionProof, goods.getExplosionProof());//是否防爆
|
|
.eq(ObjectUtils.isNotEmpty(goods.getExplosionProof()), PjGoodsDesc::getExplosionProof, goods.getExplosionProof());//是否防爆
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(goods.getCname())){
|
|
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(PjGoodsDesc::getCname, goods.getCname()).or().like(PjGoodsDesc::getCnameInt, goods.getCname()));
|
|
|
|
|
+ }
|
|
|
IPage<PjGoodsDesc> pages = goodsService.page(Condition.getPage(query),lambdaQueryWrapper);
|
|
IPage<PjGoodsDesc> pages = goodsService.page(Condition.getPage(query),lambdaQueryWrapper);
|
|
|
|
|
|
|
|
pages.getRecords().forEach(e -> {
|
|
pages.getRecords().forEach(e -> {
|
|
@@ -265,13 +263,14 @@ public class GoodsDescController extends BladeController {
|
|
|
.eq(PjGoodsDesc::getIsDeleted, 0)
|
|
.eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
.like(StringUtils.isNotBlank(goods.getSpecificationAndModel()), PjGoodsDesc::getSpecificationAndModel, goods.getSpecificationAndModel())//规格型号
|
|
.like(StringUtils.isNotBlank(goods.getSpecificationAndModel()), PjGoodsDesc::getSpecificationAndModel, goods.getSpecificationAndModel())//规格型号
|
|
|
.like(StringUtils.isNotBlank(goods.getBrandItem()), PjGoodsDesc::getBrandItem, goods.getBrandItem())//花纹
|
|
.like(StringUtils.isNotBlank(goods.getBrandItem()), PjGoodsDesc::getBrandItem, goods.getBrandItem())//花纹
|
|
|
- .like(StringUtils.isNotBlank(goods.getCname()), PjGoodsDesc::getCname, goods.getCname())//商品名称
|
|
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getBrandId()), PjGoodsDesc::getBrandId, goods.getBrandId())//品牌
|
|
.eq(ObjectUtils.isNotEmpty(goods.getBrandId()), PjGoodsDesc::getBrandId, goods.getBrandId())//品牌
|
|
|
.like(ObjectUtils.isNotEmpty(goods.getBrandName()), PjGoodsDesc::getBrandName, goods.getBrandName())
|
|
.like(ObjectUtils.isNotEmpty(goods.getBrandName()), PjGoodsDesc::getBrandName, goods.getBrandName())
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getSalesCompanyId()), PjGoodsDesc::getSalesCompanyId, goods.getSalesCompanyId())//所属公司
|
|
.eq(ObjectUtils.isNotEmpty(goods.getSalesCompanyId()), PjGoodsDesc::getSalesCompanyId, goods.getSalesCompanyId())//所属公司
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
|
|
.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getExplosionProof()), PjGoodsDesc::getExplosionProof, goods.getExplosionProof());//是否防爆
|
|
.eq(ObjectUtils.isNotEmpty(goods.getExplosionProof()), PjGoodsDesc::getExplosionProof, goods.getExplosionProof());//是否防爆
|
|
|
-
|
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(goods.getCname())){
|
|
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(PjGoodsDesc::getCname, goods.getCname()).or().like(PjGoodsDesc::getCnameInt, goods.getCname()));
|
|
|
|
|
+ }
|
|
|
List<PjGoodsDesc> list = goodsService.list(lambdaQueryWrapper);
|
|
List<PjGoodsDesc> list = goodsService.list(lambdaQueryWrapper);
|
|
|
list.forEach(e -> {
|
|
list.forEach(e -> {
|
|
|
String typeId = e.getGoodsTypeId();
|
|
String typeId = e.getGoodsTypeId();
|
|
@@ -312,8 +311,10 @@ public class GoodsDescController extends BladeController {
|
|
|
LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjGoodsDesc::getIsDeleted, 0)
|
|
.eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
- .eq(PjGoodsDesc::getSalesCompanyId, AuthUtil.getDeptId())
|
|
|
|
|
- .like(StringUtils.isNotBlank(goods.getCname()), PjGoodsDesc::getCname, goods.getCname());//商品名称
|
|
|
|
|
|
|
+ .eq(PjGoodsDesc::getSalesCompanyId, AuthUtil.getDeptId());
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(goods.getCname())){//商品名称
|
|
|
|
|
+ lambdaQueryWrapper.and(i -> i.like(PjGoodsDesc::getCname, goods.getCname()).or().like(PjGoodsDesc::getCnameInt, goods.getCname()));
|
|
|
|
|
+ }
|
|
|
List<PjGoodsDesc> list = goodsService.list(lambdaQueryWrapper);
|
|
List<PjGoodsDesc> list = goodsService.list(lambdaQueryWrapper);
|
|
|
|
|
|
|
|
return R.data(list);
|
|
return R.data(list);
|