From 1c8c26e9e264e39a8d444bef4f7e59de9933e296 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Tue, 3 Jun 2025 16:54:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BA=BA=E5=91=98=E8=B0=83=E5=B2=97?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/ApplyInfoListManager.java | 10 +++ .../manager/ApplyRecordManager.java | 86 +++++++++++++++++++ .../system/apply/PersonApplyController.java | 17 ++++ .../system/domain/apply/TdApplyAfter.java | 77 +++++++++++++++++ .../system/domain/apply/TdApplyBefore.java | 78 +++++++++++++++++ .../domain/apply/dto/ApplyRecordDTO.java | 29 +++++++ .../mapper/apply/TdApplyAfterMapper.java | 19 ++++ .../mapper/apply/TdApplyBeforeMapper.java | 18 ++++ .../service/apply/TdApplyAfterService.java | 13 +++ .../service/apply/TdApplyBeforeService.java | 13 +++ .../apply/impl/TdApplyAfterServiceImpl.java | 23 +++++ .../apply/impl/TdApplyBeforeServiceImpl.java | 23 +++++ .../system/apply/TdApplyAfterMapper.xml | 30 +++++++ .../system/apply/TdApplyBeforeMapper.xml | 30 +++++++ 14 files changed, 466 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyRecordManager.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyAfter.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyBefore.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/dto/ApplyRecordDTO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyAfterMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyBeforeMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyAfterService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyBeforeService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyAfterServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyBeforeServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/apply/TdApplyAfterMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/system/apply/TdApplyBeforeMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyInfoListManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyInfoListManager.java index 5b2fbb51..c3beda3a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyInfoListManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyInfoListManager.java @@ -39,6 +39,13 @@ public class ApplyInfoListManager { private TdFileRelationService fileRelationService; + @Resource + private ApplyRecordManager applyRecordManager; + + + + + /** * 人员登记 * @param applyInfoListDTO @@ -251,6 +258,7 @@ public class ApplyInfoListManager { } applyInfoList.setDeptId(ShiroUtils.getSysUser().getDeptId()); applyInfoList.setDeptName(ShiroUtils.getSysUser().getDept().getDeptName()); + applyRecordManager.saveRecord(applyInfoListDTO); return applyInfoListService.saveOrUpdate(applyInfoList); } @@ -258,4 +266,6 @@ public class ApplyInfoListManager { + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyRecordManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyRecordManager.java new file mode 100644 index 00000000..8ae13d11 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/ApplyRecordManager.java @@ -0,0 +1,86 @@ +package com.ruoyi.web.controller.manager; + +import cn.hutool.core.convert.Convert; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.system.domain.apply.TdApplyAfter; +import com.ruoyi.system.domain.apply.TdApplyBefore; +import com.ruoyi.system.domain.apply.TdApplyInfoList; +import com.ruoyi.system.domain.apply.dto.ApplyRecordDTO; +import com.ruoyi.system.domain.apply.dto.TdApplyInfoListDTO; +import com.ruoyi.system.service.apply.TdApplyAfterService; +import com.ruoyi.system.service.apply.TdApplyBeforeService; +import com.ruoyi.system.service.apply.TdApplyInfoListService; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * ClassName: ApplyRecordManager + * Package: com.ruoyi.web.controller.manager + * Description: + * + * @Author wangxy + * @Create 2025/6/3 16:28 + * @Version 1.0 + */ +@Component +public class ApplyRecordManager { + + + @Resource + private TdApplyBeforeService applyBeforeService; + + @Resource + private TdApplyAfterService applyAfterService; + + + @Resource + private TdApplyInfoListService applyInfoListService; + + + + + /** + * 人员修改记录 + * + * @param applyInfoListDTO + */ + @Transactional(rollbackFor = Exception.class) + public void saveRecord(TdApplyInfoListDTO applyInfoListDTO) { + if(Objects.isNull(applyInfoListDTO)){ + throw new ServiceException("人员信息不能为空"); + } + TdApplyInfoList applyInfoList = applyInfoListService.getById(applyInfoListDTO.getApplyId()); + TdApplyBefore applyBefore = Convert.convert(TdApplyBefore.class, applyInfoList); + applyBefore.setCreateTime(new Date()); + applyBefore.setCreateBy(ShiroUtils.getSysUser().getLoginName()); + applyBeforeService.save(applyBefore); + TdApplyAfter applyAfter = Convert.convert(TdApplyAfter.class, applyInfoListDTO); + applyAfter.setCreateTime(new Date()); + applyAfter.setCreateBy(ShiroUtils.getSysUser().getLoginName()); + applyAfterService.save(applyAfter); + } + + + public ApplyRecordDTO getApplyRecordDTO(String applyId) { + ApplyRecordDTO userRecordDTO = new ApplyRecordDTO(); + List<TdApplyAfter> userAfters = applyAfterService.lambdaQuery() + .eq(TdApplyAfter::getApplyId, applyId) + .orderByDesc(TdApplyAfter::getCreateTime).list(); + userRecordDTO.setApplyAfterList(userAfters); + List<TdApplyBefore> userBefores = applyBeforeService.lambdaQuery().eq(TdApplyBefore::getApplyId, applyId) + .orderByDesc(TdApplyBefore::getCreateTime).list(); + userRecordDTO.setApplyBeforeList(userBefores); + return userRecordDTO; + } + + + + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/apply/PersonApplyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/apply/PersonApplyController.java index f8986a93..35eade20 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/apply/PersonApplyController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/apply/PersonApplyController.java @@ -6,6 +6,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.domain.apply.TdApplyInfoList; import com.ruoyi.system.domain.apply.dto.TdApplyInfoListDTO; import com.ruoyi.web.controller.manager.ApplyInfoListManager; +import com.ruoyi.web.controller.manager.ApplyRecordManager; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -34,6 +35,9 @@ public class PersonApplyController extends BaseController { @Resource private ApplyInfoListManager applyInfoListManager; + @Resource + private ApplyRecordManager applyRecordManager; + @RequiresPermissions("system:person:view") @GetMapping() public String personListInfo() { @@ -63,6 +67,19 @@ public class PersonApplyController extends BaseController { return prefix + "/detail"; } + /** + * + * 查询人员记录 + * @param applyId + * @param mmap + * @return java.lang.String + */ + @GetMapping("/getApplyRecord/{applyId}") + public String getChangeRecord(@PathVariable("applyId") String applyId, ModelMap mmap) { + mmap.put("userRecordDTO", applyRecordManager.getApplyRecordDTO(applyId)); + return prefix + "/applyRecord"; + } + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyAfter.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyAfter.java new file mode 100644 index 00000000..5df9fbc4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyAfter.java @@ -0,0 +1,77 @@ +package com.ruoyi.system.domain.apply; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * sm人员申请变更后表 + * @TableName td_apply_after + */ +@Data +public class TdApplyAfter implements Serializable { + /** + * 主键 + */ + private String afterId; + + /** + * 人员名称 + */ + private String name; + + /** + * 人员性别 + */ + private String sex; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 民族 + */ + private String nationality; + + /** + * 联系方式 + */ + private String phone; + + /** + * 身份证号 + */ + private String cerno; + + /** + * 单位及职务职称 + */ + private String positionCapacity; + + /** + * 已(拟)任涉密岗位 + */ + private String smPost; + + /** + * 涉密等级 + */ + private String smGrade; + + /** + * 人员id + */ + private String applyId; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyBefore.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyBefore.java new file mode 100644 index 00000000..2bb7c38c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/TdApplyBefore.java @@ -0,0 +1,78 @@ +package com.ruoyi.system.domain.apply; + + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * sm人员申请变更前表 + * @TableName td_apply_before + */ +@Data +public class TdApplyBefore implements Serializable { + /** + * 主键 + */ + private String beforeId; + + /** + * 人员名称 + */ + private String name; + + /** + * 人员性别 + */ + private String sex; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 曾用名 + */ + private String formerName; + + /** + * 民族 + */ + private String nationality; + + /** + * 联系方式 + */ + private String phone; + + /** + * 身份证号 + */ + private String cerno; + + /** + * 单位及职务职称 + */ + private String positionCapacity; + + /** + * 已(拟)任涉密岗位 + */ + private String smPost; + + /** + * 涉密等级 + */ + private String smGrade; + + /** + * 人员id + */ + private String applyId; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/dto/ApplyRecordDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/dto/ApplyRecordDTO.java new file mode 100644 index 00000000..4225d682 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/apply/dto/ApplyRecordDTO.java @@ -0,0 +1,29 @@ +package com.ruoyi.system.domain.apply.dto; + +import com.ruoyi.system.domain.apply.TdApplyAfter; +import com.ruoyi.system.domain.apply.TdApplyBefore; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * packageName com.ruoyi.system.domain.record.dto + * + * @author wangxy + * @version JDK 8 + * @className UserRecordDTO + * @date 2024/8/21 + * @description 人员记录信息 + */ +@Data +public class ApplyRecordDTO { + + @ApiModelProperty(value = "修改前人员信息") + private List<TdApplyBefore> applyBeforeList; + + @ApiModelProperty(value = "修改后人员信息") + private List<TdApplyAfter> applyAfterList; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyAfterMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyAfterMapper.java new file mode 100644 index 00000000..5e53b45d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyAfterMapper.java @@ -0,0 +1,19 @@ +package com.ruoyi.system.mapper.apply; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.apply.TdApplyAfter; + +/** +* @author Administrator +* @description 针对表【td_apply_after(sm人员申请变更后表)】的数据库操作Mapper +* @createDate 2025-06-03 16:21:41 +* @Entity generator.domain.TdApplyAfter +*/ +public interface TdApplyAfterMapper extends BaseMapper<TdApplyAfter> { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyBeforeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyBeforeMapper.java new file mode 100644 index 00000000..0194baac --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/apply/TdApplyBeforeMapper.java @@ -0,0 +1,18 @@ +package com.ruoyi.system.mapper.apply; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.system.domain.apply.TdApplyBefore; + +/** +* @author Administrator +* @description 针对表【td_apply_before(sm人员申请变更前表)】的数据库操作Mapper +* @createDate 2025-06-03 16:21:41 +* @Entity generator.domain.TdApplyBefore +*/ +public interface TdApplyBeforeMapper extends BaseMapper<TdApplyBefore> { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyAfterService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyAfterService.java new file mode 100644 index 00000000..20b91a82 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyAfterService.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.service.apply; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.apply.TdApplyAfter; + +/** +* @author Administrator +* @description 针对表【td_apply_after(sm人员申请变更后表)】的数据库操作Service +* @createDate 2025-06-03 16:21:41 +*/ +public interface TdApplyAfterService extends IService<TdApplyAfter> { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyBeforeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyBeforeService.java new file mode 100644 index 00000000..65e65ff6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/TdApplyBeforeService.java @@ -0,0 +1,13 @@ +package com.ruoyi.system.service.apply; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.system.domain.apply.TdApplyBefore; + +/** +* @author Administrator +* @description 针对表【td_apply_before(sm人员申请变更前表)】的数据库操作Service +* @createDate 2025-06-03 16:21:41 +*/ +public interface TdApplyBeforeService extends IService<TdApplyBefore> { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyAfterServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyAfterServiceImpl.java new file mode 100644 index 00000000..16206fee --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyAfterServiceImpl.java @@ -0,0 +1,23 @@ +package com.ruoyi.system.service.apply.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.ruoyi.system.domain.apply.TdApplyAfter; +import com.ruoyi.system.mapper.apply.TdApplyAfterMapper; +import com.ruoyi.system.service.apply.TdApplyAfterService; +import org.springframework.stereotype.Service; + +/** +* @author Administrator +* @description 针对表【td_apply_after(sm人员申请变更后表)】的数据库操作Service实现 +* @createDate 2025-06-03 16:21:41 +*/ +@Service +public class TdApplyAfterServiceImpl extends ServiceImpl<TdApplyAfterMapper, TdApplyAfter> + implements TdApplyAfterService { + +} + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyBeforeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyBeforeServiceImpl.java new file mode 100644 index 00000000..9c6929c5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/apply/impl/TdApplyBeforeServiceImpl.java @@ -0,0 +1,23 @@ +package com.ruoyi.system.service.apply.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import com.ruoyi.system.domain.apply.TdApplyBefore; +import com.ruoyi.system.mapper.apply.TdApplyBeforeMapper; +import com.ruoyi.system.service.apply.TdApplyBeforeService; +import org.springframework.stereotype.Service; + +/** +* @author Administrator +* @description 针对表【td_apply_before(sm人员申请变更前表)】的数据库操作Service实现 +* @createDate 2025-06-03 16:21:41 +*/ +@Service +public class TdApplyBeforeServiceImpl extends ServiceImpl<TdApplyBeforeMapper, TdApplyBefore> + implements TdApplyBeforeService { + +} + + + + diff --git a/ruoyi-system/src/main/resources/mapper/system/apply/TdApplyAfterMapper.xml b/ruoyi-system/src/main/resources/mapper/system/apply/TdApplyAfterMapper.xml new file mode 100644 index 00000000..6c11ca7e --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/apply/TdApplyAfterMapper.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.system.mapper.apply.TdApplyAfterMapper"> + + <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.apply.TdApplyAfter"> + <result property="afterId" column="after_id" jdbcType="VARCHAR"/> + <result property="name" column="name" jdbcType="VARCHAR"/> + <result property="sex" column="sex" jdbcType="VARCHAR"/> + <result property="createBy" column="create_by" jdbcType="VARCHAR"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="formerName" column="former_name" jdbcType="VARCHAR"/> + <result property="nationality" column="nationality" jdbcType="VARCHAR"/> + <result property="phone" column="phone" jdbcType="VARCHAR"/> + <result property="cerno" column="cerno" jdbcType="VARCHAR"/> + <result property="positionCapacity" column="position_capacity" jdbcType="VARCHAR"/> + <result property="smPost" column="sm_post" jdbcType="VARCHAR"/> + <result property="smGrade" column="sm_grade" jdbcType="VARCHAR"/> + <result property="applyId" column="apply_id" jdbcType="VARCHAR"/> + </resultMap> + + <sql id="Base_Column_List"> + after_id,name,sex, + create_by,create_time,former_name, + nationality,phone,cerno, + position_capacity,sm_post,sm_grade, + apply_id + </sql> +</mapper> diff --git a/ruoyi-system/src/main/resources/mapper/system/apply/TdApplyBeforeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/apply/TdApplyBeforeMapper.xml new file mode 100644 index 00000000..85588e33 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/apply/TdApplyBeforeMapper.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.system.mapper.apply.TdApplyBeforeMapper"> + + <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.apply.TdApplyBefore"> + <result property="beforeId" column="before_id" jdbcType="VARCHAR"/> + <result property="name" column="name" jdbcType="VARCHAR"/> + <result property="sex" column="sex" jdbcType="VARCHAR"/> + <result property="createBy" column="create_by" jdbcType="VARCHAR"/> + <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> + <result property="formerName" column="former_name" jdbcType="VARCHAR"/> + <result property="nationality" column="nationality" jdbcType="VARCHAR"/> + <result property="phone" column="phone" jdbcType="VARCHAR"/> + <result property="cerno" column="cerno" jdbcType="VARCHAR"/> + <result property="positionCapacity" column="position_capacity" jdbcType="VARCHAR"/> + <result property="smPost" column="sm_post" jdbcType="VARCHAR"/> + <result property="smGrade" column="sm_grade" jdbcType="VARCHAR"/> + <result property="applyId" column="apply_id" jdbcType="VARCHAR"/> + </resultMap> + + <sql id="Base_Column_List"> + before_id,name,sex, + create_by,create_time,former_name, + nationality,phone,cerno, + position_capacity,sm_post,sm_grade, + apply_id + </sql> +</mapper>