Commit 23814581 by wangjian

2025-02-28

parent a0a988c3
......@@ -48,7 +48,7 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
* 档案出生日期 (年月)
*/
@Excel(name = "档案出生日期")
@JsonFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fileBirthDate;
......@@ -57,6 +57,13 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
*/
// private Integer fileAge;
/** 退休日期 (年月日) */
@Excel(name = "退休日期" ,dateFormat="yyyy-MM-dd")
private Date txDate;
// /** 退休年龄 */
// @Excel(name = "退休年龄")
// private Integer txAge;
/**
* 出生年月
......@@ -221,7 +228,7 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
* 毕业时间1 年月
*/
@Excel(name = "毕业时间1")
@JsonFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date graduationTime1;
/**
......@@ -240,7 +247,7 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
* 毕业时间2年月
*/
@Excel(name = "毕业时间2")
@JsonFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date graduationTime2;
/**
......@@ -259,7 +266,7 @@ public class SchoolTeacherBasicInformation extends BaseEntity {
* 毕业时间3 年月
*/
@Excel(name = "毕业时间3")
@JsonFormat(pattern = "yyyy-MM")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date graduationTime3;
/**
......
......@@ -63,6 +63,13 @@ public class SchoolTeacherBasicInformationVo extends BaseEntity {
@Excel(name = "档案年龄")
private Integer fileAge;
/** 退休日期 (年月日) */
@Excel(name = "退休日期" ,dateFormat="yyyy-MM-dd")
private Date txDate;
/** 退休年龄 */
@Excel(name = "退休年龄")
private Integer txAge;
/**
* 出生年月
......
......@@ -57,6 +57,13 @@ public class SchoolTeacherBasiclnExport {
@Excel(name = "档案年龄")
private Integer fileAge;
/** 退休日期 (年月日) */
@Excel(name = "退休日期" ,dateFormat="yyyy-MM-dd")
private Date txDate;
/** 退休年龄 */
@Excel(name = "退休年龄")
private Integer txAge;
/**
* 出生年月
......
......@@ -85,6 +85,11 @@ public class SchoolTeacherBasichlnformationServicelmpl extends ServiceImpl<Schoo
date.setToSecondAge(gl);
}
//4.计算退休年龄
if (null != date.getFileBirthDate() && null != date.getTxDate()){
int age = this.getTxAge(date.getFileBirthDate(), date.getTxDate());
date.setTxAge(age);
}
}
return list;
}
......@@ -500,6 +505,13 @@ public class SchoolTeacherBasichlnformationServicelmpl extends ServiceImpl<Schoo
int gl = this.workAge(sdf.parse(format),schoolTeacherBasicInformation.getLengthOfServiceTime());
schoolTeacherBasicInformation.setSeniority(gl);
}
//5.计算退休年龄
if (null != schoolTeacherBasicInformation.getFileBirthDate() && null != schoolTeacherBasicInformation.getTxDate()){
int age = this.getTxAge(schoolTeacherBasicInformation.getFileBirthDate(), schoolTeacherBasicInformation.getTxDate());
schoolTeacherBasicInformation.setTxAge(age);
}
return schoolTeacherBasicInformation;
}
......@@ -1155,6 +1167,31 @@ public class SchoolTeacherBasichlnformationServicelmpl extends ServiceImpl<Schoo
return age;
}
//计算退休年龄
private int getTxAge(Date birth, Date txDate){
Calendar cal = Calendar.getInstance();
cal.setTime(txDate);
int txYear = cal.get(Calendar.YEAR);
int txMonth = cal.get(Calendar.MONTH);
cal.setTime(birth);
int birthYear = cal.get(Calendar.YEAR);
int birthMonth = cal.get(Calendar.MONTH);
int age = txYear - birthYear;
// 未足月
if (txMonth <= birthMonth) {
// 当月
if (txMonth == birthMonth) {
} else {
age--;
}
}
return age;
}
//计算工龄
public int workAge(Date nowTime, Date workTime) throws ParseException{
int year = 0;
......
......@@ -4,11 +4,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="yangtz.cs.liu.campus.mapper.schoolNewTeacherDzdn.SchoolTeacherBasichlnformationMapper">
<sql id="selectSchoolTeacherBasicInformationVo">
select id, name, id_card, sex, file_birth_date, birth_date, hometown, nation, political_landscape, party_membership_time, teaching_subject, current_professional_title, current_professional_title_time, current_hiring_professional_title, current_hiring_professional_title_time, current_position, current_job_level, current_job_level_appointment_time, duties, teacher_qualification_type, teacher_qualification_certificate_num, working_hours, to_second_middle_school_time, length_of_teacher_time, length_of_service_time, on_duty_situation, current_situation, graduation_institution1, major1, graduation_time1, graduation_institution2, major2, graduation_time2, graduation_institution3, major3, graduation_time3, first_degree, last_degree, degree, work_experience, remark, photo_name, photo_url, dd_phone, del_flag from school_teacher_basic_information
select id, name, id_card, sex, file_birth_date, birth_date, hometown, nation, political_landscape,
party_membership_time, teaching_subject, current_professional_title, current_professional_title_time,
current_hiring_professional_title, current_hiring_professional_title_time, current_position,
current_job_level, current_job_level_appointment_time, duties, teacher_qualification_type,
teacher_qualification_certificate_num, working_hours, to_second_middle_school_time,
length_of_teacher_time, length_of_service_time, on_duty_situation, current_situation,
graduation_institution1, major1, graduation_time1, graduation_institution2, major2,
graduation_time2, graduation_institution3, major3, graduation_time3, first_degree, last_degree,
degree, work_experience, remark, photo_name, photo_url, dd_phone, del_flag, tx_date
from school_teacher_basic_information
</sql>
<select id="list" resultType="yangtz.cs.liu.campus.domain.schoolNewTeacherDzdn.SchoolTeacherBasicInformationVo" parameterType="yangtz.cs.liu.campus.domain.schoolNewTeacherDzdn.SchoolTeacherBasicInformationVo">
select id, name, id_card, sex, file_birth_date, birth_date, hometown, nation, political_landscape, party_membership_time, teaching_subject, current_professional_title, current_professional_title_time, current_hiring_professional_title, current_hiring_professional_title_time, current_position, current_job_level, current_job_level_appointment_time, duties, teacher_qualification_type, teacher_qualification_certificate_num, working_hours, to_second_middle_school_time, length_of_teacher_time, length_of_service_time, on_duty_situation, current_situation, graduation_institution1, major1, graduation_time1, graduation_institution2, major2, graduation_time2, graduation_institution3, major3, graduation_time3, first_degree, last_degree, degree, work_experience, remark, photo_name, photo_url, dd_phone, del_flag from school_teacher_basic_information
select id, name, id_card, sex, file_birth_date, birth_date, hometown, nation, political_landscape,
party_membership_time, teaching_subject, current_professional_title, current_professional_title_time,
current_hiring_professional_title, current_hiring_professional_title_time, current_position,
current_job_level, current_job_level_appointment_time, duties, teacher_qualification_type,
teacher_qualification_certificate_num, working_hours, to_second_middle_school_time,
length_of_teacher_time, length_of_service_time, on_duty_situation, current_situation,
graduation_institution1, major1, graduation_time1, graduation_institution2, major2,
graduation_time2, graduation_institution3, major3, graduation_time3, first_degree, last_degree,
degree, work_experience, remark, photo_name, photo_url, dd_phone, del_flag, tx_date
from school_teacher_basic_information
where del_flag = 0
<if test="teachingSubject != null "> and teaching_subject = #{teachingSubject}</if>
<if test="name != null ">
......@@ -105,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="photoUrl != null">photo_url = #{photoUrl},</if>
<if test="ddPhone != null">dd_phone = #{ddPhone},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="txDate != null">tx_date = #{txDate},</if>
</trim>
where id = #{id}
</update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment