|
|
@@ -37,10 +37,7 @@ import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.salesPart.corps.service.ICorpsDescService;
|
|
|
-import org.springblade.salesPart.entity.PjCorpsDesc;
|
|
|
-import org.springblade.salesPart.entity.PjGoodsDesc;
|
|
|
-import org.springblade.salesPart.entity.PjGoodsType;
|
|
|
-import org.springblade.salesPart.entity.PjProductLaunch;
|
|
|
+import org.springblade.salesPart.entity.*;
|
|
|
import org.springblade.salesPart.excel.GoodsDescExportExcel;
|
|
|
import org.springblade.salesPart.excel.GoodsExcel;
|
|
|
import org.springblade.salesPart.goods.service.IGoodsDescService;
|
|
|
@@ -112,7 +109,9 @@ public class GoodsDescController extends BladeController {
|
|
|
.like(StringUtils.isNotBlank(goods.getBrandItem()), PjGoodsDesc::getBrandItem, goods.getBrandItem())//花纹
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getBrandId()), PjGoodsDesc::getBrandId, goods.getBrandId())//品牌
|
|
|
.like(ObjectUtils.isNotEmpty(goods.getBrandName()), PjGoodsDesc::getBrandName, goods.getBrandName())
|
|
|
+ .like(ObjectUtils.isNotEmpty(goods.getCnameInt()), PjGoodsDesc::getCnameInt, goods.getCnameInt())
|
|
|
.like(ObjectUtils.isNotEmpty(goods.getCode()), PjGoodsDesc::getCode, goods.getCode())//编码
|
|
|
+ .eq(ObjectUtils.isNotNull(goods.getEnableOrNot()), PjGoodsDesc::getEnableOrNot, goods.getEnableOrNot())//状态
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getExplosionProof()), PjGoodsDesc::getExplosionProof, goods.getExplosionProof());//是否防爆
|
|
|
if (ObjectUtil.isNotEmpty(goods.getCname())) {
|
|
|
@@ -264,6 +263,7 @@ public class GoodsDescController extends BladeController {
|
|
|
.like(ObjectUtils.isNotEmpty(goods.getBrandName()), PjGoodsDesc::getBrandName, goods.getBrandName())
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getSalesCompanyId()), PjGoodsDesc::getSalesCompanyId, goods.getSalesCompanyId())//所属公司
|
|
|
.eq(ObjectUtils.isNotEmpty(goods.getWhether()), PjGoodsDesc::getWhether, goods.getWhether())//是否管理到批次号
|
|
|
+ .eq(ObjectUtils.isNotNull(goods.getEnableOrNot()), PjGoodsDesc::getEnableOrNot, goods.getEnableOrNot())//状态
|
|
|
.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()));
|
|
|
@@ -306,8 +306,10 @@ public class GoodsDescController extends BladeController {
|
|
|
@ApiOperation(value = "商品下拉", notes = "传入goods")
|
|
|
public R<List<PjGoodsDesc>> goodsListAll(PjGoodsDesc goods) {
|
|
|
LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+
|
|
|
lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(PjGoodsDesc::getIsDeleted, 0);
|
|
|
+ .eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
+ .eq(ObjectUtils.isNotNull(goods.getEnableOrNot()), PjGoodsDesc::getEnableOrNot, goods.getEnableOrNot());//状态;
|
|
|
if (ObjectUtil.isNotEmpty(goods.getCname())) {//商品名称
|
|
|
lambdaQueryWrapper.and(i -> i.like(PjGoodsDesc::getCname, goods.getCname()).or().like(PjGoodsDesc::getCnameInt, goods.getCname()));
|
|
|
}
|
|
|
@@ -329,38 +331,27 @@ public class GoodsDescController extends BladeController {
|
|
|
.eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
.ne(PjProductLaunch::getInventory, 0)
|
|
|
.eq(PjProductLaunch::getUpAndDownShelves, 1)
|
|
|
- .apply("find_in_set(sales_company_id,'" + AuthUtil.getDeptId() + "')")
|
|
|
- .apply("find_in_set('" + AuthUtil.getDeptId() + "',shared_company)"));
|
|
|
+ .and(i -> i.apply("find_in_set(sales_company_id,'" + AuthUtil.getDeptId() + "')")
|
|
|
+ .or().apply("find_in_set('" + AuthUtil.getDeptId() + "',shared_company)")));
|
|
|
List<Long> ids = pjProductLaunchList.stream().map(PjProductLaunch::getGoodsId).distinct().collect(Collectors.toList());
|
|
|
PjCorpsDesc pjCorpsDesc = corpsDescService.getById(goods.getCustomId());
|
|
|
String priceSystem = "";
|
|
|
- if (ObjectUtils.isNotNull(pjCorpsDesc)){
|
|
|
+ if (ObjectUtils.isNotNull(pjCorpsDesc)) {
|
|
|
priceSystem = pjCorpsDesc.getPriceSystem();
|
|
|
}
|
|
|
LambdaQueryWrapper<PjGoodsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
- .eq(PjGoodsDesc::getIsDeleted, 0);
|
|
|
+ .eq(PjGoodsDesc::getIsDeleted, 0)
|
|
|
+ .eq(ObjectUtils.isNotNull(goods.getEnableOrNot()), PjGoodsDesc::getEnableOrNot, goods.getEnableOrNot());//状态;
|
|
|
if (ObjectUtil.isNotEmpty(goods.getCname())) {//商品名称
|
|
|
lambdaQueryWrapper.and(i -> i.like(PjGoodsDesc::getCname, goods.getCname()).or().like(PjGoodsDesc::getCnameInt, goods.getCname()));
|
|
|
}
|
|
|
if (ObjectUtils.isNotNull(ids) && ids.size() > 0) {
|
|
|
lambdaQueryWrapper.in(PjGoodsDesc::getId, ids);
|
|
|
+ } else {
|
|
|
+ return R.data(new ArrayList<>());
|
|
|
}
|
|
|
List<PjGoodsDesc> list = goodsDescService.list(lambdaQueryWrapper);
|
|
|
- for (PjGoodsDesc item : list) {
|
|
|
- PjProductLaunch pjProductLaunch = pjProductLaunchList.stream().filter(e-> e.getGoodsId().equals(item.getId())).findFirst().orElse(new PjProductLaunch());
|
|
|
- if (ObjectUtils.isNotNull(pjProductLaunch)){
|
|
|
- if ("售价1".equals(priceSystem)){
|
|
|
- item.setPrice(pjProductLaunch.getPriceOne());
|
|
|
- }else if ("售价2".equals(priceSystem)){
|
|
|
- item.setPrice(pjProductLaunch.getPriceTwo());
|
|
|
- }else if ("售价3".equals(priceSystem)){
|
|
|
- item.setPrice(pjProductLaunch.getPriceThree());
|
|
|
- }else if ("售价4".equals(priceSystem)){
|
|
|
- item.setPrice(pjProductLaunch.getPriceFour());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
return R.data(list);
|
|
|
}
|
|
|
|
|
|
@@ -387,6 +378,27 @@ public class GoodsDescController extends BladeController {
|
|
|
public R<PjGoodsDesc> goodsDetail(PjGoodsDesc goods) {
|
|
|
goods.setTenantId(AuthUtil.getTenantId());
|
|
|
PjGoodsDesc detail = goodsDescService.getGoodsDetail(goods);
|
|
|
+ PjProductLaunch pjProductLaunch = productLaunchService.getOne(new LambdaQueryWrapper<PjProductLaunch>()
|
|
|
+ .eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
+ .eq(PjProductLaunch::getGoodsId, detail.getId())
|
|
|
+ .ne(PjProductLaunch::getInventory, 0)
|
|
|
+ .eq(PjProductLaunch::getUpAndDownShelves, 1)
|
|
|
+ .and(i -> i.apply("find_in_set(sales_company_id,'" + AuthUtil.getDeptId() + "')")
|
|
|
+ .or().apply("find_in_set('" + AuthUtil.getDeptId() + "',shared_company)")));
|
|
|
+ PjCorpsDesc pjCorpsDesc = corpsDescService.getById(goods.getCustomId());
|
|
|
+ String priceSystem = "";
|
|
|
+ if (ObjectUtils.isNotNull(pjCorpsDesc)) {
|
|
|
+ priceSystem = pjCorpsDesc.getPriceSystem();
|
|
|
+ }
|
|
|
+ if ("售价1".equals(priceSystem)) {
|
|
|
+ detail.setPrice(pjProductLaunch.getPriceOne());
|
|
|
+ } else if ("售价2".equals(priceSystem)) {
|
|
|
+ detail.setPrice(pjProductLaunch.getPriceTwo());
|
|
|
+ } else if ("售价3".equals(priceSystem)) {
|
|
|
+ detail.setPrice(pjProductLaunch.getPriceThree());
|
|
|
+ } else if ("售价4".equals(priceSystem)) {
|
|
|
+ detail.setPrice(pjProductLaunch.getPriceFour());
|
|
|
+ }
|
|
|
return R.data(detail);
|
|
|
}
|
|
|
}
|