减少行政区划初始化数据,提升安装速度。
This commit is contained in:
@@ -86,7 +86,7 @@ public class InitCoreData extends BaseInitDataTests {
|
|||||||
/**
|
/**
|
||||||
* 区域、行政区划表
|
* 区域、行政区划表
|
||||||
*/
|
*/
|
||||||
public void initArea() throws Exception{
|
public void initArea(String... prefixes) throws Exception{
|
||||||
clearTable(Area.class);
|
clearTable(Area.class);
|
||||||
initExcelData(Area.class, new MethodCallback() {
|
initExcelData(Area.class, new MethodCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -95,7 +95,10 @@ public class InitCoreData extends BaseInitDataTests {
|
|||||||
if("save".equals(action)){
|
if("save".equals(action)){
|
||||||
Area entity = (Area)params[1];
|
Area entity = (Area)params[1];
|
||||||
entity.setIsNewRecord(true);
|
entity.setIsNewRecord(true);
|
||||||
areaService.save(entity);
|
if (prefixes == null || prefixes.length == 0
|
||||||
|
|| StringUtils.startsWithAny(entity.getAreaCode(), prefixes)){
|
||||||
|
areaService.save(entity);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class InitCoreData extends com.jeesite.modules.sys.db.InitCoreData {
|
|||||||
public void initCoreData() throws Exception{
|
public void initCoreData() throws Exception{
|
||||||
createTable();
|
createTable();
|
||||||
initLog();
|
initLog();
|
||||||
initArea();
|
initArea("3700","3701","3702");
|
||||||
initConfig();
|
initConfig();
|
||||||
initModule();
|
initModule();
|
||||||
initDict();
|
initDict();
|
||||||
|
|||||||
Reference in New Issue
Block a user