he2802 před 2 roky
rodič
revize
ce8ca97f2e
25 změnil soubory, kde provedl 376 přidání a 196 odebrání
  1. 9 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  2. 17 6
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionActivityController.java
  3. 27 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionActivityPosterController.java
  4. 56 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionCashLogController.java
  5. 81 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionCashWithdrawalController.java
  6. 56 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionLinkController.java
  7. 52 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionSellerController.java
  8. 0 2
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/SellerLoginController.java
  9. 0 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/SellerSmsController.java
  10. 0 32
      zhongzheng-api/src/main/java/com/zhongzheng/controller/distribution/DistributionSellerController.java
  11. 3 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/core/bo/SysUserEditBo.java
  12. 6 3
      zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/SysUser.java
  13. 5 4
      zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/model/LoginUser.java
  14. 1 1
      zhongzheng-common/src/main/java/com/zhongzheng/common/type/EncryptHandler.java
  15. 48 69
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/DistributionSellerServiceImpl.java
  16. 1 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java
  17. 10 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java
  18. 0 12
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerAddBo.java
  19. 0 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerEditBo.java
  20. 0 12
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerQueryBo.java
  21. 0 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/domain/DistributionSeller.java
  22. 3 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/service/impl/DistributionLinkServiceImpl.java
  23. 0 18
      zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/vo/DistributionSellerVo.java
  24. 0 5
      zhongzheng-system/src/main/resources/mapper/modules/distribution/DistributionSellerMapper.xml
  25. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/system/SysUserMapper.xml

+ 9 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.config.RuoYiConfig;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.type.EncryptHandler;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.file.FileUploadUtils;
@@ -379,4 +380,12 @@ public class CommonController
         String dualAuth = configService.selectConfigByKey("login.dual.auth");
         return AjaxResult.success("成功",dualAuth);
     }
+
+
+    @ApiOperation("decodeTel")
+    @GetMapping("common/free/decodeTel")
+    public AjaxResult<String> decodeTel(String key) {
+
+        return AjaxResult.success("成功", EncryptHandler.decrypt(key));
+    }
 }

+ 17 - 6
zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionActivityController.java

@@ -5,23 +5,23 @@ import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
-import com.zhongzheng.modules.distribution.bo.DistributionActivityAddBo;
-import com.zhongzheng.modules.distribution.bo.DistributionActivityEditBo;
-import com.zhongzheng.modules.distribution.bo.DistributionActivityQueryBo;
-import com.zhongzheng.modules.distribution.bo.DistributionStatusEditBo;
+import com.zhongzheng.modules.distribution.bo.*;
+import com.zhongzheng.modules.distribution.service.IDistributionActivityGoodsService;
 import com.zhongzheng.modules.distribution.service.IDistributionActivityService;
+import com.zhongzheng.modules.distribution.vo.DistributionActivityGoodsVo;
 import com.zhongzheng.modules.distribution.vo.DistributionActivityVo;
 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.*;
 
 import java.util.List;
 
 /**
  * 【请填写功能名称】Controller
- * 
+ *
  * @author ruoyi
  * @date 2023-03-06
  */
@@ -33,7 +33,7 @@ public class DistributionActivityController extends BaseController {
 
     private final IDistributionActivityService iDistributionActivityService;
 
-
+    private final IDistributionActivityGoodsService iDistributionActivityGoodsService;
     /**
      * 查询【请填写功能名称】列表
      */
@@ -102,5 +102,16 @@ public class DistributionActivityController extends BaseController {
         return toAjax(iDistributionActivityService.pullGoods(distributionId) ? 1 : 0);
     }
 
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @ApiOperation("查询活动详情商品列表")
+    @PreAuthorize("@ss.hasPermi('system:activity:list')")
+    @GetMapping("/goodsList")
+    public TableDataInfo<DistributionActivityGoodsVo> getDetailGoodsList(DistributionActivityGoodsQueryBo bo) {
+        startPage();
+        List<DistributionActivityGoodsVo> list = iDistributionActivityGoodsService.getDetailGoodsList(bo);
+        return getDataTable(list);
+    }
 
 }

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

@@ -4,8 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.framework.web.service.TokenService;
 import com.zhongzheng.modules.distribution.bo.DistributionActivityPosterAddBo;
 import com.zhongzheng.modules.distribution.bo.DistributionActivityPosterEditBo;
 import com.zhongzheng.modules.distribution.bo.DistributionActivityPosterQueryBo;
@@ -14,10 +17,12 @@ import com.zhongzheng.modules.distribution.service.IDistributionActivityImageSer
 import com.zhongzheng.modules.distribution.service.IDistributionActivityPosterService;
 import com.zhongzheng.modules.distribution.vo.DistributionActivityImageVo;
 import com.zhongzheng.modules.distribution.vo.DistributionActivityPosterVo;
+import com.zhongzheng.modules.user.entity.ClientLoginSeller;
 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.*;
 
 import java.util.List;
@@ -25,7 +30,7 @@ import java.util.stream.Collectors;
 
 /**
  * 【请填写功能名称】Controller
- * 
+ *
  * @author ruoyi
  * @date 2023-03-06
  */
@@ -39,6 +44,7 @@ public class DistributionActivityPosterController extends BaseController {
 
     private final IDistributionActivityImageService iDistributionImageService;
 
+    private final TokenService tokenService;
     /**
      * 查询海报列表
      */
@@ -99,4 +105,24 @@ public class DistributionActivityPosterController extends BaseController {
         return toAjax(iDistributionActivityPosterService.updateByEditBo(bo) ? 1 : 0);
     }
 
+    /**
+     * 获取分销海报详细信息
+     */
+    @ApiOperation("生成业务员海报")
+    @PreAuthorize("@ss.hasPermi('system:poster:query')")
+    @GetMapping("/makePoster")
+    public AjaxResult<String> makePoster(DistributionActivityPosterQueryBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setSellerId(loginUser.getUser().getSellerId());
+        return AjaxResult.success("成功",iDistributionActivityPosterService.makePoster(bo));
+    }
+
+    @ApiOperation("获取分享链条码")
+    @PreAuthorize("@ss.hasPermi('system:poster:query')")
+    @GetMapping("/linkCode")
+    public AjaxResult<String> linkCode(DistributionActivityPosterQueryBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setSellerId(loginUser.getUser().getSellerId());
+        return AjaxResult.success("成功",iDistributionActivityPosterService.getLinkCode(bo));
+    }
 }

+ 56 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionCashLogController.java

