Commit 7f104959 authored by suhuiguang's avatar suhuiguang

fix(大编辑):bug修复

1.null拷贝提交
parent d42ef2db
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jg.biz.edit.process.equip;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.alibaba.fastjson.JSON;
......@@ -131,8 +130,6 @@ public class CommonEquipDataProcessService {
public static final String BASE_COLUMN_REC_DATE = "\"REC_DATE\"";
public static final String BASE_COLUMN_REC_USERID = "\"REC_USER_ID\"";
private static final CopyOptions options = CopyOptions.create()
.setIgnoreNullValue(false).ignoreCase();
@PostConstruct
public void init() {
......@@ -152,7 +149,7 @@ public class CommonEquipDataProcessService {
public static <T extends BaseChangeDataDto> T castMap2Bean(Map<String, Object> map, Class<T> clazz) {
try {
T t = clazz.newInstance();
BeanUtil.copyProperties(JSON.parse(JSONObject.toJSONString(map)), t, true);
BeanUtil.copyProperties(JSON.parseObject(JSON.toJSONString(map), clazz), t, true);
return t;
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
......@@ -160,7 +157,7 @@ public class CommonEquipDataProcessService {
}
public static <T extends IBaseChangeData> void castMap2Bean(Map<String, Object> map, T target) {
BeanUtil.copyProperties(JSON.parse(JSONObject.toJSONString(map)), target, options);
BeanUtil.copyProperties(JSON.parseObject(JSON.toJSONString(map), target.getClass()), target, true);
}
......
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