he2802 2 жил өмнө
parent
commit
f5736e29da
13 өөрчлөгдсөн 197 нэмэгдсэн , 82 устгасан
  1. 41 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/CommonDistributionController.java
  2. 12 2
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionActivityPosterController.java
  3. 1 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionSellerController.java
  4. 53 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java
  5. 72 63
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/DistributionSellerServiceImpl.java
  6. 2 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java
  7. 9 1
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserDetailsServiceImpl.java
  8. 2 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerAddBo.java
  9. 0 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerQueryBo.java
  10. 0 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/domain/DistributionSeller.java
  11. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/service/impl/DistributionActivityPosterServiceImpl.java
  12. 0 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/vo/DistributionSellerVo.java
  13. 2 1
      zhongzheng-system/src/main/resources/mapper/modules/system/SysUserMapper.xml

+ 41 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/CommonDistributionController.java

@@ -0,0 +1,41 @@
+package com.zhongzheng.controller.distribution;
+
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.modules.distribution.bo.DistributionActivityPosterQueryBo;
+import com.zhongzheng.modules.distribution.service.IDistributionActivityPosterService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * 商品Controller
+ *
+ * @author hjl
+ * @date 2021-10-12
+ */
+@Api(value = "游客商品管理", tags = {"游客商品管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/app/common/distribution")
+public class CommonDistributionController extends BaseController {
+
+
+    private final IDistributionActivityPosterService iDistributionActivityPosterService;
+
+    @ApiOperation("获取分享页面参数")
+    @PreAuthorize("@ss.hasPermi('system:poster:query')")
+    @GetMapping("/sharePoster")
+    public AjaxResult<Map<String,Object>> sharePoster(DistributionActivityPosterQueryBo bo) {
+
+        return AjaxResult.success("成功",iDistributionActivityPosterService.sharePoster(bo));
+    }
+
+}

+ 12 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionActivityPosterController.java

@@ -15,8 +15,10 @@ import com.zhongzheng.modules.distribution.bo.DistributionActivityPosterQueryBo;
 import com.zhongzheng.modules.distribution.domain.DistributionActivityImage;
 import com.zhongzheng.modules.distribution.service.IDistributionActivityImageService;
 import com.zhongzheng.modules.distribution.service.IDistributionActivityPosterService;
+import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
 import com.zhongzheng.modules.distribution.vo.DistributionActivityImageVo;
 import com.zhongzheng.modules.distribution.vo.DistributionActivityPosterVo;
+import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
 import com.zhongzheng.modules.user.entity.ClientLoginSeller;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -25,7 +27,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -45,6 +49,8 @@ public class DistributionActivityPosterController extends BaseController {
     private final IDistributionActivityImageService iDistributionImageService;
 
     private final TokenService tokenService;
+
+    private final IDistributionSellerService iDistributionSellerService;
     /**
      * 查询海报列表
      */
@@ -120,9 +126,13 @@ public class DistributionActivityPosterController extends BaseController {
     @ApiOperation("获取分享链条码")
     @PreAuthorize("@ss.hasPermi('system:poster:query')")
     @GetMapping("/linkCode")
-    public AjaxResult<String> linkCode(DistributionActivityPosterQueryBo bo) {
+    public AjaxResult<Map<String,String>> linkCode(DistributionActivityPosterQueryBo bo) {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         bo.setSellerId(loginUser.getUser().getSellerId());
-        return AjaxResult.success("成功",iDistributionActivityPosterService.getLinkCode(bo));
+        Map<String,String> map = new HashMap<>();
+        map.put("linkCode",iDistributionActivityPosterService.getLinkCode(bo));
+        DistributionSellerVo vo = iDistributionSellerService.queryById(loginUser.getUser().getSellerId());
+        map.put("shareCode",vo.getShareCode());
+        return AjaxResult.success("成功",map);
     }
 }

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionSellerController.java

@@ -112,7 +112,7 @@ public class DistributionSellerController extends BaseController {
     @Log(title = "分销业务员", businessType = BusinessType.INSERT)
     @PostMapping("/batchAdd")
     public AjaxResult<Void> batchAdd(@RequestBody DistributionSellerAddBo bo) {
-        return toAjax(iDistributionSellerService.insertByAddBo(bo) ? 1 : 0);
+        return toAjax(iDistributionSellerService.insertBatchByAddBo(bo) ? 1 : 0);
     }
 
     /**

+ 53 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java

@@ -0,0 +1,53 @@
+package com.zhongzheng.controller.wx;
+
+import cn.hutool.core.lang.Validator;
+import com.alibaba.fastjson.JSON;
+import com.github.xiaoymin.knife4j.annotations.ApiSupport;
+import com.zhongzheng.common.constant.Constants;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.redis.RedisCache;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.WxLoginService;
+import com.zhongzheng.framework.web.service.WxTokenService;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
+import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.wx.bo.WxLoginBody;
+import com.zhongzheng.modules.wx.service.IWxPayService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+@Api(tags ="微信登录用户操作管理")
+@ApiSupport(order = 2)
+@RestController
+public class WxLoginController
+{
+    @Autowired
+    private WxLoginService wxLoginService;
+
+    @Autowired
+    private IWxPayService iWxPayService;
+
+
+    @Autowired
+    private  RedisCache redisCache;
+    private static final Logger log = LoggerFactory.getLogger(WxLoginController.class);
+
+
+
+    @ApiOperation("公众号分享微信参数")
+    @GetMapping("/app/common/shareGzh")
+    public AjaxResult shareGzh(String url)
+    {
+        Map<String,String> map = iWxPayService.shareGzh(url);
+        return AjaxResult.success(map);
+    }
+
+}

+ 72 - 63
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/DistributionSellerServiceImpl.java

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.domain.entity.SysRole;
 import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.redis.RedisCache;
@@ -25,6 +26,7 @@ import com.zhongzheng.modules.distribution.domain.DistributionSeller;
 import com.zhongzheng.modules.distribution.mapper.DistributionSellerMapper;
 import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
 import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
+import com.zhongzheng.modules.system.service.ISysRoleService;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.top.distribution.bo.DistributionSellerQuery;
 import com.zhongzheng.modules.user.domain.User;
@@ -32,6 +34,7 @@ import com.zhongzheng.modules.user.entity.ClientLoginSeller;
 import com.zhongzheng.modules.user.service.IUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.io.InputStream;
 import java.util.Collection;
@@ -62,7 +65,11 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    private ISysRoleService iSysRoleService;
+
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean registerSeller(SellerAppRegisterBo bo) {
         if(StringUtils.isBlank(bo.getIdcard())){
             throw new CustomException("身份证不能为空");
@@ -95,7 +102,9 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
         SysUser sellerIdCard = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
                 .eq(SysUser::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
         if(Validator.isNotNull(sellerIdCard)){
-            throw new CustomException("该身份证已注册");
+            if(Validator.isNotEmpty(sellerIdCard.getSellerId())){
+                throw new CustomException("该身份证已注册业务员");
+            }
         }
         DistributionSeller inertData = new DistributionSeller();
         inertData.setRealname(bo.getRealname());
@@ -113,14 +122,26 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
         if(!save(inertData)){
             throw new CustomException("注册失败");
         }
-        SysUser sysUser = new SysUser();
-        sysUser.setUserName(bo.getTel());
-        sysUser.setPhonenumber(bo.getTel());
-        sysUser.setAvatar(bo.getAvatar());
-        sysUser.setPassword(SecurityUtils.encryptPassword(bo.getPwd()));
-        sysUser.setPwdTime(DateUtils.getNowTime());
-        sysUser.setSellerId(inertData.getSellerId());
-        iSysUserService.insertUser(sysUser);
+        if(Validator.isNotEmpty(sellerIdCard)){
+            sellerIdCard.setSellerId(inertData.getSellerId());
+            iSysUserService.updateById(sellerIdCard);
+        }else{
+            SysUser sysUser = new SysUser();
+            sysUser.setUserName(bo.getTel());
+            sysUser.setPhonenumber(bo.getTel());
+            sysUser.setAvatar(bo.getAvatar());
+            sysUser.setPassword(SecurityUtils.encryptPassword(bo.getPwd()));
+            sysUser.setPwdTime(DateUtils.getNowTime());
+            sysUser.setSellerId(inertData.getSellerId());
+            SysRole role = iSysRoleService.getOne(new LambdaQueryWrapper<SysRole>()
+                    .eq(SysRole::getRoleKey, "seller")
+                    .eq(SysRole::getStatus, 1).last("limit 1"));
+            if(Validator.isNotEmpty(role)){
+                sysUser.setRoleIds(new Long[]{role.getRoleId()});
+            }
+            iSysUserService.insertUser(sysUser);
+        }
+
         return true;
     }
 
@@ -168,19 +189,22 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
 
     @Override
     public Map<String, Object> accountLogin(SellerAppAccountLoginBo bo) {
-/*        if(Validator.isEmpty(bo.getAccount())){
+        if(Validator.isEmpty(bo.getAccount())){
             throw new CustomException("账号不能为空");
         }
-        LambdaQueryWrapper<DistributionSeller> queryWrapper =new LambdaQueryWrapper<DistributionSeller>();
+        LambdaQueryWrapper<SysUser> queryWrapper =new LambdaQueryWrapper<SysUser>();
         queryWrapper.and(wq -> wq
-                .eq(DistributionSeller::getTelphone,EncryptHandler.encrypt(bo.getAccount()))
+                .eq(SysUser::getPhonenumber,bo.getAccount())
                 .or()
-                .eq(DistributionSeller::getIdCard,EncryptHandler.encrypt(bo.getAccount())));
-        DistributionSeller seller = getOne(queryWrapper);
-        if(Validator.isEmpty(seller)){
+                .eq(SysUser::getIdCard,EncryptHandler.encrypt(bo.getAccount())
+                )
+                .or()
+                .eq(SysUser::getUserName,bo.getAccount()));
+        SysUser sysUser = iSysUserService.getOne(queryWrapper);
+        if(Validator.isEmpty(sysUser)){
             throw new CustomException("登录信息错误");
         }
-        else if (UserStatus.DISABLE.getCode().equals(seller.getStatus()))
+        else if (UserStatus.DISABLE.getCode().equals(sysUser.getStatus()))
         {
             throw new BaseException("对不起,您的账号:已停用");
         }
@@ -198,18 +222,19 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
         }else{
             password = bo.getPwd();
         }
-        if (!SecurityUtils.matchesPassword(password,seller.getPassword()))
+        if (!SecurityUtils.matchesPassword(password,sysUser.getPassword()))
         {
             throw new BaseException("登录信息错误");
         }
-        ClientLoginSeller loginSeller = new ClientLoginSeller();
-        loginSeller.setSeller(seller);
+        DistributionSeller seller = getOne(new LambdaQueryWrapper<DistributionSeller>()
+                .eq(DistributionSeller::getSellerId, sysUser.getSellerId()));
+        LoginUser loginSeller = new LoginUser();
+        loginSeller.setUser(sysUser);
         Map<String,Object> map = new HashMap<>();
-        map.put(Constants.TOKEN,sellerTokenService.createToken(loginSeller));
+        map.put(Constants.TOKEN,tokenService.createToken(loginSeller));
         map.put("user_account",seller.getUserAccount());
-        map.put("full_info",Validator.isEmpty(seller.getIdCard())?false:true); //是否完善身份信息
-        return map;*/
-        return null;
+        map.put("full_info",Validator.isEmpty(sysUser.getIdCard())?false:true); //是否完善身份信息
+        return map;
     }
 
     @Override
@@ -266,7 +291,6 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
         LambdaQueryWrapper<DistributionSeller> lqw = Wrappers.lambdaQuery();
         lqw.like(StrUtil.isNotBlank(bo.getRealname()), DistributionSeller::getRealname, bo.getRealname());
         lqw.eq(bo.getStatus() != null, DistributionSeller::getStatus, bo.getStatus());
-        lqw.eq(bo.getUserId() != null, DistributionSeller::getUserId, bo.getUserId());
         lqw.eq(StrUtil.isNotBlank(bo.getUserAccount()), DistributionSeller::getUserAccount, bo.getUserAccount());
         lqw.eq(StrUtil.isNotBlank(bo.getGzhOpenId()), DistributionSeller::getGzhOpenId, bo.getGzhOpenId());
         lqw.eq(StrUtil.isNotBlank(bo.getUnionId()), DistributionSeller::getUnionId, bo.getUnionId());
@@ -300,29 +324,12 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
      */
     @Override
     public Boolean insertByAddBo(DistributionSellerAddBo bo) {
-       /* if(StringUtils.isBlank(bo.getIdCard())){
-            throw new CustomException("身份证不能为空");
-        }
-        if(bo.getTelphone()==null){
-            throw new CustomException("手机号不能为空");
-        }
-        if(Validator.isEmpty(bo.getRealname())){
-            throw new CustomException("姓名不能为空");
-        }
-        DistributionSeller add = BeanUtil.toBean(bo, DistributionSeller.class);
+
+   /*     DistributionSeller add = BeanUtil.toBean(bo, DistributionSeller.class);
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
-        DistributionSeller seller = getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getTelphone, EncryptHandler.encrypt(bo.getTelphone())).last("limit 1"));
-        if(Validator.isNotNull(seller)){
-            throw new CustomException("该手机号已注册");
-        }
-        DistributionSeller sellerIdCard = getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getIdCard,EncryptHandler.encrypt(bo.getIdCard())).last("limit 1"));
-        if(Validator.isNotNull(sellerIdCard)){
-            throw new CustomException("该身份证已注册");
-        }
+
         DistributionSeller inertData = new DistributionSeller();
         //密码身份证后六位
         String pwd =  bo.getIdCard().substring(bo.getIdCard().length() - 6);
@@ -353,30 +360,32 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean insertBatchByAddBo(DistributionSellerAddBo bo) {
-       /* for(Long userId:bo.getUserIds()){
-            User user = iUserService.getOne(new LambdaQueryWrapper<User>()
-                    .eq(User::getUserId,userId));
+        for(Long userId:bo.getSysUserIds()){
+            SysUser user = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                    .eq(SysUser::getUserId,userId));
             if(Validator.isEmpty(user.getIdCard())){
                 throw new CustomException(user.getUserId()+"没有身份证信息");
             }
-            DistributionSeller sellerIdCard = getOne(new LambdaQueryWrapper<DistributionSeller>()
-                    .eq(DistributionSeller::getIdCard,EncryptHandler.encrypt(user.getIdCard())).last("limit 1"));
-            if(Validator.isNotEmpty(sellerIdCard)){
-                if(Validator.isEmpty(sellerIdCard.getUserId())){
-                    sellerIdCard.setUserId(user.getUserId());
-                    sellerIdCard.setUpdateTime(DateUtils.getNowTime());
-                    updateById(sellerIdCard);
-                }
-            }else{
-                DistributionSellerAddBo bo1 = new DistributionSellerAddBo();
-                bo1.setIdCard(user.getIdCard());
-                bo1.setTelphone(user.getTelphone());
-                bo1.setRealname(user.getRealname());
-                insertByAddBo(bo1);
+            if(Validator.isEmpty(user.getPhonenumber())){
+                throw new CustomException(user.getUserId()+"没有手机号码");
             }
-
-        }*/
+            if(Validator.isNotEmpty(user.getSellerId())){
+                throw new CustomException(user.getUserName()+"该用户已绑定分销员");
+            }
+            DistributionSeller inertData = new DistributionSeller();
+            //密码身份证后六位
+    //        String pwd =  user.getIdCard().substring(user.getIdCard().length() - 6);
+            inertData.setRealname(bo.getRealname());
+            inertData.setUserAccount(ServletUtils.getEncoded("YW"));
+            inertData.setCreateTime(DateUtils.getNowTime());
+            inertData.setUpdateTime(DateUtils.getNowTime());
+            inertData.setShareCode(ToolsUtils.getRandomString(8));
+            if(this.save(inertData)){
+                user.setSellerId(inertData.getSellerId());
+            }
+        }
         return true;
     }
 

+ 2 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java

@@ -103,6 +103,8 @@ public class SysLoginService
             if(password.length()>20){
                 password = AES.decrypt(password,rsaPrivate);
             }
+            System.out.println(username);
+            System.out.println(password);
             authentication = authenticationManager
                     .authenticate(new UsernamePasswordAuthenticationToken(username, password));
         }

+ 9 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserDetailsServiceImpl.java

@@ -5,6 +5,7 @@ import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.enums.UserStatus;
 import com.zhongzheng.common.exception.BaseException;
+import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -36,6 +37,13 @@ public class UserDetailsServiceImpl implements UserDetailsService
     {
         //普通系统用户
         SysUser user = userService.selectUserByUserName(username);
+        System.out.println(234234);
+        System.out.println(user);
+        System.out.println(user.getPassword());
+        if (!SecurityUtils.matchesPassword("admin123",user.getPassword()))
+        {
+            throw new BaseException("密码错了");
+        }
         if (Validator.isNull(user))
         {
             log.info("登录用户:{} 不存在.", username);
@@ -56,7 +64,7 @@ public class UserDetailsServiceImpl implements UserDetailsService
     }
 
     public UserDetails createLoginUser(SysUser user)
-    {
+    { System.out.println("113435");
         return new LoginUser(user, permissionService.getMenuPermission(user));
     }
 

+ 2 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerAddBo.java

@@ -32,9 +32,6 @@ public class DistributionSellerAddBo {
     /** 更新时间 */
     @ApiModelProperty("更新时间")
     private Long updateTime;
-    /** 关联用户ID */
-    @ApiModelProperty("关联用户ID")
-    private Long userId;
     /** 业务员编号 */
     @ApiModelProperty("业务员编号")
     private String userAccount;
@@ -51,8 +48,8 @@ public class DistributionSellerAddBo {
     @ApiModelProperty("分享码")
     private String shareCode;
 
-    @ApiModelProperty("批量用户ID")
-    private List<Long> userIds;
+    @ApiModelProperty("批量系统用户ID")
+    private List<Long> sysUserIds;
     /** 可提现余额(不含冻结) */
     @ApiModelProperty("可提现余额(不含冻结)")
     private BigDecimal cash;

+ 0 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerQueryBo.java

@@ -42,9 +42,6 @@ public class DistributionSellerQueryBo extends BaseEntity {
 	/** 1有效 0禁用 */
 	@ApiModelProperty("1有效 0禁用")
 	private Integer status;
-	/** 关联用户ID */
-	@ApiModelProperty("关联用户ID")
-	private Long userId;
 	/** 业务员编号 */
 	@ApiModelProperty("业务员编号")
 	private String userAccount;

+ 0 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/domain/DistributionSeller.java

@@ -37,8 +37,6 @@ private static final long serialVersionUID=1L;
     /** 更新时间 */
     @TableField(fill = FieldFill.INSERT_UPDATE)
     private Long updateTime;
-    /** 关联用户ID */
-    private Long userId;
     /** 业务员编号 */
     private String userAccount;
     /** 公众号openid */

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/service/impl/DistributionActivityPosterServiceImpl.java

@@ -163,6 +163,9 @@ public class DistributionActivityPosterServiceImpl extends ServiceImpl<Distribut
             throw new CustomException("活动不存在");
         }
         DistributionSellerVo sellerVo = iDistributionSellerService.queryById(bo.getSellerId());
+        if(Validator.isNotEmpty(sellerVo)){
+            throw new CustomException("非业务员");
+        }
         DistributionLinkAddBo addBo = new DistributionLinkAddBo();
         String linkCode =activityVo.getDistributionId()+"_"+sellerVo.getSellerId()+"_"+ToolsUtils.getRandomString(8);
         addBo.setLinkCode(linkCode);

+ 0 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/vo/DistributionSellerVo.java

@@ -31,10 +31,6 @@ public class DistributionSellerVo {
 	@Excel(name = "1有效 0禁用")
 	@ApiModelProperty("1有效 0禁用")
 	private Integer status;
-	/** 关联用户ID */
-	@Excel(name = "关联用户ID")
-	@ApiModelProperty("关联用户ID")
-	private Long userId;
 	/** 业务员编号 */
 	@Excel(name = "业务员编号")
 	@ApiModelProperty("业务员编号")

+ 2 - 1
zhongzheng-system/src/main/resources/mapper/modules/system/SysUserMapper.xml

@@ -27,6 +27,7 @@
         <result property="preLoginIp" column="pre_login_ip"/>
         <result property="preLoginDate" column="pre_login_date"/>
         <result property="pwdTime" column="pwd_time"/>
+        <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
         <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/>
         <collection property="roles" column="user_id" select="findRolesList" javaType="java.util.List" />
     </resultMap>
@@ -100,7 +101,7 @@
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
         select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
         u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,
-        u.code from
+        u.code,u.id_card from
         sys_user u
         left join sys_dept d on u.dept_id = d.dept_id
         <if test="roleName != null and roleName != ''">