futian.liu
2023-12-02 8e41786892a4bd7cff2d63bde8cb0636cdb0650c
consum-base/src/main/java/com/consum/base/controller/FinSysTenantUserController.java
@@ -1,5 +1,6 @@
package com.consum.base.controller;
import cn.hutool.core.util.ReflectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.context.AnalysisContext;
@@ -13,19 +14,17 @@
import com.consum.base.pojo.response.FinSysTenantUserVO;
import com.consum.base.pojo.response.FinSysTenantVO;
import com.consum.base.pojo.response.UserVO;
import com.consum.base.service.FinSysTenantDepartmentServiceImpl;
import com.consum.base.service.FinSysTenantDepartmentService;
import com.consum.base.service.FinSysTenantServiceImpl;
import com.consum.base.service.FinSysTenantUserServiceImpl;
import com.consum.model.po.FinSysTenant;
import com.consum.model.po.FinSysTenantDepartment;
import com.consum.model.po.FinSysTenantUser;
import com.iplatform.base.ArgumentsConstants;
import com.iplatform.base.service.DeptServiceImpl;
import com.iplatform.base.service.RoleServiceImpl;
import com.iplatform.base.service.UserServiceImpl;
import com.iplatform.base.util.PlatformRSAUtils;
import com.iplatform.core.util.AESUtils;
import com.iplatform.model.po.S_config;
import com.iplatform.model.po.S_dept;
import com.iplatform.model.po.S_role;
import com.iplatform.model.po.S_user_core;
@@ -79,14 +78,13 @@
    private UserServiceImpl userService;
    private DeptServiceImpl deptService;
    private FinSysTenantServiceImpl finSysTenantService;
    private RoleServiceImpl roleService;
    @Autowired
    private FinSysTenantDepartmentServiceImpl finSysTenantDepartmentService;
    private FinSysTenantDepartmentService finSysTenantDepartmentService;
    @Autowired
@@ -94,7 +92,6 @@
        this.userService = userService;
    }
    private S_config sConfig;
    @Autowired
    public FinSysTenantUserController(FinSysTenantServiceImpl finSysTenantService, FinSysTenantUserServiceImpl finSysTenantUserService,
@@ -174,8 +171,10 @@
        try {
            Field fieldDatas = GenericPager.class.getDeclaredField("datas");
            fieldDatas.setAccessible(true);
            fieldDatas.set(pager, resultList);
//            fieldDatas.setAccessible(true);
//            fieldDatas.set(pager, resultList);
            ReflectUtil.setFieldValue(pager, fieldDatas, resultList);
        } catch (Exception e) {
            e.printStackTrace();
        }
@@ -227,11 +226,11 @@
        user.setSysUserId(NumberGenerator.getLongSequenceNumber());
        // 加密手机号
        String key = PlatformRSAUtils.AES_KEY;
        String pwdPhone = "";
        String encPhone = "";
        if (user.getUserPhone() != null) {
            pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key);
            encPhone = AESUtils.encryptStrAES(user.getUserPhone(), key);
        }
        user.setUserPhone(pwdPhone);
        user.setUserPhone(encPhone);
        //怎么获取左侧机构树数据
        user.setSysDeptId(3L); //对应平台机构id  默认为平台管理
        this.finSysTenantUserService.insert(user);
@@ -245,7 +244,7 @@
        userCore.setNick_name(user.getUserName());
        //用户类型 先默认设置为2
        userCore.setUser_type(2);
        userCore.setPhonenumber(pwdPhone);
        userCore.setPhonenumber(encPhone);
        userCore.setSex(user.getSex().toString());
        //初始化密码 123456
        String pws = this.getArgumentVariable(ArgumentsConstants.KEY_SECURITY_PASSWORD_INIT).getStringValue();
@@ -427,8 +426,8 @@
                user.setRemark("批量导入");
                // 加密手机号
                String key = PlatformRSAUtils.AES_KEY;
                String pwdPhone = AESUtils.encryptStrAES(data.getUserPhone(), key);
                user.setUserPhone(pwdPhone);
                String encPhone = AESUtils.encryptStrAES(data.getUserPhone(), key);
                user.setUserPhone(encPhone);
                user.setIsDelete(1);
                //怎么获取左侧机构树数据
@@ -551,11 +550,11 @@
            return ResponseValue.error("参数为空");
        }
        String key = PlatformRSAUtils.AES_KEY;
        String pwdPhone = "";
        String encPhone = "";
        if (user.getUserPhone() != null) {
            pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key);
            encPhone = AESUtils.encryptStrAES(user.getUserPhone(), key);
        }
        user.setUserPhone(pwdPhone);
        user.setUserPhone(encPhone);
        // 1.更新系统用户   FIN_SYS_TENANT_USER
        finSysTenantUserService.update(user);
        // 2.更新平台用户  S_USER_CORE
@@ -786,10 +785,10 @@
        // 加密手机号
        String key = PlatformRSAUtils.AES_KEY;
        String userPhone = user.getUserPhone();
        String pwdPhone = "";
        String encPhone = "";
        if (userPhone != null) {
            pwdPhone = AESUtils.encryptStrAES(userPhone, key);
            user.setUserPhone(pwdPhone);
            encPhone = AESUtils.encryptStrAES(userPhone, key);
            user.setUserPhone(encPhone);
        }
        this.finSysTenantUserService.insert(user);
@@ -883,12 +882,12 @@
        updUser.setEmail(user.getEmail());
        updUser.setUserName(user.getUserName());
        updUser.setSex(user.getSex());
        String pwdPhone = "";
        String encPhone = "";
        if (user.getUserPhone() != null) {
            String key = PlatformRSAUtils.AES_KEY;
            pwdPhone = AESUtils.encryptStrAES(user.getUserPhone(), key);
            encPhone = AESUtils.encryptStrAES(user.getUserPhone(), key);
        }
        updUser.setUserPhone(pwdPhone);
        updUser.setUserPhone(encPhone);
        // 1.更新系统用户   FIN_SYS_TENANT_USER
        finSysTenantUserService.update(updUser);
        // 2.更新平台用户  S_USER_CORE