parent
de3f0a623d
commit
1c8c26e9e2
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
|
||||
}
|
@ -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> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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> {
|
||||
|
||||
}
|
@ -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> {
|
||||
|
||||
}
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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>
|
@ -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>
|
Loading…
Reference in new issue