项目书-基本信息 功能添加 10.24

master
zhc077 4 weeks ago
parent ca66b7bce2
commit e887e4414e
  1. 21
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java
  2. 2
      jeecgboot-vue3/src/views/projectApplication/project/ProjectList.vue

@ -7,14 +7,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
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.query.QueryGenerator;
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.service.IDepartExtService;
import org.jeecg.modules.demo.project.dto.DepartExtDto;
@ -99,7 +98,7 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "项目表-根据id查询", notes = "项目表-根据id查询")
@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());
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid());
project.setAnnualName(projectType.getAnnualName());
@ -111,7 +110,7 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息")
@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();
Project project = projectService.getById(para.getId());
SysUser sysUser = iSysUserService.getById(project.getProjectCharger());
@ -126,7 +125,7 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "获取申请单位信息", notes = "获取申请单位信息")
@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());
SysUser sysUser = iSysUserService.getById(project.getProjectCharger());
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())
);
DepartExtDto dto = new DepartExtDto();
BeanUtils.copyProperties(sysDepart,dto);
BeanUtils.copyProperties(departExt,dto);
BeanUtils.copyProperties(sysDepart, dto);
BeanUtils.copyProperties(departExt, dto);
return Result.OK(dto);
}
@ -159,6 +158,10 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@ApiOperation(value = "新增项目审报", notes = "新增项目审报")
@PostMapping(value = "/save4shenbao")
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);
return Result.OK("添加成功!");
}
@ -198,8 +201,8 @@ public class ProjectController extends JeecgController<Project, IProjectService>
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
projectService.removeById(id);
iUserExtService.remove(new LambdaQueryWrapper<UserExt>().eq(UserExt::getProjectId,id));
iDepartExtService.remove(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getProjectId,id));
iUserExtService.remove(new LambdaQueryWrapper<UserExt>().eq(UserExt::getProjectId, id));
iDepartExtService.remove(new LambdaQueryWrapper<DepartExt>().eq(DepartExt::getProjectId, id));
return Result.OK("删除成功!");
}

@ -4,7 +4,7 @@
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>-->
<!-- <a-button type="primary" @click="go_xinjianshenbao" preIcon="ant-design:plus-outlined"> 新建审报书</a-button>-->
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<!-- <j-upload-button type="primary" v-auth="'project:project:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>-->

Loading…
Cancel
Save