From f73e485c89802e42fc203b705c0cd4b4b6455f92 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Thu, 24 Oct 2024 14:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B9=A6-=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=2010.?= =?UTF-8?q?24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/controller/ProjectController.java | 25 ++- .../demo/project/dto/DepartExtDto.java | 156 ++++++++++++++++++ .../demo/project/dto/ProjectShenBaoDto.java | 47 ++---- .../service/impl/ProjectServiceImpl.java | 21 ++- .../modules/demo/userext/entity/UserExt.java | 9 + .../kejigongguan/projectApplicationList.vue | 4 + .../kejigongguan/xiangmushu/JiBenXinXi.ts | 14 ++ 7 files changed, 235 insertions(+), 41 deletions(-) create mode 100644 jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/DepartExtDto.java 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 6db773c..f5fd6b8 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 @@ -7,14 +7,17 @@ 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.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; import org.jeecg.modules.demo.project.dto.ProjectShenBaoDto; import org.jeecg.modules.demo.project.entity.Project; import org.jeecg.modules.demo.project.service.IProjectService; @@ -24,6 +27,7 @@ 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.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -49,7 +53,7 @@ public class ProjectController extends JeecgController private IProjectService projectService; @Autowired - private IUserExtService userExtService; + private IUserExtService iUserExtService; @Autowired private ISysUserService iSysUserService; @@ -97,17 +101,21 @@ public class ProjectController extends JeecgController @ApiOperation(value = "获取项目负责人信息", notes = "获取项目负责人信息") @GetMapping(value = "/getUserInfo") public Result getUserInfo(Project para,HttpServletRequest req) { +// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); Project project = projectService.getById(para.getId()); - UserExt userExt = userExtService.getOne(new LambdaQueryWrapper() + SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); + UserExt userExt = iUserExtService.getOne(new LambdaQueryWrapper() .eq(UserExt::getUserId, project.getProjectCharger()) .eq(UserExt::getProjectId, para.getId()) ); + userExt.setIdNO(sysUser.getId()); + userExt.setPhone(sysUser.getPhone()); return Result.OK(userExt); } @ApiOperation(value = "获取申请单位信息", notes = "获取申请单位信息") @GetMapping(value = "/getDepartInfo") - public Result getDepartInfo(Project para,HttpServletRequest req) { + public Result getDepartInfo(Project para,HttpServletRequest req) { Project project = projectService.getById(para.getId()); SysUser sysUser = iSysUserService.getById(project.getProjectCharger()); SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); @@ -115,7 +123,10 @@ public class ProjectController extends JeecgController .eq(DepartExt::getDepartId, sysDepart.getId()) .eq(DepartExt::getProjectId, para.getId()) ); - return Result.OK(departExt); + DepartExtDto dto = new DepartExtDto(); + BeanUtils.copyProperties(sysDepart,dto); + BeanUtils.copyProperties(departExt,dto); + return Result.OK(dto); } /** @@ -146,7 +157,7 @@ public class ProjectController extends JeecgController @PostMapping(value = "/update4shenbao") public Result update4shenbao(@RequestBody ProjectShenBaoDto dto) { projectService.update4shenbao(dto); - return Result.OK("添加成功!"); + return Result.OK("修改成功!"); } /** @@ -170,12 +181,14 @@ public class ProjectController extends JeecgController * @param id * @return */ - @AutoLog(value = "项目表-通过id删除") +// @AutoLog(value = "项目表-通过id删除") @ApiOperation(value = "项目表-通过id删除", notes = "项目表-通过id删除") // @RequiresPermissions("project:project:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name = "id", required = true) String id) { projectService.removeById(id); + iUserExtService.remove(new LambdaQueryWrapper().eq(UserExt::getProjectId,id)); + iDepartExtService.remove(new LambdaQueryWrapper().eq(DepartExt::getProjectId,id)); return Result.OK("删除成功!"); } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/DepartExtDto.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/DepartExtDto.java new file mode 100644 index 0000000..2b4f9e4 --- /dev/null +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/DepartExtDto.java @@ -0,0 +1,156 @@ +package org.jeecg.modules.demo.project.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description: TODO + * @Author: Z.H.C + * @CreateTime: 2024-10-24 11:09 + * @Version: 1.0 + */ +@Data +public class DepartExtDto { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ +// @ApiModelProperty(value = "主键") +// private String id; + /** + * 部门表id + */ + @Excel(name = "部门表id", width = 15) + @ApiModelProperty(value = "部门表id") + private String departId; + + @ApiModelProperty(value = "项目id") + private String projectId; + + /** + * 单位性质 + */ + @Excel(name = "单位性质", width = 15, dicCode = "depart_category") + @Dict(dicCode = "depart_category") + @ApiModelProperty(value = "单位性质") + private String category; + /** + * 企业登记注册类型 + */ + @Excel(name = "企业登记注册类型", width = 15) + @ApiModelProperty(value = "企业登记注册类型") + private String type; + /** + * 开户银行 + */ + @Excel(name = "开户银行", width = 15) + @ApiModelProperty(value = "开户银行") + private String bankName; + /** + * 账号 + */ + @Excel(name = "账号", width = 15) + @ApiModelProperty(value = "账号") + private String bankNo; + /** + * 职工总数 + */ + @Excel(name = "职工总数", width = 15) + @ApiModelProperty(value = "职工总数") + private String employeeNum; + /** + * 上年度研发经费 + */ + @Excel(name = "上年度研发经费", width = 15) + @ApiModelProperty(value = "上年度研发经费") + private BigDecimal lastYearFee; + /** + * 注册时间 + */ + @Excel(name = "注册时间", width = 15, format = "yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @ApiModelProperty(value = "注册时间") + private Date registerDate; + /** + * 联系人 + */ + @Excel(name = "联系人", width = 15) + @ApiModelProperty(value = "联系人") + private String linkmanName; + /** + * 手机 + */ + @Excel(name = "手机", width = 15) + @ApiModelProperty(value = "手机") + private String linkmanPhone; + /** + * 电子邮箱 + */ + @Excel(name = "电子邮箱", width = 15) + @ApiModelProperty(value = "电子邮箱") + private String linkmanEmail; + + + @Excel(name = "机构/部门名称", width = 15) + private String departName; + /** + * 英文名 + */ + @Excel(name = "英文名", width = 15) + private String departNameEn; + /** + * 缩写 + */ + private String departNameAbbr; + /** + * 排序 + */ + @Excel(name = "排序", width = 15) + private Integer departOrder; + /** + * 描述 + */ + @Excel(name = "描述", width = 15) + private String description; + /** + * 机构类别 1=公司,2=组织机构,3=岗位 + */ + @Excel(name = "机构类别", width = 15, dicCode = "org_category") + private String orgCategory; + /** + * 机构类型 + */ + private String orgType; + /** + * 机构编码 + */ + @Excel(name = "机构编码", width = 15) + private String orgCode; + /** + * 手机号 + */ + @Excel(name = "手机号", width = 15) + private String mobile; + /** + * 传真 + */ + @Excel(name = "传真", width = 15) + private String fax; + /** + * 地址 + */ + @Excel(name = "地址", width = 15) + private String address; + + +} diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/ProjectShenBaoDto.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/ProjectShenBaoDto.java index 8a583b0..89beaf0 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/ProjectShenBaoDto.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/project/dto/ProjectShenBaoDto.java @@ -7,6 +7,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecg.common.aspect.annotation.Dict; +import org.jeecg.modules.demo.project.entity.Project; +import org.jeecg.modules.demo.userext.entity.UserExt; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; @@ -33,36 +35,6 @@ public class ProjectShenBaoDto implements Serializable { // @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键") private String id; - /** - * 创建人 - */ -// @ApiModelProperty(value = "创建人") -// private String createBy; -// /** -// * 创建日期 -// */ -// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") -// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") -// @ApiModelProperty(value = "创建日期") -// private Date createTime; -// /** -// * 更新人 -// */ -// @ApiModelProperty(value = "更新人") -// private String updateBy; -// /** -// * 更新日期 -// */ -// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") -// @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") -// @ApiModelProperty(value = "更新日期") -// private Date updateTime; -// /** -// * 所属部门 -// */ -// @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") -// @ApiModelProperty(value = "所属部门") -// private String sysOrgCode; /** * 项目名称 */ @@ -379,4 +351,19 @@ public class ProjectShenBaoDto implements Serializable { @Excel(name = "电子邮箱", width = 15) @ApiModelProperty(value = "电子邮箱") private String linkmanEmail; + + /** + * 地址 + */ + @Excel(name = "地址", width = 15) + @ApiModelProperty(value = "部门表地址") + private String address; + + @Excel(name = "传真", width = 15) + @ApiModelProperty(value = "传真") + private String fax; + + @Excel(name = "用户表身份证号", width = 15) + @ApiModelProperty(value = "用户表身份证号") + private String idNO; } 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 55a4662..698f594 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 @@ -54,15 +54,14 @@ public class ProjectServiceImpl extends ServiceImpl impl log.info(">>> the 新增项目审报 reqParams:{}", JSON.toJSONString(dto)); LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - -// SysDepart sysDepart = new SysDepart(); + 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, sysDepart); // BeanUtils.copyProperties(dto, sysUser); BeanUtils.copyProperties(dto, userExt); BeanUtils.copyProperties(dto, project); @@ -80,6 +79,14 @@ public class ProjectServiceImpl extends ServiceImpl impl departExt.setDepartId(loginUser.getOrgId()); departExt.setProjectId(project.getId()); this.iDepartExtService.save(departExt); + + + sysDepart.setId(loginUser.getOrgId()); + updateDepart4ShenBao(sysDepart); + } + + void updateDepart4ShenBao(SysDepart depart){ + this.iSysDepartService.updateById(depart); } @Override @@ -90,14 +97,14 @@ public class ProjectServiceImpl extends ServiceImpl impl iUserExtService.remove(new LambdaQueryWrapper().eq(UserExt::getProjectId,dto.getId())); iDepartExtService.remove(new LambdaQueryWrapper().eq(DepartExt::getProjectId,dto.getId())); -// SysDepart sysDepart = new SysDepart(); + 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, sysDepart); // BeanUtils.copyProperties(dto, sysUser); BeanUtils.copyProperties(dto, userExt); BeanUtils.copyProperties(dto, project); @@ -113,5 +120,9 @@ public class ProjectServiceImpl extends ServiceImpl impl departExt.setDepartId(loginUser.getOrgId()); departExt.setProjectId(project.getId()); this.iDepartExtService.save(departExt); + + + sysDepart.setId(loginUser.getOrgId()); + updateDepart4ShenBao(sysDepart); } } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/userext/entity/UserExt.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/userext/entity/UserExt.java index 711df54..e5688e6 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/userext/entity/UserExt.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/userext/entity/UserExt.java @@ -1,6 +1,7 @@ package org.jeecg.modules.demo.userext.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; @@ -113,5 +114,13 @@ public class UserExt implements Serializable { @ApiModelProperty(value = "项目id") private String projectId; + @TableField(exist = false) + @ApiModelProperty(value = "用户表身份证号") + private String idNO; + + @TableField(exist = false) + @ApiModelProperty(value = "用户表负责人手机号") + private String phone; + } diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue index 6fba32e..6979504 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/projectApplicationList.vue @@ -76,6 +76,10 @@ // const { routename } = unref(currentRoute); back(); }; + + function getUserDepart(){ + projectBaseInfoSchemas.se + } return { registerProjectInfo, registerUser, registerDepart, submitAll, goBack }; }, }); diff --git a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts index ec92782..c21ad97 100644 --- a/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts +++ b/jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/JiBenXinXi.ts @@ -84,6 +84,20 @@ export const userSchemas: FormSchema[] = [ // required: true, // colProps: { span: 6 }, }, + { + field: 'idNO', + component: 'Input', + label: '身份证号', + // required: true, + // colProps: { span: 6 }, + }, + { + field: 'phone', + component: 'Input', + label: '负责人手机号', + // required: true, + // colProps: { span: 6 }, + }, { label: '名族', field: 'nation',