@@ -0,0 +1,56 @@
+package com.zhongzheng.controller.distribution;
+
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.model.LoginUser;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.SellerTokenService;
+import com.zhongzheng.framework.web.service.TokenService;
+import com.zhongzheng.modules.distribution.bo.DistributionCashLogQueryBo;
+import com.zhongzheng.modules.distribution.service.IDistributionCashLogService;
+import com.zhongzheng.modules.distribution.vo.DistributionCashLogVo;
+import com.zhongzheng.modules.user.entity.ClientLoginSeller;
+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.List;
+
+/**
+ * 业务员金额操作日志Controller
+ *
+ * @author ruoyi
+ * @date 2023-03-25
+ */
+@Api(value = "业务员金额操作日志控制器", tags = {"业务员金额操作日志管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/distribution/cash/log")
+public class DistributionCashLogController extends BaseController {
+
+    private final IDistributionCashLogService iDistributionCashLogService;
+
+    private final TokenService tokenService;
+
+    /**
+     * 查询业务员金额操作日志列表
+     */
+    @ApiOperation("查询业务员佣金列表")
+    @PreAuthorize("@ss.hasPermi('system:log:list')")
+    @GetMapping("/fromOrderCashList")
+    public TableDataInfo<DistributionCashLogVo> fromOrderCashList(DistributionCashLogQueryBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setSellerId(loginUser.getUser().getSellerId());
+        startPage();
+        List<DistributionCashLogVo> list = iDistributionCashLogService.fromOrderCashList(bo);
+        return getDataTable(list);
+    }
+
+
+
+}

+ 81 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionCashWithdrawalController.java

@@ -0,0 +1,81 @@
+package com.zhongzheng.controller.distribution;
+
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.domain.model.LoginUser;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.SellerTokenService;
+import com.zhongzheng.framework.web.service.TokenService;
+import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalAddBo;
+import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalQueryBo;
+import com.zhongzheng.modules.distribution.service.IDistributionCashWithdrawalService;
+import com.zhongzheng.modules.distribution.vo.DistributionCashWithdrawalVo;
+import com.zhongzheng.modules.user.entity.ClientLoginSeller;
+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.*;
+
+import java.util.List;
+
+/**
+ * 分销业务员提现申请Controller
+ *
+ * @author ruoyi
+ * @date 2023-03-25
+ */
+@Api(value = "分销业务员提现申请控制器", tags = {"分销业务员提现申请管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/distribution/withdrawal")
+public class DistributionCashWithdrawalController extends BaseController {
+
+    private final IDistributionCashWithdrawalService iDistributionCashWithdrawalService;
+
+    private final TokenService tokenService;
+
+    /**
+     * 查询分销业务员提现申请列表
+     */
+    @ApiOperation("查询分销业务员提现申请列表")
+    @PreAuthorize("@ss.hasPermi('system:withdrawal:list')")
+    @GetMapping("/list")
+    public TableDataInfo<DistributionCashWithdrawalVo> list(DistributionCashWithdrawalQueryBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setSellerId(loginUser.getUser().getSellerId());
+        startPage();
+        List<DistributionCashWithdrawalVo> list = iDistributionCashWithdrawalService.queryList(bo);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取分销业务员提现申请详细信息
+     */
+    @ApiOperation("获取分销业务员提现申请详细信息")
+    @PreAuthorize("@ss.hasPermi('system:withdrawal:query')")
+    @GetMapping("/{id}")
+    public AjaxResult<DistributionCashWithdrawalVo> getInfo(@PathVariable("id" ) Long id) {
+        return AjaxResult.success(iDistributionCashWithdrawalService.queryById(id));
+    }
+
+    /**
+     * 新增分销业务员提现申请
+     */
+    @ApiOperation("新增分销业务员提现申请")
+    @PreAuthorize("@ss.hasPermi('system:withdrawal:add')")
+    @Log(title = "分销业务员提现申请", businessType = BusinessType.INSERT)
+    @PostMapping()
+    public AjaxResult<Void> add(@RequestBody DistributionCashWithdrawalAddBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setSellerId(loginUser.getUser().getSellerId());
+        return toAjax(iDistributionCashWithdrawalService.insertByAddBo(bo) ? 1 : 0);
+    }
+
+
+}

+ 56 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/DistributionLinkController.java

@@ -0,0 +1,56 @@
+package com.zhongzheng.controller.distribution;
+
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.domain.model.LoginUser;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.TokenService;
+import com.zhongzheng.framework.web.service.WxTokenService;
+import com.zhongzheng.modules.distribution.bo.DistributionLinkAddBo;
+import com.zhongzheng.modules.distribution.service.IDistributionLinkService;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 分销链路Controller
+ *
+ * @author ruoyi
+ * @date 2023-03-23
+ */
+@Api(value = "分销链路控制器", tags = {"分销链路管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/system/link")
+public class DistributionLinkController extends BaseController {
+
+    private final IDistributionLinkService iDistributionLinkService;
+
+    private final TokenService tokenService;
+
+    /**
+     * 新增分销链路
+     */
+    @ApiOperation("绑定分销链路")
+    @PreAuthorize("@ss.hasPermi('system:link:add')")
+    @Log(title = "分销链路", businessType = BusinessType.INSERT)
+    @PostMapping()
+    public AjaxResult<Void> add(@RequestBody DistributionLinkAddBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setSellerId(loginUser.getUser().getSellerId());
+        return toAjax(iDistributionLinkService.bindLink(bo) ? 1 : 0);
+    }
+
+
+
+
+}

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

@@ -3,10 +3,13 @@ package com.zhongzheng.controller.distribution;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.SellerTokenService;
+import com.zhongzheng.framework.web.service.TokenService;
+import com.zhongzheng.framework.web.service.WxLoginService;
 import com.zhongzheng.modules.distribution.bo.DistributionSellerAddBo;
 import com.zhongzheng.modules.distribution.bo.DistributionSellerEditBo;
 import com.zhongzheng.modules.distribution.bo.DistributionSellerQueryBo;
@@ -14,6 +17,7 @@ import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
 import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
 import com.zhongzheng.modules.user.bo.UserVisitLogAddBo;
 import com.zhongzheng.modules.user.entity.ClientLoginSeller;
+import com.zhongzheng.modules.wx.bo.WxLoginBody;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
@@ -37,6 +41,9 @@ public class DistributionSellerController extends BaseController {
 
     private final IDistributionSellerService iDistributionSellerService;
 
+    private final TokenService tokenService;
+
+    private final WxLoginService wxLoginService;
 
     /**
      * 查询分销业务员列表
@@ -80,9 +87,21 @@ public class DistributionSellerController extends BaseController {
     @Log(title = "分销业务员", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     public AjaxResult<Void> edit(@RequestBody DistributionSellerEditBo bo) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setSellerId(loginUser.getUser().getSellerId());
         return toAjax(iDistributionSellerService.updateByEditBo(bo) ? 1 : 0);
     }
 
+    /**
+     * 管理员修改分销业务员
+     */
+    @ApiOperation("管理员修改分销业务员")
+    @PreAuthorize("@ss.hasPermi('system:seller:edit')")
+    @Log(title = "分销业务员", businessType = BusinessType.UPDATE)
+    @PostMapping("/sysEdit")
+    public AjaxResult<Void> sysEdit(@RequestBody DistributionSellerEditBo bo) {
+        return toAjax(iDistributionSellerService.updateByEditBo(bo) ? 1 : 0);
+    }
 
 
     /**
@@ -96,5 +115,38 @@ public class DistributionSellerController extends BaseController {
         return toAjax(iDistributionSellerService.insertByAddBo(bo) ? 1 : 0);
     }
 
+    /**
+     * 获取用户信息
+     *
+     * @return 用户信息
+     */
+    @ApiOperation("登录业务员用户信息")
+    @GetMapping("getInfo")
+    public AjaxResult<DistributionSellerVo> getInfo()
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        DistributionSellerVo vo = iDistributionSellerService.queryById(loginUser.getUser().getSellerId());
+        vo.setSelfNull();
+        return AjaxResult.success(vo);
+    }
+
+    @ApiOperation("业务员检查是否绑定公众号")
+    @GetMapping("/checkBindGzh")
+    public AjaxResult<String> checkBindGzh()
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        DistributionSellerVo vo = iDistributionSellerService.queryById(loginUser.getUser().getSellerId());
+        return AjaxResult.success("成功",vo.getGzhOpenId());
+    }
+
+    @ApiOperation("提现前绑定公众号openid")
+    @PostMapping("/gzh_bind")
+    public AjaxResult gzh_bind(@RequestBody WxLoginBody loginBody)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        loginBody.setSellerId(loginUser.getUser().getSellerId());
+        wxLoginService.bindWxGzhUnionIdSeller(loginBody);
+        return AjaxResult.success();
+    }
 
 }

+ 0 - 2
zhongzheng-api/src/main/java/com/zhongzheng/controller/distribution/SellerLoginController.java → zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/SellerLoginController.java

@@ -7,8 +7,6 @@ import com.zhongzheng.framework.web.service.SellerTokenService;
 import com.zhongzheng.modules.distribution.bo.SellerAppAccountLoginBo;
 import com.zhongzheng.modules.distribution.bo.SellerAppRegisterBo;
 import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
-import com.zhongzheng.modules.user.bo.*;
-import com.zhongzheng.modules.user.service.IUserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;

+ 0 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/distribution/SellerSmsController.java → zhongzheng-admin/src/main/java/com/zhongzheng/controller/distribution/SellerSmsController.java


+ 0 - 32
zhongzheng-api/src/main/java/com/zhongzheng/controller/distribution/DistributionSellerController.java

@@ -94,37 +94,5 @@ public class DistributionSellerController extends BaseController {
         return toAjax(iDistributionSellerService.updateByEditBo(bo) ? 1 : 0);
     }
 
-    /**
-     * 获取用户信息
-     *
-     * @return 用户信息
-     */
-    @ApiOperation("登录业务员用户信息")
-    @GetMapping("getInfo")
-    public AjaxResult<DistributionSellerVo> getInfo()
-    {
-        ClientLoginSeller loginUser = sellerTokenService.getLoginUser(ServletUtils.getRequest());
-        DistributionSellerVo vo = iDistributionSellerService.queryById(loginUser.getSeller().getSellerId());
-        vo.setSelfNull();
-        return AjaxResult.success(vo);
-    }
 
-    @ApiOperation("业务员检查是否绑定公众号")
-    @GetMapping("/checkBindGzh")
-    public AjaxResult<String> checkBindGzh()
-    {
-        ClientLoginSeller loginUser = sellerTokenService.getLoginUser(ServletUtils.getRequest());
-        DistributionSellerVo vo = iDistributionSellerService.queryById(loginUser.getSeller().getSellerId());
-        return AjaxResult.success("成功",vo.getGzhOpenId());
-    }
-
-    @ApiOperation("提现前绑定公众号openid")
-    @PostMapping("/gzh_bind")
-    public AjaxResult gzh_bind(@RequestBody WxLoginBody loginBody)
-    {
-        ClientLoginSeller loginUser = sellerTokenService.getLoginUser(ServletUtils.getRequest());
-        loginBody.setSellerId(loginUser.getSeller().getSellerId());
-        wxLoginService.bindWxGzhUnionIdSeller(loginBody);
-        return AjaxResult.success();
-    }
 }

+ 3 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/core/bo/SysUserEditBo.java

@@ -87,4 +87,7 @@ public class SysUserEditBo
     private Long[] roleIds;
     @ApiModelProperty("岗位组")
     private Long[] postIds;
+    /** 身份证号 */
+    @ApiModelProperty("身份证号")
+    private String idCard;
 }

+ 6 - 3
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/SysUser.java

@@ -8,6 +8,7 @@ import com.zhongzheng.common.annotation.Excel;
 import com.zhongzheng.common.annotation.Excel.ColumnType;
 import com.zhongzheng.common.annotation.Excel.Type;
 import com.zhongzheng.common.annotation.Excels;
+import com.zhongzheng.common.type.EncryptHandler;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -30,7 +31,7 @@ import java.util.Map;
 @Data
 @NoArgsConstructor
 @Accessors(chain = true)
-@TableName("sys_user")
+@TableName(value ="sys_user",autoResultMap = true)
 public class SysUser implements Serializable
 {
     private static final long serialVersionUID = 1L;
@@ -167,7 +168,9 @@ public class SysUser implements Serializable
     private Date preLoginDate;
     /** 密码最后修改时间 */
     private Long pwdTime;
-
+    /** 身份证号 */
+    @TableField(typeHandler = EncryptHandler.class)
+    private String idCard;
 
     public SysUser(Long userId)
     {
@@ -188,5 +191,5 @@ public class SysUser implements Serializable
     {
         return userId != null && 1L == userId;
     }*/
-
+  private Long sellerId;
 }

+ 5 - 4
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/model/LoginUser.java

@@ -12,7 +12,7 @@ import java.util.Set;
 
 /**
  * 登录用户身份权限
- * 
+ *
  * @author zhongzheng
  */
 
@@ -68,6 +68,7 @@ public class LoginUser implements UserDetails
      */
     private SysUser user;
 
+
     public LoginUser(SysUser user, Set<String> permissions)
     {
         this.user = user;
@@ -99,7 +100,7 @@ public class LoginUser implements UserDetails
 
     /**
      * 指定用户是否解锁,锁定的用户无法进行身份验证
-     * 
+     *
      * @return
      */
     @JsonIgnore
@@ -111,7 +112,7 @@ public class LoginUser implements UserDetails
 
     /**
      * 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
-     * 
+     *
      * @return
      */
     @JsonIgnore
@@ -123,7 +124,7 @@ public class LoginUser implements UserDetails
 
     /**
      * 是否可用 ,禁用的用户不能身份验证
-     * 
+     *
      * @return
      */
     @JsonIgnore

+ 1 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/type/EncryptHandler.java

@@ -21,7 +21,7 @@ public class EncryptHandler  implements TypeHandler<String> {
 
 
 
-    public String decrypt(String value) {
+    public static String decrypt(String value) {
         if (null == value) {
             return null;
         }

+ 48 - 69
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/DistributionSellerServiceImpl.java

@@ -11,6 +11,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 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.SysUser;
+import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.enums.UserStatus;
 import com.zhongzheng.common.exception.BaseException;
@@ -22,6 +25,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.ISysUserService;
 import com.zhongzheng.modules.top.distribution.bo.DistributionSellerQuery;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.entity.ClientLoginSeller;
@@ -53,7 +57,10 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
     private IUserService iUserService;
 
     @Autowired
-    private SellerTokenService sellerTokenService;
+    private ISysUserService iSysUserService;
+
+    @Autowired
+    private TokenService tokenService;
 
     @Override
     public Boolean registerSeller(SellerAppRegisterBo bo) {
@@ -80,32 +87,22 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
         if(!code.equals(bo.getCode())){
             throw new CustomException("验证码错误");
         }
-        DistributionSeller seller = getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getTelphone, EncryptHandler.encrypt(bo.getTel())).last("limit 1"));
+        SysUser seller = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getPhonenumber, bo.getTel()).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"));
+        SysUser sellerIdCard = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
         if(Validator.isNotNull(sellerIdCard)){
             throw new CustomException("该身份证已注册");
         }
         DistributionSeller inertData = new DistributionSeller();
-        inertData.setTelphone(bo.getTel());
-        inertData.setIdCard(bo.getIdcard());
         inertData.setRealname(bo.getRealname());
-        inertData.setAvatar(Constants.DEFAULT_AVATAR);
-        inertData.setPassword(SecurityUtils.encryptPassword(bo.getPwd()));
         inertData.setUserAccount(ServletUtils.getEncoded("YW"));
         inertData.setCreateTime(DateUtils.getNowTime());
         inertData.setUpdateTime(DateUtils.getNowTime());
         inertData.setShareCode(ToolsUtils.getRandomString(8));
-        inertData.setAvatar(bo.getAvatar());
-        User userIdCard = iUserService.getOne(new LambdaQueryWrapper<User>()
-                .eq(User::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
-        if(Validator.isNotEmpty(userIdCard)){
-            inertData.setUserId(userIdCard.getUserId());
-        }
         if(Validator.isNotEmpty(bo.getShareCode())){
             DistributionSeller sellerShare = getOne(new LambdaQueryWrapper<DistributionSeller>()
                     .eq(DistributionSeller::getShareCode,bo.getShareCode()).last("limit 1"));
@@ -116,6 +113,14 @@ 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);
         return true;
     }
 
@@ -136,19 +141,16 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
             throw new CustomException("验证码错误");
         }
         redisCache.deleteObject(key);
-        DistributionSeller seller = getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getTelphone,EncryptHandler.encrypt(bo.getTel())).last("limit 1"));
+        SysUser seller = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getPhonenumber,bo.getTel()).last("limit 1"));
         if(Validator.isEmpty(seller)){
             throw new CustomException("该手机号未注册");
         }
-        seller.setPassword(SecurityUtils.encryptPassword(bo.getPwd()));
-        seller.setUpdateTime(DateUtils.getNowTime());
-
-        DistributionSeller sellerSync = new DistributionSeller();
-        sellerSync.setUserId(seller.getUserId());
-        sellerSync.setPassword(seller.getPassword());
-    //    syncSellerToUser(sellerSync,null,1);
-        return updateById(seller);
+        return iSysUserService.update(null,
+                new LambdaUpdateWrapper<SysUser>()
+                        .set(SysUser::getPassword,SecurityUtils.encryptPassword(bo.getPwd()))
+                        .set(SysUser::getPwdTime,DateUtils.getNowTime())
+                        .eq(SysUser::getUserId,seller.getUserId()));
     }
 
     /**
@@ -160,38 +162,13 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
      */
     @Override
     public Boolean syncSellerToUser(DistributionSeller seller, User user, Integer type) {
-        if(type==1){
-            if(Validator.isNotEmpty(seller.getUserId())){
-                iUserService.update(new LambdaUpdateWrapper<User>()
-                        .eq(User::getUserId,seller.getUserId())
-                        .set(User::getUpdateTime,DateUtils.getNowTime())
-                        .set(Validator.isNotEmpty(seller.getTelphone()),User::getTelphone,seller.getTelphone())
-                        .set(Validator.isNotEmpty(seller.getIdCard()),User::getIdCard,seller.getIdCard())
-                        .set(Validator.isNotEmpty(seller.getAvatar()),User::getAvatar,seller.getAvatar())
-                        .set(Validator.isNotEmpty(seller.getRealname()),User::getRealname,seller.getRealname())
-                        .set(Validator.isNotEmpty(seller.getPassword()),User::getPassword,seller.getPassword()));
-            }
-        }
-        else if(type==2){
-            DistributionSeller sellerUser = getOne(new LambdaQueryWrapper<DistributionSeller>()
-                    .eq(DistributionSeller::getUserId,user.getUserId()).last("limit 1"));
-            if(Validator.isNotEmpty(sellerUser)){
-                update(new LambdaUpdateWrapper<DistributionSeller>()
-                        .eq(DistributionSeller::getSellerId,sellerUser.getSellerId())
-                        .set(DistributionSeller::getUpdateTime,DateUtils.getNowTime())
-                        .set(Validator.isNotEmpty(user.getTelphone()),DistributionSeller::getTelphone,user.getTelphone())
-                        .set(Validator.isNotEmpty(user.getIdCard()),DistributionSeller::getIdCard,user.getIdCard())
-                        .set(Validator.isNotEmpty(user.getAvatar()),DistributionSeller::getAvatar,user.getAvatar())
-                        .set(Validator.isNotEmpty(user.getRealname()),DistributionSeller::getRealname,user.getRealname())
-                        .set(Validator.isNotEmpty(user.getPassword()),DistributionSeller::getPassword,user.getPassword()));
-            }
-        }
+
         return true;
     }
 
     @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>();
