|
|
@@ -19,30 +19,29 @@ package org.springblade.salesPart.productLaunch.service.impl;
|
|
|
import com.alibaba.csp.sentinel.util.StringUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.client.feign.ISerialClient;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
-import org.springblade.purchase.sales.entity.Order;
|
|
|
import org.springblade.salesPart.corps.service.ICorpsAttnService;
|
|
|
import org.springblade.salesPart.corps.service.ICorpsDescService;
|
|
|
import org.springblade.salesPart.entity.*;
|
|
|
import org.springblade.salesPart.excel.ProductLaunchImportExcel;
|
|
|
import org.springblade.salesPart.goods.mapper.GoodsDescMapper;
|
|
|
+import org.springblade.salesPart.productLaunch.mapper.ProductLaunchMapper;
|
|
|
import org.springblade.salesPart.productLaunch.service.IProductLaunchFilesService;
|
|
|
+import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
|
|
|
import org.springblade.salesPart.shoppingCart.mapper.ShoppingCartMapper;
|
|
|
import org.springblade.salesPart.stock.service.IStockDescService;
|
|
|
import org.springblade.salesPart.vo.ProductLaunchVO;
|
|
|
-import org.springblade.salesPart.productLaunch.mapper.ProductLaunchMapper;
|
|
|
-import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springblade.system.entity.Dept;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
@@ -80,7 +79,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
|
|
|
detail.setFilesList(productLaunchFilesService.list(new QueryWrapper<PjProductLaunchFiles>().eq("pid", productLaunch.getId()).eq("is_deleted", 0)));
|
|
|
|
|
|
- if (ObjectUtil.isEmpty(detail.getSharedCompany())){
|
|
|
+ if (ObjectUtil.isEmpty(detail.getSharedCompany())) {
|
|
|
detail.setSharedCompany("");
|
|
|
}
|
|
|
return detail;
|
|
|
@@ -131,7 +130,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
}
|
|
|
|
|
|
//如果有共享公司 生成共享数据
|
|
|
- if (ObjectUtil.isNotEmpty(productLaunch.getSharedCompany())){
|
|
|
+ if (ObjectUtil.isNotEmpty(productLaunch.getSharedCompany())) {
|
|
|
|
|
|
LambdaQueryWrapper<PjProductLaunch> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
@@ -141,7 +140,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjProductLaunch::getSourceCompanyId, productLaunch.getSalesCompanyId());
|
|
|
|
|
|
List<PjProductLaunch> list = baseMapper.selectList(queryWrapper);
|
|
|
- if (ObjectUtil.isNotEmpty(list)){
|
|
|
+ if (ObjectUtil.isNotEmpty(list)) {
|
|
|
list.forEach(e -> {
|
|
|
e.setWhetherShare(1);
|
|
|
baseMapper.updateById(e);
|
|
|
@@ -162,7 +161,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjProductLaunch::getSourceCompanyId, productLaunch.getSalesCompanyId());
|
|
|
PjProductLaunch selOne = baseMapper.selectOne(lambdaQueryWrapper);
|
|
|
|
|
|
- if (ObjectUtil.isEmpty(selOne)){
|
|
|
+ if (ObjectUtil.isEmpty(selOne)) {
|
|
|
launch.setId(null);
|
|
|
launch.setBillType(1);
|
|
|
launch.setWhetherShare(0);
|
|
|
@@ -183,7 +182,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
}
|
|
|
baseMapper.insert(launch);
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
selOne.setInventory(productLaunch.getInventory());
|
|
|
selOne.setPriceOne(productLaunch.getPriceOne());
|
|
|
selOne.setPriceTwo(productLaunch.getPriceTwo());
|
|
|
@@ -202,7 +201,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
baseMapper.updateById(selOne);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
@@ -211,7 +210,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjProductLaunch::getSourceCompanyId, productLaunch.getSalesCompanyId());
|
|
|
List<PjProductLaunch> selectList = baseMapper.selectList(lambdaQueryWrapper);
|
|
|
|
|
|
- if (ObjectUtil.isNotEmpty(selectList)){
|
|
|
+ if (ObjectUtil.isNotEmpty(selectList)) {
|
|
|
selectList.forEach(e -> {
|
|
|
e.setWhetherShare(1);
|
|
|
baseMapper.updateById(e);
|
|
|
@@ -234,7 +233,9 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
if (CollectionUtils.isEmpty(data)) {
|
|
|
throw new SecurityException("导入数据不能为空");
|
|
|
}
|
|
|
-
|
|
|
+ List<PjProductLaunch> pjProductLaunchList = new ArrayList<>();
|
|
|
+ List<PjProductLaunch> launchList = new ArrayList<>();
|
|
|
+ List<PjProductLaunch> pjProductLaunchList1 = new ArrayList<>();
|
|
|
data.forEach(e -> {
|
|
|
PjProductLaunch productLaunch = new PjProductLaunch();
|
|
|
BeanUtils.copyProperties(e, productLaunch);
|
|
|
@@ -245,7 +246,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjGoodsDesc::getCname, e.getCname()));
|
|
|
|
|
|
- if (ObjectUtil.isNotEmpty(pjGoodsDesc)){
|
|
|
+ if (ObjectUtil.isNotEmpty(pjGoodsDesc)) {
|
|
|
//商品id
|
|
|
productLaunch.setGoodsId(pjGoodsDesc.getId());
|
|
|
productLaunch.setBrandId(pjGoodsDesc.getBrandId());
|
|
|
@@ -265,11 +266,11 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjStockDesc::getGoodsId, pjGoodsDesc.getId());
|
|
|
|
|
|
List<PjStockDesc> list = stockDescService.list(lambdaQueryWrapper);
|
|
|
- if (ObjectUtil.isNotEmpty(list)){
|
|
|
+ if (ObjectUtil.isNotEmpty(list)) {
|
|
|
productLaunch.setInventory(list.stream().map(PjStockDesc::getBalanceQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
}
|
|
|
- }else {
|
|
|
- throw new RuntimeException("商品"+e.getCname()+"名称错误或商品不存在");
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("商品" + e.getCname() + "名称错误或商品不存在");
|
|
|
}
|
|
|
|
|
|
//获得所属公司
|
|
|
@@ -282,17 +283,6 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
throw new SecurityException("请输入正确的所属公司");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- //获得共享公司
|
|
|
- if (StringUtil.isNotBlank(e.getSharedCompany())) {
|
|
|
- R<Dept> dept = iSysClient.getDeptIByName(AuthUtil.getTenantId(), e.getSalesCompanyName());
|
|
|
- if (ObjectUtil.isNotEmpty(dept.getData())) {
|
|
|
- productLaunch.setSharedCompany(dept.getData().getId()+"");
|
|
|
- } else {
|
|
|
- throw new SecurityException("请输入正确的共享公司");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
productLaunch.setBillType(0);
|
|
|
productLaunch.setPriceOne(e.getPriceOne());
|
|
|
productLaunch.setPriceTwo(e.getPriceTwo());
|
|
|
@@ -308,38 +298,112 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjProductLaunch::getBillType, 0);
|
|
|
PjProductLaunch one = baseMapper.selectOne(queryWrapper);
|
|
|
|
|
|
- if (one == null){
|
|
|
+ if (one == null) {
|
|
|
productLaunch.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
productLaunch.setCreateTime(new Date());
|
|
|
productLaunch.setCreateUser(AuthUtil.getUserId());
|
|
|
productLaunch.setTenantId(AuthUtil.getTenantId());
|
|
|
productLaunch.setUpAndDownShelves(1);
|
|
|
- baseMapper.insert(productLaunch);
|
|
|
- }else {
|
|
|
+// baseMapper.insert(productLaunch);
|
|
|
+ } else {
|
|
|
productLaunch.setId(one.getId());
|
|
|
productLaunch.setUpdateUser(AuthUtil.getUserId());
|
|
|
productLaunch.setUpdateTime(new Date());
|
|
|
productLaunch.setSharedCompany(one.getSharedCompany());
|
|
|
- baseMapper.updateById(productLaunch);
|
|
|
+// baseMapper.updateById(productLaunch);
|
|
|
+ }
|
|
|
+ //获得共享公司
|
|
|
+ if (StringUtil.isNotBlank(e.getSharedCompany())) {
|
|
|
+ R<List<Dept>> dept = iSysClient.getDeptListIByName(AuthUtil.getTenantId(), e.getSharedCompany());
|
|
|
+ productLaunch.setSharedCompany("");
|
|
|
+ for (Dept item : dept.getData()) {
|
|
|
+ productLaunch.setSharedCompany(productLaunch.getSharedCompany() + "," + item.getId());
|
|
|
+ PjProductLaunch launch = new PjProductLaunch();
|
|
|
+ BeanUtils.copyProperties(productLaunch, launch);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper1.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
+ .eq(PjProductLaunch::getBillType, 1)
|
|
|
+ .eq(PjProductLaunch::getGoodsId, productLaunch.getGoodsId())
|
|
|
+ .eq(PjProductLaunch::getSalesCompanyId, item)
|
|
|
+ .eq(PjProductLaunch::getSourceCompanyId, productLaunch.getSalesCompanyId());
|
|
|
+ PjProductLaunch selOne = baseMapper.selectOne(lambdaQueryWrapper1);
|
|
|
+
|
|
|
+ if (ObjectUtil.isEmpty(selOne)) {
|
|
|
+ launch.setId(null);
|
|
|
+ launch.setBillType(1);
|
|
|
+ launch.setWhetherShare(0);
|
|
|
+ launch.setUpAndDownShelves(0);
|
|
|
+ launch.setCreateUser(AuthUtil.getUserId());
|
|
|
+ launch.setCreateTime(new Date());
|
|
|
+ launch.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ launch.setSourceId(productLaunch.getId());
|
|
|
+ launch.setSourceCompanyId(productLaunch.getSalesCompanyId());
|
|
|
+ launch.setTenantId(AuthUtil.getTenantId());
|
|
|
+ launch.setSharedCompany(null);
|
|
|
+ launch.setSalesCompanyId(item.getId());
|
|
|
+ launch.setSalesCompanyName(item.getFullName());
|
|
|
+// baseMapper.insert(launch);
|
|
|
+ launchList.add(launch);
|
|
|
+ } else {
|
|
|
+ selOne.setInventory(productLaunch.getInventory());
|
|
|
+ selOne.setPriceOne(productLaunch.getPriceOne());
|
|
|
+ selOne.setPriceTwo(productLaunch.getPriceTwo());
|
|
|
+ selOne.setPriceThree(productLaunch.getPriceThree());
|
|
|
+ selOne.setPriceFour(productLaunch.getPriceFour());
|
|
|
+ selOne.setBrandItem(productLaunch.getBrandItem());
|
|
|
+ selOne.setPlaceProduction(productLaunch.getPlaceProduction());
|
|
|
+ selOne.setExplosionProof(productLaunch.getExplosionProof());
|
|
|
+ selOne.setOriginalFactory(productLaunch.getOriginalFactory());
|
|
|
+ selOne.setSelfRecovery(productLaunch.getSelfRecovery());
|
|
|
+ selOne.setUpdateTime(new Date());
|
|
|
+ selOne.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ selOne.setWhetherShare(0);
|
|
|
+ selOne.setUpAndDownShelves(0);
|
|
|
+ selOne.setSharedCompany(null);
|
|
|
+// baseMapper.updateById(selOne);
|
|
|
+ launchList.add(selOne);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String sharedCompany = productLaunch.getSharedCompany().substring(1);
|
|
|
+ productLaunch.setSharedCompany(sharedCompany);
|
|
|
+ LambdaQueryWrapper<PjProductLaunch> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
+ .eq(PjProductLaunch::getBillType, 1)
|
|
|
+ .eq(PjProductLaunch::getIsDeleted, 0)
|
|
|
+ .eq(PjProductLaunch::getGoodsId, productLaunch.getGoodsId())
|
|
|
+ .eq(PjProductLaunch::getSourceCompanyId, productLaunch.getSalesCompanyId());
|
|
|
+
|
|
|
+ List<PjProductLaunch> list = baseMapper.selectList(lambdaQueryWrapper);
|
|
|
+ if (ObjectUtil.isNotEmpty(list)) {
|
|
|
+ list.forEach(i -> {
|
|
|
+ i.setWhetherShare(1);
|
|
|
+ pjProductLaunchList1.add(i);
|
|
|
+// baseMapper.updateById(i);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+ pjProductLaunchList.add(productLaunch);
|
|
|
});
|
|
|
+ this.saveOrUpdateBatch(pjProductLaunchList);
|
|
|
+ this.saveOrUpdateBatch(launchList);
|
|
|
+ this.updateBatchById(pjProductLaunchList1);
|
|
|
return R.success("ok");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量操作上下架
|
|
|
- * */
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void batchOperationProductLaunch(List<Long> ids, int flag)
|
|
|
- {
|
|
|
+ public void batchOperationProductLaunch(List<Long> ids, int flag) {
|
|
|
|
|
|
List<PjProductLaunch> list = baseMapper.selectBatchIds(ids);
|
|
|
- if(CollectionUtils.isEmpty(list))
|
|
|
- {
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
throw new SecurityException("未查到相关物品信息,操作失败");
|
|
|
}
|
|
|
- list.forEach(e->{
|
|
|
+ list.forEach(e -> {
|
|
|
e.setUpAndDownShelves(flag);
|
|
|
baseMapper.updateById(e);
|
|
|
});
|
|
|
@@ -366,32 +430,32 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
PjCorpsDesc corpsDesc = null;
|
|
|
//根据当前登录人获得客户
|
|
|
PjCorpsAttn corpsAttn = corpsAttnService.getAttn(AuthUtil.getUserId());
|
|
|
- if (ObjectUtil.isNotEmpty(corpsAttn)){
|
|
|
+ if (ObjectUtil.isNotEmpty(corpsAttn)) {
|
|
|
corpsDesc = corpsDescService.getCorpsDesc(corpsAttn.getPid());
|
|
|
- if (ObjectUtil.isEmpty(corpsDesc)){
|
|
|
+ if (ObjectUtil.isEmpty(corpsDesc)) {
|
|
|
throw new RuntimeException("未查到用户信息");
|
|
|
- }else {
|
|
|
- if (ObjectUtil.isNotEmpty(corpsDesc.getPriceSystem())){
|
|
|
- if ("售价1".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else {
|
|
|
+ if (ObjectUtil.isNotEmpty(corpsDesc.getPriceSystem())) {
|
|
|
+ if ("售价1".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceOne());
|
|
|
- }else if ("售价2".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价2".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceTwo());
|
|
|
- }else if ("售价3".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价3".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceThree());
|
|
|
- }else if ("售价4".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价4".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceFour());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
detail.setMallPrice(detail.getPriceOne());
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new RuntimeException("未查到用户信息");
|
|
|
}
|
|
|
|
|
|
map.put("type", detail.getBillType());
|
|
|
|
|
|
- if (detail.getBillType() == 0){//本地
|
|
|
+ if (detail.getBillType() == 0) {//本地
|
|
|
//查询是否有共享
|
|
|
LambdaQueryWrapper<PjProductLaunch> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(PjProductLaunch::getTenantId, AuthUtil.getTenantId())
|
|
|
@@ -402,20 +466,20 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjProductLaunch::getSalesCompanyId, detail.getSalesCompanyId());
|
|
|
|
|
|
PjProductLaunch selectOne = baseMapper.selectOne(queryWrapper);
|
|
|
- if (ObjectUtil.isNotEmpty(selectOne)){
|
|
|
+ if (ObjectUtil.isNotEmpty(selectOne)) {
|
|
|
//获得附件
|
|
|
selectOne.setFilesList(productLaunchFilesService.list(new QueryWrapper<PjProductLaunchFiles>()
|
|
|
.eq("pid", selectOne.getId())
|
|
|
.eq("is_deleted", 0)));
|
|
|
|
|
|
- if (ObjectUtil.isNotEmpty(corpsDesc.getPriceSystem())){
|
|
|
- if ("售价1".equals(corpsDesc.getPriceSystem())){
|
|
|
+ if (ObjectUtil.isNotEmpty(corpsDesc.getPriceSystem())) {
|
|
|
+ if ("售价1".equals(corpsDesc.getPriceSystem())) {
|
|
|
selectOne.setMallPrice(selectOne.getPriceOne());
|
|
|
- }else if ("售价2".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价2".equals(corpsDesc.getPriceSystem())) {
|
|
|
selectOne.setMallPrice(selectOne.getPriceTwo());
|
|
|
- }else if ("售价3".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价3".equals(corpsDesc.getPriceSystem())) {
|
|
|
selectOne.setMallPrice(selectOne.getPriceThree());
|
|
|
- }else if ("售价4".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价4".equals(corpsDesc.getPriceSystem())) {
|
|
|
selectOne.setMallPrice(selectOne.getPriceFour());
|
|
|
}
|
|
|
}
|
|
|
@@ -423,7 +487,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
map.put("thisLocality", detail);
|
|
|
map.put("offsite", selectOne);
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
map.put("thisLocality", null);
|
|
|
map.put("offsite", detail);
|
|
|
}
|
|
|
@@ -444,26 +508,26 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
PjCorpsDesc corpsDesc = null;
|
|
|
//根据当前登录人获得客户
|
|
|
PjCorpsAttn corpsAttn = corpsAttnService.getAttn(AuthUtil.getUserId());
|
|
|
- if (ObjectUtil.isNotEmpty(corpsAttn)){
|
|
|
+ if (ObjectUtil.isNotEmpty(corpsAttn)) {
|
|
|
corpsDesc = corpsDescService.getCorpsDesc(corpsAttn.getPid());
|
|
|
- if (ObjectUtil.isEmpty(corpsDesc)){
|
|
|
+ if (ObjectUtil.isEmpty(corpsDesc)) {
|
|
|
throw new RuntimeException("未查到用户信息");
|
|
|
- }else {
|
|
|
- if (ObjectUtil.isNotEmpty(corpsDesc.getPriceSystem())){
|
|
|
- if ("售价1".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else {
|
|
|
+ if (ObjectUtil.isNotEmpty(corpsDesc.getPriceSystem())) {
|
|
|
+ if ("售价1".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceOne());
|
|
|
- }else if ("售价2".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价2".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceTwo());
|
|
|
- }else if ("售价3".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价3".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceThree());
|
|
|
- }else if ("售价4".equals(corpsDesc.getPriceSystem())){
|
|
|
+ } else if ("售价4".equals(corpsDesc.getPriceSystem())) {
|
|
|
detail.setMallPrice(detail.getPriceFour());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
detail.setMallPrice(detail.getPriceOne());
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new RuntimeException("未查到用户信息");
|
|
|
}
|
|
|
|
|
|
@@ -510,10 +574,10 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
shoppingCart.setProductLaunchId(productLaunch.getId());
|
|
|
shoppingCart.setInventory(productLaunch.getInventory());
|
|
|
|
|
|
- if (productLaunch.getBillType() == 0){
|
|
|
+ if (productLaunch.getBillType() == 0) {
|
|
|
shoppingCart.setSharedCompanyId(productLaunch.getSalesCompanyId());
|
|
|
shoppingCart.setSharedCompanyName(productLaunch.getSalesCompanyName());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
shoppingCart.setSharedCompanyId(productLaunch.getSourceCompanyId());
|
|
|
shoppingCart.setSharedCompanyName(iSysClient.getDept(productLaunch.getSourceCompanyId()).getData().getFullName());
|
|
|
}
|
|
|
@@ -527,9 +591,9 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
|
|
|
.eq(PjShoppingCart::getSharedCompanyId, shoppingCart.getSharedCompanyId());
|
|
|
|
|
|
PjShoppingCart cart = shoppingCartMapper.selectOne(lambdaQueryWrapper);
|
|
|
- if (ObjectUtil.isEmpty(cart)){//不存在 新增
|
|
|
+ if (ObjectUtil.isEmpty(cart)) {//不存在 新增
|
|
|
shoppingCartMapper.insert(shoppingCart);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
cart.setGoodsNum(cart.getGoodsNum().add(productLaunch.getGoodsNum()));
|
|
|
cart.setUpdateUser(AuthUtil.getUserId());
|
|
|
cart.setUpdateTime(new Date());
|