|
@@ -3,6 +3,7 @@ package com.lc.ibps.platform.plan.job;
|
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.lc.ibps.base.core.util.AppUtil;
|
|
import com.lc.ibps.base.core.util.AppUtil;
|
|
|
|
|
+import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
import com.lc.ibps.base.core.util.Collections;
|
|
import com.lc.ibps.base.core.util.Collections;
|
|
|
import com.lc.ibps.base.framework.id.UniqueIdUtil;
|
|
import com.lc.ibps.base.framework.id.UniqueIdUtil;
|
|
|
import com.lc.ibps.base.framework.table.ICommonDao;
|
|
import com.lc.ibps.base.framework.table.ICommonDao;
|
|
@@ -39,6 +40,9 @@ public class BasicDataInitializationJob extends BaseJob2 {
|
|
|
|
|
|
|
|
//其他的基础数据
|
|
//其他的基础数据
|
|
|
executeBaseTablesStep(posAdmin);
|
|
executeBaseTablesStep(posAdmin);
|
|
|
|
|
+
|
|
|
|
|
+ // 外部文件基础数据
|
|
|
|
|
+ externalFile();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void excutePositionStep(String posAdmin) throws Exception {
|
|
private void excutePositionStep(String posAdmin) throws Exception {
|
|
@@ -298,4 +302,32 @@ public class BasicDataInitializationJob extends BaseJob2 {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ private void externalFile() throws Exception {
|
|
|
|
|
+ String baseSql = "SELECT *from t_wjxxb where bian_zhi_ren_='1' ";
|
|
|
|
|
+ String deptSql = "select SUBSTRING_INDEX(SUBSTRING_INDEX(PATH_, '.', 2),'.',-1 ) AS di_dian_,a.id_ AS position_id_ " +
|
|
|
|
|
+ " from ibps_party_entity a where party_type_='position' AND depth_=3 GROUP BY PARENT_ID_";
|
|
|
|
|
+ List<Map<String, Object>> dataList = (List<Map<String, Object>>) commonDao.query(baseSql);
|
|
|
|
|
+ List<Map<String, Object>> deptList = (List<Map<String, Object>>) commonDao.query(deptSql);
|
|
|
|
|
+ if (Collections.isNotEmpty(dataList) && Collections.isNotEmpty(deptList)) {
|
|
|
|
|
+ for (Map<String, Object> dept : deptList) {
|
|
|
|
|
+ String diDian = dept.get("di_dian_").toString();
|
|
|
|
|
+ String position = dept.get("position_id_").toString();
|
|
|
|
|
+ String sql = " SELECT *from t_wjxxb where bian_zhi_ren_='1' and di_dian_='%s' and bian_zhi_bu_men_='%s' limit 1";
|
|
|
|
|
+ sql = String.format(sql,diDian,position);
|
|
|
|
|
+ Map<String, Object> map = commonDao.queryOne(sql);
|
|
|
|
|
+ if (BeanUtils.isEmpty(map)){
|
|
|
|
|
+ for (Map<String, Object> cVal1 : dataList) {
|
|
|
|
|
+ Map<String, Object> cVal = this.transformUpperCase(cVal1);
|
|
|
|
|
+ cVal.put("ID_", UniqueIdUtil.getId());
|
|
|
|
|
+ cVal.put("CREATE_TIME_", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
|
+ cVal.put("DI_DIAN_", diDian);
|
|
|
|
|
+ cVal.put("BIAN_ZHI_BU_MEN_", position);
|
|
|
|
|
+ commonDao.execute(this.buildInsertSql(cVal, "t_wjxxb"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|