|
@@ -53,7 +53,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
-/** 分销管理
|
|
|
|
|
|
|
+/** admin/分销管理
|
|
|
*项目名: netflix
|
|
*项目名: netflix
|
|
|
*文件名: DistributeController
|
|
*文件名: DistributeController
|
|
|
*创建者: JavaZou
|
|
*创建者: JavaZou
|
|
@@ -117,6 +117,8 @@ public class DistributeController {
|
|
|
|
|
|
|
|
private final UserDistributeTargetAlertRecordMapper targetAlertRecordMapper;
|
|
private final UserDistributeTargetAlertRecordMapper targetAlertRecordMapper;
|
|
|
|
|
|
|
|
|
|
+ private final UserDistributeSharedWhiteMapper userDistributeSharedWhiteMapper;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 添加固定推广者
|
|
* 添加固定推广者
|
|
|
*/
|
|
*/
|
|
@@ -1194,4 +1196,42 @@ public class DistributeController {
|
|
|
UserDistributeUnbindOrderMoneyView userDistributeUnbindOrderMoneyView = beanSearcher.searchFirst(UserDistributeUnbindOrderMoneyView.class, builder.build());
|
|
UserDistributeUnbindOrderMoneyView userDistributeUnbindOrderMoneyView = beanSearcher.searchFirst(UserDistributeUnbindOrderMoneyView.class, builder.build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(userDistributeUnbindOrderMoneyView);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(userDistributeUnbindOrderMoneyView);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 新增分销渠道白名单
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("/post/white")
|
|
|
|
|
+ @Log(module = "分销管理/渠道分销/新增渠道白名单", businessType = BusinessType.POST, isSaveRequestData = true)
|
|
|
|
|
+ public Result<String> postDistributeWhite(@RequestBody UserDistributeSharedWhite sharedWhite) {
|
|
|
|
|
+ if (sharedWhite.getUserId() == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请指定对应渠道用户");
|
|
|
|
|
+ }
|
|
|
|
|
+ UserDistributeSharedWhite userDistributeSharedWhite = userDistributeSharedWhiteMapper.selectOne(Wrappers.lambdaQuery(UserDistributeSharedWhite.class)
|
|
|
|
|
+ .eq(UserDistributeSharedWhite::getUserId, sharedWhite.getUserId())
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (userDistributeSharedWhite == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("已添加该渠道用户");
|
|
|
|
|
+ }
|
|
|
|
|
+ userDistributeSharedWhiteMapper.insert(sharedWhite);
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除渠道用户白名单
|
|
|
|
|
+ */
|
|
|
|
|
+ @DeleteMapping("/del/white/{userId}")
|
|
|
|
|
+ @Log(module = "分销管理/渠道分销/删除渠道白名单", businessType = BusinessType.DELETE, isSaveRequestData = true)
|
|
|
|
|
+ public Result<String> delDistributeWhite(@PathVariable Long userId) {
|
|
|
|
|
+ userDistributeSharedWhiteMapper.deleteById(userId);
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 用户白名单列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/white")
|
|
|
|
|
+ public Result<SearchResult<UserDistributeSharedWhite>> getDistributeWhite() {
|
|
|
|
|
+ SearchResult<UserDistributeSharedWhite> search = beanSearcher.search(UserDistributeSharedWhite.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|