kgdxpr 1 year ago
commit ef27246f1e

@ -80,11 +80,11 @@ public class OrganizationController extends Controller {
if (school_type_id > 0) {
DmModel dmModel = new DmModel();
List<Record> rs = dmModel.getAreaById(parent_org_id);
if (rs == null || rs.size() == 0) {
if (rs == null || rs.isEmpty()) {
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;
@ -92,12 +92,12 @@ public class OrganizationController extends Controller {
cityOrarea = 2;
}
List<Record> r = dmModel.convertSchoolTypeToOrgType(school_type_id);
if (r == null || rs.size() == 0) {
if (r == null || rs.isEmpty()) {
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 {
@ -130,7 +130,7 @@ public class OrganizationController extends Controller {
@IsSysAdminInterface({"1", "2", "3"}) //是不是123号管理员
//是不是有权限操作这个单位或区域下的数据?
@LengthInterface({"bureau_name,2,64"})
public void updateBureau(String bureau_id, String org_code, String bureau_name, String parent_org_id, int sort_id, String main_school_id, int property_id,int is_virtual) {
public void updateBureau(String bureau_id, String org_code, String bureau_name, String parent_org_id, int sort_id, String main_school_id, int property_id,int is_virtual,String city_id,String area_id) {
if (model.getOrgCodeCountExceptSelf(bureau_id, org_code) > 0) {
renderJson(CommonUtil.returnMessageJson(false, "此单位代码已存在,不能添加!"));
return;
@ -139,7 +139,7 @@ public class OrganizationController extends Controller {
String operator = SessionKit.get(getRequest(), getResponse(), "person_id");
//客户端ip_address
String ip_address = IpUtil.getIpAddr(getRequest());
model.updateBureau(bureau_id, org_code, bureau_name, parent_org_id, sort_id, main_school_id, property_id, operator, ip_address,is_virtual);
model.updateBureau(bureau_id, org_code, bureau_name, parent_org_id, sort_id, main_school_id, property_id, operator, ip_address,is_virtual,city_id,area_id);
renderJson(CommonUtil.returnMessageJson(true, "修改成功!"));
}

@ -11,8 +11,6 @@ import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.activerecord.SqlPara;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -39,21 +37,16 @@ public class OrganizationModel {
* @return
*/
public Map getCityAreaMainSchoolByBureauId(String bureau_id) {
try {
HashMap<String,Object> resMap = new HashMap<>();
String sql = Db.getSql("organization.getOrgInfoById");
List<Record> list = Db.find(sql, bureau_id);
if (list.size() > 0) {
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"));
return resMap;
} else {
return null;
}
} catch (Exception e) {
e.printStackTrace();
HashMap<String, Object> resMap = new HashMap<>();
String sql = Db.getSql("organization.getOrgInfoById");
List<Record> list = Db.find(sql, bureau_id);
if (!list.isEmpty()) {
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;
}
}
@ -71,7 +64,7 @@ public class OrganizationModel {
Map<String, String> map = new HashMap<>();
String sql = Db.getSql("dm.getAreaById");
List<Record> records = Db.find(sql, id);
if (records.size() == 0) {
if (records.isEmpty()) {
map.put("city_id", NullGuid);
map.put("area_id", NullGuid);
map.put("area_name", "没有找到");
@ -79,23 +72,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;
@ -107,7 +100,7 @@ public class OrganizationModel {
* 2018-11-29
*/
public void addBureau(String org_code, String org_name, String parent_org_id, int org_type_id, int school_type_id, int sort_id, String operator,
String ip_address, String property_id, int level_id,int is_virtual) {
String ip_address, String property_id, int level_id, int is_virtual) {
//默认的身份证号
String NullIdCardCode = "000000000000000000";
String city_id;
@ -146,7 +139,7 @@ public class OrganizationModel {
record.set("property_id", property_id);
record.set("level_id", level_id);
record.set("update_ts", DateTime.now());
record.set("is_virtual",is_virtual);
record.set("is_virtual", is_virtual);
Db.save("t_base_organization", "org_id", record);
//添加登录人员信息(单位管理员)
@ -202,9 +195,9 @@ public class OrganizationModel {
record.set("bureau_id", bureau_id);
record.set("org_pk_num", org_pk_num);
List<Record> rs = getAreaIdByParentId(bureau_id);
if (rs != null && rs.size() > 0) {
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).getStr("area_id");
if (rs != null && !rs.isEmpty()) {
city_id = rs.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
} else {
city_id = "-1";
area_id = "-1";
@ -244,10 +237,10 @@ public class OrganizationModel {
*/
public List<Record> getAreaIdByParentId(String parent_id) {
List<Record> rs = getOrgInfoById(parent_id);
if (rs.size() > 0) {
String bureau_id = rs.get(0).getStr("bureau_id");
if (!rs.isEmpty()) {
String bureau_id = rs.getFirst().getStr("bureau_id");
rs = getOrgInfoById(bureau_id);
if (rs.size() > 0) {
if (!rs.isEmpty()) {
return rs;
} else {
return null;
@ -262,7 +255,8 @@ public class OrganizationModel {
*
* 2018-11-29
*/
public void updateBureau(String org_id, String org_code, String org_name, String parent_org_id, int sort_id, String main_school_id, int property_id, String operator, String ip_address,int is_virtual) {
public void updateBureau(String org_id, String org_code, String org_name, String parent_org_id, int sort_id, String main_school_id, int property_id, String operator, String ip_address, int is_virtual,
String city_id, String area_id) {
Record record = Db.findById("t_base_organization", "org_id", org_id);
record.set("org_id", org_id);
record.set("org_code", org_code);
@ -277,18 +271,20 @@ public class OrganizationModel {
record.set("bureau_id", org_id);
record.set("operator", operator);
record.set("ip_address", IpUtil.ipToLong(ip_address));
if (!StrKit.isBlank(city_id)) record.set("city_id", city_id);
if (!StrKit.isBlank(area_id)) record.set("area_id", area_id);
//获取不可以修改的字段信息
DateTime create_time = DateTime.now();
int b_use = 0;
List<Record> rs = getOrgInfoById(org_id);
if (rs.size() > 0) {
create_time = DateUtil.parse(rs.get(0).getStr("create_time"));
b_use = rs.get(0).getInt("b_use");
if (!rs.isEmpty()) {
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);
record.remove("update_ts");
record.set("is_virtual",is_virtual);
record.set("is_virtual", is_virtual);
Db.update("t_base_organization", "org_id", record);
}
@ -310,9 +306,9 @@ public class OrganizationModel {
String area_id;
List<Record> rs = getAreaIdByParentId(parent_id);
if (rs != null && rs.size() > 0) {
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).getStr("area_id");
if (rs != null && !rs.isEmpty()) {
city_id = rs.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
} else {
city_id = "-1";
area_id = "-1";
@ -326,10 +322,10 @@ public class OrganizationModel {
int b_use = 0;
String bureau_id = null;
rs = getOrgInfoById(org_id);
if (rs.size() > 0) {
bureau_id = rs.get(0).getStr("bureau_id");
create_time = rs.get(0).getStr("create_time");
b_use = rs.get(0).getInt("b_use");
if (!rs.isEmpty()) {
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));
@ -350,7 +346,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");
}
/**
@ -363,7 +359,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");
}
/**
@ -376,7 +372,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");
}
/**
@ -389,7 +385,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");
}
/**
@ -402,7 +398,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");
}
/**
@ -415,7 +411,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");
}
/**
@ -453,7 +449,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");
}
/**
@ -466,7 +462,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");
}
/**
@ -475,15 +471,15 @@ public class OrganizationModel {
* 2018-12-03
*/
public Page<Record> getBureauList(String parent_id, int org_type_id, int page, int limit) {
Page<Record> dataPage;
if (org_type_id == -1) {
SqlPara sp = Db.getSqlPara("organization.getBureauList", parent_id);
Page<Record> dataPage = Db.paginate(page, limit, sp);
return dataPage;
dataPage = Db.paginate(page, limit, sp);
} else {
Page<Record> dataPage = Db.paginate(page, limit,
dataPage = Db.paginate(page, limit,
Db.getSqlPara("organization.getBureauListByBureauType", parent_id, org_type_id));
return dataPage;
}
return dataPage;
}
/**
@ -497,14 +493,14 @@ public class OrganizationModel {
* @return
*/
public Page<Record> getSchoolList(String parent_org_id, int school_type_id, int page, int limit) {
Page<Record> dataPage;
if (school_type_id == -1) {
SqlPara sp = Db.getSqlPara("organization.getSchoolList", parent_org_id);
Page<Record> dataPage = Db.paginate(page, limit, sp);
return dataPage;
dataPage = Db.paginate(page, limit, sp);
} else {
Page<Record> dataPage = Db.paginate(page, limit, Db.getSqlPara("organization.getSchoolListBySchoolType", parent_org_id, school_type_id));
return dataPage;
dataPage = Db.paginate(page, limit, Db.getSqlPara("organization.getSchoolListBySchoolType", parent_org_id, school_type_id));
}
return dataPage;
}
/**
@ -513,8 +509,7 @@ public class OrganizationModel {
* 2018-12-04
*/
public Page<Record> getOrgList(String parent_org_id, int page, int limit) {
Page<Record> dataPage = Db.paginate(page, limit, Db.getSqlPara("organization.getOrgList", parent_org_id));
return dataPage;
return Db.paginate(page, limit, Db.getSqlPara("organization.getOrgList", parent_org_id));
}
/**
@ -539,8 +534,7 @@ public class OrganizationModel {
* @return
*/
public Page<Record> getSchoolListByAreaId(String area_id, String keyword, int page, int limit) {
Page<Record> dataPage = Db.paginate(page, limit, Db.getSqlPara("organization.getSchoolListByAreaId", area_id, area_id, "%" + keyword + "%"));
return dataPage;
return Db.paginate(page, limit, Db.getSqlPara("organization.getSchoolListByAreaId", area_id, area_id, "%" + keyword + "%"));
}
/**
@ -553,8 +547,7 @@ public class OrganizationModel {
* @return
*/
public Page<Record> getBureauListByAreaId(String area_id, String keyword, int page, int limit) {
Page<Record> dataPage = Db.paginate(page, limit, Db.getSqlPara("organization.getBureauListByAreaId", area_id, area_id, "%" + keyword + "%"));
return dataPage;
return Db.paginate(page, limit, Db.getSqlPara("organization.getBureauListByAreaId", area_id, area_id, "%" + keyword + "%"));
}
/**
@ -567,7 +560,6 @@ public class OrganizationModel {
* @return
*/
public Page<Record> getAllListByAreaId(String area_id, String keyword, int page, int limit) {
Page<Record> dataPage = Db.paginate(page, limit, Db.getSqlPara("organization.getAllListByAreaId", area_id, area_id, "%" + keyword + "%"));
return dataPage;
return Db.paginate(page, limit, Db.getSqlPara("organization.getAllListByAreaId", area_id, area_id, "%" + keyword + "%"));
}
}

@ -256,27 +256,27 @@ public class StudentYdController extends Controller {
public void deleteTransferInfoById(int id) {
//1、是登录人员本单位申请的
List<Record> records = ydModel.getStudentTransferInfoById(id);
if (records == null || records.size() == 0) {
if (records == null || records.isEmpty()) {
renderJson(CommonUtil.returnMessageJson(false, "没有找到此学生调动的业务ID!"));
return;
}
String source_bureau_id = records.get(0).getStr("source_bureau_id");
String source_bureau_id = records.getFirst().getStr("source_bureau_id");
String personId = SessionKit.get(getRequest(), getResponse(), "person_id");
String identity_id = SessionKit.get(getRequest(), getResponse(),"identity_id");
LoginPersonModel _loginPersonModel = new LoginPersonModel();
Record obj = _loginPersonModel.getLoginInfoByPersonId(personId);
if (identity_id.equals("4") && !obj.get("bureau_id").equals(source_bureau_id)) {
if (identity_id != null && identity_id.equals("4") && !obj.get("bureau_id").equals(source_bureau_id)) {
renderJson(CommonUtil.returnMessageJson(false, "此ID不是您所在单位范围内的申请ID!"));
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;

@ -172,7 +172,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);
@ -188,12 +188,12 @@ public class StudentYdModel {
if (status_id == 2) {
String sql = Db.getSql("organization.getOrgInfoById");
List<Record> rs = Db.find(sql, target_bureau_id);
if (rs == null || rs.size() == 0) {
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, ip_address, person_id);
@ -213,7 +213,7 @@ public class StudentYdModel {
Db.update(sql, operator, 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);
}
/**
@ -223,7 +223,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");
}
/**
@ -233,7 +233,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");
}
/**
@ -263,10 +263,10 @@ public class StudentYdModel {
//根据id获取source_bureau_id和target_bureau_id
List<Record> applyRs = getStudentTransferInfoById(id);
if (applyRs == null || applyRs.size() == 0) {
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");
@ -295,12 +295,12 @@ public class StudentYdModel {
public boolean changeTransferStudentByAdmin(String person_id, String bureau_id, String class_id, String operator, String ip_address) {
String sql = Db.getSql("organization.getOrgInfoById");
List<Record> rs = Db.find(sql, bureau_id);
if (rs == null || rs.size() == 0) {
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);
@ -308,10 +308,10 @@ public class StudentYdModel {
//1、找到家长ID
sql = Db.getSql("loginPerson.getParentInfoByStudentId");
rs = Db.find(sql, person_id);
if (rs == null || rs.size() == 0) {
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);

@ -120,7 +120,7 @@ public class TeacherController extends Controller {
//客户端ip_address
String ip_address = IpUtil.getIpAddr(getRequest());
_teacherModel.addTeacherInfo(pwd, person_name, org_id, xb, mz, id_card, originalPwd, cityId, areaId, mainSchoolId, bureauId, xl_id, stage_id, subject_id, zc_id, t_teaching_date, sort_id, t_duty_charge, zzmm, operator, ip_address);
_teacherModel.addTeacherInfo(pwd, person_name, org_id, xb, mz, id_card, originalPwd, cityId, areaId, mainSchoolId, bureauId, xl_id, stage_id, subject_id, zc_id, t_teaching_date, sort_id, t_duty_charge, zzmm, operator, ip_address);
resultJson.put("success", true);
renderJson(resultJson);
}
@ -186,7 +186,7 @@ public class TeacherController extends Controller {
public void getTeacherListByBureauIdForExcel(String bureau_id, String person_name) throws URISyntaxException {
Page<Record> dt;
if (person_name == null || person_name == "") {
if (person_name == null || person_name.isEmpty()) {
dt = CommonUtil.ConvertLoginRs(_teacherModel.getTeacherListByBureauId(bureau_id, 1, 10000));
} else {
dt = CommonUtil.ConvertLoginRs(_teacherModel.getTeacherListByPersonNameAndBureauId(bureau_id, person_name, 1, 10000));
@ -196,6 +196,9 @@ public class TeacherController extends Controller {
String filePath = excelPath + "getTeacherListByBureauId.json";
//转成 json对象
JSONObject jo = CommonUtil.getJsonFile(filePath);
BaseModel bm = new BaseModel();
String bureau_name = bm.getOrgInfoById(bureau_id).getStr("org_name");
jo.put("title", bureau_name + "教师登录账号");
//导出
String excelFile = excelPath + "excelTemp/" + UUID.randomUUID().toString().toUpperCase() + ".xls";
ExcelExportUtil.export(dt, jo, excelFile);
@ -226,7 +229,7 @@ public class TeacherController extends Controller {
JSONObject jo = jarray.getJSONObject(i);
String duties_id = jo.getString("duties_id");
if (duties_id != null && !duties_id.equals("-1")) {
if (duties_id != null && !duties_id.equals("-1")) {
BaseModel model = new BaseModel();
String duties_name = model.getOrgTypePrincipalshipById(duties_id).get(0).get("name");
JSONObject targetJo = new JSONObject();

@ -30,12 +30,11 @@ public class TeacherYdController extends Controller {
@IsSysAdminInterface({"1","2","3", "4"})
public void getPersonStatus(String person_id) {
List<Record> rs = model.getPersonStatus(person_id);
if (rs == null || rs.size() == 0) {
if (rs == null || rs.isEmpty()) {
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 {
@ -277,7 +276,7 @@ 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;

@ -35,8 +35,8 @@ public class TeacherYdModel {
*/
public boolean updateTeacherStatus(String person_id, String status_code, String operator, String ip_address) {
List<Record> rs = get_dm_status_teacher_by_code(status_code);
if (rs != null && rs.size() > 0) {
int change_person_b_use = rs.get(0).getInt("change_person_b_use");
if (rs != null && !rs.isEmpty()) {
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, IpUtil.ipToLong(ip_address), person_id);
@ -83,13 +83,13 @@ public class TeacherYdModel {
//人员是不是存在是不是B_USE=1需扩充
String sql = Db.getSql("loginPerson.getLoginInfoByPersonId");
List<Record> rs = Db.find(sql, person_id);
if (rs == null || rs.size() == 0) {
if (rs == null || rs.isEmpty()) {
return false;
}
//开始检查审核流程
sql = Db.getSql("teacherYd.checkAllowTeacherTransferApply");
rs = Db.find(sql, person_id);
if (rs == null || rs.size() == 0) {
if (rs == null || rs.isEmpty()) {
return true;
}
if (rs.get(0).getInt("status_id") == 1) {
@ -169,7 +169,7 @@ public class TeacherYdModel {
*/
public boolean checkTeacherTransfer(int id, int status_id, String echo_message, String org_id, String operator, String ip_address) {
List<Record> records = getTeacherTransferInfoById(id);
if (records == null || records.size() == 0) {
if (records == null || records.isEmpty()) {
return false;
}
Record record = records.get(0);

@ -215,6 +215,7 @@
inner join t_base_org_type_principalship as t2 on t1.org_type_id=t2.id
left join t_dm_schooltype as t3 on t1.school_type_id=t3.school_type_id
where t1.city_id=#para(city_id) and t1.bureau_id=t1.org_id
and t3.b_use=1
and t1.is_virtual=0
and (CASE WHEN t1.third_party_id IS NULL or t1.third_party_id='' THEN 0 ELSE 1 END)=#para(is_match)
order by t2.name,t3.school_type_name desc

@ -218,6 +218,7 @@
where t1.km_code='${km_code}$' and
t2.org_id in ($bureau_ids$)
$blank$
and t4.b_use=1
order by t1.templet_id,t2.org_name
#end
@ -227,6 +228,7 @@
on t1.bureau_id=t3.org_id
inner join t_dm_schooltype as t4 on t3.school_type_id=t4.school_type_id
where
t4.b_use=1 and
t1.bureau_id in ($bureau_ids$)
and t1.year=$year$ and t2.km_code='$km_code$' $blank$) as ta
#end

@ -79,12 +79,12 @@
-- 获取学校类型
#sql("getSchoolType")
select school_type_id,school_type_name from t_dm_schooltype order by school_type_id
select school_type_id,school_type_name from t_dm_schooltype where b_use=1 order by school_type_id
#end
-- 将学校类型换算成组织机构类型
#sql("convertSchoolTypeToOrgType")
select shi_org_type,area_org_type from t_dm_schooltype where school_type_id=? order by shi_org_type
select shi_org_type,area_org_type from t_dm_schooltype where school_type_id=? and b_use=1 order by shi_org_type
#end
-- 通过ID获取区域的信息

Loading…
Cancel
Save