commit
This commit is contained in:
@@ -79,8 +79,19 @@ public class UpdateUnitController {
|
||||
// 从源数据中心拉取所有的单位
|
||||
// List<Sys_unit> units = SourceData.units();
|
||||
|
||||
Sys_unit unit = dao.fetch(Sys_unit.class, Cnd.where("unitcode", "=", "00000"));
|
||||
if(unit == null) {
|
||||
Sys_unit firstUnit = new Sys_unit();
|
||||
firstUnit.setId("00000");
|
||||
firstUnit.setName("河海大学");
|
||||
firstUnit.setUnitlevel(1);
|
||||
firstUnit.setUnitcode("00000");
|
||||
firstUnit.setHasChildren(true);
|
||||
dao.fastInsert(firstUnit);
|
||||
}
|
||||
|
||||
List<Record> depDbList = dao.query("dep_db", null);
|
||||
/* depDbList.forEach(v -> {
|
||||
depDbList.forEach(v -> {
|
||||
if (list.contains(v.getString("unitcode"))) {
|
||||
dao.update(Sys_unit.class, Chain.make("name", v.getString("unitname")).add("id", v.getString("unitcode")),
|
||||
Cnd.where("id", "=", v.getString("unitcode")));
|
||||
@@ -88,10 +99,12 @@ public class UpdateUnitController {
|
||||
Sys_unit insertUnit = new Sys_unit();
|
||||
insertUnit.setId(v.getString("unitcode"));
|
||||
insertUnit.setName(v.getString("unitname"));
|
||||
dao.insert(Sys_unit.class, Chain.from(insertUnit));
|
||||
insertUnit.setUnitcode(v.getString("unitcode"));
|
||||
insertUnit.setUnitlevel(2);
|
||||
insertUnit.setParentId("00000");
|
||||
dao.fastInsert(insertUnit);
|
||||
}
|
||||
});*/
|
||||
|
||||
});
|
||||
|
||||
/* for (Sys_unit unit : units) {
|
||||
if (list.contains(unit.getId())) { // 包含就修改
|
||||
@@ -181,7 +194,7 @@ public class UpdateUnitController {
|
||||
try {
|
||||
List list = new ArrayList();
|
||||
|
||||
Sys_unit school = sysUnitService.fetch("0");
|
||||
Sys_unit school = sysUnitService.fetch("00000");
|
||||
school.setChild(child(school.getId()));
|
||||
|
||||
list.add(school);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class Sys_unit extends BaseModel implements Serializable {
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(els = {@EL("uuid()")})
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
|
||||
Reference in New Issue
Block a user