|
|
@ -1,5 +1,6 @@ |
|
|
|
package org.jeecg.modules.demo.project.controller; |
|
|
|
package org.jeecg.modules.demo.project.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -16,6 +17,7 @@ import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
import org.jeecg.common.system.query.QueryRuleEnum; |
|
|
|
import org.jeecg.common.system.query.QueryRuleEnum; |
|
|
|
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.BasicInfoDto; |
|
|
|
import org.jeecg.modules.demo.project.dto.DepartExtDto; |
|
|
|
import org.jeecg.modules.demo.project.dto.DepartExtDto; |
|
|
|
import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto; |
|
|
|
import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto; |
|
|
|
import org.jeecg.modules.demo.project.entity.Project; |
|
|
|
import org.jeecg.modules.demo.project.entity.Project; |
|
|
@ -28,6 +30,7 @@ import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
import org.jeecg.modules.system.service.ISysUserService; |
|
|
|
import org.jeecg.modules.system.service.ISysUserService; |
|
|
|
|
|
|
|
import org.jeewx.api.core.util.DateUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -115,13 +118,43 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid()); |
|
|
|
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid()); |
|
|
|
project.setAnnualName(projectType.getAnnualName()); |
|
|
|
project.setAnnualName(projectType.getAnnualName()); |
|
|
|
project.setProjectTypeName(projectType.getTypeName()); |
|
|
|
project.setProjectTypeName(projectType.getTypeName()); |
|
|
|
|
|
|
|
SysDepart sysDepart = iSysDepartService.getById(project.getSysOrgCode()); |
|
|
|
|
|
|
|
project.setDepartName(sysDepart.getDepartName()); |
|
|
|
|
|
|
|
SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); |
|
|
|
|
|
|
|
project.setProjectCharger(sysUser.getRealname()); |
|
|
|
|
|
|
|
return Result.OK(project); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "预算书-获取预算基本信息", notes = "预算书-获取预算基本信息") |
|
|
|
|
|
|
|
@GetMapping(value = "/getBaseInfo") |
|
|
|
|
|
|
|
public Result<BasicInfoDto> getBaseInfo(Project param, HttpServletRequest req) { |
|
|
|
|
|
|
|
Project project = projectService.getById(param.getId()); |
|
|
|
|
|
|
|
ProjectType projectType = iProjectTypeService.getById(project.getProjectTypeid()); |
|
|
|
project.setAnnualName(projectType.getAnnualName()); |
|
|
|
project.setAnnualName(projectType.getAnnualName()); |
|
|
|
project.setProjectTypeName(projectType.getTypeName()); |
|
|
|
project.setProjectTypeName(projectType.getTypeName()); |
|
|
|
SysDepart sysDepart = iSysDepartService.getById(project.getSysOrgCode()); |
|
|
|
SysDepart sysDepart = iSysDepartService.getById(project.getSysOrgCode()); |
|
|
|
project.setDepartName(sysDepart.getDepartName()); |
|
|
|
project.setDepartName(sysDepart.getDepartName()); |
|
|
|
SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); |
|
|
|
SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); |
|
|
|
project.setProjectCharger(sysUser.getRealname()); |
|
|
|
project.setProjectCharger(sysUser.getRealname()); |
|
|
|
return Result.OK(project); |
|
|
|
|
|
|
|
|
|
|
|
UserExt userExt = iUserExtService.getOne(new LambdaQueryWrapper<UserExt>() |
|
|
|
|
|
|
|
.eq(UserExt::getUserId, sysUser.getId()) |
|
|
|
|
|
|
|
.eq(UserExt::getProjectId, param.getId()) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(sysUser.getPhone())) { |
|
|
|
|
|
|
|
userExt.setPhone(sysUser.getPhone()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(sysUser.getEmail())) { |
|
|
|
|
|
|
|
userExt.setEmail(sysUser.getEmail()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BasicInfoDto basicInfoDto = new BasicInfoDto(); |
|
|
|
|
|
|
|
BeanUtils.copyProperties(userExt, basicInfoDto); |
|
|
|
|
|
|
|
BeanUtils.copyProperties(project, basicInfoDto); |
|
|
|
|
|
|
|
basicInfoDto.setRealName(sysUser.getRealname()); |
|
|
|
|
|
|
|
basicInfoDto.setProjectTime(DateUtils.formatDate(project.getStartTime()) +"——"+DateUtils.formatDate(project.getEndTime())); |
|
|
|
|
|
|
|
return Result.OK(basicInfoDto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息") |
|
|
|
@ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息") |
|
|
@ -134,7 +167,7 @@ public class ProjectController extends JeecgController<Project, IProjectService> |
|
|
|
.eq(UserExt::getUserId, project.getProjectCharger()) |
|
|
|
.eq(UserExt::getUserId, project.getProjectCharger()) |
|
|
|
.eq(UserExt::getProjectId, para.getId()) |
|
|
|
.eq(UserExt::getProjectId, para.getId()) |
|
|
|
); |
|
|
|
); |
|
|
|
userExt.setIdNO(sysUser.getId()); |
|
|
|
userExt.setIdNO(sysUser.getIdNo()); |
|
|
|
userExt.setPhone(sysUser.getPhone()); |
|
|
|
userExt.setPhone(sysUser.getPhone()); |
|
|
|
userExt.setEmail(sysUser.getEmail()); |
|
|
|
userExt.setEmail(sysUser.getEmail()); |
|
|
|
return Result.OK(userExt); |
|
|
|
return Result.OK(userExt); |
|
|
|