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 userAfters = applyAfterService.lambdaQuery() + .eq(TdApplyAfter::getApplyId, applyId) + .orderByDesc(TdApplyAfter::getCreateTime).list(); + userRecordDTO.setApplyAfterList(userAfters); + List 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 applyBeforeList; + + @ApiModelProperty(value = "修改后人员信息") + private List 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 { + +} + + + + 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 { + +} + + + + 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 { + +} 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 { + +} 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 + 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 + 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 @@ + + + + + + + + + + + + + + + + + + + + + + after_id,name,sex, + create_by,create_time,former_name, + nationality,phone,cerno, + position_capacity,sm_post,sm_grade, + apply_id + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + before_id,name,sex, + create_by,create_time,former_name, + nationality,phone,cerno, + position_capacity,sm_post,sm_grade, + apply_id + +