Parcourir la source

Merge branch 'opt_api'

# Conflicts:
#	netflix-web/src/main/java/com/cyksj/config/SaTokenConfigure.java
zoujiajian il y a 3 ans
Parent
commit
0648f7eab7
19 fichiers modifiés avec 420 ajouts et 22 suppressions
  1. 14 1
      netflix-dao/src/main/java/com/cyksj/model/entity/DynamicList.java
  2. 23 0
      netflix-dao/src/main/java/com/cyksj/model/views/DistributeBusinessListVo.java
  3. 58 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonFrontSkuView.java
  4. 2 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonPopularizeView.java
  5. 115 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsFrontListView.java
  6. 2 2
      netflix-dao/src/main/java/com/cyksj/model/views/UserDistributeViews.java
  7. 24 0
      netflix-dao/src/main/java/com/cyksj/model/views/UserDistributeVo.java
  8. 2 0
      netflix-service/src/main/java/com/cyksj/service/mange/business/UserBusinessRateService.java
  9. 6 0
      netflix-service/src/main/java/com/cyksj/service/mange/business/impl/UserBusinessRateServiceImpl.java
  10. 3 0
      netflix-service/src/main/java/com/cyksj/service/mange/cms/CmsUserManager.java
  11. 3 1
      netflix-web/src/main/java/com/cyksj/config/SaTokenConfigure.java
  12. 86 15
      netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java
  13. 12 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/channel/CmsChannelController.java
  14. 3 3
      netflix-web/src/main/java/com/cyksj/web/controller/manage/channel/CmsChannelPopularizeController.java
  15. 5 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/cms/CmsAdminUserController.java
  16. 20 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/coupon/CouponController.java
  17. 25 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/DistributeController.java
  18. 10 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonController.java
  19. 7 0
      netflix-web/src/main/java/com/cyksj/web/controller/sys/DynamicListController.java

+ 14 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/DynamicList.java

