|
|
@@ -12,6 +12,7 @@ import com.cyksj.mapper.shop.YhShopApplyRecordMapper;
|
|
|
import com.cyksj.mapper.shop.YhShopMapper;
|
|
|
import com.cyksj.model.dto.YhShopInfo;
|
|
|
import com.cyksj.model.entity.SysConfig;
|
|
|
+import com.cyksj.model.entity.UserDistribute;
|
|
|
import com.cyksj.model.entity.YhShop;
|
|
|
import com.cyksj.model.entity.YhShopApplyRecord;
|
|
|
import com.cyksj.service.shop.YhShopFrontService;
|
|
|
@@ -72,12 +73,21 @@ public class YhShopServiceImpl implements YhShopFrontService {
|
|
|
if (user_ds_order < ds_order_limit) {
|
|
|
throw BusinessRuntimeException.getInstance("您推广单数不符合开店资格");
|
|
|
}
|
|
|
+ UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class)
|
|
|
+ .eq(UserDistribute::getUserId, userId)
|
|
|
+ .eq(UserDistribute::getDeleted, true)
|
|
|
+ .last("limit 1"));
|
|
|
+ Long businessId = 0l;
|
|
|
+ if (userDistribute != null) {
|
|
|
+ businessId = userDistribute.getBusinessId();
|
|
|
+ }
|
|
|
try {
|
|
|
YhShop save = new YhShop();
|
|
|
save.setName(name);
|
|
|
save.setUserId(userId);
|
|
|
save.setCustomId(customId);
|
|
|
save.setVerifyStatus(YhShop.Status.verify);
|
|
|
+ save.setBusinessId(businessId);
|
|
|
yhShopMapper.insert(save);
|
|
|
|
|
|
YhShopApplyRecord yhShopApplyRecord = new YhShopApplyRecord();
|
|
|
@@ -85,6 +95,7 @@ public class YhShopServiceImpl implements YhShopFrontService {
|
|
|
yhShopApplyRecord.setUserId(userId);
|
|
|
yhShopApplyRecord.setCustomId(customId);
|
|
|
yhShopApplyRecord.setVerifyStatus(YhShopApplyRecord.Status.verify);
|
|
|
+ yhShopApplyRecord.setBusinessId(businessId);
|
|
|
yhShopApplyRecordMapper.insert(yhShopApplyRecord);
|
|
|
} catch (Exception e) {
|
|
|
throw BusinessRuntimeException.getInstance("系统繁忙,请重试..");
|