| | |
| | | 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; |
| | |
| | | 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.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.infrastructure.utils.*; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.RequestBody; |
| | | 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.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 系统用户 |
| | |
| | | |
| | | 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(); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | 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); |
| | | //怎么获取左侧机构树数据 |
| | |
| | | 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 |
| | |
| | | // 加密手机号 |
| | | 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); |
| | |
| | | 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 |