Commit 673dee69 authored by hongguangwu's avatar hongguangwu

变更记录,忽略更新人更新时间

parent f6cf2a4b
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.entity; package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
...@@ -89,12 +86,14 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -89,12 +86,14 @@ public class TEmployeeInfo extends BaseEntity {
* 身份证有效期起 * 身份证有效期起
*/ */
@Schema(description = "身份证有效期起") @Schema(description = "身份证有效期起")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDate validityStart; private LocalDate validityStart;
/** /**
* 身份证有效期止 * 身份证有效期止
*/ */
@Schema(description = "身份证有效期止") @Schema(description = "身份证有效期止")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDate validityEnd; private LocalDate validityEnd;
/** /**
...@@ -154,18 +153,21 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -154,18 +153,21 @@ public class TEmployeeInfo extends BaseEntity {
* 身份证-省 * 身份证-省
*/ */
@Schema(description = "身份证-省") @Schema(description = "身份证-省")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer idProvince; private Integer idProvince;
/** /**
* 身份证-市 * 身份证-市
*/ */
@Schema(description = "身份证-市") @Schema(description = "身份证-市")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer idCity; private Integer idCity;
/** /**
* 身份证-县 * 身份证-县
*/ */
@Schema(description = "身份证-县") @Schema(description = "身份证-县")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer idTown; private Integer idTown;
/** /**
...@@ -178,24 +180,28 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -178,24 +180,28 @@ public class TEmployeeInfo extends BaseEntity {
* 档案-省 * 档案-省
*/ */
@Schema(description = "档案-省") @Schema(description = "档案-省")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer fileProvince; private Integer fileProvince;
/** /**
* 档案-市 * 档案-市
*/ */
@Schema(description = "档案-市") @Schema(description = "档案-市")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer fileCity; private Integer fileCity;
/** /**
* 档案-县 * 档案-县
*/ */
@Schema(description = "档案-县") @Schema(description = "档案-县")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer fileTown; private Integer fileTown;
/** /**
* 是否大专及以上(0否1是) * 是否大专及以上(0否1是)
*/ */
@Schema(description = "是否大专及以上(0否1是)") @Schema(description = "是否大专及以上(0否1是)")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer isCollege; private Integer isCollege;
/** /**
...@@ -220,12 +226,14 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -220,12 +226,14 @@ public class TEmployeeInfo extends BaseEntity {
* 入学时间 * 入学时间
*/ */
@Schema(description = "入学时间") @Schema(description = "入学时间")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDate admissionDate; private LocalDate admissionDate;
/** /**
* 毕业时间 * 毕业时间
*/ */
@Schema(description = "毕业时间") @Schema(description = "毕业时间")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private LocalDate gradutionDate; private LocalDate gradutionDate;
/** /**
......
...@@ -7,7 +7,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; ...@@ -7,7 +7,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.logging.Handler;
/** /**
* @program: master * @program: master
...@@ -47,12 +50,31 @@ public class HrEquator extends GetterBaseEquator { ...@@ -47,12 +50,31 @@ public class HrEquator extends GetterBaseEquator {
Equator equator = new HrEquator(); Equator equator = new HrEquator();
// 获取不同的属性 // 获取不同的属性
List<FieldInfo> diff = equator.getDiffFields(oldInfo, newInfo); List<FieldInfo> diff = equator.getDiffFields(oldInfo, newInfo);
if(!Common.isEmpty(diff)){ Map<String, Integer> curMap = new HashMap<>();
String fieldName;
boolean newChange = false;
if (!Common.isEmpty(diff)) {
for(FieldInfo field:diff){ for(FieldInfo field:diff){
if (!"updateTime".equals(field.getFieldName()) && !"updateBy".equals(field.getFieldName())) { fieldName = field.getFieldName();
curMap.put(fieldName, 1);
if (!"updateTime".equals(fieldName) && !"updateBy".equals(fieldName)) {
newChange = true;
sb.append(field.getFieldName()).append(","); sb.append(field.getFieldName()).append(",");
} }
} }
}
// 从有值变为空,也要记录变更日志
List<FieldInfo> diff2 = equator.getDiffFields(newInfo, oldInfo);
if (!Common.isEmpty(diff2)) {
for(FieldInfo field:diff2){
fieldName = field.getFieldName();
if (curMap.get(fieldName) == null && !"updateTime".equals(field.getFieldName()) && !"updateBy".equals(field.getFieldName())) {
newChange = true;
sb.append(field.getFieldName()).append(",");
}
}
}
if (newChange) {
sb.deleteCharAt(sb.length()-1); sb.deleteCharAt(sb.length()-1);
} }
return sb.toString(); return sb.toString();
......
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