main
HuangHai 3 months ago
parent aac61eb9c1
commit 082ff05c62

@ -5,16 +5,4 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/resource" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resource" type="java-resource" />
</content> </content>
</component> </component>
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/dsssoserver/WebRoot/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/dsssoserver/WebRoot" relative="/" />
</webroots>
</configuration>
</facet>
</component>
</module> </module>

@ -56,14 +56,14 @@
<!-- 数据库相关 --> <!-- 数据库相关 -->
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>com.alibaba</groupId>
<artifactId>HikariCP</artifactId> <artifactId>druid</artifactId>
<version>${HikariCP.version}</version> <version>${druid.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>com.mysql</groupId>
<artifactId>postgresql</artifactId> <artifactId>mysql-connector-j</artifactId>
<version>${postgresql.version}</version> <version>${mysql.version}</version>
</dependency> </dependency>
<!-- 工具类库 --> <!-- 工具类库 -->
@ -220,8 +220,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version> <version>3.11.0</version>
<configuration> <configuration>
<source>21</source> <source>8</source>
<target>21</target> <target>8</target>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
<compilerArgument>-parameters</compilerArgument> <compilerArgument>-parameters</compilerArgument>
<compilerArgument>-Xlint:unchecked</compilerArgument> <compilerArgument>-Xlint:unchecked</compilerArgument>

@ -188,7 +188,7 @@ public class BaseModel {
*/ */
public Record getCurrentTerm() { public Record getCurrentTerm() {
String sql = Db.getSql("Base.getCurrentTerm"); String sql = Db.getSql("Base.getCurrentTerm");
return Db.find(sql).getFirst(); return Db.findFirst(sql);
} }
/** /**

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

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

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

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

@ -81,7 +81,7 @@ public class JApiDocsGenerator {
Method[] methods = cls.getDeclaredMethods(); Method[] methods = cls.getDeclaredMethods();
for (Method method : methods) { for (Method method : methods) {
// 检查方法上是否有@Before注解 // 检查方法上是否有@Before注解
var before = method.getAnnotation(Before.class); Before before = method.getAnnotation(Before.class);
if (before != null) { if (before != null) {
String httpType = getHttpType(before); String httpType = getHttpType(before);
res.put(cls.getSimpleName() + "." + method.getName(), httpType); res.put(cls.getSimpleName() + "." + method.getName(), httpType);

@ -65,7 +65,7 @@ public class LoginPersonModel {
String sql = Db.getSql("loginPerson.getLoginInfoByPersonId"); String sql = Db.getSql("loginPerson.getLoginInfoByPersonId");
List<Record> list = Db.find(sql, personId); List<Record> list = Db.find(sql, personId);
if (!list.isEmpty()) { if (!list.isEmpty()) {
return list.getFirst(); return list.get(0);
} else { } else {
return null; return null;
} }

@ -13,6 +13,7 @@ import com.jfinal.core.Controller;
import com.jfinal.ext.interceptor.GET; import com.jfinal.ext.interceptor.GET;
import com.jfinal.ext.interceptor.POST; import com.jfinal.ext.interceptor.POST;
import com.jfinal.kit.Kv; import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record; import com.jfinal.plugin.activerecord.Record;
import java.util.HashMap; import java.util.HashMap;
@ -74,7 +75,7 @@ public class MenuController extends Controller {
String person_id = rPerson.getStr("person_id"); String person_id = rPerson.getStr("person_id");
//获取单位管理员菜单 //获取单位管理员菜单
if (identity_id < 5) { //1,2,3,4 if (identity_id < 5) { //1,2,3,4
var list = model.selectBureauMenuByPersonId(identity_id, person_id).getList(); List<Record> list = model.selectBureauMenuByPersonId(identity_id, person_id).getList();
renderJson(MenuUtil.convertListToMenuForTreeTable(list).getChildren().get(0).getChildren()); renderJson(MenuUtil.convertListToMenuForTreeTable(list).getChildren().get(0).getChildren());
return; return;
} }
@ -100,7 +101,7 @@ public class MenuController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "无法获取指定ID的信息")); renderJson(CommonUtil.returnMessageJson(false, "无法获取指定ID的信息"));
return; return;
} }
Record record = list.getFirst(); Record record = list.get(0);
int duties_id; int duties_id;
int level_id = record.getInt("level"); int level_id = record.getInt("level");
if (level_id == 4) { if (level_id == 4) {

@ -84,7 +84,7 @@ public class OrganizationController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "parent_org_id参数不正确!")); renderJson(CommonUtil.returnMessageJson(false, "parent_org_id参数不正确!"));
return; return;
} }
String city_id = rs.getFirst().getStr("city_id"); String city_id = rs.get(0).getStr("city_id");
int cityOrarea; int cityOrarea;
if (parent_org_id.equals(city_id)) { if (parent_org_id.equals(city_id)) {
cityOrarea = 1; cityOrarea = 1;
@ -96,8 +96,8 @@ public class OrganizationController extends Controller {
renderJson(CommonUtil.returnMessageJson(false, "school_type_id参数不正确!")); renderJson(CommonUtil.returnMessageJson(false, "school_type_id参数不正确!"));
return; return;
} }
int shi_org_type = r.getFirst().getInt("shi_org_type"); int shi_org_type = r.get(0).getInt("shi_org_type");
int area_org_type = r.getFirst().getInt("area_org_type"); int area_org_type = r.get(0).getInt("area_org_type");
if (cityOrarea == 1) { if (cityOrarea == 1) {
org_type_id = shi_org_type; org_type_id = shi_org_type;
} else { } else {

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

@ -32,7 +32,7 @@ public class StudentModel {
if (rs == null || rs.isEmpty()) { if (rs == null || rs.isEmpty()) {
return false; return false;
} }
int stage_id = rs.getFirst().getInt("stage_id"); int stage_id = rs.get(0).getInt("stage_id");
// 生成6位随机明文密码 // 生成6位随机明文密码
String originalPwd = CommonUtil.getSixRandom(); String originalPwd = CommonUtil.getSixRandom();

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

@ -37,7 +37,7 @@ public class StudentYdModel {
public boolean updateStudentStatus(String person_id, String status_code, String operator, String ip_address) { 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); List<Record> rs = get_dm_status_student_by_code(status_code);
if (rs != null && !rs.isEmpty()) { if (rs != null && !rs.isEmpty()) {
int change_person_b_use = rs.getFirst().getInt("change_person_b_use"); int change_person_b_use = rs.get(0).getInt("change_person_b_use");
//修改人员主表 //修改人员主表
String sql = Db.getSql("studentYd.updateStudentStatus"); String sql = Db.getSql("studentYd.updateStudentStatus");
//update t_sys_loginperson set b_use=?,status_code=?,operator=?,ip_address=? where person_id=? //update t_sys_loginperson set b_use=?,status_code=?,operator=?,ip_address=? where person_id=?
@ -174,7 +174,7 @@ public class StudentYdModel {
if (records == null || records.size() == 0) { if (records == null || records.size() == 0) {
return false; return false;
} }
Record record = records.getFirst(); Record record = records.get(0);
String person_id = record.getStr("person_id"); String person_id = record.getStr("person_id");
String target_bureau_id = record.getStr("target_bureau_id"); String target_bureau_id = record.getStr("target_bureau_id");
record.set("status_id", status_id); record.set("status_id", status_id);
@ -193,9 +193,9 @@ public class StudentYdModel {
if (rs == null || rs.isEmpty()) { if (rs == null || rs.isEmpty()) {
return false; return false;
} }
String city_id = rs.getFirst().getStr("city_id"); String city_id = rs.get(0).getStr("city_id");
String area_id = rs.getFirst().getStr("area_id"); String area_id = rs.get(0).getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_id"); String main_school_id = rs.get(0).getStr("main_school_id");
//修改到新的单位和部门下 //修改到新的单位和部门下
sql = Db.getSql("loginPerson.changePersonClass"); 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); 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); Db.update(sql, operator, IpUtil.ipToLong(ip_address), id);
//修改为正常状态 //修改为正常状态
List<Record> records = getStudentTransferInfoById(id); List<Record> records = getStudentTransferInfoById(id);
updateStudentStatus(records.getFirst().getStr("person_id"), "01", operator, ip_address); updateStudentStatus(records.get(0).getStr("person_id"), "01", operator, ip_address);
} }
/** /**
@ -225,7 +225,7 @@ public class StudentYdModel {
*/ */
public int getNewStudentTransferApplyCount(String bureau_id) { public int getNewStudentTransferApplyCount(String bureau_id) {
String sql = Db.getSql("studentYd.getNewStudentTransferApplyCount"); String sql = Db.getSql("studentYd.getNewStudentTransferApplyCount");
return Db.find(sql, bureau_id).getFirst().getInt("c"); return Db.find(sql, bureau_id).get(0).getInt("c");
} }
/** /**
@ -235,7 +235,7 @@ public class StudentYdModel {
*/ */
public int getNewStudentTransferEchoCount(String bureau_id) { public int getNewStudentTransferEchoCount(String bureau_id) {
String sql = Db.getSql("studentYd.getNewStudentTransferEchoCount"); String sql = Db.getSql("studentYd.getNewStudentTransferEchoCount");
return Db.find(sql, bureau_id).getFirst().getInt("c"); return Db.find(sql, bureau_id).get(0).getInt("c");
} }
/** /**
@ -268,7 +268,7 @@ public class StudentYdModel {
if (applyRs == null || applyRs.isEmpty()) { if (applyRs == null || applyRs.isEmpty()) {
return false; return false;
} }
Record record = applyRs.getFirst(); Record record = applyRs.get(0);
String source_bureau_id = record.getStr("source_bureau_id"); String source_bureau_id = record.getStr("source_bureau_id");
String target_bureau_id = record.getStr("target_bureau_id"); String target_bureau_id = record.getStr("target_bureau_id");
int status_id = record.getInt("status_id"); int status_id = record.getInt("status_id");
@ -300,9 +300,9 @@ public class StudentYdModel {
if (rs == null || rs.isEmpty()) { if (rs == null || rs.isEmpty()) {
return false; return false;
} }
String city_id = rs.getFirst().getStr("city_id"); String city_id = rs.get(0).getStr("city_id");
String area_id = rs.getFirst().getStr("area_id"); String area_id = rs.get(0).getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_id"); String main_school_id = rs.get(0).getStr("main_school_id");
//修改到新的单位和班级下 //修改到新的单位和班级下
sql = Db.getSql("loginPerson.changePersonClass"); 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); 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()) { if (rs == null || rs.isEmpty()) {
return false; return false;
} }
String parent_id = rs.getFirst().getStr("person_id"); String parent_id = rs.get(0).getStr("person_id");
//2、变更 //2、变更
sql = Db.getSql("loginPerson.changePersonClass"); 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); 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; return;
} }
//获取部门所在单位ID //获取部门所在单位ID
String bureauId = rs.getFirst().get("bureau_id").toString(); String bureauId = rs.get(0).get("bureau_id").toString();
String cityId = rs.getFirst().get("city_id").toString(); String cityId = rs.get(0).get("city_id").toString();
String areaId = rs.getFirst().get("area_id").toString(); String areaId = rs.get(0).get("area_id").toString();
String mainSchoolId = rs.getFirst().get("main_school_id").toString(); String mainSchoolId = rs.get(0).get("main_school_id").toString();
//生成6位随机明文密码 //生成6位随机明文密码
String originalPwd = CommonUtil.getSixRandom(); String originalPwd = CommonUtil.getSixRandom();
@ -533,7 +533,7 @@ public class TeacherController extends Controller {
renderJson(map); renderJson(map);
return; return;
} }
bureau_id = records.getFirst().getStr("bureau_id"); bureau_id = records.get(0).getStr("bureau_id");
//5、检查EXCEL与数据库中是不是有身份证号重复 //5、检查EXCEL与数据库中是不是有身份证号重复

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

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

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

@ -255,7 +255,7 @@ public class CommonUtil {
public static String getSixRandom() { public static String getSixRandom() {
String sources = "0123456789"; String sources = "0123456789";
Random rand = new Random(); Random rand = new Random();
var flag = new StringBuffer(); StringBuffer flag = new StringBuffer();
for (int j = 0; j < 6; j++) { for (int j = 0; j < 6; j++) {
flag.append(sources.charAt(rand.nextInt(9)) + ""); flag.append(sources.charAt(rand.nextInt(9)) + "");
} }

@ -177,7 +177,7 @@ public class PoiUtil {
} }
String cellValue = ""; String cellValue = "";
switch (cell.getCellType()) { switch (cell.getCellType()) {
case CellType.NUMERIC: // 数字 case NUMERIC: // 数字
short format = cell.getCellStyle().getDataFormat(); short format = cell.getCellStyle().getDataFormat();
if (DateUtil.isCellDateFormatted(cell)) { if (DateUtil.isCellDateFormatted(cell)) {
SimpleDateFormat sdf = null; SimpleDateFormat sdf = null;
@ -210,19 +210,19 @@ public class PoiUtil {
cellValue = bd.toPlainString();// 数值 这种用BigDecimal包装再获取plainString可以防止获取到科学计数值 cellValue = bd.toPlainString();// 数值 这种用BigDecimal包装再获取plainString可以防止获取到科学计数值
} }
break; break;
case CellType.STRING: // 字符串 case STRING: // 字符串
cellValue = cell.getStringCellValue(); cellValue = cell.getStringCellValue();
break; break;
case CellType.BOOLEAN: // Boolean case BOOLEAN: // Boolean
cellValue = cell.getBooleanCellValue() + ""; cellValue = cell.getBooleanCellValue() + "";
break; break;
case CellType.FORMULA: // 公式 case FORMULA: // 公式
cellValue = cell.getCellFormula(); cellValue = cell.getCellFormula();
break; break;
case CellType.BLANK: // 空值 case BLANK: // 空值
cellValue = ""; cellValue = "";
break; break;
case CellType.ERROR: // 故障 case ERROR: // 故障
cellValue = "ERROR VALUE"; cellValue = "ERROR VALUE";
break; break;
default: default:

@ -1,9 +1,9 @@
# 数据库信息 # 数据库信息
postgresql: postgresql:
driverClassName: org.postgresql.Driver driverClassName: com.mysql.cj.jdbc.Driver
user: postgres user: ylt
password: DsideaL147258369 password: Ycharge666
jdbcUrl: jdbc:postgresql://10.10.14.71:5432/dsBase_db?reWriteBatchedInserts=true jdbcUrl: jdbc:mysql://10.10.14.210:22066/base_db?reWriteBatchedInserts=true
# redis # redis
redis: redis:

@ -1,9 +1,9 @@
# 数据库信息 # 数据库信息
postgresql: postgresql:
driverClassName: org.postgresql.Driver driverClassName: com.mysql.cj.jdbc.Driver
user: postgres user: ylt
password: DsideaL147258369 password: Ycharge666
jdbcUrl: jdbc:postgresql://10.10.14.71:5432/dsBase_db?reWriteBatchedInserts=true jdbcUrl: jdbc:mysql://10.10.14.210:22066/base_db?reWriteBatchedInserts=true
# redis # redis
redis: redis:

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

@ -41,14 +41,14 @@
<!-- 数据库相关 --> <!-- 数据库相关 -->
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>com.alibaba</groupId>
<artifactId>HikariCP</artifactId> <artifactId>druid</artifactId>
<version>${HikariCP.version}</version> <version>${druid.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>com.mysql</groupId>
<artifactId>postgresql</artifactId> <artifactId>mysql-connector-j</artifactId>
<version>${postgresql.version}</version> <version>${mysql.version}</version>
</dependency> </dependency>
<!-- 对象存储 --> <!-- 对象存储 -->
@ -220,8 +220,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>21</source> <source>8</source>
<target>21</target> <target>8</target>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
<compilerArgument>-parameters</compilerArgument> <compilerArgument>-parameters</compilerArgument>
</configuration> </configuration>

@ -83,7 +83,7 @@ public class JApiDocsGenerator {
Method[] methods = cls.getDeclaredMethods(); Method[] methods = cls.getDeclaredMethods();
for (Method method : methods) { for (Method method : methods) {
// 检查方法上是否有@Before注解 // 检查方法上是否有@Before注解
var before = method.getAnnotation(Before.class); Before before = method.getAnnotation(Before.class);
if (before != null) { if (before != null) {
String httpType = getHttpType(before); String httpType = getHttpType(before);
res.put(cls.getSimpleName() + "." + method.getName(), httpType); res.put(cls.getSimpleName() + "." + method.getName(), httpType);

@ -10,11 +10,11 @@
<artifactId>dsProject</artifactId> <artifactId>dsProject</artifactId>
<version>1.0</version> <version>1.0</version>
</parent> </parent>
<!--使用jdk21进行编译--> <!--使用jdk8进行编译-->
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
@ -42,13 +42,11 @@
<artifactId>screw-core</artifactId> <artifactId>screw-core</artifactId>
<version>1.0.5</version> <version>1.0.5</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>com.mysql</groupId>
<artifactId>postgresql</artifactId> <artifactId>mysql-connector-j</artifactId>
<version>${postgresql.version}</version> <version>${mysql.version}</version>
</dependency> </dependency>
<!--安装hutool--> <!--安装hutool-->
<dependency> <dependency>
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
@ -146,12 +144,10 @@
<artifactId>freemarker</artifactId> <artifactId>freemarker</artifactId>
<version>2.3.33</version> <version>2.3.33</version>
</dependency> </dependency>
<!--引用光-->
<!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>com.alibaba</groupId>
<artifactId>HikariCP</artifactId> <artifactId>druid</artifactId>
<version>${HikariCP.version}</version> <version>${druid.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

@ -9,10 +9,7 @@ import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.hikaricp.HikariCpPlugin; import com.jfinal.plugin.hikaricp.HikariCpPlugin;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.io.File; import java.io.*;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -286,22 +283,26 @@ public class GenerateCode {
// 设置字符编码 // 设置字符编码
cfg.setDefaultEncoding("UTF-8"); cfg.setDefaultEncoding("UTF-8");
//1、生成Controller层代码 // 1、生成Controller层代码
// 加载模板 try (Writer out = new OutputStreamWriter(
Template template = cfg.getTemplate("Controller.ftl"); new FileOutputStream(codePath + "/" + tableName + "_Controller.txt"),
// 渲染模板到文件 "UTF-8")) { // 显式指定编码
Writer out = new FileWriter(codePath + "/" + tableName + "_Controller.txt", StandardCharsets.UTF_8); Template template = cfg.getTemplate("Controller.ftl");
template.process(dataModel, out); template.process(dataModel, out);
out.close(); System.out.println(dsKit.getCurrentTimeStr() + " 1、Controller层代码生成完毕。");
System.out.println(dsKit.getCurrentTimeStr() + " 1、Controller层代码生成完毕。"); } catch (Exception e) {
throw new RuntimeException("生成Controller层代码失败", e);
}
//2、生成Model层代码 // 2、生成Model层代码
// 加载模板 try (Writer out = new OutputStreamWriter(
template = cfg.getTemplate("Model.ftl"); new FileOutputStream(codePath + "/" + tableName + "_Model.txt"),
// 渲染模板到文件 "UTF-8")) { // 显式指定编码
out = new FileWriter(codePath + "/" + tableName + "_Model.txt", StandardCharsets.UTF_8); Template template = cfg.getTemplate("Model.ftl");
template.process(dataModel, out); template.process(dataModel, out);
out.close(); System.out.println(dsKit.getCurrentTimeStr() + " 2、Model层代码生成完毕。");
System.out.println(dsKit.getCurrentTimeStr() + " 2、Model层代码生成完毕。"); } catch (Exception e) {
throw new RuntimeException("生成Model层代码失败", e);
}
} }
} }

@ -32,8 +32,8 @@
<!-- 项目基础配置 --> <!-- 项目基础配置 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
<!-- Maven插件版本 --> <!-- Maven插件版本 -->
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
@ -46,8 +46,8 @@
<jfinal-cos.version>2022.2</jfinal-cos.version> <jfinal-cos.version>2022.2</jfinal-cos.version>
<!-- 数据库相关 --> <!-- 数据库相关 -->
<HikariCP.version>6.3.0</HikariCP.version> <druid.version>1.2.24</druid.version>
<postgresql.version>42.7.5</postgresql.version> <mysql.version>9.3.0</mysql.version>
<screw.version>1.0.5</screw.version> <screw.version>1.0.5</screw.version>
<!-- 缓存相关 --> <!-- 缓存相关 -->

Loading…
Cancel
Save