|
|
@@ -30,7 +30,6 @@ import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
-import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
|
/*
|
|
|
*项目名: yhlxj
|
|
|
@@ -127,17 +126,9 @@ public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
- public void setYhShopGoodsRate(List<YhShopUserPlatDistributeRate> yhShopUserPlatDistributeRates) {
|
|
|
- AtomicBoolean checkShopOwner = new AtomicBoolean(false);
|
|
|
+ public void setYhShopGoodsRate(List<YhShopUserPlatDistributeRate> yhShopUserPlatDistributeRates, Long userId) {
|
|
|
yhShopUserPlatDistributeRates.forEach(data -> {
|
|
|
- Long userId = data.getUserId();
|
|
|
- if (!checkShopOwner.get()) {
|
|
|
- YhShop yhShop = yhShopMapper.selectOne(Wrappers.lambdaQuery(YhShop.class)
|
|
|
- .eq(YhShop::getVerifyStatus, YhShop.Status.success)
|
|
|
- .eq(YhShop::getUserId, userId).last("limit 1"));
|
|
|
- Assert.notNull(yhShop, "请检查该店铺是不是存在或审核成功");
|
|
|
- checkShopOwner.set(true);
|
|
|
- }
|
|
|
+ data.setUserId(userId);
|
|
|
Long goodsId = data.getGoodsId();
|
|
|
GoodsDon goodsDon = goodsDonMapper.selectById(goodsId);
|
|
|
Assert.notNull(goodsDon, "请检查你设置的平台是否存在");
|
|
|
@@ -159,6 +150,10 @@ public class CmsYhShopCommonServiceImpl implements CmsYhShopCommonService {
|
|
|
Long id = yhShop.getId();
|
|
|
YhShop dbShop = yhShopMapper.selectById(id);
|
|
|
Assert.notNull(dbShop, "请检查店铺是否存在");
|
|
|
+ if (dbShop.getVerifyStatus() != YhShop.Status.success) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请检查该店铺是否审核成功");
|
|
|
+ }
|
|
|
+ yhShop.setUserId(dbShop.getUserId());
|
|
|
if (businessId == null && dbShop.getBusinessId() == 0) {
|
|
|
return;
|
|
|
}
|