Compare commits

..

No commits in common. "2ab7a547748ce09bf3a62e9ef87f603917d8c121" and "1479666516e8249b4286186fbdd48f72f2c33fea" have entirely different histories.

4 changed files with 6 additions and 33 deletions

View File

@ -53,10 +53,6 @@ public class SysDictData extends BaseEntity
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/**
* ID
*/
@Excel(name = "父级ID标志")
private Integer partId;
public Integer getPartId() {

View File

@ -31,13 +31,7 @@ public class DictInit implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
this.dict();
}
//初始化防擦
public void dict(){
long startTime = System.currentTimeMillis(); // 记录开始时间
log.info("初始化字典数据...");
SysDictData dictData = new SysDictData();
@ -59,8 +53,7 @@ public class DictInit implements ApplicationRunner {
));
dictCache.put(type, subMap);
});
long cost = System.currentTimeMillis() - startTime; // 计算耗时
log.info("字典数据初始化完成,耗时 {} 毫秒", cost); // 打印耗时
log.info("字典数据初始化完成...");
}
/**

View File

@ -1,14 +1,12 @@
package com.mcwl.system.service.impl;
import com.mcwl.common.core.domain.entity.SysDictData;
import com.mcwl.common.utils.DictUtils;
import com.mcwl.system.init.DictInit;
import com.mcwl.system.mapper.SysDictDataMapper;
import com.mcwl.system.service.ISysDictDataService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.mcwl.common.core.domain.entity.SysDictData;
import com.mcwl.common.utils.DictUtils;
import com.mcwl.system.mapper.SysDictDataMapper;
import com.mcwl.system.service.ISysDictDataService;
/**
*
@ -21,9 +19,6 @@ public class SysDictDataServiceImpl implements ISysDictDataService
@Autowired
private SysDictDataMapper dictDataMapper;
@Autowired
private DictInit dictInit;
/**
*
*
@ -75,8 +70,6 @@ public class SysDictDataServiceImpl implements ISysDictDataService
dictDataMapper.deleteDictDataById(dictCode);
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
DictUtils.setDictCache(data.getDictType(), dictDatas);
//初始化字典
dictInit.dict();
}
}
@ -94,8 +87,6 @@ public class SysDictDataServiceImpl implements ISysDictDataService
{
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
DictUtils.setDictCache(data.getDictType(), dictDatas);
//初始化字典
dictInit.dict();
}
return row;
}
@ -114,8 +105,6 @@ public class SysDictDataServiceImpl implements ISysDictDataService
{
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
DictUtils.setDictCache(data.getDictType(), dictDatas);
//初始化字典表
dictInit.dict();
}
return row;
}

View File

@ -32,9 +32,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dictType != null and dictType != ''">
AND dict_type = #{dictType}
</if>
<if test="partId != null and partId != ''">
AND part_id = #{partId}
</if>
<if test="dictLabel != null and dictLabel != ''">
AND dict_label like concat('%', #{dictLabel}, '%')
</if>
@ -109,7 +106,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="partId != null and partId != ''">part_id,</if>
create_time
)values(
<if test="dictSort != null">#{dictSort},</if>
@ -122,7 +118,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="partId != null and partId != ''">#{partId},</if>
sysdate()
)
</insert>