소스 검색

开店审核商务展示

zoujiajian 2 년 전
부모
커밋
4a11ae05ea

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/YhShopApplyRecord.java

@@ -36,6 +36,8 @@ public class YhShopApplyRecord extends BaseEntity {
 	 */
 	private Status verifyStatus;
 
+	private Long businessId;
+
 	/**
 	 * 审核失败原因
 	 */

+ 8 - 1
netflix-dao/src/main/java/com/cyksj/model/views/YhShopView.java

@@ -16,7 +16,8 @@ import java.util.Date;
  */
 @Getter
 @Setter
-@SearchBean(tables = "yh_shop_apply_record ys left join user u on u.id = ys.user_id")
+@SearchBean(tables = "yh_shop_apply_record ys left join user u on u.id = ys.user_id" +
+		" left join cms_user cu on cu.id = ys.business_id")
 public class YhShopView {
 	@DbField("ys.id")
 	private Long id;
@@ -40,6 +41,12 @@ public class YhShopView {
 	@DbField("ys.custom_id")
 	private String customId;
 
+	@DbField("ys.business_id")
+	private Long businessId;
+
+	@DbField("cu.name")
+	private String businessName;
+
 	/**
 	 * 是否审核通过
 	 */

+ 11 - 0
netflix-service/src/main/java/com/cyksj/service/shop/impl/YhShopServiceImpl.java

@@ -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("系统繁忙,请重试..");

+ 1 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopUserController.java

@@ -119,6 +119,7 @@ public class YhShopUserController {
 		yhShopApplyRecord.setVerifyStatus(YhShopApplyRecord.Status.verify);
 		yhShopApplyRecord.setName(name);
 		yhShopApplyRecord.setUserId(userId);
+		yhShopApplyRecord.setBusinessId(yhShop.getBusinessId());
 		yhShopApplyRecordMapper.insert(yhShopApplyRecord);
 
 		if (StrUtil.isNotBlank(yhShop.getReason())) {