1. 版本号修改bug
This commit is contained in:
parent
241047f5e9
commit
6259550e1d
|
|
@ -41,7 +41,7 @@ public class BaseEntity implements Serializable {
|
|||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
|
||||
@TableField(value = "update_time",fill = FieldFill.UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
|
||||
@JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
|
||||
protected LocalDateTime updateTime;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
|
|||
String userName = "system";
|
||||
this.fillStrategy(metaObject, "createBy", userName);
|
||||
// 自动填充下 版本号
|
||||
this.fillStrategy(metaObject, "version", 0);
|
||||
this.strictInsertFill(metaObject, "version", Long.class,0L);
|
||||
this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
|
||||
// this.strictInsertFill(metaObject, "createBy", String.class, userName);
|
||||
}
|
||||
|
|
@ -48,8 +48,6 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
|
|||
String userName = "system";
|
||||
this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
|
||||
this.strictUpdateFill(metaObject, "updateBy", String.class, userName);
|
||||
// 自动填充下 版本号
|
||||
this.fillStrategy(metaObject, "version", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chushang.InspectionApplication;
|
||||
import com.chushang.common.core.util.FileUtils;
|
||||
|
|
@ -32,8 +33,22 @@ import java.util.Map;
|
|||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = InspectionApplication.class)
|
||||
public class GenInsTest {
|
||||
|
||||
|
||||
@Resource
|
||||
WrkInfoService wrkInfoService;
|
||||
|
||||
@Test
|
||||
public void genTest(){
|
||||
WrkInfo wrkInfo = new WrkInfo();
|
||||
wrkInfo.setDeptId(200L);
|
||||
wrkInfo.setLowerTaskId(200L);
|
||||
wrkInfo.setTaskId(200L);
|
||||
wrkInfo.setUserId(1L);
|
||||
wrkInfo.setUserName("admin");
|
||||
wrkInfo.setWorkNo(IdUtil.getSnowflakeNextId());
|
||||
wrkInfo.setWorkSort(1);
|
||||
wrkInfoService.save(wrkInfo);
|
||||
|
||||
// generatedIns.generated();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue