|
@@ -216,6 +216,17 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //查询 设置可绑定达人数
|
|
|
+ Integer count = kuaishouPromoterMapper.getUserPromotersCount(promoter.getUserId());
|
|
|
+ if (Check.isNotNull(count)) {
|
|
|
+ //查询 已绑定达人数
|
|
|
+ Integer hCount = kuaishouPromoterMapper.getBoundCount(promoter.getUserId());
|
|
|
+ if (Check.isNotNull(hCount) && hCount >= count) {
|
|
|
+ result.put("code", 500);
|
|
|
+ result.put("msg", "绑定达人数过多,暂无法绑定!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
SysUser sysUser = sysUserService.selectUserById(promoter.getUserId());
|
|
|
if (Check.isNotNull(sysUser)) {
|
|
|
promoter.setUserName(sysUser.getNickName());
|
|
@@ -320,6 +331,15 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public JSONObject addPromotersCount(Long userId, Long promotersCount) {
|
|
|
+ kuaishouPromoterMapper.addPromotersCount(userId, promotersCount);
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ result.put("code", 200);
|
|
|
+ result.put("msg", "success");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public Result updatePromoterLabel(JSONObject result) {
|
|
|
Long promoterId = result.getLong("promoterId");
|
|
|
Long userId = result.getLong("userId");
|
|
@@ -361,7 +381,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
|
@Override
|
|
|
public Result deleteKuaishouPromoterById(Long id, Long userId) {
|
|
|
KuaishouPromoter promoter = kuaishouPromoterMapper.selectKuaishouPromoterById(id);
|
|
|
- List<KuaishouItemCollectSamples> list = kuaishouItemCollectSamplesService.getListByPromoterId(promoter.getPromoterId(),userId);
|
|
|
+ List<KuaishouItemCollectSamples> list = kuaishouItemCollectSamplesService.getListByPromoterId(promoter.getPromoterId(), userId);
|
|
|
for (KuaishouItemCollectSamples item : list) {
|
|
|
if (item.getCollectSampleStatus() != 2 && item.getCollectSampleStatus() != 7) {
|
|
|
return Result.error("该达人还有未完成的领样申请,请在完成后进行解绑!");
|