futian.liu
2023-12-12 f470bdc535b6ca345d4e843da248f8860d294b85
consum-base/src/main/java/com/consum/base/controller/FinSysTenantUserController.java
@@ -1,6 +1,28 @@
package com.consum.base.controller;
import cn.hutool.core.util.ReflectUtil;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
@@ -17,7 +39,7 @@
import com.consum.base.pojo.response.FinSysTenantVO;
import com.consum.base.pojo.response.UserVO;
import com.consum.base.service.FinSysTenantDepartmentService;
import com.consum.base.service.FinSysTenantServiceImpl;
import com.consum.base.service.FinSysTenantService;
import com.consum.base.service.FinSysTenantUserServiceImpl;
import com.consum.model.po.FinSysTenant;
import com.consum.model.po.FinSysTenantDepartment;
@@ -31,22 +53,18 @@
import com.iplatform.model.po.S_role;
import com.iplatform.model.po.S_user_core;
import com.walker.db.page.GenericPager;
import com.walker.infrastructure.utils.*;
import com.walker.infrastructure.utils.CollectionUtils;
import com.walker.infrastructure.utils.DateUtils;
import com.walker.infrastructure.utils.NumberGenerator;
import com.walker.infrastructure.utils.PhoneNumberUtils;
import com.walker.infrastructure.utils.StringUtils;
import com.walker.web.ResponseValue;
import cn.hutool.core.util.ReflectUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.*;
/**
 * @Description 系统用户
@@ -64,7 +82,7 @@
    private UserServiceImpl userService;
    private FinSysTenantServiceImpl finSysTenantService;
    private FinSysTenantService finSysTenantService;
    private RoleServiceImpl roleService;
@@ -77,7 +95,7 @@
    }
    @Autowired
    public FinSysTenantUserController(FinSysTenantServiceImpl finSysTenantService,
    public FinSysTenantUserController(FinSysTenantService finSysTenantService,
        FinSysTenantUserServiceImpl finSysTenantUserService, RoleServiceImpl roleService) {
        this.finSysTenantUserService = finSysTenantUserService;
        this.finSysTenantService = finSysTenantService;
@@ -224,7 +242,7 @@
        }
        tenantUser.setUserPhone(encPhone);
        // 怎么获取左侧机构树数据
//        tenantUser.setSysDeptId(3L); // 对应平台机构id 默认为平台管理
        // tenantUser.setSysDeptId(3L); // 对应平台机构id 默认为平台管理
        this.finSysTenantUserService.insert(tenantUser);
        // 插入平台用户
@@ -292,7 +310,7 @@
    public ResponseValue importUser(@RequestParam String tenantId, @RequestParam String tenantCode, MultipartFile file)
        throws IOException {
        String originalFilename = file.getOriginalFilename();
        if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))) {
        if (!originalFilename.endsWith("xls")) {
            return ResponseValue.error("文件格式有误!");
        }
        S_user_core currentUser = this.getCurrentUser();