forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-21 e142433c71b032ce85546477543d65da0f3986b8
dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtAccountService.java
@@ -36,12 +36,12 @@
import java.util.Map;
/**
 * @author liyj
 * @version 1.0.0
 * @title: 客户用户账号表业务逻辑处理
 * @Description 客户用户账号表业务逻辑处理
 * @company hugeinfo
 * @author liyj
 * @Time 2024-08-19 20:04:18
 * @version 1.0.0
 */
@Slf4j
@Service
@@ -62,6 +62,7 @@
    /**
    * 更新对象
     *
    * @param entity 对象
    */
    public void updateCtAccount(CtAccount entity){
@@ -75,6 +76,7 @@
    /**
    * 条件更新对象
     *
    * @param entity 对象
    * @param terms 条件
    */
@@ -89,6 +91,7 @@
    /**
    * 根据编号物理删除
     *
    * @param id 查询条件集合
    */
    public void deleteCtAccount(String id){
@@ -102,6 +105,7 @@
    /**
    * 按条件查询
     *
    * @param terms 条件
    * @return List
    */
@@ -111,6 +115,7 @@
    /**
    * 按条件统计
     *
    * @param terms 条件
    * @return long
    */
@@ -120,6 +125,7 @@
    /**
    * 按条件分页查询
     *
    * @param page 分页对象
    * @param terms 条件
    * @return Page
@@ -132,6 +138,7 @@
    /**
    * 新增或更新对象
     *
    * @param ctAccount 实体对象
    */
    public void saveCtAccount(CtAccount ctAccount){
@@ -152,6 +159,7 @@
    /**
     * 根据账号和类型查询
     *
     * @param acc 账号
     * @param accType 账号类型
     * @return
@@ -166,6 +174,7 @@
    /**
     * 根据用户编号和类型查询
     *
     * @param userId 用户编号
     * @param accType 账号类型
     * @return
@@ -180,6 +189,7 @@
    /**
     * 判断密码是否正确
     *
     * @param cipher 密码
     * @param ctAccount 账号信息
     * @return Boolean
@@ -207,6 +217,7 @@
    /**
     * web端-工作人员用户登录
     *
     * @param ctAccountLoginDTO 登录账号信息
     * @return UserLoginDTO
     */
@@ -286,6 +297,7 @@
    /**
     * web端-工作人员-修改密码
     *
     * @param userId 用户编号
     * @param ctCipherDTO 修改密码信息
     * @return
@@ -322,6 +334,7 @@
    /**
     * web端-网格系统单点登录
     *
     * @param gridTokenBaseDTO 网格系统token
     * @return UserLoginDTO
     */
@@ -338,13 +351,20 @@
            if(ObjectUtils.isEmpty(ctAccount)){
                ctAccount = this.getByAccAndType(gridUserBaseDTO.getMobile(), UserBaseConsts.ACC_TYPE_1);
            }
            CtUser ctUser = null;
            if (ObjectUtils.isNotEmpty(ctAccount)){
                //返回结果
                UserLoginDTO userLoginDTO = new UserLoginDTO();
                CtUser ctUser = ctUserService.getById(ctAccount.getUserId());
                ctUser = ctUserService.getById(ctAccount.getUserId());
                if (ObjectUtils.isEmpty(ctUser)){
                    return ReturnFailUtils.getRepInfo("用户不存在!");
                }
            } else {
                //如果和亿迅系统的手机号对不上,在用身份证号去查询用户,如果查询得到,就对得上,如果查询不到,就说明用户不存在
                ctUser = ctUserService.getByIdCard(gridUserBaseDTO.getIdNumber());
            }
            if (ObjectUtils.isNotEmpty(ctUser)) {
                //返回结果
                UserLoginDTO userLoginDTO = new UserLoginDTO();
                // 封装用户信息
                userLoginDTO.setToken(JwtUtils.buildJWT(ctUser.getId()));
                userLoginDTO.setUserId(ctUser.getId());