| | |
| | | item.setOrgCodeTxt(useDepNames.get(item.getId())); |
| | | item.setProductionName(useProNames.get(item.getId())); |
| | | item.setRepairDepartName(useRepDepNames.get(item.getId())); |
| | | item.setEamFactoryIds( String.join(",",iBaseFactoryUserService.queryEamCenterIdsByUserId(item.getId()))); |
| | | }); |
| | | } |
| | | result.setSuccess(true); |
| | |
| | | String selectedDeparts = jsonObject.getString("selecteddeparts"); |
| | | String selectedProductions = jsonObject.getString("selectedProduction"); |
| | | String selectedRepairDeparts = jsonObject.getString("selectedRepairDeparts"); |
| | | String factoryIds=jsonObject.getString("selectedBaseFactory"); |
| | | try { |
| | | SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class); |
| | | user.setCreateTime(new Date());//设置创建时间 |
| | |
| | | user.setOrgCode(null); |
| | | // 保存用户走一个service 保证事务 |
| | | sysUserService.saveUser(user, selectedRoles, selectedDeparts, selectedProductions, selectedRepairDeparts); |
| | | if (oConvertUtils.isNotEmpty(factoryIds)) { |
| | | iBaseFactoryUserService.addUserFactory(user.getId(), factoryIds); |
| | | } |
| | | baseCommonService.addLog("添加用户,username: " + user.getUsername(), CommonConstant.LOG_TYPE_2, 2); |
| | | result.success("添加成功!"); |
| | | } catch (Exception e) { |
| | |
| | | String departs = jsonObject.getString("selecteddeparts"); |
| | | String productions = jsonObject.getString("selectedProduction"); |
| | | String repairDeparts = jsonObject.getString("selectedRepairDeparts"); |
| | | String factoryIds=jsonObject.getString("selectedBaseFactory"); |
| | | if (oConvertUtils.isEmpty(departs)) { |
| | | //vue3.0前端只传递了departIds |
| | | departs = user.getDepartIds(); |
| | |
| | | } |
| | | if (oConvertUtils.isNotEmpty(repairDeparts)) { |
| | | repairDeparts = user.getRepairDepartIds(); |
| | | } |
| | | if (oConvertUtils.isNotEmpty(factoryIds)) { |
| | | iBaseFactoryUserService.addUserFactory(user.getId(), factoryIds); |
| | | } |
| | | //用户表字段org_code不能在这里设置他的值 |
| | | user.setOrgCode(null); |
| | |
| | | } |
| | | } |
| | | |
| | | @AutoLog(value = "用户表-查询指定用户和维修部门关联的数据") |
| | | @ApiOperation(value = "用户表-查询指定用户和维修部门关联的数据", notes = "用户表-查询指定用户和维修部门关联的数据") |
| | | @AutoLog(value = "用户表-查询指定用户和EAM中心关联的数据") |
| | | @ApiOperation(value = "用户表-查询指定用户和EAM中心关联的数据", notes = "用户表-查询指定用户和EAM中心关联的数据") |
| | | @GetMapping(value = "/userBaseFactoryList") |
| | | public Result<List<EamBaseFactoryIdModel>> userBaseFactoryList(@RequestParam(name = "userId", required = true) String userId) { |
| | | Result<List<EamBaseFactoryIdModel>> result = new Result<>(); |