| | |
| | | /** |
| | | * 人工配置-统一修改单位名称 |
| | | * @url {ctx}/api/web/ctUser/updateUnitName |
| | | * @param id 主键编号 |
| | | * @return Object |
| | | * @throws Exception |
| | | */ |
| | | @GetMapping("/getByIdupdateUnitNameRole") |
| | | @GetMapping("/updateUnitName") |
| | | public Object updateUnitName() { |
| | | try { |
| | | |
| | | List<CtUser> ctUserList = service.list(); |
| | | for (CtUser ctUser: ctUserList){ |
| | | CtUnit ctUnit = ctUnitService.getById(ctUser.getUnitId()); |
| | | if (ObjectUtils.isNotEmpty(ctUnit)) { |
| | | ctUser.setUnitName(ctUnit.getUnitName()); |
| | | service.updateCtUser(ctUser); |
| | | } |
| | | } |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |