|
@@ -5,17 +5,16 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
import com.gree.mall.manager.bean.goods.*;
|
|
import com.gree.mall.manager.bean.goods.*;
|
|
|
import com.gree.mall.manager.commonmapper.CustomGoodsMapper;
|
|
import com.gree.mall.manager.commonmapper.CustomGoodsMapper;
|
|
|
-import com.gree.mall.manager.commonmapper.GoodsCheckMapper;
|
|
|
|
|
import com.gree.mall.manager.constant.Constant;
|
|
import com.gree.mall.manager.constant.Constant;
|
|
|
import com.gree.mall.manager.enums.FreightTypeEnum;
|
|
import com.gree.mall.manager.enums.FreightTypeEnum;
|
|
|
import com.gree.mall.manager.enums.GoodsTypeEnum;
|
|
import com.gree.mall.manager.enums.GoodsTypeEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
-import com.gree.mall.manager.logic.common.FucaiLogic;
|
|
|
|
|
import com.gree.mall.manager.logic.user.UserLogic;
|
|
import com.gree.mall.manager.logic.user.UserLogic;
|
|
|
import com.gree.mall.manager.plus.entity.*;
|
|
import com.gree.mall.manager.plus.entity.*;
|
|
|
import com.gree.mall.manager.plus.service.*;
|
|
import com.gree.mall.manager.plus.service.*;
|
|
@@ -40,8 +39,6 @@ import java.util.stream.Collectors;
|
|
|
public class GoodsLogic {
|
|
public class GoodsLogic {
|
|
|
@Resource
|
|
@Resource
|
|
|
CommonLogic commonLogic;
|
|
CommonLogic commonLogic;
|
|
|
- @Autowired
|
|
|
|
|
- FucaiLogic fucaiLogic;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
CustomGoodsMapper customGoodsMapper;
|
|
CustomGoodsMapper customGoodsMapper;
|
|
@@ -51,16 +48,9 @@ public class GoodsLogic {
|
|
|
GoodsSpecService goodsSpecService;
|
|
GoodsSpecService goodsSpecService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
GoodsTagRelaService goodsTagRelaService;
|
|
GoodsTagRelaService goodsTagRelaService;
|
|
|
-
|
|
|
|
|
- @Resource
|
|
|
|
|
- SecKillActivityService secKillActivityService;
|
|
|
|
|
- @Resource
|
|
|
|
|
- SecKillActivitySpecService secKillActivitySpecService;
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CarouselMapService carouselMapService;
|
|
private CarouselMapService carouselMapService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private GoodsCheckMapper goodsCheckMapper;
|
|
|
|
|
- @Autowired
|
|
|
|
|
private GoodsTemplateService goodsTemplateService;
|
|
private GoodsTemplateService goodsTemplateService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CommonFileService commonFileService;
|
|
private CommonFileService commonFileService;
|
|
@@ -82,8 +72,6 @@ public class GoodsLogic {
|
|
|
* @param keyword
|
|
* @param keyword
|
|
|
* @param startPrice
|
|
* @param startPrice
|
|
|
* @param endPrice
|
|
* @param endPrice
|
|
|
- * @param startShare
|
|
|
|
|
- * @param endShare
|
|
|
|
|
* @param goodsSortJson
|
|
* @param goodsSortJson
|
|
|
* @param categoryId
|
|
* @param categoryId
|
|
|
* @param status
|
|
* @param status
|
|
@@ -91,8 +79,7 @@ public class GoodsLogic {
|
|
|
* @param pageSize
|
|
* @param pageSize
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public IPage<GoodsSpecBean> page(String isTrade, String flag, String keyword, BigDecimal startPrice, BigDecimal endPrice,
|
|
|
|
|
- BigDecimal startShare, BigDecimal endShare,
|
|
|
|
|
|
|
+ public IPage<GoodsSpecBean> page(String flag, String keyword, BigDecimal startPrice, BigDecimal endPrice,
|
|
|
String goodsSortJson, String categoryId, Boolean status, List<String> goodsTypes,
|
|
String goodsSortJson, String categoryId, Boolean status, List<String> goodsTypes,
|
|
|
Integer pageNum, Integer pageSize, HttpServletRequest request) {
|
|
Integer pageNum, Integer pageSize, HttpServletRequest request) {
|
|
|
|
|
|
|
@@ -114,8 +101,8 @@ public class GoodsLogic {
|
|
|
goodsTypes.add(GoodsTypeEnum.COMMON.toString());
|
|
goodsTypes.add(GoodsTypeEnum.COMMON.toString());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(pageNum, pageSize), isTrade, flag, keyword, startPrice,
|
|
|
|
|
- endPrice, startShare, endShare, sortStr, categoryIds, status, goodsTypes, companyWechatIds);
|
|
|
|
|
|
|
+ IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(pageNum, pageSize), flag, keyword, startPrice,
|
|
|
|
|
+ endPrice, sortStr, categoryIds, status, goodsTypes, companyWechatIds);
|
|
|
|
|
|
|
|
//商品规格
|
|
//商品规格
|
|
|
List<GoodsSpecBean> records = new ArrayList<>();
|
|
List<GoodsSpecBean> records = new ArrayList<>();
|
|
@@ -146,48 +133,6 @@ public class GoodsLogic {
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 套购商品列表
|
|
|
|
|
- *
|
|
|
|
|
- * @param keyword
|
|
|
|
|
- * @param startPrice
|
|
|
|
|
- * @param endPrice
|
|
|
|
|
- * @param startShare
|
|
|
|
|
- * @param endShare
|
|
|
|
|
- * @param goodsSortJson
|
|
|
|
|
- * @param categoryId
|
|
|
|
|
- * @param status
|
|
|
|
|
- * @param pageNum
|
|
|
|
|
- * @param pageSize
|
|
|
|
|
- * @param request
|
|
|
|
|
- * @return
|
|
|
|
|
- */
|
|
|
|
|
- public IPage<GoodsPackageList> packageList(String keyword, BigDecimal startPrice, BigDecimal endPrice,
|
|
|
|
|
- BigDecimal startShare, BigDecimal endShare,
|
|
|
|
|
- String goodsSortJson, String categoryId, Boolean status,
|
|
|
|
|
- Integer pageNum, Integer pageSize, HttpServletRequest request) {
|
|
|
|
|
-
|
|
|
|
|
- //获取当前登录微信企业微信id
|
|
|
|
|
- AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
|
|
- List<String> companyWechatIds = adminUser.getCompanyWechatIds();
|
|
|
|
|
-
|
|
|
|
|
- String sortStr = null;
|
|
|
|
|
- if (goodsSortJson != null && !goodsSortJson.trim().equals("")) {
|
|
|
|
|
- JSONArray goodsSortBeanArray = JSON.parseArray(StringEscapeUtils.unescapeJava(goodsSortJson));
|
|
|
|
|
- sortStr = GoodsSortBean.convertColumn(goodsSortBeanArray);
|
|
|
|
|
- }
|
|
|
|
|
- List<String> categoryIds = new ArrayList<>();
|
|
|
|
|
- if (StringUtils.isNotBlank(categoryId)) {
|
|
|
|
|
- categoryIds.add(categoryId);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- IPage<GoodsPackageList> goodsPackageListIPage = customGoodsMapper.queryGoodsPackageList(new Page<>(pageNum, pageSize), keyword, startPrice,
|
|
|
|
|
- endPrice, startShare, endShare, sortStr, categoryIds, status, companyWechatIds);
|
|
|
|
|
-
|
|
|
|
|
- return goodsPackageListIPage;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
* 根据类型查询商品
|
|
* 根据类型查询商品
|
|
|
*
|
|
*
|
|
|
* @param categoryIds
|
|
* @param categoryIds
|
|
@@ -202,7 +147,7 @@ public class GoodsLogic {
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(1, -1), null, null, null, null,
|
|
IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(1, -1), null, null, null, null,
|
|
|
- null, null, null, null, categoryIds, null, null, companyWechatIds);
|
|
|
|
|
|
|
+ null, categoryIds, null, null, companyWechatIds);
|
|
|
//添加规格
|
|
//添加规格
|
|
|
List<GoodsSpecBean> records = goodsSpecBeanIPage.getRecords();
|
|
List<GoodsSpecBean> records = goodsSpecBeanIPage.getRecords();
|
|
|
for (GoodsSpecBean record : records) {
|
|
for (GoodsSpecBean record : records) {
|
|
@@ -235,25 +180,6 @@ public class GoodsLogic {
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void updateStatus(String goodsId, Boolean status) throws RemoteServiceException {
|
|
public void updateStatus(String goodsId, Boolean status) throws RemoteServiceException {
|
|
|
- if (!status) {
|
|
|
|
|
- List<SecKillActivitySpec> secKillActivitySpecs = secKillActivitySpecService.lambdaQuery()
|
|
|
|
|
- .eq(SecKillActivitySpec::getGoodsId, goodsId)
|
|
|
|
|
- .list();
|
|
|
|
|
- Integer activityCount = 0;
|
|
|
|
|
- for (SecKillActivitySpec secKillActivitySpec : secKillActivitySpecs) {
|
|
|
|
|
-
|
|
|
|
|
- activityCount += secKillActivityService.lambdaQuery()
|
|
|
|
|
- .eq(SecKillActivity::getSecKillId, secKillActivitySpec.getSecKillId())
|
|
|
|
|
- .ge(SecKillActivity::getEndTime, new Date())
|
|
|
|
|
- .eq(SecKillActivity::getStatus, true)
|
|
|
|
|
- .eq(SecKillActivity::getDel, false)
|
|
|
|
|
- .count();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (activityCount > 0) {
|
|
|
|
|
- throw new RemoteServiceException("商品处于秒杀活动中,操作失败!");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
goodsService.lambdaUpdate()
|
|
goodsService.lambdaUpdate()
|
|
|
.eq(Goods::getGoodsId, goodsId)
|
|
.eq(Goods::getGoodsId, goodsId)
|
|
|
.set(Goods::getStatus, status)
|
|
.set(Goods::getStatus, status)
|
|
@@ -272,25 +198,6 @@ public class GoodsLogic {
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void delete(String goodsId) throws RemoteServiceException {
|
|
public void delete(String goodsId) throws RemoteServiceException {
|
|
|
- //检查是否存在秒杀活动
|
|
|
|
|
- List<SecKillActivitySpec> secKillActivitySpecs = secKillActivitySpecService.lambdaQuery()
|
|
|
|
|
- .eq(SecKillActivitySpec::getGoodsId, goodsId)
|
|
|
|
|
- .list();
|
|
|
|
|
- Integer activityCount = 0;
|
|
|
|
|
- for (SecKillActivitySpec secKillActivitySpec : secKillActivitySpecs) {
|
|
|
|
|
-
|
|
|
|
|
- activityCount += secKillActivityService.lambdaQuery()
|
|
|
|
|
- .eq(SecKillActivity::getSecKillId, secKillActivitySpec.getSecKillId())
|
|
|
|
|
- .ge(SecKillActivity::getEndTime, new Date())
|
|
|
|
|
- .eq(SecKillActivity::getStatus, true)
|
|
|
|
|
- .eq(SecKillActivity::getDel, false)
|
|
|
|
|
- .count();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (activityCount > 0) {
|
|
|
|
|
- throw new RemoteServiceException("商品处于秒杀活动中,操作删除失败!");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
//检查是否在上架状态
|
|
//检查是否在上架状态
|
|
|
Integer count = goodsService.lambdaQuery()
|
|
Integer count = goodsService.lambdaQuery()
|
|
|
.eq(Goods::getGoodsId, goodsId)
|
|
.eq(Goods::getGoodsId, goodsId)
|
|
@@ -382,67 +289,13 @@ public class GoodsLogic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 套购商品-商品配置列表
|
|
|
|
|
- */
|
|
|
|
|
- public List<GoodsPackageBean> popList(String goodsId, Integer type) {
|
|
|
|
|
- //套购商品
|
|
|
|
|
- Goods goods = goodsService.getById(goodsId);
|
|
|
|
|
- if (!StringUtils.equals(goods.getGoodsType(), GoodsTypeEnum.PACKAGE.toString())) {
|
|
|
|
|
- throw new RemoteServiceException("非套餐商品");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //套购商品--商品配置
|
|
|
|
|
- List<GoodsPackagePop> list = goodsPackagePopService.lambdaQuery()
|
|
|
|
|
- .eq(GoodsPackagePop::getGoodsPackageId, goodsId)
|
|
|
|
|
- .eq(GoodsPackagePop::getType, type).list();
|
|
|
|
|
-
|
|
|
|
|
- Map<String, List<GoodsPackagePopBean>> map = new LinkedHashMap<>();
|
|
|
|
|
- for (GoodsPackagePop bean : list) {
|
|
|
|
|
- List<GoodsPackagePopBean> goodsPackagePops = map.get(bean.getGoodsId());
|
|
|
|
|
- if (goodsPackagePops == null) {
|
|
|
|
|
- goodsPackagePops = new ArrayList<>();
|
|
|
|
|
- }
|
|
|
|
|
- GoodsPackagePopBean newBean = new GoodsPackagePopBean();
|
|
|
|
|
- BeanUtils.copyProperties(bean, newBean);
|
|
|
|
|
-
|
|
|
|
|
- GoodsSpec goodsSpec = goodsSpecService.getById(bean.getGoodsSpecId());
|
|
|
|
|
- newBean.setSpecName(goodsSpec.getName());
|
|
|
|
|
- newBean.setSpecValue(goodsSpec.getSpecValue());
|
|
|
|
|
- newBean.setStock(goodsSpec.getStockNum());
|
|
|
|
|
-
|
|
|
|
|
- goodsPackagePops.add(newBean);
|
|
|
|
|
- map.put(bean.getGoodsId(), goodsPackagePops);
|
|
|
|
|
- }
|
|
|
|
|
- //商品
|
|
|
|
|
- List<GoodsPackageBean> goodsList = new ArrayList<>();
|
|
|
|
|
- for (String gdsId : map.keySet()) {
|
|
|
|
|
-
|
|
|
|
|
- Goods nGoods = goodsService.getById(gdsId);
|
|
|
|
|
-
|
|
|
|
|
- GoodsPackagePopBean goodsPackagePop = map.get(gdsId).get(0);
|
|
|
|
|
- GoodsPackageBean bean = new GoodsPackageBean();
|
|
|
|
|
- bean.setImgUrl(nGoods.getImgUrl());
|
|
|
|
|
- bean.setGoodsName(nGoods.getGoodsName());
|
|
|
|
|
- bean.setGoodsPackagePopList(map.get(gdsId));
|
|
|
|
|
- bean.setSortNum(goodsPackagePop.getSortNum());
|
|
|
|
|
- goodsList.add(bean);
|
|
|
|
|
- }
|
|
|
|
|
- return goodsList;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
* 添加商品
|
|
* 添加商品
|
|
|
*
|
|
*
|
|
|
* @param goodsBean
|
|
* @param goodsBean
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void add(GoodsBean goodsBean, HttpServletRequest request) throws RemoteServiceException {
|
|
public void add(GoodsBean goodsBean, HttpServletRequest request) throws RemoteServiceException {
|
|
|
- if (StringUtils.equals(goodsBean.getGoodsType(), GoodsTypeEnum.COMMON.toString())
|
|
|
|
|
- && (goodsBean.getGoodsSpecs() == null || goodsBean.getGoodsSpecs().size() == 0)) {
|
|
|
|
|
- //如果是规格没有抛出异常
|
|
|
|
|
- throw new RemoteServiceException("至少要有一个规格!");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.commonCheckGoods(goodsBean);
|
|
|
//设置企业微信id
|
|
//设置企业微信id
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
// if (StringUtils.isBlank(goodsBean.getCompanyWechatId())) {
|
|
// if (StringUtils.isBlank(goodsBean.getCompanyWechatId())) {
|
|
@@ -455,41 +308,35 @@ public class GoodsLogic {
|
|
|
goodsBean.setCompanyName(adminUser.getCompanyName());
|
|
goodsBean.setCompanyName(adminUser.getCompanyName());
|
|
|
|
|
|
|
|
Date creatDate = new Date();
|
|
Date creatDate = new Date();
|
|
|
|
|
+
|
|
|
|
|
+ goodsBean.setCreateTime(creatDate);
|
|
|
|
|
+
|
|
|
List<GoodsSpec> goodsSpecList = goodsBean.getGoodsSpecs();
|
|
List<GoodsSpec> goodsSpecList = goodsBean.getGoodsSpecs();
|
|
|
if (CollectionUtils.isNotEmpty(goodsSpecList)) {
|
|
if (CollectionUtils.isNotEmpty(goodsSpecList)) {
|
|
|
- Collections.sort(goodsSpecList, (o1, o2) -> o1.getPrice().compareTo(o2.getPrice()));
|
|
|
|
|
|
|
+ goodsSpecList.sort(Comparator.comparing(GoodsSpec::getPrice));
|
|
|
goodsBean.setGoodsPrice(goodsSpecList.get(0).getPrice());
|
|
goodsBean.setGoodsPrice(goodsSpecList.get(0).getPrice());
|
|
|
- goodsBean.setOrgGoodsPrice(goodsSpecList.get(0).getOrgPrice());
|
|
|
|
|
- }
|
|
|
|
|
- goodsBean.setCreateTime(creatDate);
|
|
|
|
|
- goodsService.save(goodsBean);
|
|
|
|
|
-
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(goodsBean.getGoodsSpecs())) {
|
|
|
|
|
-
|
|
|
|
|
- List<GoodsSpec> goodsSpecs = goodsBean.getGoodsSpecs();
|
|
|
|
|
- for (GoodsSpec goodsSpec : goodsSpecs) {
|
|
|
|
|
|
|
+ goodsBean.setOrgGoodsPrice(BigDecimal.ZERO);
|
|
|
|
|
+ for (GoodsSpec goodsSpec : goodsSpecList) {
|
|
|
|
|
|
|
|
GoodsMaterial goodsMaterial = goodsMaterialService.getById(goodsSpec.getGoodsCode());
|
|
GoodsMaterial goodsMaterial = goodsMaterialService.getById(goodsSpec.getGoodsCode());
|
|
|
if (goodsMaterial != null) {
|
|
if (goodsMaterial != null) {
|
|
|
goodsSpec.setSpecValue(goodsMaterial.getSpecsName());
|
|
goodsSpec.setSpecValue(goodsMaterial.getSpecsName());
|
|
|
|
|
+ if (StringUtils.isBlank(goodsSpec.getName())) {
|
|
|
|
|
+ goodsSpec.setName(goodsMaterial.getSpecsName());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
|
.setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
.setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
|
- .setCreateTime(creatDate).setDel(false)
|
|
|
|
|
- //.setSpecValue(goodsSpec.getSpecValue())
|
|
|
|
|
- .setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
|
|
|
- .setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getSharePercent() != null //分销比列不为0覆盖分销金额
|
|
|
|
|
- && goodsSpec.getSharePercent().compareTo(new Double("0.00")) > 0 ?
|
|
|
|
|
- goodsSpec.getPrice().multiply(new BigDecimal(goodsSpec.getSharePercent() / 100.0))
|
|
|
|
|
- .setScale(2, BigDecimal.ROUND_DOWN)
|
|
|
|
|
- : goodsSpec.getShareAmount()))
|
|
|
|
|
- .setInnerShareAmount(getInnerShareAmount(goodsSpec));//需最后设置
|
|
|
|
|
|
|
+ .setOrgPrice(BigDecimal.ZERO)
|
|
|
|
|
+ .setCreateTime(creatDate)
|
|
|
|
|
+ .setDel(false);//需最后设置
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ goodsService.save(goodsBean);
|
|
|
|
|
+
|
|
|
if (StringUtils.isNotBlank(goodsBean.getTemplateId())) {
|
|
if (StringUtils.isNotBlank(goodsBean.getTemplateId())) {
|
|
|
GoodsTemplate goodsTemplate = new GoodsTemplate();
|
|
GoodsTemplate goodsTemplate = new GoodsTemplate();
|
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
@@ -500,8 +347,6 @@ public class GoodsLogic {
|
|
|
goodsTemplateService.save(goodsTemplate);
|
|
goodsTemplateService.save(goodsTemplate);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //查询物料信息
|
|
|
|
|
- fucaiLogic.getWuliao(goodsSpecList);
|
|
|
|
|
//批量保存商品规格
|
|
//批量保存商品规格
|
|
|
if (CollectionUtils.isNotEmpty(goodsSpecList))
|
|
if (CollectionUtils.isNotEmpty(goodsSpecList))
|
|
|
goodsSpecService.saveBatch(goodsSpecList);
|
|
goodsSpecService.saveBatch(goodsSpecList);
|
|
@@ -515,8 +360,14 @@ public class GoodsLogic {
|
|
|
this.saveGoodsTagRela(goodsBean.getTags(), goodsBean.getGoodsId(), 1);
|
|
this.saveGoodsTagRela(goodsBean.getTags(), goodsBean.getGoodsId(), 1);
|
|
|
this.saveGoodsTagRela(goodsBean.getTagsLabel(), goodsBean.getGoodsId(), 2);
|
|
this.saveGoodsTagRela(goodsBean.getTagsLabel(), goodsBean.getGoodsId(), 2);
|
|
|
|
|
|
|
|
- //套购商品处理
|
|
|
|
|
- //this.saveGoodsPackage(goodsBean);
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void commonCheckGoods(GoodsBean goodsBean) {
|
|
|
|
|
+ if (StringUtils.equals(goodsBean.getGoodsType(), GoodsTypeEnum.COMMON.toString())
|
|
|
|
|
+ && (goodsBean.getGoodsSpecs() == null || goodsBean.getGoodsSpecs().size() == 0)) {
|
|
|
|
|
+ //如果是规格没有抛出异常
|
|
|
|
|
+ throw new RemoteServiceException("至少要有一个规格!");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -541,49 +392,6 @@ public class GoodsLogic {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 限制最大分账
|
|
|
|
|
- *
|
|
|
|
|
- * @param price
|
|
|
|
|
- * @param shareAmount
|
|
|
|
|
- * @return
|
|
|
|
|
- */
|
|
|
|
|
- private BigDecimal limitShareAmount(BigDecimal price, BigDecimal shareAmount) {
|
|
|
|
|
- if (price == null) {
|
|
|
|
|
- throw new RemoteServiceException("销售价不能为空");
|
|
|
|
|
- }
|
|
|
|
|
- if (shareAmount == null) {
|
|
|
|
|
- throw new RemoteServiceException("佣金或分销金额不能为空");
|
|
|
|
|
- }
|
|
|
|
|
- return shareAmount;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取内部分销金额
|
|
|
|
|
- */
|
|
|
|
|
- private BigDecimal getInnerShareAmount(GoodsSpec goodsSpec) {
|
|
|
|
|
- BigDecimal innerShareAmount = goodsSpec.getInnerShareAmount();
|
|
|
|
|
- Double innerSharePercent = goodsSpec.getInnerSharePercent();
|
|
|
|
|
- BigDecimal price = goodsSpec.getPrice();
|
|
|
|
|
-
|
|
|
|
|
- //以内部分销比列为准
|
|
|
|
|
- if (innerSharePercent != null && innerSharePercent.compareTo(new Double("0.00")) > 0) {
|
|
|
|
|
- // price * innerSharePercent/100 = 内部分销金额
|
|
|
|
|
- innerShareAmount = price.multiply(new BigDecimal(innerSharePercent / 100.0)).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
-
|
|
|
|
|
- return limitShareAmount(price, innerShareAmount);
|
|
|
|
|
- }
|
|
|
|
|
- //没有比列有金额以金额为准
|
|
|
|
|
- else if (innerShareAmount != null) {
|
|
|
|
|
- goodsSpec.setInnerSharePercent(new Double("0.00"));
|
|
|
|
|
- return limitShareAmount(price, innerShareAmount);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- goodsSpec.setInnerSharePercent(goodsSpec.getSharePercent());
|
|
|
|
|
- return goodsSpec.getShareAmount();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 编辑商品
|
|
* 编辑商品
|
|
|
*
|
|
*
|
|
@@ -592,16 +400,12 @@ public class GoodsLogic {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void update(GoodsBean goodsBean, HttpServletRequest request) throws RemoteServiceException {
|
|
public void update(GoodsBean goodsBean, HttpServletRequest request) throws RemoteServiceException {
|
|
|
|
|
|
|
|
- //检查是否存在秒杀活动
|
|
|
|
|
- if (StringUtils.equals(goodsBean.getGoodsType(), GoodsTypeEnum.COMMON.toString())
|
|
|
|
|
- && (goodsBean.getGoodsSpecs() == null || goodsBean.getGoodsSpecs().size() == 0)) {
|
|
|
|
|
- throw new RemoteServiceException("至少要有一个规格!");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.commonCheckGoods(goodsBean);
|
|
|
|
|
|
|
|
//设置企业微信id
|
|
//设置企业微信id
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
if (StringUtils.isBlank(adminUser.getCompanyWechatId())) {
|
|
if (StringUtils.isBlank(adminUser.getCompanyWechatId())) {
|
|
|
- throw new RemoteServiceException("非租户账号不可操作当前信息");
|
|
|
|
|
|
|
+ throw new RemoteServiceException("非商户账号不可操作当前信息");
|
|
|
}
|
|
}
|
|
|
goodsBean.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
goodsBean.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
|
goodsBean.setCompanyName(adminUser.getCompanyName());
|
|
goodsBean.setCompanyName(adminUser.getCompanyName());
|
|
@@ -615,13 +419,6 @@ public class GoodsLogic {
|
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
|
.setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
.setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
|
- .setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
|
|
|
- .setShareAmount(limitShareAmount(goodsSpec.getPrice(), //比列>0 覆盖分销金额
|
|
|
|
|
- goodsSpec.getSharePercent() != null && goodsSpec.getSharePercent().compareTo(new Double("0.00")) > 0 ?
|
|
|
|
|
- goodsSpec.getPrice().multiply(new BigDecimal(goodsSpec.getSharePercent() / 100.0)).setScale(2, BigDecimal.ROUND_DOWN)
|
|
|
|
|
- : goodsSpec.getShareAmount()
|
|
|
|
|
- ))
|
|
|
|
|
- .setInnerShareAmount(getInnerShareAmount(goodsSpec))//需最后设置
|
|
|
|
|
)
|
|
)
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
@@ -629,12 +426,10 @@ public class GoodsLogic {
|
|
|
//更新主表信息
|
|
//更新主表信息
|
|
|
List<GoodsSpec> goodsSpecList = goodsBean.getGoodsSpecs();
|
|
List<GoodsSpec> goodsSpecList = goodsBean.getGoodsSpecs();
|
|
|
if (CollectionUtils.isNotEmpty(goodsSpecList)) {
|
|
if (CollectionUtils.isNotEmpty(goodsSpecList)) {
|
|
|
- Collections.sort(goodsSpecList, (o1, o2) -> o1.getPrice().compareTo(o2.getPrice()));
|
|
|
|
|
|
|
+ goodsSpecList.sort(Comparator.comparing(GoodsSpec::getPrice));
|
|
|
goodsBean.setGoodsPrice(goodsSpecList.get(0).getPrice());
|
|
goodsBean.setGoodsPrice(goodsSpecList.get(0).getPrice());
|
|
|
- goodsBean.setOrgGoodsPrice(goodsSpecList.get(0).getOrgPrice());
|
|
|
|
|
|
|
+ goodsBean.setOrgGoodsPrice(BigDecimal.ZERO);
|
|
|
}
|
|
}
|
|
|
- //查询物料信息
|
|
|
|
|
- fucaiLogic.getWuliao(goodsSpecList);
|
|
|
|
|
}
|
|
}
|
|
|
goodsService.updateById(goodsBean);
|
|
goodsService.updateById(goodsBean);
|
|
|
|
|
|
|
@@ -659,7 +454,6 @@ public class GoodsLogic {
|
|
|
}
|
|
}
|
|
|
//查找规格id为空的 添加到从表
|
|
//查找规格id为空的 添加到从表
|
|
|
if (CollectionUtils.isNotEmpty(goodsBean.getGoodsSpecs())) {
|
|
if (CollectionUtils.isNotEmpty(goodsBean.getGoodsSpecs())) {
|
|
|
-
|
|
|
|
|
List<GoodsSpec> addGoodsSpecList = goodsBean.getGoodsSpecs();
|
|
List<GoodsSpec> addGoodsSpecList = goodsBean.getGoodsSpecs();
|
|
|
for (GoodsSpec goodsSpec : addGoodsSpecList) {
|
|
for (GoodsSpec goodsSpec : addGoodsSpecList) {
|
|
|
|
|
|
|
@@ -670,15 +464,7 @@ public class GoodsLogic {
|
|
|
|
|
|
|
|
goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
|
.setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
.setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
|
- .setCompanyName(goodsBean.getCompanyName())
|
|
|
|
|
- //.setSpecValue(goodsSpec.getSpecValue())
|
|
|
|
|
- .setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
|
|
|
- .setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getSharePercent() != null //分销比列不为0覆盖分销金额
|
|
|
|
|
- && goodsSpec.getSharePercent().compareTo(new Double("0.00")) > 0 ?
|
|
|
|
|
- goodsSpec.getPrice().multiply(new BigDecimal(goodsSpec.getSharePercent() / 100.0))
|
|
|
|
|
- .setScale(2, BigDecimal.ROUND_DOWN)
|
|
|
|
|
- : goodsSpec.getShareAmount()))
|
|
|
|
|
- .setInnerShareAmount(getInnerShareAmount(goodsSpec));//需最后设置
|
|
|
|
|
|
|
+ .setCompanyName(goodsBean.getCompanyName());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (addGoodsSpecList.size() > 0) {
|
|
if (addGoodsSpecList.size() > 0) {
|
|
@@ -689,88 +475,9 @@ public class GoodsLogic {
|
|
|
this.saveGoodsTagRela(goodsBean.getTags(), goodsBean.getGoodsId(), 1);
|
|
this.saveGoodsTagRela(goodsBean.getTags(), goodsBean.getGoodsId(), 1);
|
|
|
this.saveGoodsTagRela(goodsBean.getTagsLabel(), goodsBean.getGoodsId(), 2);
|
|
this.saveGoodsTagRela(goodsBean.getTagsLabel(), goodsBean.getGoodsId(), 2);
|
|
|
|
|
|
|
|
- //套购商品处理
|
|
|
|
|
- //this.saveGoodsPackage(goodsBean);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 添加套购商品
|
|
|
|
|
- */
|
|
|
|
|
-// public void saveGoodsPackage(GoodsBean goodsBean){
|
|
|
|
|
-// if(!StringUtils.equals(goodsBean.getGoodsType(),GoodsTypeEnum.PACKAGE.toString())){
|
|
|
|
|
-// return;
|
|
|
|
|
-// }
|
|
|
|
|
-// if(StringUtils.isBlank(goodsBean.getPackagePop()) || goodsBean.getPackagePop().indexOf(":") == -1){
|
|
|
|
|
-// throw new RemoteServiceException("请填写正确的比例,例如 2:1");
|
|
|
|
|
-// }
|
|
|
|
|
-// List<GoodsPackagePop> goodsPackagePops = goodsBean.getGoodsPackagePops();
|
|
|
|
|
-// if(CollectionUtils.isEmpty(goodsPackagePops)){
|
|
|
|
|
-// throw new RemoteServiceException("请配置套购的比例商品");
|
|
|
|
|
-// }
|
|
|
|
|
-// List<GoodsPackagePop> distinctList = goodsPackagePops.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
-// if(goodsPackagePops.size() != distinctList.size()){
|
|
|
|
|
-// throw new RemoteServiceException("禁止配置重复的机型");
|
|
|
|
|
-// }
|
|
|
|
|
-// //计算最低销售价格,最低分佣金额
|
|
|
|
|
-// BigDecimal totalMinPrice = BigDecimal.valueOf(0);
|
|
|
|
|
-// BigDecimal totalMinShareAmount = BigDecimal.valueOf(0);
|
|
|
|
|
-// //判断条件的比例和对应的机型是否合格
|
|
|
|
|
-// String[] split = goodsBean.getPackagePop().split(":");
|
|
|
|
|
-// for (int i = 1;i <= split.length; i++) {
|
|
|
|
|
-// int a = i;
|
|
|
|
|
-// long count = goodsPackagePops.stream().filter(v -> v.getType().intValue() == a).count();
|
|
|
|
|
-// if(count == 0){
|
|
|
|
|
-// throw new RemoteServiceException("条件比例与商品配置错误");
|
|
|
|
|
-// }
|
|
|
|
|
-// //判断比例格式是否正确
|
|
|
|
|
-// try {
|
|
|
|
|
-// int i1 = Integer.parseInt(split[i - 1]);
|
|
|
|
|
-// }catch(Exception e){
|
|
|
|
|
-// throw new RemoteServiceException("请填写正确的比例,例如 1:2");
|
|
|
|
|
-// }
|
|
|
|
|
-// BigDecimal minPrice = null;
|
|
|
|
|
-// BigDecimal minShareAmount = null;
|
|
|
|
|
-// for(GoodsPackagePop goodsPackagePop : goodsPackagePops) {
|
|
|
|
|
-// if(i != goodsPackagePop.getType()){
|
|
|
|
|
-// continue;
|
|
|
|
|
-// }
|
|
|
|
|
-// //计算最低销售金额和分佣金额
|
|
|
|
|
-// BigDecimal minPrice2 = goodsPackagePop.getPrice().multiply(new BigDecimal(split[goodsPackagePop.getType() - 1])).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
-// if (minPrice == null || minPrice.doubleValue() > minPrice2.doubleValue()) {
|
|
|
|
|
-// minPrice = minPrice2;
|
|
|
|
|
-// }
|
|
|
|
|
-// BigDecimal minShareAmount2 = minPrice2.multiply(goodsPackagePop.getShareRate()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
-// if (minShareAmount == null || minShareAmount.doubleValue() > minShareAmount2.doubleValue()) {
|
|
|
|
|
-// minShareAmount = minShareAmount2;
|
|
|
|
|
-// }
|
|
|
|
|
-// }
|
|
|
|
|
-// totalMinPrice = totalMinPrice.add(minPrice);
|
|
|
|
|
-// totalMinShareAmount = totalMinShareAmount.add(minShareAmount);
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// //添加配置机型
|
|
|
|
|
-// goodsPackagePopService.lambdaUpdate().eq(GoodsPackagePop::getGoodsPackageId,goodsBean.getGoodsId()).remove();
|
|
|
|
|
-// for(GoodsPackagePop goodsPackagePop : goodsPackagePops){
|
|
|
|
|
-// goodsPackagePop.setGoodsPackageId(goodsBean.getGoodsId());
|
|
|
|
|
-// }
|
|
|
|
|
-// goodsPackagePopService.saveBatch(goodsPackagePops);
|
|
|
|
|
-// //添加指定人员
|
|
|
|
|
-// if(goodsBean.getPackageUserType() == 0 && CollectionUtils.isEmpty(goodsBean.getGoodsPackageUserRelas())){
|
|
|
|
|
-// throw new RemoteServiceException("请选择指定用户");
|
|
|
|
|
-// }
|
|
|
|
|
-// for(GoodsPackageUserRela rela : goodsBean.getGoodsPackageUserRelas()){
|
|
|
|
|
-// rela.setGoodsId(goodsBean.getGoodsId());
|
|
|
|
|
-// rela.setCreateTime(new Date());
|
|
|
|
|
-// }
|
|
|
|
|
-// goodsBean.setPackageMinAmount(totalMinPrice);
|
|
|
|
|
-// goodsBean.setPackageMinShareAmount(totalMinShareAmount);
|
|
|
|
|
-// goodsBean.updateById();
|
|
|
|
|
-//
|
|
|
|
|
-// goodsPackageUserRelaService.lambdaUpdate().eq(GoodsPackageUserRela::getGoodsId,goodsBean.getGoodsId()).remove();
|
|
|
|
|
-// goodsPackageUserRelaService.saveBatch(goodsBean.getGoodsPackageUserRelas());
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
* 分类统计
|
|
* 分类统计
|
|
|
*/
|
|
*/
|
|
|
public GoodsTypeCount countByType(HttpServletRequest request) {
|
|
public GoodsTypeCount countByType(HttpServletRequest request) {
|
|
@@ -830,24 +537,12 @@ public class GoodsLogic {
|
|
|
goodsTemplateService.saveBatch(goodsTemplateList);
|
|
goodsTemplateService.saveBatch(goodsTemplateList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- public Integer secCheck(String goodsId) {
|
|
|
|
|
- Integer count = goodsCheckMapper.checkGoodsSec(goodsId);
|
|
|
|
|
- return count;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public List<String> secCheckBatch(List<String> goodsIdList) {
|
|
|
|
|
- List<String> secGoodsIds = goodsCheckMapper.checkGoodsSecBatch(goodsIdList);
|
|
|
|
|
- return secGoodsIds;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public Goods clone(String goodsId) {
|
|
public Goods clone(String goodsId) {
|
|
|
Goods goods = goodsService.getById(goodsId);
|
|
Goods goods = goodsService.getById(goodsId);
|
|
|
if (goods != null) {
|
|
if (goods != null) {
|
|
|
goods.setGoodsId(null);
|
|
goods.setGoodsId(null);
|
|
|
goods.setCreateTime(new Date());
|
|
goods.setCreateTime(new Date());
|
|
|
- goods.setPromotionGroup(false);
|
|
|
|
|
goodsService.save(goods);
|
|
goodsService.save(goods);
|
|
|
}
|
|
}
|
|
|
List<GoodsSpec> goodsSpecs = goodsSpecService.lambdaQuery()
|
|
List<GoodsSpec> goodsSpecs = goodsSpecService.lambdaQuery()
|
|
@@ -909,20 +604,6 @@ public class GoodsLogic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 用 商品规格的 分销金额 覆盖其 为null的 内部分销金额
|
|
|
|
|
- */
|
|
|
|
|
- public void syncGoodsSpecInnerShareMsg(HttpServletRequest request) {
|
|
|
|
|
- String companyWechatId = commonLogic.getAdminUser(request).getCompanyWechatId();
|
|
|
|
|
- if (StringUtils.isBlank(companyWechatId)) {
|
|
|
|
|
- throw new RemoteServiceException("运营账号暂无权限操作");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- customGoodsMapper.syncGoodsSpecInnerShareMsg(companyWechatId);
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
* 修改商品水印和有效时间
|
|
* 修改商品水印和有效时间
|
|
|
*/
|
|
*/
|
|
|
public void updateGoodsLogo(List<String> goodsIds, String logo, String logoStartTime, String logoEndTime) throws ParseException {
|
|
public void updateGoodsLogo(List<String> goodsIds, String logo, String logoStartTime, String logoEndTime) throws ParseException {
|
|
@@ -949,35 +630,10 @@ public class GoodsLogic {
|
|
|
return users;
|
|
return users;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 套购商品-导入指定人员
|
|
|
|
|
- */
|
|
|
|
|
- public List<User> importPackageUser(List<Object> list) {
|
|
|
|
|
- if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
- return new ArrayList<>();
|
|
|
|
|
- }
|
|
|
|
|
- List<String> mobiles = new ArrayList<>();
|
|
|
|
|
- for (Object o : list) {
|
|
|
|
|
- List<Object> row = (List<Object>) o;
|
|
|
|
|
- mobiles.add((String) row.get(1));
|
|
|
|
|
- }
|
|
|
|
|
- List<User> users = userLogic.getByMobile(mobiles);
|
|
|
|
|
- return users;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
public List<Goods> getById(List<String> goodsIds) {
|
|
public List<Goods> getById(List<String> goodsIds) {
|
|
|
List<Goods> goodsList = goodsService.lambdaQuery().in(Goods::getGoodsId, goodsIds).list();
|
|
List<Goods> goodsList = goodsService.lambdaQuery().in(Goods::getGoodsId, goodsIds).list();
|
|
|
return goodsList;
|
|
return goodsList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<GoodsSpec> getSpec(List<String> goodsIds) {
|
|
|
|
|
- List<GoodsSpec> goodsSpecs = goodsSpecService.lambdaQuery().in(GoodsSpec::getGoodsId, goodsIds).list();
|
|
|
|
|
- return goodsSpecs;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public void batchUp(List<String> goodsIds, String isTrade) {
|
|
|
|
|
- goodsService.lambdaUpdate()
|
|
|
|
|
- .in(Goods::getGoodsId, goodsIds)
|
|
|
|
|
- .set(Goods::getIsTrade, isTrade).update();
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|