|
|
@ -3,6 +3,9 @@ package com.ruoyi.tc.controller;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
import com.ruoyi.tc.entity.Unit;
|
|
|
|
import com.ruoyi.tc.entity.Unit;
|
|
|
|
import com.ruoyi.tc.entity.request.UnitRequest;
|
|
|
|
import com.ruoyi.tc.entity.request.UnitRequest;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
@ -44,6 +47,9 @@ public class UnitController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private ExamineInfoService examineInfoService;
|
|
|
|
private ExamineInfoService examineInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ISysUserService iSysUserService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取单位列表
|
|
|
|
* 获取单位列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -97,6 +103,7 @@ public class UnitController {
|
|
|
|
@ApiOperation(value = "根据用户编号获取详细信息")
|
|
|
|
@ApiOperation(value = "根据用户编号获取详细信息")
|
|
|
|
@GetMapping("/{id}")
|
|
|
|
@GetMapping("/{id}")
|
|
|
|
public AjaxResult getInfo(@PathVariable(value = "id") Long id) {
|
|
|
|
public AjaxResult getInfo(@PathVariable(value = "id") Long id) {
|
|
|
|
|
|
|
|
System.out.println(SecurityUtils.encryptPassword("TcZc@2024"));
|
|
|
|
return AjaxResult.success(unitService.getById(id));
|
|
|
|
return AjaxResult.success(unitService.getById(id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -130,10 +137,8 @@ public class UnitController {
|
|
|
|
@PutMapping
|
|
|
|
@PutMapping
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public AjaxResult edit(@RequestBody Unit x) {
|
|
|
|
public AjaxResult edit(@RequestBody Unit x) {
|
|
|
|
Unit byId = unitService.getById(x.getId());
|
|
|
|
//查询用户表是否存在该用户
|
|
|
|
if (!byId.getUserName().equals(x.getUserName()) || !byId.getNickName().equals(x.getNickName())) {
|
|
|
|
unitService.validUser(x);
|
|
|
|
throw new ServiceException("不允许修改单位名称和统一信用代码!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
unitService.updateById(x);
|
|
|
|
unitService.updateById(x);
|
|
|
|
if(!x.getOtherConcat().isEmpty()){
|
|
|
|
if(!x.getOtherConcat().isEmpty()){
|
|
|
|
x.getOtherConcat().forEach(y->{
|
|
|
|
x.getOtherConcat().forEach(y->{
|
|
|
@ -159,7 +164,13 @@ public class UnitController {
|
|
|
|
public AjaxResult remove(@PathVariable Long id) {
|
|
|
|
public AjaxResult remove(@PathVariable Long id) {
|
|
|
|
List<String> userNames = unitService.selectByIds(id);
|
|
|
|
List<String> userNames = unitService.selectByIds(id);
|
|
|
|
//逻辑删除单位和用户
|
|
|
|
//逻辑删除单位和用户
|
|
|
|
unitService.deleteUsers(userNames);
|
|
|
|
if(!userNames.isEmpty()){
|
|
|
|
|
|
|
|
for (String it : userNames) {
|
|
|
|
|
|
|
|
if(it!=null){
|
|
|
|
|
|
|
|
unitService.deleteUsers(it);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
unitService.deleteUnits(id);
|
|
|
|
unitService.deleteUnits(id);
|
|
|
|
unitOtherConcatService.deleteByUnitIds(id);
|
|
|
|
unitOtherConcatService.deleteByUnitIds(id);
|
|
|
|
examineInfoService.deleteByUnitIds(id);
|
|
|
|
examineInfoService.deleteByUnitIds(id);
|
|
|
|