@@ -231,7 +208,8 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
         map.put(Constants.TOKEN,sellerTokenService.createToken(loginSeller));
         map.put("user_account",seller.getUserAccount());
         map.put("full_info",Validator.isEmpty(seller.getIdCard())?false:true); //是否完善身份信息
-        return map;
+        return map;*/
+        return null;
     }
 
     @Override
@@ -248,18 +226,22 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
             throw new CustomException("验证码错误");
         }
         redisCache.deleteObject(key);
-        DistributionSeller seller = getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getTelphone, EncryptHandler.encrypt(bo.getTel())).last("limit 1"));
-        if (Validator.isEmpty(seller)) {
+        SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getPhonenumber, bo.getTel()).last("limit 1"));
+        if (Validator.isEmpty(sysUser)) {
             throw new CustomException("该手机号未注册");
         }
-
-        ClientLoginSeller loginSeller = new ClientLoginSeller();
-        loginSeller.setSeller(seller);
+        if(Validator.isEmpty(sysUser.getSellerId())){
+            throw new CustomException("非业务员账号");
+        }
+        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); //是否完善身份信息
+        map.put("full_info", Validator.isEmpty(sysUser.getIdCard()) ? false : true); //是否完善身份信息
         return map;
     }
     public List<DistributionSellerVo> getSellerListByTenant(DistributionSellerQuery query) {
@@ -283,15 +265,11 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
     public List<DistributionSellerVo> queryList(DistributionSellerQueryBo bo) {
         LambdaQueryWrapper<DistributionSeller> lqw = Wrappers.lambdaQuery();
         lqw.like(StrUtil.isNotBlank(bo.getRealname()), DistributionSeller::getRealname, bo.getRealname());
-        lqw.eq(StrUtil.isNotBlank(bo.getIdCard()), DistributionSeller::getIdCard, bo.getIdCard());
-        lqw.eq(StrUtil.isNotBlank(bo.getTelphone()), DistributionSeller::getTelphone, bo.getTelphone());
         lqw.eq(bo.getStatus() != null, DistributionSeller::getStatus, bo.getStatus());
-        lqw.eq(StrUtil.isNotBlank(bo.getAvatar()), DistributionSeller::getAvatar, bo.getAvatar());
         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());
-        lqw.eq(StrUtil.isNotBlank(bo.getPassword()), DistributionSeller::getPassword, bo.getPassword());
         return entity2Vo(this.list(lqw));
     }
 
@@ -322,7 +300,7 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
      */
     @Override
     public Boolean insertByAddBo(DistributionSellerAddBo bo) {
-        if(StringUtils.isBlank(bo.getIdCard())){
+       /* if(StringUtils.isBlank(bo.getIdCard())){
             throw new CustomException("身份证不能为空");
         }
         if(bo.getTelphone()==null){
@@ -370,12 +348,13 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
                 inertData.setParentId(sellerShare.getSellerId());
             }
         }
-        return this.save(inertData);
+        return this.save(inertData);*/
+        return null;
     }
 
     @Override
     public Boolean insertBatchByAddBo(DistributionSellerAddBo bo) {
-        for(Long userId:bo.getUserIds()){
+       /* for(Long userId:bo.getUserIds()){
             User user = iUserService.getOne(new LambdaQueryWrapper<User>()
                     .eq(User::getUserId,userId));
             if(Validator.isEmpty(user.getIdCard())){
@@ -397,7 +376,7 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
                 insertByAddBo(bo1);
             }
 
-        }
+        }*/
         return true;
     }
 

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

@@ -60,6 +60,7 @@ public class SysLoginService
 
     @Autowired
     private IUserLoginErrorService iUserLoginErrorService;
+
     /**
      * 登录验证
      *

+ 10 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
 import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zhongzheng.common.constant.Constants;
+import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.type.EncryptHandler;
@@ -19,6 +20,7 @@ import com.zhongzheng.modules.base.bo.SmsAddBo;
 import com.zhongzheng.modules.base.service.ISmsService;
 import com.zhongzheng.modules.distribution.domain.DistributionSeller;
 import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
+import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.service.IUserService;
 import org.slf4j.Logger;
@@ -65,6 +67,8 @@ public class AliSmsServiceImpl implements IAliSmsService {
     @Autowired
     private IDistributionSellerService iDistributionSellerService;
 
+    @Autowired
+    private ISysUserService iSysUserService;
 
     @Override
     public ResultBean sendSms(String tel, String param) {
@@ -250,8 +254,8 @@ public class AliSmsServiceImpl implements IAliSmsService {
         if(tel==null){
             throw new CustomException("手机号码不能为空");
         }
-        DistributionSeller seller = iDistributionSellerService.getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getTelphone,EncryptHandler.encrypt(tel)).last("limit 1"));
+        SysUser seller = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getPhonenumber,tel).last("limit 1"));
         if(Validator.isNotNull(seller)){
             throw new CustomException("该手机号已注册");
         }
@@ -283,8 +287,8 @@ public class AliSmsServiceImpl implements IAliSmsService {
         if(tel==null){
             throw new CustomException("手机号码不能为空");
         }
-        DistributionSeller user = iDistributionSellerService.getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getTelphone,EncryptHandler.encrypt(tel)).last("limit 1"));
+        SysUser user = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getPhonenumber,tel).last("limit 1"));
         if(Validator.isEmpty(user)){
             throw new CustomException("该手机号未注册");
         }
@@ -315,8 +319,8 @@ public class AliSmsServiceImpl implements IAliSmsService {
         if(tel==null){
             throw new CustomException("手机号码不能为空");
         }
-        DistributionSeller user = iDistributionSellerService.getOne(new LambdaQueryWrapper<DistributionSeller>()
-                .eq(DistributionSeller::getTelphone,EncryptHandler.encrypt(tel)).last("limit 1"));
+        SysUser user = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getPhonenumber,tel).last("limit 1"));
         if(Validator.isEmpty(user)){
             throw new CustomException("该手机号未注册");
         }

+ 0 - 12
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerAddBo.java

@@ -23,12 +23,6 @@ public class DistributionSellerAddBo {
     /** 真实姓名 */
     @ApiModelProperty("真实姓名")
     private String realname;
-    /** 身份证号 */
-    @ApiModelProperty("身份证号")
-    private String idCard;
-    /** 手机号码 */
-    @ApiModelProperty("手机号码")
-    private String telphone;
     /** 1有效 0禁用 */
     @ApiModelProperty("1有效 0禁用")
     private Integer status;
@@ -38,9 +32,6 @@ public class DistributionSellerAddBo {
     /** 更新时间 */
     @ApiModelProperty("更新时间")
     private Long updateTime;
-    /** 头像 */
-    @ApiModelProperty("头像")
-    private String avatar;
     /** 关联用户ID */
     @ApiModelProperty("关联用户ID")
     private Long userId;
@@ -53,9 +44,6 @@ public class DistributionSellerAddBo {
     /** 微信unionId */
     @ApiModelProperty("微信unionId")
     private String unionId;
-    /** 密码 */
-    @ApiModelProperty("密码")
-    private String password;
     /** 父ID */
     @ApiModelProperty("父ID")
     private Long parentId;

+ 0 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/bo/DistributionSellerEditBo.java

@@ -27,13 +27,7 @@ public class DistributionSellerEditBo {
     @ApiModelProperty("真实姓名")
     private String realname;
 
-    /** 身份证号 */
-    @ApiModelProperty("身份证号")
-    private String idCard;
 
-    /** 手机号码 */
-    @ApiModelProperty("手机号码")
-    private String telphone;
 
     /** 1有效 0禁用 */
     @ApiModelProperty("1有效 0禁用")
@@ -44,10 +38,6 @@ public class DistributionSellerEditBo {
     private Long updateTime;
 
 
-    /** 头像 */
-    @ApiModelProperty("头像")
-    private String avatar;
-
     /** 关联用户ID */
    /* @ApiModelProperty("关联用户ID")
     private Long userId;

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

@@ -39,18 +39,9 @@ public class DistributionSellerQueryBo extends BaseEntity {
 	/** 真实姓名 */
 	@ApiModelProperty("真实姓名")
 	private String realname;
-	/** 身份证号 */
-	@ApiModelProperty("身份证号")
-	private String idCard;
-	/** 手机号码 */
-	@ApiModelProperty("手机号码")
-	private String telphone;
 	/** 1有效 0禁用 */
 	@ApiModelProperty("1有效 0禁用")
 	private Integer status;
-	/** 头像 */
-	@ApiModelProperty("头像")
-	private String avatar;
 	/** 关联用户ID */
 	@ApiModelProperty("关联用户ID")
 	private Long userId;
@@ -63,9 +54,6 @@ public class DistributionSellerQueryBo extends BaseEntity {
 	/** 微信unionId */
 	@ApiModelProperty("微信unionId")
 	private String unionId;
-	/** 密码 */
-	@ApiModelProperty("密码")
-	private String password;
 	/** 父ID */
 	@ApiModelProperty("父ID")
 	private Long parentId;

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

@@ -29,12 +29,6 @@ private static final long serialVersionUID=1L;
     private Long sellerId;
     /** 真实姓名 */
     private String realname;
-    /** 身份证号 */
-    @TableField(typeHandler = EncryptHandler.class)
-    private String idCard;
-    /** 手机号码 */
-    @TableField(typeHandler = EncryptHandler.class)
-    private String telphone;
     /** 1有效 0禁用 */
     private Integer status;
     /** 创建时间 */
@@ -43,8 +37,6 @@ private static final long serialVersionUID=1L;
     /** 更新时间 */
     @TableField(fill = FieldFill.INSERT_UPDATE)
     private Long updateTime;
-    /** 头像 */
-    private String avatar;
     /** 关联用户ID */
     private Long userId;
     /** 业务员编号 */
@@ -53,8 +45,6 @@ private static final long serialVersionUID=1L;
     private String gzhOpenId;
     /** 微信unionId */
     private String unionId;
-    /** 密码 */
-    private String password;
     /** 父ID */
     private Long parentId;
     /** 分享码 */

+ 3 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/distribution/service/impl/DistributionLinkServiceImpl.java

@@ -100,15 +100,14 @@ public class DistributionLinkServiceImpl extends ServiceImpl<DistributionLinkMap
             throw new CustomException("code不能为空");
         }
         DistributionLink add = BeanUtil.toBean(bo, DistributionLink.class);
-        DistributionSeller seller = iDistributionSellerService.getOne(new LambdaQueryWrapper<DistributionSeller>().eq(DistributionSeller::getUserId, bo.getUserId()));
-        if(Validator.isNotEmpty(seller)){
-            DistributionLink link = getOne(new LambdaQueryWrapper<DistributionLink>().eq(DistributionLink::getSellerId, seller.getSellerId())
+        if(Validator.isNotEmpty(bo.getSellerId())){
+            DistributionLink link = getOne(new LambdaQueryWrapper<DistributionLink>()
                     .eq(DistributionLink::getDistributionId, bo.getDistributionId())
                     .eq(DistributionLink::getLinkCode, bo.getLinkCode()));
             if(Validator.isNotEmpty(link)){
                 return false;
             }
-            add.setSellerId(seller.getSellerId());
+            add.setSellerId(bo.getSellerId());
             validEntityBeforeSave(add);
             add.setCreateTime(DateUtils.getNowTime());
             add.setOwner(0);

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

@@ -27,22 +27,10 @@ public class DistributionSellerVo {
 	@Excel(name = "真实姓名")
 	@ApiModelProperty("真实姓名")
 	private String realname;
-	/** 身份证号 */
-	@Excel(name = "身份证号")
-	@ApiModelProperty("身份证号")
-	private String idCard;
-	/** 手机号码 */
-	@Excel(name = "手机号码")
-	@ApiModelProperty("手机号码")
-	private String telphone;
 	/** 1有效 0禁用 */
 	@Excel(name = "1有效 0禁用")
 	@ApiModelProperty("1有效 0禁用")
 	private Integer status;
-	/** 头像 */
-	@Excel(name = "头像")
-	@ApiModelProperty("头像")
-	private String avatar;
 	/** 关联用户ID */
 	@Excel(name = "关联用户ID")
 	@ApiModelProperty("关联用户ID")
@@ -59,10 +47,6 @@ public class DistributionSellerVo {
 	@Excel(name = "微信unionId")
 	@ApiModelProperty("微信unionId")
 	private String unionId;
-	/** 密码 */
-	@Excel(name = "密码")
-	@ApiModelProperty("密码")
-	private String password;
 	/** 父ID */
 	@Excel(name = "父ID")
 	@ApiModelProperty("父ID")
@@ -74,12 +58,10 @@ public class DistributionSellerVo {
 
 	public void setSelfNull(){
 		this.setGzhOpenId(null);
-		this.setPassword(null);
 	}
 
 	public void setNull(){
 		this.setGzhOpenId(null);
-		this.setPassword(null);
 		this.setCash(null);
 		this.setUsedCash(null);
 		this.setFreezeCash(null);

+ 0 - 5
zhongzheng-system/src/main/resources/mapper/modules/distribution/DistributionSellerMapper.xml

@@ -7,17 +7,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="com.zhongzheng.modules.distribution.domain.DistributionSeller" id="DistributionSellerResult">
         <result property="sellerId" column="seller_id"/>
         <result property="realname" column="realname"/>
-        <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
-        <result property="telphone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
         <result property="status" column="status"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
-        <result property="avatar" column="avatar"/>
-        <result property="userId" column="user_id"/>
         <result property="userAccount" column="user_account"/>
         <result property="gzhOpenId" column="gzh_open_id"/>
         <result property="unionId" column="union_id"/>
-        <result property="password" column="password"/>
         <result property="parentId" column="parent_id"/>
         <result property="shareCode" column="share_code"/>
     </resultMap>

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

@@ -143,7 +143,7 @@
 
     <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
         <include refid="selectUserVo"/>
-        where u.user_name = #{userName} and u.`status` != -1
+        where (u.user_name = #{userName} or u.phonenumber = #{userName} or u.id_card = #{userName,typeHandler=com.zhongzheng.common.type.EncryptHandler}) and u.`status` != -1
     </select>
 
     <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">