@@ -20,9 +20,22 @@ public class DynamicList extends BaseEntity{
 	@NotEmpty(message = "标题不能为空")
 	private String title;
 
-	@NotEmpty(message = "链接不能为空")
 	private String link;
 
+	/**
+	 * 标签
+	 */
+	private String tag;
+
+	private String picture;
+
+	private String content;
+
+	/**
+	 * 1动态、2商务
+	 */
+	private Integer type;
+
 	private Integer sortNum;
 
 	private Boolean status;

+ 23 - 0
netflix-dao/src/main/java/com/cyksj/model/views/DistributeBusinessListVo.java

@@ -0,0 +1,23 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+/*
+ *项目名: netflix
+ *文件名: DistributeBusinessListVo
+ *创建者: JavaZou
+ *创建时间:2023/3/31 14:15
+ */
+@Getter
+@Setter
+@SearchBean(tables = "(select distinct business_id from user_distribute_business_rate) ur left join cms_user cu on cu.id = ur.business_id")
+public class DistributeBusinessListVo {
+	@DbField("ur.business_id")
+	private Long businessId;
+
+	@DbField("cu.nickname")
+	private String businessName;
+}

+ 58 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonFrontSkuView.java

@@ -0,0 +1,58 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.SearchBean;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/*
+ *项目名: netflix
+ *文件名: GoodsDonFrontSkuView
+ *创建者: JavaZou
+ *创建时间:2023/4/6 17:58
+ */
+@Getter
+@Setter
+@SearchBean(tables = "goods_don_sku")
+public class GoodsDonFrontSkuView {
+
+	private Long id;
+
+	private Long goodsId;
+
+	/**
+	 * 商品规格 ids
+	 */
+	private String specIds;
+
+	/**
+	 * 商品规格 value
+	 */
+	private String specVal;
+
+	/**
+	 * 商品规格 json
+	 */
+	private String specJson;
+
+
+	/**
+	 * true 上架 / false 下架
+	 */
+	@JsonIgnore
+	private Boolean status;
+
+	/**
+	 * 价格
+	 */
+	private BigDecimal price;
+
+	/**
+	 * 月数
+	 */
+	private Integer months;
+
+	private String notifyText;
+}

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonPopularizeView.java

@@ -6,6 +6,7 @@ import com.cyksj.model.entity.OrderComment;
 import com.ejlchina.searcher.bean.DbField;
 import com.ejlchina.searcher.bean.DbIgnore;
 import com.ejlchina.searcher.bean.SearchBean;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -95,6 +96,7 @@ public class GoodsDonPopularizeView {
 	 * 虚拟销量
 	 */
 	@DbField("g.virtual_sold")
+	@JsonIgnore
 	private Integer virtualSold;
 
 	/**

+ 115 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsFrontListView.java

@@ -0,0 +1,115 @@
+package com.cyksj.model.views;
+
+import com.cyksj.model.entity.GoodsDonSpec;
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.DbIgnore;
+import com.ejlchina.searcher.bean.SearchBean;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/*
+ *项目名: netflix
+ *文件名: GoodsFrontListView
+ *创建者: JavaZou
+ *创建时间:2023/4/6 17:50
+ */
+@Getter
+@Setter
+@SearchBean(tables = "goods_don g")
+public class GoodsFrontListView {
+	@DbField("g.id")
+	private Long id;
+
+	/**
+	 * 商品名称
+	 */
+	@DbField("g.title")
+	private String title;
+
+	/**
+	 * 标签
+	 */
+	@DbField("g.tags")
+	private String tags;
+
+	/**
+	 * 缩略图
+	 */
+	@DbField("g.logo")
+	private String logo;
+
+	/**
+	 * 背景图
+	 */
+	@DbField("g.img")
+	private String img;
+
+	@DbField("g.type")
+	@JsonIgnore
+	private Integer type;
+
+	@DbField("g.second_type")
+	private Integer secondType;
+
+	/**
+	 * true 上架 / false 下架
+	 */
+	@DbField("g.status")
+	@JsonIgnore
+	private Boolean status;
+
+	/**
+	 * true 存在 / false 删除
+	 */
+	@DbField("g.deleted")
+	@JsonIgnore
+	private Boolean deleted;
+
+	/**
+	 * 最低规格价格
+	 */
+	@DbIgnore
+	private BigDecimal price;
+
+	/**
+	 * 最低规格月份
+	 */
+	@DbIgnore
+	private Integer months;
+
+	/**
+	 * 已售
+	 */
+	@DbIgnore
+	private Integer sold;
+
+	/**
+	 * 虚拟销量
+	 */
+	@DbField("g.virtual_sold")
+	@JsonIgnore
+	private Integer virtualSold;
+
+	/**
+	 * 排序
+	 */
+	@DbField("g.sort_by")
+	@JsonIgnore
+	private Integer sortBy;
+
+	/**
+	 * 购买通知信息
+	 */
+	@DbIgnore
+	private String notifyMsg;
+
+	@DbIgnore
+	private List<GoodsDonFrontSkuView> skuList;
+
+	@DbIgnore
+	private GoodsDonSpec specs;
+}

+ 2 - 2
netflix-dao/src/main/java/com/cyksj/model/views/UserDistributeViews.java

@@ -18,9 +18,9 @@ import java.util.Date;
  */
 @Getter
 @Setter
-@SearchBean(tables = "user_distribute ud left join user u on u.id = ud.user_id" +
+@SearchBean(tables = "user_distribute ud inner join user u on u.id = ud.user_id" +
 		" left join cms_user cu on cu.id = ud.business_id",
-where = "ud.deleted is true and u.id is not null")
+where = "ud.deleted is true")
 public class UserDistributeViews {
 
 	@DbField("ud.id")

+ 24 - 0
netflix-dao/src/main/java/com/cyksj/model/views/UserDistributeVo.java

@@ -0,0 +1,24 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Getter;
+import lombok.Setter;
+
+/*
+ *项目名: netflix
+ *文件名: UserDistributeVo
+ *创建者: JavaZou
+ *创建时间:2023/3/30 17:01
+ */
+@Getter
+@Setter
+@SearchBean(tables = "user_distribute ud inner join user u on u.id = ud.user_id",
+		where = "ud.deleted is true")
+public class UserDistributeVo {
+	@DbField("ud.id")
+	private Long id;
+
+	@DbField("u.nickname")
+	private String nickname;
+}

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/mange/business/UserBusinessRateService.java

@@ -13,4 +13,6 @@ public interface UserBusinessRateService {
 	void saveBusinessRate(Long businessId);
 
 	Boolean isBusiness(Long businessId);
+
+	void deleteBusinessRateByUid(Long businessId);
 }

+ 6 - 0
netflix-service/src/main/java/com/cyksj/service/mange/business/impl/UserBusinessRateServiceImpl.java

@@ -68,4 +68,10 @@ public class UserBusinessRateServiceImpl implements UserBusinessRateService {
 		}
 		return false;
 	}
+
+	@Override
+	public void deleteBusinessRateByUid(Long businessId) {
+		userDistributeBusinessRateMapper.delete(Wrappers.lambdaQuery(UserDistributeBusinessRate.class)
+				.eq(UserDistributeBusinessRate::getBusinessId, businessId));
+	}
 }

+ 3 - 0
netflix-service/src/main/java/com/cyksj/service/mange/cms/CmsUserManager.java

@@ -108,6 +108,9 @@ public class CmsUserManager {
 	}
 
 	public void saveUserRoleRelation(Long userId, String roleIds) {
+		if (!userBusinessRateService.isBusiness(userId)) {
+			userBusinessRateService.deleteBusinessRateByUid(userId);
+		}
 		Arrays.stream(roleIds.split(",")).collect(Collectors.toSet()).forEach(roleId -> {
 			CmsRole cmsRole = cmsRoleMapper.selectById(roleId);
 			if (cmsRole != null && cmsRole.getRoleName().contains("商务")) {

+ 3 - 1
netflix-web/src/main/java/com/cyksj/config/SaTokenConfigure.java

@@ -38,7 +38,9 @@ public class SaTokenConfigure implements WebMvcConfigurer {
 						"/manage/coupon/get/classification",
 						"/manage/account/get/latest/orders",
 						"/manage/account/get/expired/accounts",
-						"/manage/account/put/account"));
+						"/manage/account/put/account",
+						"/manage/coupon/get/classificationList",
+						"/manage/coupon/get/couponList"));
 		//注解权限校验
 		registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**");
 	}

+ 86 - 15
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -11,9 +11,7 @@ import com.cyksj.enums.GatewayResponse;
 import com.cyksj.mapper.GoodsDonSkuMapper;
 import com.cyksj.mapper.OrderDonMapper;
 import com.cyksj.model.entity.*;
-import com.cyksj.model.views.GoodsDonPopularizeView;
-import com.cyksj.model.views.GoodsDonSkuView;
-import com.cyksj.model.views.GoodsDonViews;
+import com.cyksj.model.views.*;
 import com.ejlchina.searcher.BeanSearcher;
 import com.ejlchina.searcher.SearchResult;
 import com.ejlchina.searcher.param.Operator;
@@ -26,9 +24,9 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Optional;
-import java.util.stream.Collectors;
 
 /**
  * @author chan
@@ -87,18 +85,10 @@ public class GoodsDonController {
                 .orderBy(GoodsDonPopularizeView::getId).asc()
                 .build());
         DateTime now = DateTime.now();
+        LinkedList<GoodsDonPopularizeView> collect = new LinkedList<>();
         search.getDataList().forEach(data -> {
-            GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectOne(Wrappers.lambdaQuery(GoodsDonSku.class)
-                    .eq(GoodsDonSku::getGoodsId, data.getId())
-                    .eq(GoodsDonSku::getStatus, true)
-                    .orderByAsc(GoodsDonSku::getPrice)
-                    .last("limit 1"));
-            Optional.ofNullable(goodsDonSku).ifPresent(sku -> {
-                data.setPrice(sku.getPrice());
-                data.setMonths(sku.getMonths());
-            });
             data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
-            data.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder().field(GoodsDonSku::getGoodsId, data.getId()).field(GoodsDonSku::getStatus, true).build()));
+            data.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder().field(GoodsDonSku::getGoodsId, data.getId()).field(GoodsDonSku::getStatus, true).orderBy(GoodsDonSku::getPrice).asc().build()));
             Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
                     .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
             data.setSold(sold + data.getVirtualSold());
@@ -106,6 +96,14 @@ public class GoodsDonController {
                     MapUtils.builder().field(OrderComment::getGoodsId, data.getId())
                             .orderBy(OrderComment::getId).desc()
                             .build());
+
+            Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
+                GoodsDonSku goodsDonSku = skuList.get(0);
+                if (goodsDonSku != null) {
+                    data.setPrice(goodsDonSku.getPrice());
+                    data.setMonths(goodsDonSku.getMonths());
+                }
+            });
             if (orderComments != null) {
                 List<OrderComment> comments = orderComments.getDataList();
                 data.setOrderComments(comments);
@@ -144,8 +142,81 @@ public class GoodsDonController {
             }
             notifyMsg.append("前有人购买");
             data.setNotifyMsg(notifyMsg.toString());
+            if (data.getPrice() != null && data.getPrice().compareTo(BigDecimal.ZERO) > 0) {
+                collect.add(data);
+            }
+        });
+        search = new SearchResult<>(collect);
+        search.setTotalCount(collect.size());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    }
+
+    /**
+     * 官网首页 平台列表
+     */
+    @GetMapping("/get/list")
+    public Result<SearchResult<GoodsFrontListView>> getGoodsList() {
+        SearchResult<GoodsFrontListView> search = beanSearcher.search(GoodsFrontListView.class, MapUtils.flatBuilder(request.getParameterMap())
+                .field(GoodsFrontListView::getStatus, true)
+                .field(GoodsFrontListView::getDeleted, true)
+                .field(GoodsFrontListView::getType, 1)
+                .orderBy(GoodsFrontListView::getSortBy).desc()
+                .orderBy(GoodsFrontListView::getId).asc()
+                .build());
+        DateTime now = DateTime.now();
+        LinkedList<GoodsFrontListView> collect = new LinkedList<>();
+        search.getDataList().forEach(data -> {
+            data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
+            data.setSkuList(beanSearcher.searchAll(GoodsDonFrontSkuView.class, MapUtils.builder().field(GoodsDonFrontSkuView::getGoodsId, data.getId()).field(GoodsDonFrontSkuView::getStatus, true).orderBy(GoodsDonFrontSkuView::getPrice).asc().build()));
+            Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
+                    .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
+            data.setSold(sold + data.getVirtualSold());
+
+            Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
+                GoodsDonFrontSkuView donFrontSkuView = skuList.get(0);
+                if (donFrontSkuView != null) {
+                    data.setPrice(donFrontSkuView.getPrice());
+                    data.setMonths(donFrontSkuView.getMonths());
+                }
+            });
+            OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
+                    .eq(OrderDon::getGoodsId, data.getId())
+                    .notIn(OrderDon::getStatus, Constant.noOrderStatus).select(OrderDon::getCreatedTime, OrderDon::getPayTime, OrderDon::getId)
+                    .orderByDesc(OrderDon::getId)
+                    .last("limit 1"));
+            StringBuilder notifyMsg = new StringBuilder();
+            if (orderDon == null) {
+                notifyMsg.append("点击购买立即上车");
+                data.setNotifyMsg(notifyMsg.toString());
+                return;
+            } else {
+                Date payTime = orderDon.getPayTime();
+                Date startTime = payTime != null ? payTime : orderDon.getCreatedTime();
+                long hour = DateUtil.between(startTime, now, DateUnit.HOUR);
+                if (hour == 0) {
+                    long minute = DateUtil.between(startTime, now, DateUnit.MINUTE);
+                    if (minute == 0) {
+                        notifyMsg.append("1分钟");
+                    } else {
+                        notifyMsg.append(minute);
+                        notifyMsg.append("分钟");
+                    }
+                } else {
+                    if (hour > 3) {
+                        int hours = RandomUtil.randomInt(3) + 1;
+                        notifyMsg.append(hours);
+                    } else {
+                        notifyMsg.append(hour);
+                    }
+                    notifyMsg.append("小时");
+                }
+            }
+            notifyMsg.append("前有人购买");
+            data.setNotifyMsg(notifyMsg.toString());
+            if (data.getPrice() != null && data.getPrice().compareTo(BigDecimal.ZERO) > 0) {
+                collect.add(data);
+            }
         });
