diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java index e03e8be..897aad1 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/controller/ProjectController.java @@ -82,9 +82,8 @@ public class ProjectController extends JeecgController return Result.OK("添加成功!"); } - @AutoLog(value = "项目审报") - @ApiOperation(value = "项目表-添加", notes = "项目表-添加") -// @RequiresPermissions("project:project:add") + @AutoLog(value = "新增项目审报") + @ApiOperation(value = "新增项目审报", notes = "新增项目审报") @PostMapping(value = "/save4shenbao") public Result save4shenbao(@RequestBody ProjectShenBaoDto dto) { projectService.save4shenbao(dto); diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/entity/Project.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/entity/Project.java index fd028a9..b5235ed 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/entity/Project.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/entity/Project.java @@ -257,8 +257,8 @@ public class Project implements Serializable { /** * 负责人 */ - @Excel(name = "负责人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Excel(name = "负责人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") @ApiModelProperty(value = "负责人") private String projectCharger; } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java index e65d872..2a134e4 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/service/impl/ProjectServiceImpl.java @@ -1,24 +1,70 @@ package org.jeecg.modules.demo.project.service.impl; +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.SecurityUtils; +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.ProjectShenBaoDto; import org.jeecg.modules.demo.project.entity.Project; import org.jeecg.modules.demo.project.mapper.ProjectMapper; import org.jeecg.modules.demo.project.service.IProjectService; +import org.jeecg.modules.demo.userext.entity.UserExt; +import org.jeecg.modules.demo.userext.service.IUserExtService; +import org.jeecg.modules.system.entity.SysDepart; +import org.jeecg.modules.system.entity.SysUser; +import org.jeecg.modules.system.service.ISysDepartService; +import org.jeecg.modules.system.service.ISysUserService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - /** * @Description: 项目表 * @Author: jeecg-boot - * @Date: 2024-10-17 + * @Date: 2024-10-17 * @Version: V1.0 */ @Service +@Slf4j public class ProjectServiceImpl extends ServiceImpl implements IProjectService { + @Autowired + private IDepartExtService iDepartExtService; + + @Autowired + private ISysDepartService iSysDepartService; + + @Autowired + private ISysUserService iSysUserService; + + @Autowired + private IUserExtService iUserExtService; + @Override public void save4shenbao(ProjectShenBaoDto dto) { - System.out.println("dto = " + dto); + log.info(">>> the 新增项目审报 reqParams:{}", JSON.toJSONString(dto)); + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); +// SysDepart sysDepart = new SysDepart(); + DepartExt departExt = new DepartExt(); +// SysUser sysUser = new SysUser(); + UserExt userExt = new UserExt(); + Project project = new Project(); + + BeanUtils.copyProperties(dto, departExt); +// BeanUtils.copyProperties(dto, sysDepart); +// BeanUtils.copyProperties(dto, sysUser); + BeanUtils.copyProperties(dto, userExt); + BeanUtils.copyProperties(dto, project); + + //负责人 + project.setProjectCharger(loginUser.getId()); + this.save(project); + userExt.setUserId(loginUser.getId()); + this.iUserExtService.save(userExt); + departExt.setDepartId(loginUser.getOrgId()); + this.iDepartExtService.save(departExt); } } diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue index 1bb3e1f..fe1e455 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue @@ -1,103 +1,85 @@