|
@@ -440,8 +440,6 @@ public class GoodsLogic {
|
|
|
}
|
|
|
String result = name.substring(0, name.length() - 1);
|
|
|
goodsBean.setPutCompanyName(result);
|
|
|
- goodsBean.setCompanyName(result);
|
|
|
- goodsBean.setCompanyId(goodsBean.getPutCompanyId());
|
|
|
}
|
|
|
|
|
|
GoodsCategory goodsCategory = goodsCategoryService.getById(goodsBean.getCategoryId());
|
|
@@ -455,9 +453,8 @@ public class GoodsLogic {
|
|
|
goodsSpecList = goodsBean.getGoodsSpecs()
|
|
|
.stream()
|
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
|
- .setCompanyId(goodsBean.getCompanyId())
|
|
|
- .setCompanyName(goodsBean.getCompanyName())
|
|
|
- .setCreateTime(creatDate).setDel(false)
|
|
|
+ .setCreateTime(creatDate)
|
|
|
+ .setDel(false)
|
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getSharePercent() != null //分销比列不为0覆盖分销金额
|
|
|
&& goodsSpec.getSharePercent().compareTo(new Double("0.00")) > 0 ?
|
|
@@ -476,8 +473,6 @@ public class GoodsLogic {
|
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
|
goodsTemplate.setTemplateId(goodsBean.getTemplateId());
|
|
|
goodsTemplate.setCreateTime(new Date());
|
|
|
- goodsTemplate.setCompanyId(goodsBean.getCompanyId());
|
|
|
- goodsTemplate.setCompanyName(goodsBean.getCompanyName());
|
|
|
goodsTemplateService.save(goodsTemplate);
|
|
|
}
|
|
|
|
|
@@ -582,9 +577,6 @@ public class GoodsLogic {
|
|
|
//设置企业微信id
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
|
|
|
- goodsBean.setCompanyId(null);
|
|
|
- goodsBean.setCompanyName(null);
|
|
|
-
|
|
|
if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
|
|
|
goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
|
|
|
String[] split = StringUtils.split(goodsBean.getPutCompanyId(), ",");
|
|
@@ -596,8 +588,6 @@ public class GoodsLogic {
|
|
|
}
|
|
|
String result = name.substring(0, name.length() - 1);
|
|
|
goodsBean.setPutCompanyName(result);
|
|
|
- goodsBean.setCompanyName(result);
|
|
|
- goodsBean.setCompanyId(goodsBean.getPutCompanyId());
|
|
|
}
|
|
|
|
|
|
List<GoodsSpec> notRemoveList = new ArrayList<>();
|
|
@@ -606,8 +596,6 @@ public class GoodsLogic {
|
|
|
notRemoveList = goodsBean.getGoodsSpecs().stream()
|
|
|
.filter(goodsSpec -> StringUtils.isNotEmpty(goodsSpec.getGoodsSpecId()))
|
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
|
- .setCompanyId(goodsBean.getCompanyId())
|
|
|
- .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 ?
|
|
@@ -635,8 +623,6 @@ public class GoodsLogic {
|
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
|
goodsTemplate.setTemplateId(goodsBean.getTemplateId());
|
|
|
goodsTemplate.setCreateTime(new Date());
|
|
|
- goodsTemplate.setCompanyId(goodsBean.getCompanyId());
|
|
|
- goodsTemplate.setCompanyName(goodsBean.getCompanyName());
|
|
|
goodsTemplateService.save(goodsTemplate);
|
|
|
}
|
|
|
|
|
@@ -665,8 +651,6 @@ public class GoodsLogic {
|
|
|
List<GoodsSpec> addGoodsSpecList = goodsBean.getGoodsSpecs().stream()
|
|
|
.filter(goodsSpec -> StringUtils.isEmpty(goodsSpec.getGoodsSpecId()))
|
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
|
- .setCompanyId(goodsBean.getCompanyId())
|
|
|
- .setCompanyName(goodsBean.getCompanyName())
|
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), 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)
|
|
@@ -812,8 +796,6 @@ public class GoodsLogic {
|
|
|
goodsTemplate.setGoodsId(goodsId);
|
|
|
goodsTemplate.setTemplateId(goodsTemplateBean.getTemplateId());
|
|
|
goodsTemplate.setCreateTime(new Date());
|
|
|
- goodsTemplate.setCompanyId(null);
|
|
|
- goodsTemplate.setCompanyName(null);
|
|
|
goodsTemplateList.add(goodsTemplate);
|
|
|
}
|
|
|
goodsTemplateService.saveBatch(goodsTemplateList);
|
|
@@ -970,10 +952,10 @@ public class GoodsLogic {
|
|
|
*/
|
|
|
public List<GoodsBean> outsideList(Date time){
|
|
|
|
|
|
- List<GoodsCategory> goodsCategoryList = goodsCategoryService.lambdaQuery().eq(GoodsCategory::getCompanyId, "1").list();
|
|
|
+ List<GoodsCategory> goodsCategoryList = goodsCategoryService.lambdaQuery().list();
|
|
|
Map<String, GoodsCategory> map = goodsCategoryList.stream().collect(Collectors.toMap(GoodsCategory::getCategoryId, Function.identity()));
|
|
|
|
|
|
- List<Goods> list = goodsService.lambdaQuery().ge(time != null, Goods::getUpdateTime, time).eq(Goods::getCompanyId,"1").list();
|
|
|
+ List<Goods> list = goodsService.lambdaQuery().ge(time != null, Goods::getUpdateTime, time).list();
|
|
|
List<GoodsBean> goodsBeans = BeanUtil.copyToList(list, GoodsBean.class);
|
|
|
for(GoodsBean goodsBean : goodsBeans){
|
|
|
List<GoodsSpec> list1 = goodsSpecService.lambdaQuery().eq(GoodsSpec::getGoodsId, goodsBean.getGoodsId()).list();
|
|
@@ -982,8 +964,6 @@ public class GoodsLogic {
|
|
|
GoodsCategory goodsCategory = map.get(goodsBean.getCategoryId());
|
|
|
if(goodsCategory != null){
|
|
|
goodsBean.setCategory2(goodsCategory.getName());
|
|
|
- goodsBean.setMainName(goodsCategory.getMainName());
|
|
|
- goodsBean.setSmallName(goodsCategory.getSmallName());
|
|
|
goodsBean.setIsVr(goodsBean.getGoodsName().indexOf("清洗") > -1);
|
|
|
}
|
|
|
GoodsCategory parentCategory = map.get(goodsCategory.getParentId());
|
|
@@ -1000,13 +980,11 @@ public class GoodsLogic {
|
|
|
|
|
|
public void categoryAndGoods(String sourceCompanyId, String targetCompanyId, String targetCompanyName) {
|
|
|
final Integer count = goodsCategoryService.lambdaQuery()
|
|
|
- .eq(GoodsCategory::getCompanyId, targetCompanyId)
|
|
|
.count();
|
|
|
if (count > 0) {
|
|
|
throw new RemoteServiceException("数据已存在");
|
|
|
}
|
|
|
List<GoodsCategory> parentCategoryList = goodsCategoryService.lambdaQuery()
|
|
|
- .eq(GoodsCategory::getCompanyId, sourceCompanyId)
|
|
|
.eq(GoodsCategory::getLevel, 1)
|
|
|
.eq(GoodsCategory::getStatus, true)
|
|
|
.list();
|
|
@@ -1017,14 +995,11 @@ public class GoodsLogic {
|
|
|
// 插入目前父类
|
|
|
BeanUtils.copyProperties(parentCategory, copyParentCategory);
|
|
|
copyParentCategory.setCategoryId(IdWorker.getIdStr())
|
|
|
- .setCompanyId(targetCompanyId)
|
|
|
- .setCompanyName(targetCompanyName)
|
|
|
.setCreateTime(DateUtil.date())
|
|
|
.insert();
|
|
|
|
|
|
// 查询源小类
|
|
|
List<GoodsCategory> categoryList = goodsCategoryService.lambdaQuery()
|
|
|
- .eq(GoodsCategory::getCompanyId, sourceCompanyId)
|
|
|
.eq(GoodsCategory::getParentId, parentCategory.getCategoryId())
|
|
|
.eq(GoodsCategory::getLevel, 2)
|
|
|
.eq(GoodsCategory::getStatus, true)
|
|
@@ -1036,8 +1011,6 @@ public class GoodsLogic {
|
|
|
// 插入目前小类
|
|
|
BeanUtils.copyProperties(goodsCategory, copyCategory);
|
|
|
copyCategory.setCategoryId(IdWorker.getIdStr())
|
|
|
- .setCompanyId(targetCompanyId)
|
|
|
- .setCompanyName(targetCompanyName)
|
|
|
.setParentId(copyParentCategory.getCategoryId())
|
|
|
.setCreateTime(DateUtil.date())
|
|
|
.insert();
|
|
@@ -1045,7 +1018,6 @@ public class GoodsLogic {
|
|
|
// 查询源小类关联商品
|
|
|
final List<Goods> goodsList = goodsService.lambdaQuery()
|
|
|
.eq(Goods::getCategoryId, goodsCategory.getCategoryId())
|
|
|
- .eq(Goods::getCompanyId, sourceCompanyId)
|
|
|
.eq(Goods::getStatus, true)
|
|
|
.list();
|
|
|
|
|
@@ -1055,8 +1027,6 @@ public class GoodsLogic {
|
|
|
// 插入目前商品
|
|
|
BeanUtils.copyProperties(goods, copyGoods);
|
|
|
copyGoods.setGoodsId(IdWorker.getIdStr())
|
|
|
- .setCompanyId(targetCompanyId)
|
|
|
- .setCompanyName(targetCompanyName)
|
|
|
.setCategoryId(copyCategory.getCategoryId())
|
|
|
.setSoldNum(0)
|
|
|
.setUmsDiscountCode("")
|
|
@@ -1066,7 +1036,6 @@ public class GoodsLogic {
|
|
|
// 查询源商品关联规格
|
|
|
final List<GoodsSpec> goodsSpecList = goodsSpecService.lambdaQuery()
|
|
|
.eq(GoodsSpec::getGoodsId, goods.getGoodsId())
|
|
|
- .eq(GoodsSpec::getCompanyId, sourceCompanyId)
|
|
|
.list();
|
|
|
|
|
|
// 遍历源规格
|
|
@@ -1076,8 +1045,6 @@ public class GoodsLogic {
|
|
|
BeanUtils.copyProperties(goodsSpec, copyGoodsSpec);
|
|
|
copyGoodsSpec.setGoodsSpecId(IdWorker.getIdStr())
|
|
|
.setGoodsId(copyGoods.getGoodsId())
|
|
|
- .setCompanyId(targetCompanyId)
|
|
|
- .setCompanyName(targetCompanyName)
|
|
|
.setShareAmount(BigDecimal.ZERO)
|
|
|
.setSharePercent((double) 0)
|
|
|
.setInnerShareAmount(BigDecimal.ZERO)
|
|
@@ -1163,7 +1130,6 @@ public class GoodsLogic {
|
|
|
goodsService.lambdaUpdate()
|
|
|
.set(Goods::getFreightTemplateId, copyFreightTemplate.getFreightTemplateId())
|
|
|
.eq(Goods::getFreightTemplateId, freightTemplate.getFreightTemplateId())
|
|
|
- .eq(Goods::getCompanyId, targetCompanyId)
|
|
|
.update();
|
|
|
|
|
|
// 遍历源模板关联
|