-        List<GoodsDonPopularizeView> collect = search.getDataList().stream().filter(data -> data.getPrice().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
         search = new SearchResult<>(collect);
         search.setTotalCount(collect.size());
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);

+ 12 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/channel/CmsChannelController.java

@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 /**
  * @author chan
@@ -52,6 +53,17 @@ public class CmsChannelController {
         return GatewayResponse.SUCCESS.newBuilder().toResult(searchResult);
     }
 
+    /**
+     * 所有渠道列表
+     */
+    @GetMapping("/get/channelList")
+    public Result<List<Channel>> getChannels() {
+        List<Channel> list = beanSearcher.searchAll(Channel.class, MapUtils.flatBuilder(request.getParameterMap())
+                .onlySelect(Channel::getId, Channel::getName)
+                .build());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(list);
+    }
+
     @PostMapping
     public Result<String> post(@RequestBody Channel channel){
         channelService.save(channel);

+ 3 - 3
netflix-web/src/main/java/com/cyksj/web/controller/manage/channel/CmsChannelPopularizeController.java

@@ -123,8 +123,8 @@ public class CmsChannelPopularizeController {
     }
 
     @GetMapping("/get")
-    public Result<SearchResult<ChannelPopularize>> getAllPopularizeList() {
-        SearchResult<ChannelPopularize> search = beanSearcher.search(ChannelPopularize.class, MapUtils.flatBuilder(request.getParameterMap()).onlySelect(ChannelPopularize::getId, ChannelPopularize::getName).build());
-        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    public Result<List<ChannelPopularize>> getAllPopularizeList() {
+        List<ChannelPopularize> list = beanSearcher.searchAll(ChannelPopularize.class, MapUtils.flatBuilder(request.getParameterMap()).onlySelect(ChannelPopularize::getId, ChannelPopularize::getName).build());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(list);
     }
 }

+ 5 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/cms/CmsAdminUserController.java

@@ -24,6 +24,7 @@ import com.cyksj.model.entity.PhoneCode;
 import com.cyksj.model.manage.dto.AdminInfo;
 import com.cyksj.model.request.CmsUserReq;
 import com.cyksj.model.views.CmsUserVO;
+import com.cyksj.service.mange.business.UserBusinessRateService;
 import com.cyksj.service.mange.cms.CmsUserManager;
 import com.cyksj.service.mange.cms.manager.service.CacheService;
 import com.ejlchina.searcher.BeanSearcher;
@@ -64,6 +65,8 @@ public class CmsAdminUserController {
 
 	private final HttpServletRequest request;
 
+	private final UserBusinessRateService userBusinessRateService;
+
 	@PostMapping(value = "/login")
 	public Result<String> login(@RequestBody CmsUser adminRequest) throws Exception {
 		CmsUser admin = cmsUserMapper.selectOne(
@@ -135,6 +138,8 @@ public class CmsAdminUserController {
 		if (id.equals(adminId)) {
 			throw BusinessRuntimeException.getInstance("无法删除自己");
 		}
+		//是商务直接删除比例
+		userBusinessRateService.deleteBusinessRateByUid(adminId);
 		//删除用户角色关联关系、缓存
 		cmsUserManager.delUserRoleRelation(exist);
 		cmsUserMapper.deleteById(id);

+ 20 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/coupon/CouponController.java

@@ -191,6 +191,18 @@ public class CouponController {
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 
+	/**
+	 * 所有优惠券列表
+	 */
+	@GetMapping("/get/couponList")
+	public Result<List<Coupon>> getCouponList() {
+		List<Coupon> couponList = beanSearcher.searchAll(Coupon.class, MapUtils.flatBuilder(request.getParameterMap())
+				.field(Coupon::getDeleted, true)
+				.onlySelect(Coupon::getId, Coupon::getName)
+				.build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(couponList);
+	}
+
 	/**
 	 * 优惠券发放列表
 	 */
@@ -394,6 +406,14 @@ public class CouponController {
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 
+	/**
+	 * 优惠券所有分类
+	 */
+	@GetMapping("/get/classificationList")
+	public Result<List<CouponClassification>> getClassificationList() {
+		List<CouponClassification> CouponClassifications = beanSearcher.searchAll(CouponClassification.class, MapUtils.flatBuilder(request.getParameterMap()).build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(CouponClassifications);
+	}
 
 	public String getUnionId(String corpId, String externalUserId) throws Exception {
 		WxCorpApp wxCorpApp = WeChatCorpFactory.getCorpConfigStrategy(corpId);

+ 25 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/distribute/DistributeController.java

@@ -167,6 +167,16 @@ public class DistributeController {
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 
+	/**
+	 * 所有固定推广者列表
+	 */
+	@GetMapping("/get/all")
+	public Result<List<UserDistributeVo>> getAllDistributes() {
+		List<UserDistributeVo> userDistributes = beanSearcher.searchAll(UserDistributeVo.class, MapUtils.flatBuilder(request.getParameterMap())
+				.build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(userDistributes);
+	}
+
 	/**
 	 * 获取平台分销比例
 	 */
@@ -379,6 +389,21 @@ public class DistributeController {
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
 
+	/**
+	 * 商务人员列表
+	 */
+	@GetMapping("/get/businessList")
+	public Result<List<DistributeBusinessListVo>> getBusinessList() {
+		long adminId = StpUtil.getLoginIdAsLong();
+		MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
+		//是否是商务人员
+		if (userBusinessRateService.isBusiness(adminId)) {
+			builder.field(DistributeBusinessListVo::getBusinessId, adminId);
+		}
+		List<DistributeBusinessListVo> list = beanSearcher.searchAll(DistributeBusinessListVo.class, builder.build());
+		return GatewayResponse.SUCCESS.newBuilder().toResult(list);
+	}
+
 	/**
 	 * 商务人员提成详情
 	 */

+ 10 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonController.java

@@ -123,4 +123,14 @@ public class CmsGoodsDonController {
         return GatewayResponse.SUCCESS.newBuilder().toResult(id);
     }
 
+    /**
+     * 获取所有平台列表
+     */
+    @GetMapping("/get/all")
+    public Result<List<GoodsDon>> getAllGoodsList() {
+        List<GoodsDon> goodsDons = beanSearcher.searchAll(GoodsDon.class, MapUtils.flatBuilder(request.getParameterMap())
+                .field(GoodsDon::getDeleted,true)
+                .onlySelect(GoodsDon::getId, GoodsDon::getTitle).build());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDons);
+    }
 }

+ 7 - 0
netflix-web/src/main/java/com/cyksj/web/controller/sys/DynamicListController.java

@@ -1,6 +1,7 @@
 package com.cyksj.web.controller.sys;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.GatewayResponse;
@@ -37,6 +38,9 @@ public class DynamicListController {
 	 */
 	@PostMapping
 	public Result<String> post(@RequestBody @Validated DynamicList dynamicList) {
+		if (dynamicList.getType() == 1 && StrUtil.isBlank(dynamicList.getLink())) {
+			throw BusinessRuntimeException.getInstance("链接不能为空");
+		}
 		dynamicListMapper.insert(dynamicList);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
@@ -54,6 +58,9 @@ public class DynamicListController {
 		if (dl == null || !dl.getDeleted()) {
 			throw BusinessRuntimeException.getInstance("该记录不存在");
 		}
+		if (dynamicList.getType() == 1 && StrUtil.isBlank(dynamicList.getLink())) {
+			throw BusinessRuntimeException.getInstance("链接不能为空");
+		}
 		BeanUtil.copyProperties(dynamicList, dl);
 		dynamicListMapper.updateById(dl);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();