|
@@ -11,7 +11,6 @@ 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.ExcelData;
|
|
import com.gree.mall.manager.bean.ExcelData;
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
-import com.gree.mall.manager.bean.admin.AdminWebsitVO;
|
|
|
|
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.commonmapper.GoodsCheckMapper;
|
|
@@ -19,7 +18,6 @@ import com.gree.mall.manager.constant.Constant;
|
|
import com.gree.mall.manager.enums.*;
|
|
import com.gree.mall.manager.enums.*;
|
|
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.*;
|
|
@@ -52,8 +50,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;
|
|
@@ -116,7 +112,7 @@ public class GoodsLogic {
|
|
|
|
|
|
//获取当前登录微信企业微信id
|
|
//获取当前登录微信企业微信id
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
- List<String> companyWechatIds = adminUser.getAdminCompanyIds();
|
|
|
|
|
|
+ List<String> companyIds = adminUser.getAdminCompanyIds();
|
|
|
|
|
|
String sortStr = null;
|
|
String sortStr = null;
|
|
if (goodsSortJson != null && !goodsSortJson.trim().equals("")) {
|
|
if (goodsSortJson != null && !goodsSortJson.trim().equals("")) {
|
|
@@ -133,7 +129,7 @@ public class GoodsLogic {
|
|
}
|
|
}
|
|
|
|
|
|
IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(pageNum, pageSize), flag, keyword, startPrice,
|
|
IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(pageNum, pageSize), flag, keyword, startPrice,
|
|
- endPrice, startShare, endShare, sortStr, categoryIds, status, goodsTypes,adminUser.getCompanyWechatId());
|
|
|
|
|
|
+ endPrice, startShare, endShare, sortStr, categoryIds, status, goodsTypes,adminUser.getCompanyId());
|
|
|
|
|
|
//商品规格
|
|
//商品规格
|
|
for (GoodsSpecBean goodsSpecBean : goodsSpecBeanIPage.getRecords()) {
|
|
for (GoodsSpecBean goodsSpecBean : goodsSpecBeanIPage.getRecords()) {
|
|
@@ -167,7 +163,7 @@ public class GoodsLogic {
|
|
|
|
|
|
//获取当前登录微信企业微信id
|
|
//获取当前登录微信企业微信id
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
- List<String> companyWechatIds = adminUser.getAdminCompanyIds();
|
|
|
|
|
|
+ List<String> companyIds = adminUser.getAdminCompanyIds();
|
|
|
|
|
|
String sortStr = null;
|
|
String sortStr = null;
|
|
if (goodsSortJson != null && !goodsSortJson.trim().equals("")) {
|
|
if (goodsSortJson != null && !goodsSortJson.trim().equals("")) {
|
|
@@ -180,7 +176,7 @@ public class GoodsLogic {
|
|
}
|
|
}
|
|
|
|
|
|
IPage<GoodsPackageList> goodsPackageListIPage = customGoodsMapper.queryGoodsPackageList(new Page<>(pageNum, pageSize), keyword, startPrice,
|
|
IPage<GoodsPackageList> goodsPackageListIPage = customGoodsMapper.queryGoodsPackageList(new Page<>(pageNum, pageSize), keyword, startPrice,
|
|
- endPrice, startShare, endShare, sortStr, categoryIds, status, companyWechatIds);
|
|
|
|
|
|
+ endPrice, startShare, endShare, sortStr, categoryIds, status, companyIds);
|
|
|
|
|
|
return goodsPackageListIPage;
|
|
return goodsPackageListIPage;
|
|
}
|
|
}
|
|
@@ -196,11 +192,11 @@ public class GoodsLogic {
|
|
|
|
|
|
//获取当前登录微信企业微信id
|
|
//获取当前登录微信企业微信id
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
- List<String> companyWechatIds = adminUser.getAdminCompanyIds();
|
|
|
|
|
|
+ List<String> companyIds = adminUser.getAdminCompanyIds();
|
|
|
|
|
|
|
|
|
|
IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(1, -1), null, null, null,
|
|
IPage<GoodsSpecBean> goodsSpecBeanIPage = customGoodsMapper.pageList(new Page<>(1, -1), null, null, null,
|
|
- null, null, null, null, categoryIds, null, null,adminUser.getCompanyWechatId());
|
|
|
|
|
|
+ null, null, null, null, categoryIds, null, null,adminUser.getCompanyId());
|
|
//添加规格
|
|
//添加规格
|
|
List<GoodsSpecBean> records = goodsSpecBeanIPage.getRecords();
|
|
List<GoodsSpecBean> records = goodsSpecBeanIPage.getRecords();
|
|
for (GoodsSpecBean record : records) {
|
|
for (GoodsSpecBean record : records) {
|
|
@@ -445,7 +441,7 @@ public class GoodsLogic {
|
|
String result = name.substring(0, name.length() - 1);
|
|
String result = name.substring(0, name.length() - 1);
|
|
goodsBean.setPutCompanyName(result);
|
|
goodsBean.setPutCompanyName(result);
|
|
goodsBean.setCompanyName(result);
|
|
goodsBean.setCompanyName(result);
|
|
- goodsBean.setCompanyWechatId(goodsBean.getPutCompanyId());
|
|
|
|
|
|
+ goodsBean.setCompanyId(goodsBean.getPutCompanyId());
|
|
}
|
|
}
|
|
|
|
|
|
GoodsCategory goodsCategory = goodsCategoryService.getById(goodsBean.getCategoryId());
|
|
GoodsCategory goodsCategory = goodsCategoryService.getById(goodsBean.getCategoryId());
|
|
@@ -459,7 +455,7 @@ public class GoodsLogic {
|
|
goodsSpecList = goodsBean.getGoodsSpecs()
|
|
goodsSpecList = goodsBean.getGoodsSpecs()
|
|
.stream()
|
|
.stream()
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
- .setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
|
|
|
|
+ .setCompanyId(goodsBean.getCompanyId())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setCreateTime(creatDate).setDel(false)
|
|
.setCreateTime(creatDate).setDel(false)
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
@@ -480,7 +476,7 @@ public class GoodsLogic {
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
goodsTemplate.setTemplateId(goodsBean.getTemplateId());
|
|
goodsTemplate.setTemplateId(goodsBean.getTemplateId());
|
|
goodsTemplate.setCreateTime(new Date());
|
|
goodsTemplate.setCreateTime(new Date());
|
|
- goodsTemplate.setCompanyWechatId(goodsBean.getCompanyWechatId());
|
|
|
|
|
|
+ goodsTemplate.setCompanyId(goodsBean.getCompanyId());
|
|
goodsTemplate.setCompanyName(goodsBean.getCompanyName());
|
|
goodsTemplate.setCompanyName(goodsBean.getCompanyName());
|
|
goodsTemplateService.save(goodsTemplate);
|
|
goodsTemplateService.save(goodsTemplate);
|
|
}
|
|
}
|
|
@@ -586,8 +582,8 @@ public class GoodsLogic {
|
|
//设置企业微信id
|
|
//设置企业微信id
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
|
|
|
- goodsBean.setCompanyWechatId(adminUser.getLoginCompanyWechatId());
|
|
|
|
- goodsBean.setCompanyName(adminUser.getLoginCompanyName());
|
|
|
|
|
|
+ goodsBean.setCompanyId(null);
|
|
|
|
+ goodsBean.setCompanyName(null);
|
|
|
|
|
|
if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
|
|
if (!StringUtil.isEmpty(goodsBean.getPutCompanyId())) {
|
|
goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
|
|
goodsBean.setPutCompanyId(goodsBean.getPutCompanyId());
|
|
@@ -601,18 +597,16 @@ public class GoodsLogic {
|
|
String result = name.substring(0, name.length() - 1);
|
|
String result = name.substring(0, name.length() - 1);
|
|
goodsBean.setPutCompanyName(result);
|
|
goodsBean.setPutCompanyName(result);
|
|
goodsBean.setCompanyName(result);
|
|
goodsBean.setCompanyName(result);
|
|
- goodsBean.setCompanyWechatId(goodsBean.getPutCompanyId());
|
|
|
|
|
|
+ goodsBean.setCompanyId(goodsBean.getPutCompanyId());
|
|
}
|
|
}
|
|
|
|
|
|
- final AdminCompanyWechat companyWechat = adminCompanyWechatService.getById(adminUser.getLoginCompanyWechatId());
|
|
|
|
-
|
|
|
|
List<GoodsSpec> notRemoveList = new ArrayList<>();
|
|
List<GoodsSpec> notRemoveList = new ArrayList<>();
|
|
//查找未删除的规格
|
|
//查找未删除的规格
|
|
if(CollectionUtils.isNotEmpty(goodsBean.getGoodsSpecs())) {
|
|
if(CollectionUtils.isNotEmpty(goodsBean.getGoodsSpecs())) {
|
|
notRemoveList = goodsBean.getGoodsSpecs().stream()
|
|
notRemoveList = goodsBean.getGoodsSpecs().stream()
|
|
.filter(goodsSpec -> StringUtils.isNotEmpty(goodsSpec.getGoodsSpecId()))
|
|
.filter(goodsSpec -> StringUtils.isNotEmpty(goodsSpec.getGoodsSpecId()))
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
- .setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
|
|
|
|
+ .setCompanyId(goodsBean.getCompanyId())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getShareAmount())) //限制金额40%
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), //比列>0 覆盖分销金额
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), //比列>0 覆盖分销金额
|
|
@@ -641,7 +635,7 @@ public class GoodsLogic {
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
goodsTemplate.setGoodsId(goodsBean.getGoodsId());
|
|
goodsTemplate.setTemplateId(goodsBean.getTemplateId());
|
|
goodsTemplate.setTemplateId(goodsBean.getTemplateId());
|
|
goodsTemplate.setCreateTime(new Date());
|
|
goodsTemplate.setCreateTime(new Date());
|
|
- goodsTemplate.setCompanyWechatId(goodsBean.getCompanyWechatId());
|
|
|
|
|
|
+ goodsTemplate.setCompanyId(goodsBean.getCompanyId());
|
|
goodsTemplate.setCompanyName(goodsBean.getCompanyName());
|
|
goodsTemplate.setCompanyName(goodsBean.getCompanyName());
|
|
goodsTemplateService.save(goodsTemplate);
|
|
goodsTemplateService.save(goodsTemplate);
|
|
}
|
|
}
|
|
@@ -671,7 +665,7 @@ public class GoodsLogic {
|
|
List<GoodsSpec> addGoodsSpecList = goodsBean.getGoodsSpecs().stream()
|
|
List<GoodsSpec> addGoodsSpecList = goodsBean.getGoodsSpecs().stream()
|
|
.filter(goodsSpec -> StringUtils.isEmpty(goodsSpec.getGoodsSpecId()))
|
|
.filter(goodsSpec -> StringUtils.isEmpty(goodsSpec.getGoodsSpecId()))
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
.map(goodsSpec -> goodsSpec.setGoodsId(goodsBean.getGoodsId())
|
|
- .setCompanyWechatId(goodsBean.getCompanyWechatId())
|
|
|
|
|
|
+ .setCompanyId(goodsBean.getCompanyId())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setCompanyName(goodsBean.getCompanyName())
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getSharePercent() != null
|
|
.setShareAmount(limitShareAmount(goodsSpec.getPrice(), goodsSpec.getSharePercent() != null
|
|
&& goodsSpec.getSharePercent().compareTo(new Double("0.00")) > 0 ?
|
|
&& goodsSpec.getSharePercent().compareTo(new Double("0.00")) > 0 ?
|
|
@@ -818,8 +812,8 @@ public class GoodsLogic {
|
|
goodsTemplate.setGoodsId(goodsId);
|
|
goodsTemplate.setGoodsId(goodsId);
|
|
goodsTemplate.setTemplateId(goodsTemplateBean.getTemplateId());
|
|
goodsTemplate.setTemplateId(goodsTemplateBean.getTemplateId());
|
|
goodsTemplate.setCreateTime(new Date());
|
|
goodsTemplate.setCreateTime(new Date());
|
|
- goodsTemplate.setCompanyWechatId(adminUser.getLoginCompanyWechatId());
|
|
|
|
- goodsTemplate.setCompanyName(adminUser.getLoginCompanyName());
|
|
|
|
|
|
+ goodsTemplate.setCompanyId(null);
|
|
|
|
+ goodsTemplate.setCompanyName(null);
|
|
goodsTemplateList.add(goodsTemplate);
|
|
goodsTemplateList.add(goodsTemplate);
|
|
}
|
|
}
|
|
goodsTemplateService.saveBatch(goodsTemplateList);
|
|
goodsTemplateService.saveBatch(goodsTemplateList);
|
|
@@ -907,12 +901,8 @@ public class GoodsLogic {
|
|
* 用 商品规格的 分销金额 覆盖其 为null的 内部分销金额
|
|
* 用 商品规格的 分销金额 覆盖其 为null的 内部分销金额
|
|
*/
|
|
*/
|
|
public void syncGoodsSpecInnerShareMsg(HttpServletRequest request){
|
|
public void syncGoodsSpecInnerShareMsg(HttpServletRequest request){
|
|
- String companyWechatId = commonLogic.getAdminUser(request).getLoginCompanyWechatId();
|
|
|
|
- if(StringUtils.isEmpty(companyWechatId)){
|
|
|
|
- throw new RemoteServiceException("运营账号暂无权限操作");
|
|
|
|
- }
|
|
|
|
|
|
|
|
- customGoodsMapper.syncGoodsSpecInnerShareMsg(companyWechatId);
|
|
|
|
|
|
+ customGoodsMapper.syncGoodsSpecInnerShareMsg(null);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -980,10 +970,10 @@ public class GoodsLogic {
|
|
*/
|
|
*/
|
|
public List<GoodsBean> outsideList(Date time){
|
|
public List<GoodsBean> outsideList(Date time){
|
|
|
|
|
|
- List<GoodsCategory> goodsCategoryList = goodsCategoryService.lambdaQuery().eq(GoodsCategory::getCompanyWechatId, "1").list();
|
|
|
|
|
|
+ List<GoodsCategory> goodsCategoryList = goodsCategoryService.lambdaQuery().eq(GoodsCategory::getCompanyId, "1").list();
|
|
Map<String, GoodsCategory> map = goodsCategoryList.stream().collect(Collectors.toMap(GoodsCategory::getCategoryId, Function.identity()));
|
|
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::getCompanyWechatId,"1").list();
|
|
|
|
|
|
+ List<Goods> list = goodsService.lambdaQuery().ge(time != null, Goods::getUpdateTime, time).eq(Goods::getCompanyId,"1").list();
|
|
List<GoodsBean> goodsBeans = BeanUtil.copyToList(list, GoodsBean.class);
|
|
List<GoodsBean> goodsBeans = BeanUtil.copyToList(list, GoodsBean.class);
|
|
for(GoodsBean goodsBean : goodsBeans){
|
|
for(GoodsBean goodsBean : goodsBeans){
|
|
List<GoodsSpec> list1 = goodsSpecService.lambdaQuery().eq(GoodsSpec::getGoodsId, goodsBean.getGoodsId()).list();
|
|
List<GoodsSpec> list1 = goodsSpecService.lambdaQuery().eq(GoodsSpec::getGoodsId, goodsBean.getGoodsId()).list();
|
|
@@ -1010,13 +1000,13 @@ public class GoodsLogic {
|
|
|
|
|
|
public void categoryAndGoods(String sourceCompanyId, String targetCompanyId, String targetCompanyName) {
|
|
public void categoryAndGoods(String sourceCompanyId, String targetCompanyId, String targetCompanyName) {
|
|
final Integer count = goodsCategoryService.lambdaQuery()
|
|
final Integer count = goodsCategoryService.lambdaQuery()
|
|
- .eq(GoodsCategory::getCompanyWechatId, targetCompanyId)
|
|
|
|
|
|
+ .eq(GoodsCategory::getCompanyId, targetCompanyId)
|
|
.count();
|
|
.count();
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
throw new RemoteServiceException("数据已存在");
|
|
throw new RemoteServiceException("数据已存在");
|
|
}
|
|
}
|
|
List<GoodsCategory> parentCategoryList = goodsCategoryService.lambdaQuery()
|
|
List<GoodsCategory> parentCategoryList = goodsCategoryService.lambdaQuery()
|
|
- .eq(GoodsCategory::getCompanyWechatId, sourceCompanyId)
|
|
|
|
|
|
+ .eq(GoodsCategory::getCompanyId, sourceCompanyId)
|
|
.eq(GoodsCategory::getLevel, 1)
|
|
.eq(GoodsCategory::getLevel, 1)
|
|
.eq(GoodsCategory::getStatus, true)
|
|
.eq(GoodsCategory::getStatus, true)
|
|
.list();
|
|
.list();
|
|
@@ -1027,14 +1017,14 @@ public class GoodsLogic {
|
|
// 插入目前父类
|
|
// 插入目前父类
|
|
BeanUtils.copyProperties(parentCategory, copyParentCategory);
|
|
BeanUtils.copyProperties(parentCategory, copyParentCategory);
|
|
copyParentCategory.setCategoryId(IdWorker.getIdStr())
|
|
copyParentCategory.setCategoryId(IdWorker.getIdStr())
|
|
- .setCompanyWechatId(targetCompanyId)
|
|
|
|
|
|
+ .setCompanyId(targetCompanyId)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCreateTime(DateUtil.date())
|
|
.setCreateTime(DateUtil.date())
|
|
.insert();
|
|
.insert();
|
|
|
|
|
|
// 查询源小类
|
|
// 查询源小类
|
|
List<GoodsCategory> categoryList = goodsCategoryService.lambdaQuery()
|
|
List<GoodsCategory> categoryList = goodsCategoryService.lambdaQuery()
|
|
- .eq(GoodsCategory::getCompanyWechatId, sourceCompanyId)
|
|
|
|
|
|
+ .eq(GoodsCategory::getCompanyId, sourceCompanyId)
|
|
.eq(GoodsCategory::getParentId, parentCategory.getCategoryId())
|
|
.eq(GoodsCategory::getParentId, parentCategory.getCategoryId())
|
|
.eq(GoodsCategory::getLevel, 2)
|
|
.eq(GoodsCategory::getLevel, 2)
|
|
.eq(GoodsCategory::getStatus, true)
|
|
.eq(GoodsCategory::getStatus, true)
|
|
@@ -1046,7 +1036,7 @@ public class GoodsLogic {
|
|
// 插入目前小类
|
|
// 插入目前小类
|
|
BeanUtils.copyProperties(goodsCategory, copyCategory);
|
|
BeanUtils.copyProperties(goodsCategory, copyCategory);
|
|
copyCategory.setCategoryId(IdWorker.getIdStr())
|
|
copyCategory.setCategoryId(IdWorker.getIdStr())
|
|
- .setCompanyWechatId(targetCompanyId)
|
|
|
|
|
|
+ .setCompanyId(targetCompanyId)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCompanyName(targetCompanyName)
|
|
.setParentId(copyParentCategory.getCategoryId())
|
|
.setParentId(copyParentCategory.getCategoryId())
|
|
.setCreateTime(DateUtil.date())
|
|
.setCreateTime(DateUtil.date())
|
|
@@ -1055,7 +1045,7 @@ public class GoodsLogic {
|
|
// 查询源小类关联商品
|
|
// 查询源小类关联商品
|
|
final List<Goods> goodsList = goodsService.lambdaQuery()
|
|
final List<Goods> goodsList = goodsService.lambdaQuery()
|
|
.eq(Goods::getCategoryId, goodsCategory.getCategoryId())
|
|
.eq(Goods::getCategoryId, goodsCategory.getCategoryId())
|
|
- .eq(Goods::getCompanyWechatId, sourceCompanyId)
|
|
|
|
|
|
+ .eq(Goods::getCompanyId, sourceCompanyId)
|
|
.eq(Goods::getStatus, true)
|
|
.eq(Goods::getStatus, true)
|
|
.list();
|
|
.list();
|
|
|
|
|
|
@@ -1065,7 +1055,7 @@ public class GoodsLogic {
|
|
// 插入目前商品
|
|
// 插入目前商品
|
|
BeanUtils.copyProperties(goods, copyGoods);
|
|
BeanUtils.copyProperties(goods, copyGoods);
|
|
copyGoods.setGoodsId(IdWorker.getIdStr())
|
|
copyGoods.setGoodsId(IdWorker.getIdStr())
|
|
- .setCompanyWechatId(targetCompanyId)
|
|
|
|
|
|
+ .setCompanyId(targetCompanyId)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCategoryId(copyCategory.getCategoryId())
|
|
.setCategoryId(copyCategory.getCategoryId())
|
|
.setSoldNum(0)
|
|
.setSoldNum(0)
|
|
@@ -1076,7 +1066,7 @@ public class GoodsLogic {
|
|
// 查询源商品关联规格
|
|
// 查询源商品关联规格
|
|
final List<GoodsSpec> goodsSpecList = goodsSpecService.lambdaQuery()
|
|
final List<GoodsSpec> goodsSpecList = goodsSpecService.lambdaQuery()
|
|
.eq(GoodsSpec::getGoodsId, goods.getGoodsId())
|
|
.eq(GoodsSpec::getGoodsId, goods.getGoodsId())
|
|
- .eq(GoodsSpec::getCompanyWechatId, sourceCompanyId)
|
|
|
|
|
|
+ .eq(GoodsSpec::getCompanyId, sourceCompanyId)
|
|
.list();
|
|
.list();
|
|
|
|
|
|
// 遍历源规格
|
|
// 遍历源规格
|
|
@@ -1086,7 +1076,7 @@ public class GoodsLogic {
|
|
BeanUtils.copyProperties(goodsSpec, copyGoodsSpec);
|
|
BeanUtils.copyProperties(goodsSpec, copyGoodsSpec);
|
|
copyGoodsSpec.setGoodsSpecId(IdWorker.getIdStr())
|
|
copyGoodsSpec.setGoodsSpecId(IdWorker.getIdStr())
|
|
.setGoodsId(copyGoods.getGoodsId())
|
|
.setGoodsId(copyGoods.getGoodsId())
|
|
- .setCompanyWechatId(targetCompanyId)
|
|
|
|
|
|
+ .setCompanyId(targetCompanyId)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCompanyName(targetCompanyName)
|
|
.setShareAmount(BigDecimal.ZERO)
|
|
.setShareAmount(BigDecimal.ZERO)
|
|
.setSharePercent((double) 0)
|
|
.setSharePercent((double) 0)
|
|
@@ -1103,7 +1093,7 @@ public class GoodsLogic {
|
|
// 查询源商品关联说明模板
|
|
// 查询源商品关联说明模板
|
|
// final List<GoodsTemplate> goodsTemplateList = goodsTemplateService.lambdaQuery()
|
|
// final List<GoodsTemplate> goodsTemplateList = goodsTemplateService.lambdaQuery()
|
|
// .eq(GoodsTemplate::getGoodsId, goods.getGoodsId())
|
|
// .eq(GoodsTemplate::getGoodsId, goods.getGoodsId())
|
|
-// .eq(GoodsTemplate::getCompanyWechatId, sourceCompanyId)
|
|
|
|
|
|
+// .eq(GoodsTemplate::getCompanyId, sourceCompanyId)
|
|
// .list();
|
|
// .list();
|
|
//
|
|
//
|
|
// // 遍历源关联说明模板
|
|
// // 遍历源关联说明模板
|
|
@@ -1113,7 +1103,7 @@ public class GoodsLogic {
|
|
// BeanUtils.copyProperties(goodsTemplate, copyGoodsTemplate);
|
|
// BeanUtils.copyProperties(goodsTemplate, copyGoodsTemplate);
|
|
// copyGoodsTemplate.setGoodsTemplateId(IdWorker.getIdStr())
|
|
// copyGoodsTemplate.setGoodsTemplateId(IdWorker.getIdStr())
|
|
// .setGoodsId(copyGoods.getGoodsId())
|
|
// .setGoodsId(copyGoods.getGoodsId())
|
|
-// .setCompanyWechatId(targetCompanyId)
|
|
|
|
|
|
+// .setCompanyId(targetCompanyId)
|
|
// .setCompanyName(targetCompanyName)
|
|
// .setCompanyName(targetCompanyName)
|
|
// .setCreateTime(DateUtil.date())
|
|
// .setCreateTime(DateUtil.date())
|
|
// .insert();
|
|
// .insert();
|
|
@@ -1144,13 +1134,13 @@ public class GoodsLogic {
|
|
|
|
|
|
public void copyFreightTemplate(String sourceCompanyId, String targetCompanyId, String targetCompanyName) {
|
|
public void copyFreightTemplate(String sourceCompanyId, String targetCompanyId, String targetCompanyName) {
|
|
final Integer count = freightTemplateService.lambdaQuery()
|
|
final Integer count = freightTemplateService.lambdaQuery()
|
|
- .eq(FreightTemplate::getCompanyWechatId, targetCompanyId)
|
|
|
|
|
|
+ .eq(FreightTemplate::getCompanyId, targetCompanyId)
|
|
.count();
|
|
.count();
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
throw new RemoteServiceException("数据已存在");
|
|
throw new RemoteServiceException("数据已存在");
|
|
}
|
|
}
|
|
List<FreightTemplate> freightTemplateList = freightTemplateService.lambdaQuery()
|
|
List<FreightTemplate> freightTemplateList = freightTemplateService.lambdaQuery()
|
|
- .eq(FreightTemplate::getCompanyWechatId, sourceCompanyId)
|
|
|
|
|
|
+ .eq(FreightTemplate::getCompanyId, sourceCompanyId)
|
|
.list();
|
|
.list();
|
|
|
|
|
|
// 遍历源模板
|
|
// 遍历源模板
|
|
@@ -1159,21 +1149,21 @@ public class GoodsLogic {
|
|
// 插入目前模板
|
|
// 插入目前模板
|
|
BeanUtils.copyProperties(freightTemplate, copyFreightTemplate);
|
|
BeanUtils.copyProperties(freightTemplate, copyFreightTemplate);
|
|
copyFreightTemplate.setFreightTemplateId(IdWorker.getIdStr())
|
|
copyFreightTemplate.setFreightTemplateId(IdWorker.getIdStr())
|
|
- .setCompanyWechatId(targetCompanyId)
|
|
|
|
|
|
+ .setCompanyId(targetCompanyId)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCreateTime(DateUtil.date())
|
|
.setCreateTime(DateUtil.date())
|
|
.insert();
|
|
.insert();
|
|
|
|
|
|
// 查询源模板关联
|
|
// 查询源模板关联
|
|
List<FreightTemplateDetail> freightTemplateDetailList = freightTemplateDetailService.lambdaQuery()
|
|
List<FreightTemplateDetail> freightTemplateDetailList = freightTemplateDetailService.lambdaQuery()
|
|
- .eq(FreightTemplateDetail::getCompanyWechatId, sourceCompanyId)
|
|
|
|
|
|
+ .eq(FreightTemplateDetail::getCompanyId, sourceCompanyId)
|
|
.eq(FreightTemplateDetail::getFreightTemplateId, freightTemplate.getFreightTemplateId())
|
|
.eq(FreightTemplateDetail::getFreightTemplateId, freightTemplate.getFreightTemplateId())
|
|
.list();
|
|
.list();
|
|
|
|
|
|
goodsService.lambdaUpdate()
|
|
goodsService.lambdaUpdate()
|
|
.set(Goods::getFreightTemplateId, copyFreightTemplate.getFreightTemplateId())
|
|
.set(Goods::getFreightTemplateId, copyFreightTemplate.getFreightTemplateId())
|
|
.eq(Goods::getFreightTemplateId, freightTemplate.getFreightTemplateId())
|
|
.eq(Goods::getFreightTemplateId, freightTemplate.getFreightTemplateId())
|
|
- .eq(Goods::getCompanyWechatId, targetCompanyId)
|
|
|
|
|
|
+ .eq(Goods::getCompanyId, targetCompanyId)
|
|
.update();
|
|
.update();
|
|
|
|
|
|
// 遍历源模板关联
|
|
// 遍历源模板关联
|
|
@@ -1182,7 +1172,7 @@ public class GoodsLogic {
|
|
// 插入目前模板关联
|
|
// 插入目前模板关联
|
|
BeanUtils.copyProperties(detail, copyDetail);
|
|
BeanUtils.copyProperties(detail, copyDetail);
|
|
copyDetail.setFreightTemplateDetailId(IdWorker.getIdStr())
|
|
copyDetail.setFreightTemplateDetailId(IdWorker.getIdStr())
|
|
- .setCompanyWechatId(targetCompanyId)
|
|
|
|
|
|
+ .setCompanyId(targetCompanyId)
|
|
.setCompanyName(targetCompanyName)
|
|
.setCompanyName(targetCompanyName)
|
|
.setFreightTemplateId(copyFreightTemplate.getFreightTemplateId())
|
|
.setFreightTemplateId(copyFreightTemplate.getFreightTemplateId())
|
|
.setCreateTime(DateUtil.date())
|
|
.setCreateTime(DateUtil.date())
|