main
HuangHai 1 month ago
parent f88542ac39
commit 7f575f9da0

@ -40,7 +40,7 @@ public class IpUtil
for (int i = 0; i < 4; ++i) {
ipNums.add(Long.valueOf(Long.parseLong(ipArray[i].trim())));
}
long ZhongIPNumTotal = ((Long) ipNums.get(0)).longValue() * 256L * 256L * 256L
long ZhongIPNumTotal = ((Long) ipNums.getFirst()).longValue() * 256L * 256L * 256L
+ ((Long) ipNums.get(1)).longValue() * 256L * 256L + ((Long) ipNums.get(2)).longValue() * 256L
+ ((Long) ipNums.get(3)).longValue();

@ -95,7 +95,7 @@ public class BaseController extends Controller {
return;
}
// 构建根节点
Record record = list.get(0);
Record record = list.getFirst();
int pId = record.getInt("pId");
int id = record.getInt("id");
String name = record.getStr("name");
@ -171,7 +171,7 @@ public class BaseController extends Controller {
if (parentRercod == null || parentRercod.size() == 0) {
renderJson(CommonUtil.returnMessageJson(false, "传入的parent_id有误系统中找不到此记录"));
} else {
String parentCode = parentRercod.get(0).get("code");
String parentCode = parentRercod.getFirst().get("code");
boolean isExists = bm.checkOrgTypePrincipalshipCodeDuplicate(parentCode + code, false, "0");
if (isExists) {
renderJson(CommonUtil.returnMessageJson(false, "传入的code有误系统中已存在此记录"));
@ -200,7 +200,7 @@ public class BaseController extends Controller {
}
//检查是不是存在子节点
List<Record> rs = bm.getOrgTypePrincipalship(id, -1, null);
if (rs.size() > 0 && rs.get(0).getInt("is_leaf") > 0) {
if (rs.size() > 0 && rs.getFirst().getInt("is_leaf") > 0) {
renderJson(CommonUtil.returnMessageJson(false, "删除失败,此节点存在子节点,请先删除子节点!"));
return;
}
@ -243,7 +243,7 @@ public class BaseController extends Controller {
if (parentRercod == null || parentRercod.size() == 0) {
renderJson(CommonUtil.returnMessageJson(false, "传入的parent_id有误系统中找不到此记录"));
} else {
String parentCode = parentRercod.get(0).get("code");
String parentCode = parentRercod.getFirst().get("code");
boolean isExists = bm.checkOrgTypePrincipalshipCodeDuplicate(parentCode + code, true, id);
if (isExists) {
renderJson(CommonUtil.returnMessageJson(false, "传入的code有误系统中已存在此记录"));

@ -92,10 +92,10 @@ public class BaseModel {
if (!UpdateCheck) {
sql = Db.getSql("Base.t_base_org_type_principalship_CountByCode");
count = Db.find(sql, code).get(0).getInt("c");
count = Db.find(sql, code).getFirst().getInt("c");
} else {
sql = Db.getSql("Base.t_base_org_type_principalship_CountByCodeExceptSelf");
count = Db.find(sql, code, Integer.parseInt(id)).get(0).getInt("c");
count = Db.find(sql, code, Integer.parseInt(id)).getFirst().getInt("c");
}
if (count == 0) {
@ -202,7 +202,7 @@ public class BaseModel {
Kv kv = Kv.by("person_id", person_id);
SqlPara sp = Db.getSqlPara("Base.getCurrentPerson", kv);
List<Record> list = Db.find(sp);
return list.get(0);
return list.getFirst();
}
/**
@ -216,7 +216,7 @@ public class BaseModel {
Kv kv = Kv.by("person_id", person_id);
SqlPara sp = Db.getSqlPara("Base.getCurrentClass", kv);
List<Record> list = Db.find(sp);
return list.get(0);
return list.getFirst();
}
/**
@ -237,7 +237,7 @@ public class BaseModel {
Kv kv = Kv.by("person_id", person_id).set("ids", v_ids);
SqlPara sp = Db.getSqlPara("Base.isInDutyList", kv);
List<Record> list = Db.find(sp);
return list.get(0).getInt("c") >= 1 ? true : false;
return list.getFirst().getInt("c") >= 1 ? true : false;
}

@ -3,7 +3,6 @@ package com.dsideal.Base.Classes.Controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dsideal.Base.Classes.Model.ClassModel;
import com.dsideal.Base.Classes.Model.ClassUtil;
import com.dsideal.Base.Interceptor.*;
import com.dsideal.Base.Organization.Model.OrganizationModel;
import com.dsideal.Base.Util.CommonUtil;
@ -25,12 +24,12 @@ public class ClassController extends Controller {
/**
*
*
* @param bureau_id
* @param stage_id
* @param school_length
* @param entry_year
* @param start_num
* @param end_num
* @param bureau_id id
* @param stage_id id
* @param school_length
* @param entry_year
* @param start_num
* @param end_num
*/
@Before({POST.class})
@EmptyInterface({"bureau_id"})
@ -46,7 +45,7 @@ public class ClassController extends Controller {
return;
}
if (!ClassUtil.getStageCorrectRange(stage_id)) {
if (!model.getStageCorrectRange(stage_id)) {
resultJson.put("success", false);
resultJson.put("message", "学段不正确!");
renderJson(resultJson);
@ -79,7 +78,7 @@ public class ClassController extends Controller {
String areaId = orgMap.get("area_id").toString();
String mainSchoolId = orgMap.get("main_school_id").toString();
JSONObject existsClassObj = ClassUtil.getExistsClassName(bureau_id, stage_id, entry_year, start_num, end_num);
JSONObject existsClassObj = model.getExistsClassName(bureau_id, stage_id, entry_year, start_num, end_num);
if (existsClassObj.getBoolean("success")) {
resultJson.put("success", false);
resultJson.put("message", "班级重复!");
@ -112,11 +111,11 @@ public class ClassController extends Controller {
/**
*
*
* @param bureau_id
* @param stage_id
* @param entry_year
* @param page
* @param limit
* @param bureau_id id
* @param stage_id id
* @param entry_year
* @param page
* @param limit
*/
@Before({GET.class})
@EmptyInterface({"bureau_id"})
@ -124,7 +123,7 @@ public class ClassController extends Controller {
@IsSysAdminInterface({"1", "2", "3", "4"}) //是不是超级管理员或单位管理员
public void getClassList(String bureau_id, String stage_id, int entry_year, int page, int limit) {
JSONObject resultJson = new JSONObject();
if (!ClassUtil.getStageCorrectRange(stage_id)) {
if (!model.getStageCorrectRange(stage_id)) {
resultJson.put("success", false);
resultJson.put("message", "学段不正确!");
renderJson(resultJson);
@ -143,8 +142,8 @@ public class ClassController extends Controller {
/**
*
*
* @param class_id
* @param class_name
* @param class_id id
* @param class_name
*/
@Before({POST.class})
@EmptyInterface({"class_id", "class_name"})
@ -171,23 +170,22 @@ public class ClassController extends Controller {
/**
* ID
*
* @param class_id
* @param class_id id
*/
@Before({GET.class})
@EmptyInterface({"class_id"})
@IsSysAdminInterface({"1", "2", "3", "4"}) //是不是超级管理员或单位管理员
public void getClassInfo(String class_id) {
JSONObject resultJson = new JSONObject();
Map classMap = model.getClassInfoByClassId(class_id);
if (classMap == null) {
JSONObject jo = model.getClassInfoByClassId(class_id);
if (jo == null) {
resultJson.put("success", false);
resultJson.put("message", "获取班级信息异常!");
renderJson(resultJson);
return;
} else {
resultJson.put("success", true);
resultJson.put("class_name", classMap.get("class_name").toString());
resultJson.put("bureau_id", classMap.get("bureau_id").toString());
resultJson.put("class_name", jo.get("class_name").toString());
resultJson.put("bureau_id", jo.get("bureau_id").toString());
renderJson(resultJson);
}
}
@ -195,7 +193,7 @@ public class ClassController extends Controller {
/**
*
*
* @param class_ids
* @param class_ids ids
*/
@Before({POST.class})
@EmptyInterface({"class_ids"})
@ -227,14 +225,14 @@ public class ClassController extends Controller {
/**
* ID
*
* @param bureau_id
* @param bureau_id id
*/
@Before({GET.class})
@EmptyInterface({"bureau_id"})
public void getStageList(String bureau_id) {
JSONObject resultJson = new JSONObject();
OrganizationModel orgModel = new OrganizationModel();
String schoolType = orgModel.getOrgInfoById(bureau_id).get(0).getStr("school_type_id");
String schoolType = orgModel.getOrgInfoById(bureau_id).getFirst().getStr("school_type_id");
JSONArray listArray = model.getStageList(schoolType);
resultJson.put("success", true);

@ -10,6 +10,8 @@ import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.activerecord.SqlPara;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
@ -28,8 +30,8 @@ public class ClassModel {
String sql = Db.getSql("loginPerson.getLoginInfoByPersonId");
List<Record> list = Db.find(sql, person_id);
if (list.size() > 0) {
String bureauId = list.get(0).getStr("bureau_id");
String identityId = list.get(0).getStr("identity_id");
String bureauId = list.getFirst().getStr("bureau_id");
String identityId = list.getFirst().getStr("identity_id");
if (identityId.equals("1")) {
flag = true;
} else {
@ -37,7 +39,7 @@ public class ClassModel {
sql = Db.getSql("organization.getOrgInfoById");
list = Db.find(sql, bureauId);
if (list.size() > 0) {
int schoolTypeId = list.get(0).getInt("school_type_id");
int schoolTypeId = list.getFirst().getInt("school_type_id");
if (schoolTypeId > 0) {
flag = true;
}
@ -130,14 +132,14 @@ public class ClassModel {
JSONObject obj = new JSONObject();
String sql = Db.getSql("class.getClassInfoByClassId");
List<Record> list = Db.find(sql, class_id);
if (list.size() > 0) {
obj.put("class_name", list.get(0).getStr("class_name"));
obj.put("altas_name", list.get(0).getStr("altas_name"));
obj.put("entry_year", list.get(0).getStr("entry_year"));
obj.put("city_id", list.get(0).getStr("city_id"));
obj.put("area_id", list.get(0).getStr("area_id"));
obj.put("main_school_id", list.get(0).getStr("main_school_id"));
obj.put("bureau_id", list.get(0).getStr("bureau_id"));
if (!list.isEmpty()) {
obj.put("class_name", list.getFirst().getStr("class_name"));
obj.put("altas_name", list.getFirst().getStr("altas_name"));
obj.put("entry_year", list.getFirst().getStr("entry_year"));
obj.put("city_id", list.getFirst().getStr("city_id"));
obj.put("area_id", list.getFirst().getStr("area_id"));
obj.put("main_school_id", list.getFirst().getStr("main_school_id"));
obj.put("bureau_id", list.getFirst().getStr("bureau_id"));
return obj;
} else {
return null;
@ -184,8 +186,7 @@ public class ClassModel {
public int getStudentCountByClassId(String class_id) {
String sql = Db.getSql("class.getStudentCountByClassId");
List<Record> list = Db.find(sql, class_id);
int count = list.size();
return count;
return list.size();
}
/**
@ -236,4 +237,63 @@ public class ClassModel {
}
return ja;
}
/**
*
*
* 2018-12-04
*
* @param stage_id
* @return
*/
public boolean getStageCorrectRange(String stage_id) {
String[] stageArr = new String[]{"4", "5", "6", "7", "8"};
for (String s : stageArr) {
if (s.equals(stage_id)) {
return true;
}
}
return false;
}
/**
*
*
* 2018-12-04
*
* @param bureau_id
* @param stage_id
* @param entry_year
* @param start_num
* @param end_num
* @return
*/
public JSONObject getExistsClassName(String bureau_id, String stage_id, int entry_year, int start_num, int end_num) {
JSONObject result = new JSONObject();
List<String> addClassList = new ArrayList<>();
for (int i = start_num; i < (end_num + 1); i++) {
addClassList.add(entry_year + "级" + i + "班");
}
List<String> dbClassList = new ArrayList<>();
ClassModel classmodel = new ClassModel();
List<Record> classList = classmodel.getClassListByBureauIdStageIdEntryYear(bureau_id, stage_id, entry_year);
if (classList != null) {
for (int i = 0; i < classList.size(); i++) {
dbClassList.add(classList.get(i).get("class_name").toString());
}
Collection<String> exists = new ArrayList<String>(dbClassList);
Collection<String> notexists = new ArrayList<String>(dbClassList);
exists.removeAll(addClassList);
notexists.removeAll(exists);
if (notexists.size() > 0) {
result.put("success", true);
result.put("exists_list", notexists);
} else {
result.put("success", false);
}
} else {
result.put("success", false);
}
return result;
}
}

@ -1,71 +0,0 @@
package com.dsideal.Base.Classes.Model;
import com.alibaba.fastjson.JSONObject;
import com.jfinal.plugin.activerecord.Record;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class ClassUtil {
/**
*
*
* 2018-12-04
*
* @param stage_id
* @return
*/
public static boolean getStageCorrectRange(String stage_id) {
String[] stageArr = new String[]{"4", "5", "6", "7", "8"};
for (String s : stageArr) {
if (s.equals(stage_id)) {
return true;
}
}
return false;
}
/**
*
*
* 2018-12-04
*
* @param bureau_id
* @param stage_id
* @param entry_year
* @param start_num
* @param end_num
* @return
*/
public static JSONObject getExistsClassName(String bureau_id, String stage_id, int entry_year, int start_num, int end_num) {
JSONObject result = new JSONObject();
List<String> addClassList = new ArrayList<>();
for (int i = start_num; i < (end_num + 1); i++) {
addClassList.add(entry_year + "级" + i + "班");
}
List<String> dbClassList = new ArrayList<>();
ClassModel classmodel = new ClassModel();
List<Record> classList = classmodel.getClassListByBureauIdStageIdEntryYear(bureau_id, stage_id, entry_year);
if (classList != null) {
for (int i = 0; i < classList.size(); i++) {
dbClassList.add(classList.get(i).get("class_name").toString());
}
Collection<String> exists = new ArrayList<String>(dbClassList);
Collection<String> notexists = new ArrayList<String>(dbClassList);
exists.removeAll(addClassList);
notexists.removeAll(exists);
if (notexists.size() > 0) {
result.put("success", true);
result.put("exists_list", notexists);
} else {
result.put("success", false);
}
} else {
result.put("success", false);
}
return result;
}
}

@ -215,7 +215,7 @@ public class DmController extends Controller {
if (need_root_boolean) {
List<Record> records = model.getAreaInfoById(parent_id);
if (records != null && !records.isEmpty()) {
Record record = records.get(0);
Record record = records.getFirst();
record.set("open", true);
dtnew.add(record);
}
@ -234,7 +234,7 @@ public class DmController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "传入的parent_id的值不是一个合法的uuid"));
return;
}
Record rootRecord = model.getAreaInfoById(parent_id).get(0);
Record rootRecord = model.getAreaInfoById(parent_id).getFirst();
List<Record> list = model.getArea(parent_id);
int level_id = rootRecord.getInt("level_id");

@ -211,7 +211,7 @@ public class StudentImportExcelUtil {
//计算本校应该有哪些学段
OrganizationModel orgModel = new OrganizationModel();
String schoolType = orgModel.getOrgInfoById(bureauId).get(0).getStr("school_type_id");
String schoolType = orgModel.getOrgInfoById(bureauId).getFirst().getStr("school_type_id");
ClassModel cm = new ClassModel();
JSONArray listArray = cm.getStageList(schoolType);
Map<String, String> mapStage = new HashMap<>(); //可用学段
@ -417,9 +417,9 @@ public class StudentImportExcelUtil {
OrganizationModel orgModel = new OrganizationModel();
List<Record> rs = orgModel.getAreaIdByParentId(bureau_id);
if (rs != null && !rs.isEmpty()) {
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).getStr("area_id");
main_school_id = rs.get(0).getStr("main_school_id");
city_id = rs.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
main_school_id = rs.getFirst().getStr("main_school_id");
} else {
city_id = "-1";
area_id = "-1";

@ -188,7 +188,7 @@ public class StudentTemplateUtil {
} else {
//还是根据传入的学校id计算出学段
OrganizationModel orgModel = new OrganizationModel();
String schoolType = orgModel.getOrgInfoById(school_id).get(0).getStr("school_type_id");
String schoolType = orgModel.getOrgInfoById(school_id).getFirst().getStr("school_type_id");
ClassModel cm = new ClassModel();
JSONArray listArray = cm.getStageList(schoolType);
for (int i = 0; i < listArray.size(); i++) {

@ -349,9 +349,9 @@ public class TeacherImportExcelUtil {
OrganizationModel orgModel = new OrganizationModel();
List<Record> rs = orgModel.getAreaIdByParentId(bureau_id);
if (rs != null && !rs.isEmpty()) {
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).getStr("area_id");
main_school_id = rs.get(0).getStr("main_school_id");
city_id = rs.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
main_school_id = rs.getFirst().getStr("main_school_id");
} else {
city_id = "-1";
area_id = "-1";

@ -41,7 +41,7 @@ public class GlobalController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "没有找到对应的省和市!"));
return;
}
String area_id = records.get(0).getStr("id");
String area_id = records.getFirst().getStr("id");
//保存
GlobalModel model = new GlobalModel();
model.saveInstallArea(area_id);

@ -75,7 +75,7 @@ public class GlobalModel {
public int checkGlobalCodeCount(String global_id, String globalCode) {
String install_area = getInstallArea();
String sql = "select count(1) as c from t_base_global where global_id<>? and global_code=? and install_area=?";
Record record = Db.find(sql, Integer.parseInt(global_id), globalCode, install_area).get(0);
Record record = Db.find(sql, Integer.parseInt(global_id), globalCode, install_area).getFirst();
return record.getInt("c");
}

@ -19,7 +19,7 @@ public class GraduationAction implements Runnable {
String sql = Db.getSql("graduation.checkCurrentYearIsGraduation");
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int count = Db.find(sql, year).get(0).getInt("count");
int count = Db.find(sql, year).getFirst().getInt("count");
if (count > 0) {
while (true) {
//2、检查需要毕业的班级及学生、家长

@ -35,7 +35,7 @@ public class LoginPersonModel {
*/
public boolean checkPwdByPersonId(String person_id, String pwd) {
String sql = Db.getSql("loginPerson.checkPwdByPersonId");
int count = Db.find(sql, person_id, CommonUtil.getLdapPassword(pwd)).get(0).getInt("c");
int count = Db.find(sql, person_id, CommonUtil.getLdapPassword(pwd)).getFirst().getInt("c");
return count > 0;
}
@ -65,7 +65,7 @@ public class LoginPersonModel {
String sql = Db.getSql("loginPerson.getLoginInfoByPersonId");
List<Record> list = Db.find(sql, personId);
if (!list.isEmpty()) {
return list.get(0);
return list.getFirst();
} else {
return null;
}

@ -75,12 +75,12 @@ public class MenuController extends Controller {
//获取单位管理员菜单
if (identity_id < 5) { //1,2,3,4
List<Record> list = model.selectBureauMenuByPersonId(identity_id, person_id).getList();
renderJson(MenuUtil.convertListToMenuForTreeTable(list).getChildren().get(0).getChildren());
renderJson(MenuUtil.convertListToMenuForTreeTable(list).getChildren().getFirst().getChildren());
return;
}
//5,6 角色,就是教师,学生
List<Record> list = model.selectMenuByPersonId(person_id);
renderJson(MenuUtil.convertListToMenuForTreeTable(list).getChildren().get(0).getChildren());
renderJson(MenuUtil.convertListToMenuForTreeTable(list).getChildren().getFirst().getChildren());
}
/**
@ -100,7 +100,7 @@ public class MenuController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "无法获取指定ID的信息"));
return;
}
Record record = list.get(0);
Record record = list.getFirst();
int duties_id;
int level_id = record.getInt("level");
if (level_id == 4) {
@ -198,7 +198,7 @@ public class MenuController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "无法获取指定ID的信息"));
return;
}
Record record = list.get(0);
Record record = list.getFirst();
int duties_id;
int level_id = record.getInt("level");
if (level_id == 4) {

@ -33,7 +33,7 @@ public class OrganizationController extends Controller {
if (records == null || records.size() == 0) {
renderJson(CommonUtil.returnMessageJson(false, "没有找到此单位号!"));
} else {
Record record = records.get(0);
Record record = records.getFirst();
int school_type_id = record.getInt("school_type_id");
if (school_type_id > 0) {
renderJson(CommonUtil.returnMessageJson(true, "是学校!"));
@ -84,7 +84,7 @@ public class OrganizationController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "parent_org_id参数不正确!"));
return;
}
String city_id = rs.get(0).getStr("city_id");
String city_id = rs.getFirst().getStr("city_id");
int cityOrarea;
if (parent_org_id.equals(city_id)) {
cityOrarea = 1;
@ -96,8 +96,8 @@ public class OrganizationController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "school_type_id参数不正确!"));
return;
}
int shi_org_type = r.get(0).getInt("shi_org_type");
int area_org_type = r.get(0).getInt("area_org_type");
int shi_org_type = r.getFirst().getInt("shi_org_type");
int area_org_type = r.getFirst().getInt("area_org_type");
if (cityOrarea == 1) {
org_type_id = shi_org_type;
} else {
@ -172,16 +172,16 @@ public class OrganizationController extends Controller {
if (identity_id == 2) //2号人物角色即市管理员
{
String city_id = orgrs.get(0).getStr("city_id");
if (!rs.get(0).getStr("city_id").equals(city_id)) {
String city_id = orgrs.getFirst().getStr("city_id");
if (!rs.getFirst().getStr("city_id").equals(city_id)) {
renderJson(CommonUtil.returnMessageJson(false, "当前登录用户没有此单位的管理权限,不能删除!"));
return;
}
}
if (identity_id == 3) //3号人物角色即县区管理员
{
String area_id = orgrs.get(0).getStr("area_id");
if (!rs.get(0).getStr("area_id").equals(area_id)) {
String area_id = orgrs.getFirst().getStr("area_id");
if (!rs.getFirst().getStr("area_id").equals(area_id)) {
renderJson(CommonUtil.returnMessageJson(false, "当前登录用户没有此单位的管理权限,不能删除!"));
return;
}
@ -313,7 +313,7 @@ public class OrganizationController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "没有找到此父ID节点!"));
return;
}
String bureau_id = rs.get(0).getStr("bureau_id");
String bureau_id = rs.getFirst().getStr("bureau_id");
//操作人
Record rPerson = JwtUtil.getPersonInfo(getRequest());
String operator = rPerson.getStr("person_id");

@ -42,10 +42,10 @@ public class OrganizationModel {
String sql = Db.getSql("organization.getOrgInfoById");
List<Record> list = Db.find(sql, bureau_id);
if (!list.isEmpty()) {
resMap.put("city_id", list.get(0).getStr("city_id"));
resMap.put("area_id", list.get(0).getStr("area_id"));
resMap.put("main_school_id", list.get(0).getStr("main_school_id"));
resMap.put("school_type_id", list.get(0).getStr("school_type_id"));
resMap.put("city_id", list.getFirst().getStr("city_id"));
resMap.put("area_id", list.getFirst().getStr("area_id"));
resMap.put("main_school_id", list.getFirst().getStr("main_school_id"));
resMap.put("school_type_id", list.getFirst().getStr("school_type_id"));
return resMap;
} else {
return null;
@ -74,23 +74,23 @@ public class OrganizationModel {
map.put("area_code", "");
} else {
//如果是市
if (records.get(0).getStr("id").equals(records.get(0).getStr("city_id"))) {
if (records.getFirst().getStr("id").equals(records.getFirst().getStr("city_id"))) {
map.put("city_id", id);
map.put("area_id", NullGuid);
map.put("parent_id", records.get(0).getStr("parent_id"));
map.put("area_name", records.get(0).getStr("area_name"));
map.put("area_code", records.get(0).getStr("area_code"));
map.put("province_id", records.get(0).getStr("province_id"));
map.put("province_name", records.get(0).getStr("province_name"));
map.put("parent_id", records.getFirst().getStr("parent_id"));
map.put("area_name", records.getFirst().getStr("area_name"));
map.put("area_code", records.getFirst().getStr("area_code"));
map.put("province_id", records.getFirst().getStr("province_id"));
map.put("province_name", records.getFirst().getStr("province_name"));
} else//如果是县区
{
sql = Db.getSql("dm.getAreaById");
String city_id = Db.find(sql, id).get(0).getStr("parent_id");
String city_id = Db.find(sql, id).getFirst().getStr("parent_id");
map.put("city_id", city_id);
map.put("area_id", id);
map.put("parent_id", records.get(0).getStr("parent_id"));
map.put("area_name", records.get(0).getStr("area_name"));
map.put("area_code", records.get(0).getStr("area_code"));
map.put("parent_id", records.getFirst().getStr("parent_id"));
map.put("area_name", records.getFirst().getStr("area_name"));
map.put("area_code", records.getFirst().getStr("area_code"));
}
}
return map;
@ -196,8 +196,8 @@ public class OrganizationModel {
record.set("bureau_id", bureau_id);
List<Record> rs = getAreaIdByParentId(bureau_id);
if (rs != null && !rs.isEmpty()) {
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).getStr("area_id");
city_id = rs.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
} else {
city_id = "-1";
area_id = "-1";
@ -238,7 +238,7 @@ public class OrganizationModel {
public List<Record> getAreaIdByParentId(String parent_id) {
List<Record> rs = getOrgInfoById(parent_id);
if (!rs.isEmpty()) {
String bureau_id = rs.get(0).getStr("bureau_id");
String bureau_id = rs.getFirst().getStr("bureau_id");
rs = getOrgInfoById(bureau_id);
if (!rs.isEmpty()) {
return rs;
@ -276,8 +276,8 @@ public class OrganizationModel {
int b_use = 0;
List<Record> rs = getOrgInfoById(org_id);
if (!rs.isEmpty()) {
create_time = DateUtil.parse(rs.get(0).getStr("create_time"));
b_use = rs.get(0).getInt("b_use");
create_time = DateUtil.parse(rs.getFirst().getStr("create_time"));
b_use = rs.getFirst().getInt("b_use");
}
record.set("create_time", create_time);
record.set("b_use", b_use);
@ -315,8 +315,8 @@ public class OrganizationModel {
List<Record> rs = getAreaIdByParentId(parent_id);
if (rs != null && !rs.isEmpty()) {
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).getStr("area_id");
city_id = rs.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
} else {
city_id = "-1";
area_id = "-1";
@ -331,9 +331,9 @@ public class OrganizationModel {
String bureau_id = null;
rs = getOrgInfoById(org_id);
if (!rs.isEmpty()) {
bureau_id = rs.get(0).getStr("bureau_id");
create_time = rs.get(0).getStr("create_time");
b_use = rs.get(0).getInt("b_use");
bureau_id = rs.getFirst().getStr("bureau_id");
create_time = rs.getFirst().getStr("create_time");
b_use = rs.getFirst().getInt("b_use");
}
record.set("bureau_id", bureau_id);
record.set("create_time", DateUtil.parse(create_time));
@ -354,7 +354,7 @@ public class OrganizationModel {
*/
public int getClassCountByBureauId(String org_id) {
String sql = Db.getSql("class.getClassCountByBureauId");
return Db.find(sql, org_id).get(0).getInt("c");
return Db.find(sql, org_id).getFirst().getInt("c");
}
/**
@ -367,7 +367,7 @@ public class OrganizationModel {
*/
public int getOrgCountByBureauId(String org_id) {
String sql = Db.getSql("organization.getOrgCountByBureauId");
return Db.find(sql, org_id, org_id).get(0).getInt("c");
return Db.find(sql, org_id, org_id).getFirst().getInt("c");
}
/**
@ -380,7 +380,7 @@ public class OrganizationModel {
*/
public int getTeacherCountByBureauId(String org_id) {
String sql = Db.getSql("loginPerson.getTeacherCountByBureauId");
return Db.find(sql, org_id).get(0).getInt("c");
return Db.find(sql, org_id).getFirst().getInt("c");
}
/**
@ -393,7 +393,7 @@ public class OrganizationModel {
*/
public int getTeacherCountByOrgId(String org_id) {
String sql = Db.getSql("loginPerson.getTeacherCountByOrgId");
return Db.find(sql, org_id).get(0).getInt("c");
return Db.find(sql, org_id).getFirst().getInt("c");
}
/**
@ -406,7 +406,7 @@ public class OrganizationModel {
*/
public int getStudentCountByBureauId(String org_id) {
String sql = Db.getSql("loginPerson.getStudentCountByBureauId");
return Db.find(sql, org_id).get(0).getInt("c");
return Db.find(sql, org_id).getFirst().getInt("c");
}
/**
@ -419,7 +419,7 @@ public class OrganizationModel {
*/
public int getParentCountByBureauId(String org_id) {
String sql = Db.getSql("loginPerson.getParentCountByBureauId");
return Db.find(sql, org_id).get(0).getInt("c");
return Db.find(sql, org_id).getFirst().getInt("c");
}
/**
@ -457,7 +457,7 @@ public class OrganizationModel {
*/
public int getOrgCodeCount(String org_code) {
String sql = Db.getSql("organization.getOrgCodeCount");
return Db.find(sql, org_code).get(0).getInt("c");
return Db.find(sql, org_code).getFirst().getInt("c");
}
/**
@ -470,7 +470,7 @@ public class OrganizationModel {
*/
public int getOrgCodeCountExceptSelf(String org_id, String org_code) {
String sql = Db.getSql("organization.getOrgCodeCountExceptSelf");
return Db.find(sql, org_code, org_id).get(0).getInt("c");
return Db.find(sql, org_code, org_id).getFirst().getInt("c");
}
/**

@ -32,7 +32,7 @@ public class StudentModel {
if (rs == null || rs.isEmpty()) {
return false;
}
int stage_id = rs.get(0).getInt("stage_id");
int stage_id = rs.getFirst().getInt("stage_id");
// 生成6位随机明文密码
String originalPwd = CommonUtil.getSixRandom();
@ -89,7 +89,7 @@ public class StudentModel {
String sql = Db.getSql("loginPerson.getLoginInfoByPersonId");
List<Record> list = Db.find(sql, person_id);
if (list.size() > 0) {
Record record = list.get(0);
Record record = list.getFirst();
record.set("person_id", person_id);
record.set("identity_id", 6);
record.set("person_name", person_name);
@ -172,7 +172,7 @@ public class StudentModel {
String sql = Db.getSql("student.getStudentInfoByPersonId");
List<Record> list = Db.find(sql, student_id);
if (list.size() > 0) {
Record record = list.get(0);
Record record = list.getFirst();
return record;
} else {
return null;

@ -36,7 +36,7 @@ public class StudentYdController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "人员状态异常!"));
return;
}
int c = rs.get(0).getInt("c");
int c = rs.getFirst().getInt("c");
if (c > 0) {
renderJson(CommonUtil.returnMessageJson(false, "人员处理在调转审核中!"));
} else {
@ -271,7 +271,7 @@ public class StudentYdController extends Controller {
return;
}
Record rPerson = JwtUtil.getPersonInfo(getRequest());
String source_bureau_id = records.get(0).getStr("source_bureau_id");
String source_bureau_id = records.getFirst().getStr("source_bureau_id");
String personId = rPerson.getStr("person_id");
String identity_id = rPerson.getStr("identity_id");
LoginPersonModel _loginPersonModel = new LoginPersonModel();
@ -281,13 +281,13 @@ public class StudentYdController extends Controller {
return;
}
//2、是不是已经是删除状态的
int b_use = records.get(0).getInt("b_use");
int b_use = records.getFirst().getInt("b_use");
if (b_use != 1) {
renderJson(CommonUtil.returnMessageJson(false, "此记录已经是删除状态,不能重复删除!"));
return;
}
//3、是不是对方还没有审核
int status_id = records.get(0).getInt("status_id");
int status_id = records.getFirst().getInt("status_id");
if (status_id > 1) {
renderJson(CommonUtil.returnMessageJson(false, "此记录已被对方审核处理,不能删除!"));
return;

@ -37,7 +37,7 @@ public class StudentYdModel {
public boolean updateStudentStatus(String person_id, String status_code, String operator, String ip_address) {
List<Record> rs = get_dm_status_student_by_code(status_code);
if (rs != null && !rs.isEmpty()) {
int change_person_b_use = rs.get(0).getInt("change_person_b_use");
int change_person_b_use = rs.getFirst().getInt("change_person_b_use");
//修改人员主表
String sql = Db.getSql("studentYd.updateStudentStatus");
//update t_sys_loginperson set b_use=?,status_code=?,operator=?,ip_address=? where person_id=?
@ -94,7 +94,7 @@ public class StudentYdModel {
if (rs == null || rs.size() == 0) {
return true;
}
if (rs.get(0).getInt("status_id") == 1) {
if (rs.getFirst().getInt("status_id") == 1) {
return false;
}
return true;
@ -174,7 +174,7 @@ public class StudentYdModel {
if (records == null || records.size() == 0) {
return false;
}
Record record = records.get(0);
Record record = records.getFirst();
String person_id = record.getStr("person_id");
String target_bureau_id = record.getStr("target_bureau_id");
record.set("status_id", status_id);
@ -193,9 +193,9 @@ public class StudentYdModel {
if (rs == null || rs.isEmpty()) {
return false;
}
String city_id = rs.get(0).getStr("city_id");
String area_id = rs.get(0).getStr("area_id");
String main_school_id = rs.get(0).getStr("main_school_id");
String city_id = rs.getFirst().getStr("city_id");
String area_id = rs.getFirst().getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_id");
//修改到新的单位和部门下
sql = Db.getSql("loginPerson.changePersonClass");
Db.update(sql, city_id, area_id, main_school_id, target_bureau_id, class_id, operator, IpUtil.ipToLong(ip_address), person_id);
@ -215,7 +215,7 @@ public class StudentYdModel {
Db.update(sql, operator, IpUtil.ipToLong(ip_address), id);
//修改为正常状态
List<Record> records = getStudentTransferInfoById(id);
updateStudentStatus(records.get(0).getStr("person_id"), "01", operator, ip_address);
updateStudentStatus(records.getFirst().getStr("person_id"), "01", operator, ip_address);
}
/**
@ -225,7 +225,7 @@ public class StudentYdModel {
*/
public int getNewStudentTransferApplyCount(String bureau_id) {
String sql = Db.getSql("studentYd.getNewStudentTransferApplyCount");
return Db.find(sql, bureau_id).get(0).getInt("c");
return Db.find(sql, bureau_id).getFirst().getInt("c");
}
/**
@ -235,7 +235,7 @@ public class StudentYdModel {
*/
public int getNewStudentTransferEchoCount(String bureau_id) {
String sql = Db.getSql("studentYd.getNewStudentTransferEchoCount");
return Db.find(sql, bureau_id).get(0).getInt("c");
return Db.find(sql, bureau_id).getFirst().getInt("c");
}
/**
@ -268,7 +268,7 @@ public class StudentYdModel {
if (applyRs == null || applyRs.isEmpty()) {
return false;
}
Record record = applyRs.get(0);
Record record = applyRs.getFirst();
String source_bureau_id = record.getStr("source_bureau_id");
String target_bureau_id = record.getStr("target_bureau_id");
int status_id = record.getInt("status_id");
@ -300,9 +300,9 @@ public class StudentYdModel {
if (rs == null || rs.isEmpty()) {
return false;
}
String city_id = rs.get(0).getStr("city_id");
String area_id = rs.get(0).getStr("area_id");
String main_school_id = rs.get(0).getStr("main_school_id");
String city_id = rs.getFirst().getStr("city_id");
String area_id = rs.getFirst().getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_id");
//修改到新的单位和班级下
sql = Db.getSql("loginPerson.changePersonClass");
Db.update(sql, city_id, area_id, main_school_id, bureau_id, class_id, operator, IpUtil.ipToLong(ip_address), person_id);
@ -313,7 +313,7 @@ public class StudentYdModel {
if (rs == null || rs.isEmpty()) {
return false;
}
String parent_id = rs.get(0).getStr("person_id");
String parent_id = rs.getFirst().getStr("person_id");
//2、变更
sql = Db.getSql("loginPerson.changePersonClass");
Db.update(sql, city_id, area_id, main_school_id, bureau_id, class_id, operator, IpUtil.ipToLong(ip_address), parent_id);

@ -108,10 +108,10 @@ public class TeacherController extends Controller {
return;
}
//获取部门所在单位ID
String bureauId = rs.get(0).get("bureau_id").toString();
String cityId = rs.get(0).get("city_id").toString();
String areaId = rs.get(0).get("area_id").toString();
String mainSchoolId = rs.get(0).get("main_school_id").toString();
String bureauId = rs.getFirst().get("bureau_id").toString();
String cityId = rs.getFirst().get("city_id").toString();
String areaId = rs.getFirst().get("area_id").toString();
String mainSchoolId = rs.getFirst().get("main_school_id").toString();
//生成6位随机明文密码
String originalPwd = CommonUtil.getSixRandom();
@ -234,7 +234,7 @@ public class TeacherController extends Controller {
if (duties_id != null && !duties_id.equals("-1")) {
BaseModel model = new BaseModel();
String duties_name = model.getOrgTypePrincipalshipById(duties_id).get(0).get("name");
String duties_name = model.getOrgTypePrincipalshipById(duties_id).getFirst().get("name");
JSONObject targetJo = new JSONObject();
targetJo.put("duties_id", duties_id);
targetJo.put("duties_name", duties_name);
@ -533,7 +533,7 @@ public class TeacherController extends Controller {
renderJson(map);
return;
}
bureau_id = records.get(0).getStr("bureau_id");
bureau_id = records.getFirst().getStr("bureau_id");
//5、检查EXCEL与数据库中是不是有身份证号重复

@ -115,12 +115,12 @@ public class TeacherModel {
String sql = Db.getSql("loginPerson.getLoginInfoByPersonId");
List<Record> list = Db.find(sql, person_id);
if (!list.isEmpty()) {
city_id = list.get(0).getStr("city_id");
area_id = list.get(0).getStr("area_id");
main_school_id = list.get(0).getStr("main_school_id");
bureau_id = list.get(0).getStr("bureau_id");
city_id = list.getFirst().getStr("city_id");
area_id = list.getFirst().getStr("area_id");
main_school_id = list.getFirst().getStr("main_school_id");
bureau_id = list.getFirst().getStr("bureau_id");
Record record = list.get(0);
Record record = list.getFirst();
record.set("person_id", person_id);
record.set("identity_id", 5);
record.set("person_name", person_name);

@ -35,7 +35,7 @@ public class TeacherYdController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "人员状态异常!"));
return;
}
int c = rs.get(0).getInt("c");
int c = rs.getFirst().getInt("c");
if (c > 0) {
renderJson(CommonUtil.returnMessageJson(false, "人员处理在调转审核中!"));
} else {
@ -279,7 +279,7 @@ public class TeacherYdController extends Controller {
return;
}
Record rPerson = JwtUtil.getPersonInfo(getRequest());
String source_bureau_id = records.get(0).getStr("source_bureau_id");
String source_bureau_id = records.getFirst().getStr("source_bureau_id");
String personId = rPerson.getStr("person_id");
;
String identity_id = rPerson.getStr("identity_id");
@ -290,13 +290,13 @@ public class TeacherYdController extends Controller {
return;
}
//2、是不是已经是删除状态的
int b_use = records.get(0).getInt("b_use");
int b_use = records.getFirst().getInt("b_use");
if (b_use != 1) {
renderJson(CommonUtil.returnMessageJson(false, "此记录已经是删除状态,不能重复删除!"));
return;
}
//3、是不是对方还没有审核
int status_id = records.get(0).getInt("status_id");
int status_id = records.getFirst().getInt("status_id");
if (status_id > 1) {
renderJson(CommonUtil.returnMessageJson(false, "此记录已被对方审核处理,不能删除!"));
return;

@ -36,7 +36,7 @@ public class TeacherYdModel {
public boolean updateTeacherStatus(String person_id, String status_code, String operator, long ip_address) {
List<Record> rs = get_dm_status_teacher_by_code(status_code);
if (rs != null && !rs.isEmpty()) {
int change_person_b_use = rs.get(0).getInt("change_person_b_use");
int change_person_b_use = rs.getFirst().getInt("change_person_b_use");
//修改人员主表
String sql = Db.getSql("teacherYd.updateTeacherStatus");
Db.update(sql, change_person_b_use, status_code, operator, ip_address, person_id);
@ -92,7 +92,7 @@ public class TeacherYdModel {
if (rs == null || rs.isEmpty()) {
return true;
}
if (rs.get(0).getInt("status_id") == 1) {
if (rs.getFirst().getInt("status_id") == 1) {
return false;
}
return true;
@ -173,7 +173,7 @@ public class TeacherYdModel {
if (records == null || records.isEmpty()) {
return false;
}
Record record = records.get(0);
Record record = records.getFirst();
String person_id = record.getStr("person_id");
String target_bureau_id = record.getStr("target_bureau_id");
record.set("status_id", status_id);
@ -191,9 +191,9 @@ public class TeacherYdModel {
if (rs == null || rs.isEmpty()) {
return false;
}
String city_id = rs.get(0).getStr("city_id");
String area_id = rs.get(0).getStr("area_id");
String main_school_id = rs.get(0).getStr("main_school_id");
String city_id = rs.getFirst().getStr("city_id");
String area_id = rs.getFirst().getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_id");
//修改到新的单位和部门下
sql = Db.getSql("loginPerson.changePersonBureau");
Db.update(sql, city_id, area_id, main_school_id, target_bureau_id, org_id, operator, IpUtil.ipToLong(ip_address), person_id);
@ -213,7 +213,7 @@ public class TeacherYdModel {
Db.update(sql, operator, IpUtil.ipToLong(ip_address), id);
//修改为正常状态
List<Record> records = getTeacherTransferInfoById(id);
updateTeacherStatus(records.get(0).getStr("person_id"), "01", operator, IpUtil.ipToLong(ip_address));
updateTeacherStatus(records.getFirst().getStr("person_id"), "01", operator, IpUtil.ipToLong(ip_address));
}
/**
@ -223,7 +223,7 @@ public class TeacherYdModel {
*/
public int getNewTeacherTransferApplyCount(String bureau_id) {
String sql = Db.getSql("teacherYd.getNewTeacherTransferApplyCount");
return Db.find(sql, bureau_id).get(0).getInt("c");
return Db.find(sql, bureau_id).getFirst().getInt("c");
}
/**
@ -233,7 +233,7 @@ public class TeacherYdModel {
*/
public int getNewTeacherTransferEchoCount(String bureau_id) {
String sql = Db.getSql("teacherYd.getNewTeacherTransferEchoCount");
return Db.find(sql, bureau_id).get(0).getInt("c");
return Db.find(sql, bureau_id).getFirst().getInt("c");
}
/**
@ -267,7 +267,7 @@ public class TeacherYdModel {
if (applyRs == null || applyRs.size() == 0) {
return false;
}
Record record = applyRs.get(0);
Record record = applyRs.getFirst();
String source_bureau_id = record.getStr("source_bureau_id");
String target_bureau_id = record.getStr("target_bureau_id");
int status_id = record.getInt("status_id");
@ -305,10 +305,10 @@ public class TeacherYdModel {
if (rs == null || rs.size() == 0) {
return false;
}
String bureau_id = rs.get(0).getStr("bureau_id");
String city_id = rs.get(0).getStr("city_id");
String area_id = rs.get(0).getStr("area_id");
String main_school_id = rs.get(0).getStr("main_school_id");
String bureau_id = rs.getFirst().getStr("bureau_id");
String city_id = rs.getFirst().getStr("city_id");
String area_id = rs.getFirst().getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_id");
//修改到新的单位和部门下
sql = Db.getSql("loginPerson.changePersonBureau");
Db.update(sql, city_id, area_id, main_school_id, bureau_id, org_id, operator, IpUtil.ipToLong(ip_address), person_id);

@ -40,7 +40,7 @@ public class IpUtil {
ipNums.add(Long.parseLong(ipArray[i].trim()));
}
return ipNums.get(0) * 256L * 256L * 256L
return ipNums.getFirst() * 256L * 256L * 256L
+ ipNums.get(1) * 256L * 256L + ipNums.get(2) * 256L
+ ipNums.get(3);
}

@ -13,7 +13,7 @@ public class ExecutorRouteFirst extends ExecutorRouter {
@Override
public ReturnT<String> route(TriggerParam triggerParam, List<String> addressList){
return new ReturnT<String>(addressList.get(0));
return new ReturnT<String>(addressList.getFirst());
}
}

@ -63,7 +63,7 @@ public class ExecutorRouteLFU extends ExecutorRouter {
}
});
Map.Entry<String, Integer> addressItem = lfuItemList.get(0);
Map.Entry<String, Integer> addressItem = lfuItemList.getFirst();
String minAddress = addressItem.getKey();
addressItem.setValue(addressItem.getValue() + 1);

@ -170,7 +170,7 @@ public class JobTrigger {
if (index < group.getRegistryList().size()) {
address = group.getRegistryList().get(index);
} else {
address = group.getRegistryList().get(0);
address = group.getRegistryList().getFirst();
}
} else {
routeAddressResult = executorRouteStrategyEnum.getRouter().route(triggerParam, group.getRegistryList());

@ -285,7 +285,7 @@ public class DataxJsonHelper implements DataxJsonInterface {
}
dataxHbasePojo.setColumns(columns);
dataxHbasePojo.setReaderHbaseConfig(readerDatasource.getZkAdress());
String readerTable=!CollectionUtils.isEmpty(readerTables)?readerTables.get(0):Constants.STRING_BLANK;
String readerTable=!CollectionUtils.isEmpty(readerTables)?readerTables.getFirst():Constants.STRING_BLANK;
dataxHbasePojo.setReaderTable(readerTable);
dataxHbasePojo.setReaderMode(hbaseReaderDto.getReaderMode());
dataxHbasePojo.setReaderRange(hbaseReaderDto.getReaderRange());
@ -301,7 +301,7 @@ public class DataxJsonHelper implements DataxJsonInterface {
dataxMongoDBPojo.setColumns(columns);
dataxMongoDBPojo.setAddress(readerDatasource.getJdbcUrl());
dataxMongoDBPojo.setDbName(readerDatasource.getDatabaseName());
dataxMongoDBPojo.setReaderTable(readerTables.get(0));
dataxMongoDBPojo.setReaderTable(readerTables.getFirst());
return readerPlugin.buildMongoDB(dataxMongoDBPojo);
}
@ -352,7 +352,7 @@ public class DataxJsonHelper implements DataxJsonInterface {
}
dataxHbasePojo.setColumns(columns);
dataxHbasePojo.setWriterHbaseConfig(writerDatasource.getZkAdress());
String writerTable=!CollectionUtils.isEmpty(writerTables)?writerTables.get(0):Constants.STRING_BLANK;
String writerTable=!CollectionUtils.isEmpty(writerTables)?writerTables.getFirst():Constants.STRING_BLANK;
dataxHbasePojo.setWriterTable(writerTable);
dataxHbasePojo.setWriterVersionColumn(hbaseWriterDto.getWriterVersionColumn());
dataxHbasePojo.setWriterRowkeyColumn(hbaseWriterDto.getWriterRowkeyColumn());
@ -370,7 +370,7 @@ public class DataxJsonHelper implements DataxJsonInterface {
dataxMongoDBPojo.setColumns(columns);
dataxMongoDBPojo.setAddress(writerDatasource.getJdbcUrl());
dataxMongoDBPojo.setDbName(writerDatasource.getDatabaseName());
dataxMongoDBPojo.setWriterTable(readerTables.get(0));
dataxMongoDBPojo.setWriterTable(readerTables.getFirst());
dataxMongoDBPojo.setUpsertInfo(mongoDBWriterDto.getUpsertInfo());
return writerPlugin.buildMongoDB(dataxMongoDBPojo);
}

@ -120,9 +120,9 @@ public abstract class BaseQueryTool implements QueryToolInterface {
TableInfo tableInfo = new TableInfo();
//表名,注释
List tValues = new ArrayList(tableInfos.get(0).values());
List tValues = new ArrayList(tableInfos.getFirst().values());
tableInfo.setName(StrUtil.toString(tValues.get(0)));
tableInfo.setName(StrUtil.toString(tValues.getFirst()));
tableInfo.setComment(StrUtil.toString(tValues.get(1)));
@ -281,7 +281,7 @@ public abstract class BaseQueryTool implements QueryToolInterface {
try {
List<Map<String, Object>> pkColumns = JdbcUtils.executeQuery(connection, sqlQueryPrimaryKey, ImmutableList.of(currentSchema, tableName));
//返回主键名称即可
pkColumns.forEach(e -> res.add((String) new ArrayList<>(e.values()).get(0)));
pkColumns.forEach(e -> res.add((String) new ArrayList<>(e.values()).getFirst()));
} catch (SQLException e) {
logger.error("[getPrimaryKeys Exception] --> "
+ "the exception message is:" + e.getMessage());

@ -58,7 +58,7 @@ public class JwtTokenUtils {
public static Integer getUserId(String token) {
String s= JSON.toJSONString(getTokenBody(token).getSubject());
List<String> userInfo = Arrays.asList(getTokenBody(token).getSubject().split(SPLIT_COMMA));
return Integer.parseInt(userInfo.get(0));
return Integer.parseInt(userInfo.getFirst());
}
// 获取用户角色

@ -111,7 +111,7 @@ public class BuildCommand {
}
private static String buildPartition(List<String> partitionInfo) {
String field = partitionInfo.get(0);
String field = partitionInfo.getFirst();
int timeOffset = Integer.parseInt(partitionInfo.get(1));
String timeFormat = partitionInfo.get(2);
String partitionTime = DateUtil.format(DateUtil.addDays(new Date(), timeOffset), timeFormat);

@ -60,7 +60,7 @@ public class XxlRpcLoadBalanceLFUStrategy extends XxlRpcLoadBalance {
}
});
Map.Entry<String, Integer> addressItem = lfuItemList.get(0);
Map.Entry<String, Integer> addressItem = lfuItemList.getFirst();
String minAddress = addressItem.getKey();
addressItem.setValue(addressItem.getValue() + 1);

@ -99,7 +99,7 @@ public class BasicJson {
Class list_field_RealType = (Class<?>)((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
if (FieldReflectionUtil.validBaseType(list_field_RealType)) {
// List<Base
if (list_field_RealType != fieldValueList.get(0).getClass()) {
if (list_field_RealType != fieldValueList.getFirst().getClass()) {
List<Object> list_newItemList = new ArrayList<>();
for (Object list_oldItem: fieldValueList) {
@ -139,7 +139,7 @@ public class BasicJson {
if (listObject.size() == 0) {
return new ArrayList<>();
}
if (listObject.get(0).getClass() != LinkedHashMap.class) {
if (listObject.getFirst().getClass() != LinkedHashMap.class) {
throw new IllegalArgumentException("Cannot parse JSON, custom class must match LinkedHashMap");
}
// parse business class

@ -187,7 +187,7 @@ public class RouterHandler extends Handler {
return;
}
Request request = buildFileUploadRequest(files.get(0), forwardUrl);
Request request = buildFileUploadRequest(files.getFirst(), forwardUrl);
executeRequest(request, res);
isHandled[0] = true;
} catch (Exception e) {

@ -40,7 +40,7 @@ public class IpUtil
for (int i = 0; i < 4; ++i) {
ipNums.add(Long.valueOf(Long.parseLong(ipArray[i].trim())));
}
long ZhongIPNumTotal = ((Long) ipNums.get(0)).longValue() * 256L * 256L * 256L
long ZhongIPNumTotal = ((Long) ipNums.getFirst()).longValue() * 256L * 256L * 256L
+ ((Long) ipNums.get(1)).longValue() * 256L * 256L + ((Long) ipNums.get(2)).longValue() * 256L
+ ((Long) ipNums.get(3)).longValue();

@ -11,7 +11,7 @@ public class IpUtil {
for (int i = 0; i < 4; ++i) {
ipNums.add(Long.parseLong(ipArray[i].trim()));
}
return ipNums.get(0) * 256L * 256L * 256L
return ipNums.getFirst() * 256L * 256L * 256L
+ ipNums.get(1) * 256L * 256L + ipNums.get(2) * 256L
+ ipNums.get(3);
}

@ -38,7 +38,7 @@ public class LoginLogUtil {
record.set("person_id", person_id);
String sql = Db.getSql("login.getPersonInfoByPersonId");
Record personrecord = Db.find(sql, person_id).get(0);
Record personrecord = Db.find(sql, person_id).getFirst();
record.set("person_name", personrecord.getStr("person_name"));
record.set("city_id", personrecord.getStr("city_id"));
record.set("area_id", personrecord.getStr("area_id"));

Loading…
Cancel
Save