|
|
@ -7,14 +7,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
|
|
|
import org.jeecg.common.exception.JeecgBootException; |
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
import org.jeecg.common.system.query.QueryRuleEnum; |
|
|
|
import org.jeecg.common.system.query.QueryRuleEnum; |
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
|
|
|
|
import org.jeecg.modules.demo.departext.entity.DepartExt; |
|
|
|
import org.jeecg.modules.demo.departext.entity.DepartExt; |
|
|
|
import org.jeecg.modules.demo.departext.service.IDepartExtService; |
|
|
|
import org.jeecg.modules.demo.departext.service.IDepartExtService; |
|
|
|
import org.jeecg.modules.demo.project.dto.DepartExtDto; |
|
|
|
import org.jeecg.modules.demo.project.dto.DepartExtDto; |
|
|
@ -99,7 +98,7 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询") |
|
|
|
@ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询") |
|
|
|
@GetMapping(value = "/getById") |
|
|
|
@GetMapping(value = "/getById") |
|
|
|
public Result<Project> getById(Project param,HttpServletRequest req) { |
|
|
|
public Result<Project> getById(Project param, HttpServletRequest req) { |
|
|
|
Project project = projectService.getById(param.getId()); |
|
|
|
Project project = projectService.getById(param.getId()); |
|
|
|
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid()); |
|
|
|
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid()); |
|
|
|
project.setAnnualName(projectType.getAnnualName()); |
|
|
|
project.setAnnualName(projectType.getAnnualName()); |
|
|
@ -111,7 +110,7 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息") |
|
|
|
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息") |
|
|
|
@GetMapping(value = "/getUserInfo") |
|
|
|
@GetMapping(value = "/getUserInfo") |
|
|
|
public Result<UserExt> getUserInfo(Project para,HttpServletRequest req) { |
|
|
|
public Result<UserExt> getUserInfo(Project para, HttpServletRequest req) { |
|
|
|
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
Project project = projectService.getById(para.getId()); |
|
|
|
Project project = projectService.getById(para.getId()); |
|
|
|
SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); |
|
|
|
SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); |
|
|
@ -126,7 +125,7 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取申请单位信息", notes = "获取申请单位信息") |
|
|
|
@ApiOperation(value = "获取申请单位信息", notes = "获取申请单位信息") |
|
|
|
@GetMapping(value = "/getDepartInfo") |
|
|
|
@GetMapping(value = "/getDepartInfo") |
|
|
|
public Result<DepartExtDto> getDepartInfo(Project para,HttpServletRequest req) { |
|
|
|
public Result<DepartExtDto> getDepartInfo(Project para, HttpServletRequest req) { |
|
|
|
Project project = projectService.getById(para.getId()); |
|
|
|
Project project = projectService.getById(para.getId()); |
|
|
|
SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); |
|
|
|
SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); |
|
|
|
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); |
|
|
|
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); |
|
|
@ -135,8 +134,8 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
.eq(DepartExt::getProjectId, para.getId()) |
|
|
|
.eq(DepartExt::getProjectId, para.getId()) |
|
|
|
); |
|
|
|
); |
|
|
|
DepartExtDto dto = new DepartExtDto(); |
|
|
|
DepartExtDto dto = new DepartExtDto(); |
|
|
|
BeanUtils.copyProperties(sysDepart,dto); |
|
|
|
BeanUtils.copyProperties(sysDepart, dto); |
|
|
|
BeanUtils.copyProperties(departExt,dto); |
|
|
|
BeanUtils.copyProperties(departExt, dto); |
|
|
|
return Result.OK(dto); |
|
|
|
return Result.OK(dto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -159,6 +158,10 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
@ApiOperation(value = "新增项目审报", notes = "新增项目审报") |
|
|
|
@ApiOperation(value = "新增项目审报", notes = "新增项目审报") |
|
|
|
@PostMapping(value = "/save4shenbao") |
|
|
|
@PostMapping(value = "/save4shenbao") |
|
|
|
public Result<String> save4shenbao(@RequestBody ProjectShenBaoDto dto) { |
|
|
|
public Result<String> save4shenbao(@RequestBody ProjectShenBaoDto dto) { |
|
|
|
|
|
|
|
long count = projectService.count(new LambdaQueryWrapper<Project>().eq(Project::getProjectTypeid, dto.getProjectTypeid())); |
|
|
|
|
|
|
|
if (count > 0) { |
|
|
|
|
|
|
|
throw new JeecgBootException("该项目类型,当年已填报,不能重复填报!"); |
|
|
|
|
|
|
|
} |
|
|
|
projectService.save4shenbao(dto); |
|
|
|
projectService.save4shenbao(dto); |
|
|
|
return Result.OK("添加成功!"); |
|
|
|
return Result.OK("添加成功!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -198,8 +201,8 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
projectService.removeById(id); |
|
|
|
projectService.removeById(id); |
|
|
|
iUserExtService.remove(new LambdaQueryWrapper<UserExt>().eq(UserExt::getProjectId,id)); |
|
|
|
iUserExtService.remove(new LambdaQueryWrapper<UserExt>().eq(UserExt::getProjectId, id)); |
|
|
|
iDepartExtService.remove(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getProjectId,id)); |
|
|
|
iDepartExtService.remove(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getProjectId, id)); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|