| | |
| | | package com.consum.base.controller; |
| | | |
| | | 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 cn.hutool.core.util.ReflectUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | |
| | | 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 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 系统用户 |
| | |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResponseValue add() { |
| | | FinSysTenantUserParam user = CommonUtil.getObjFromReqBody(FinSysTenantUserParam.class); |
| | | FinSysTenantUser user = CommonUtil.getObjFromReqBody(FinSysTenantUser.class); |
| | | FinSysTenantUser tenantUser = new FinSysTenantUser(); |
| | | CommonUtil.copyProperties(user, tenantUser); |
| | | |
| | |
| | | // 怎么获取左侧机构树数据 |
| | | tenantUser.setSysDeptId(3L); // 对应平台机构id 默认为平台管理 |
| | | this.finSysTenantUserService.insert(tenantUser); |
| | | |
| | | // 插入平台用户 |
| | | S_user_core userCore = new S_user_core(); |
| | | userCore.setId(user.getSysUserId()); |
| | | userCore.setId(tenantUser.getSysUserId()); |
| | | userCore.setDept_id(3L); // 部门id,目前写死 |
| | | userCore.setOrg_id(user.getSysDeptId()); // 机构id |
| | | userCore.setOrg_id(tenantUser.getSysDeptId()); // 机构id |
| | | userCore.setOrg_id(1L); |
| | | userCore.setUser_name(user.getUserCode()); // 用户账号 |
| | | userCore.setNick_name(user.getUserName()); |
| | | userCore.setUser_name(tenantUser.getUserCode()); // 用户账号 |
| | | userCore.setNick_name(tenantUser.getUserName()); |
| | | // 用户类型 先默认设置为2 |
| | | userCore.setUser_type(2); |
| | | userCore.setPhonenumber(encPhone); |
| | | userCore.setSex(user.getSex().toString()); |
| | | userCore.setSex(tenantUser.getSex().toString()); |
| | | // 初始化密码 123456 |
| | | String pws = this.getArgumentVariable(ArgumentsConstants.KEY_SECURITY_PASSWORD_INIT).getStringValue(); |
| | | userCore.setPassword(pws); |
| | | // 平台用户表和系统用户 表状态相反 |
| | | if (user.getStatus() == 0) { |
| | | user.setStatus(1); |
| | | if (tenantUser.getStatus() == 0) { |
| | | tenantUser.setStatus(1); |
| | | } else { |
| | | user.setStatus(0); |
| | | tenantUser.setStatus(0); |
| | | } |
| | | userCore.setStatus(user.getStatus()); |
| | | userCore.setStatus(tenantUser.getStatus()); |
| | | userCore.setDel_flag(0); |
| | | userCore.setCreate_by(this.getCurrentUser().getUser_name()); |
| | | userCore.setCreate_time(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | userCore.setRemark(user.getRemark()); |
| | | userCore.setRemark(tenantUser.getRemark()); |
| | | userCore.setType(1); |
| | | userCore.setBind_client_id("0"); |
| | | userCore.setBind_wechat(0); |
| | |
| | | // 少角色id |
| | | List<Long> roleList = user.getRoleList(); // 机构id 多个 |
| | | if (!CollectionUtils.isEmpty(roleList)) { |
| | | Long sysUserId = user.getSysUserId(); // 用户id |
| | | Long sysUserId = tenantUser.getSysUserId(); // 用户id |
| | | this.finSysTenantUserService.execInsertRoleUserList(roleList, sysUserId); |
| | | } |
| | | // this.getFinCustomerCache().remove(); |
| | |
| | | @PostMapping("/update") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResponseValue update() { |
| | | FinSysTenantUserParam user = CommonUtil.getObjFromReqBody(FinSysTenantUserParam.class); |
| | | FinSysTenantUser user = CommonUtil.getObjFromReqBody(FinSysTenantUser.class); |
| | | FinSysTenantUser tenantUser = new FinSysTenantUser(); |
| | | CommonUtil.copyProperties(user, tenantUser); |
| | | |
| | |
| | | */ |
| | | @PostMapping("/updRole") |
| | | public ResponseValue updRole() { |
| | | FinSysTenantUserParam user = CommonUtil.getObjFromReqBody(FinSysTenantUserParam.class); |
| | | FinSysTenantUserParam tenantUser = new FinSysTenantUserParam(); |
| | | FinSysTenantUser user = CommonUtil.getObjFromReqBody(FinSysTenantUser.class); |
| | | FinSysTenantUser tenantUser = new FinSysTenantUser(); |
| | | CommonUtil.copyProperties(user, tenantUser); |
| | | user = tenantUser; |
| | | |