main
HuangHai 3 months ago
parent aac61eb9c1
commit 082ff05c62

@ -5,16 +5,4 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/resource" type="java-resource" />
</content>
</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>

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

@ -188,7 +188,7 @@ public class BaseModel {
*/
public Record 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();
List<Record> rs = orgModel.getAreaIdByParentId(bureau_id);
if (rs != null && !rs.isEmpty()) {
city_id = rs.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
main_school_id = rs.getFirst().getStr("main_school_id");
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");
} else {
city_id = "-1";
area_id = "-1";

@ -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.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
main_school_id = rs.getFirst().getStr("main_school_id");
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");
} 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.getFirst().getStr("id");
String area_id = records.get(0).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).getFirst();
Record record = Db.find(sql, Integer.parseInt(global_id), globalCode, install_area).get(0);
return record.getInt("c");
}

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

@ -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.getFirst();
return list.get(0);
} else {
return null;
}

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

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

@ -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.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"));
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;
@ -74,23 +74,23 @@ public class OrganizationModel {
map.put("area_code", "");
} 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("area_id", NullGuid);
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"));
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"));
} else//如果是县区
{
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("area_id", id);
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("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"));
}
}
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.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).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.getFirst().getStr("bureau_id");
String bureau_id = rs.get(0).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.getFirst().getStr("create_time"));
b_use = rs.getFirst().getInt("b_use");
create_time = DateUtil.parse(rs.get(0).getStr("create_time"));
b_use = rs.get(0).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.getFirst().getStr("city_id");
area_id = rs.getFirst().getStr("area_id");
city_id = rs.get(0).getStr("city_id");
area_id = rs.get(0).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.getFirst().getStr("bureau_id");
create_time = rs.getFirst().getStr("create_time");
b_use = rs.getFirst().getInt("b_use");
bureau_id = rs.get(0).getStr("bureau_id");
create_time = rs.get(0).getStr("create_time");
b_use = rs.get(0).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).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) {
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) {
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) {
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) {
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) {
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) {
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) {
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()) {
return false;
}
int stage_id = rs.getFirst().getInt("stage_id");
int stage_id = rs.get(0).getInt("stage_id");
// 生成6位随机明文密码
String originalPwd = CommonUtil.getSixRandom();

@ -271,7 +271,7 @@ public class StudentYdController extends Controller {
return;
}
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 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.getFirst().getInt("b_use");
int b_use = records.get(0).getInt("b_use");
if (b_use != 1) {
renderJson(CommonUtil.returnMessageJson(false, "此记录已经是删除状态,不能重复删除!"));
return;
}
//3、是不是对方还没有审核
int status_id = records.getFirst().getInt("status_id");
int status_id = records.get(0).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.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");
//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) {
return false;
}
Record record = records.getFirst();
Record record = records.get(0);
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.getFirst().getStr("city_id");
String area_id = rs.getFirst().getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_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");
//修改到新的单位和部门下
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.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) {
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) {
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()) {
return false;
}
Record record = applyRs.getFirst();
Record record = applyRs.get(0);
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.getFirst().getStr("city_id");
String area_id = rs.getFirst().getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_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");
//修改到新的单位和班级下
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.getFirst().getStr("person_id");
String parent_id = rs.get(0).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.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();
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();
//生成6位随机明文密码
String originalPwd = CommonUtil.getSixRandom();
@ -533,7 +533,7 @@ public class TeacherController extends Controller {
renderJson(map);
return;
}
bureau_id = records.getFirst().getStr("bureau_id");
bureau_id = records.get(0).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.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");
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");
Record record = list.getFirst();
Record record = list.get(0);
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.getFirst().getInt("c");
int c = rs.get(0).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.getFirst().getStr("source_bureau_id");
String source_bureau_id = records.get(0).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.getFirst().getInt("b_use");
int b_use = records.get(0).getInt("b_use");
if (b_use != 1) {
renderJson(CommonUtil.returnMessageJson(false, "此记录已经是删除状态,不能重复删除!"));
return;
}
//3、是不是对方还没有审核
int status_id = records.getFirst().getInt("status_id");
int status_id = records.get(0).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.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");
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()) {
return false;
}
Record record = records.getFirst();
Record record = records.get(0);
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.getFirst().getStr("city_id");
String area_id = rs.getFirst().getStr("area_id");
String main_school_id = rs.getFirst().getStr("main_school_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");
//修改到新的单位和部门下
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.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() {
String sources = "0123456789";
Random rand = new Random();
var flag = new StringBuffer();
StringBuffer flag = new StringBuffer();
for (int j = 0; j < 6; j++) {
flag.append(sources.charAt(rand.nextInt(9)) + "");
}

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

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

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

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

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

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

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

@ -9,10 +9,7 @@ import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.hikaricp.HikariCpPlugin;
import javax.sql.DataSource;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.sql.Connection;
import java.sql.ResultSet;
@ -286,22 +283,26 @@ public class GenerateCode {
// 设置字符编码
cfg.setDefaultEncoding("UTF-8");
//1、生成Controller层代码
// 加载模板
Template template = cfg.getTemplate("Controller.ftl");
// 渲染模板到文件
Writer out = new FileWriter(codePath + "/" + tableName + "_Controller.txt", StandardCharsets.UTF_8);
template.process(dataModel, out);
out.close();
System.out.println(dsKit.getCurrentTimeStr() + " 1、Controller层代码生成完毕。");
// 1、生成Controller层代码
try (Writer out = new OutputStreamWriter(
new FileOutputStream(codePath + "/" + tableName + "_Controller.txt"),
"UTF-8")) { // 显式指定编码
Template template = cfg.getTemplate("Controller.ftl");
template.process(dataModel, out);
System.out.println(dsKit.getCurrentTimeStr() + " 1、Controller层代码生成完毕。");
} catch (Exception e) {
throw new RuntimeException("生成Controller层代码失败", e);
}
//2、生成Model层代码
// 加载模板
template = cfg.getTemplate("Model.ftl");
// 渲染模板到文件
out = new FileWriter(codePath + "/" + tableName + "_Model.txt", StandardCharsets.UTF_8);
template.process(dataModel, out);
out.close();
System.out.println(dsKit.getCurrentTimeStr() + " 2、Model层代码生成完毕。");
// 2、生成Model层代码
try (Writer out = new OutputStreamWriter(
new FileOutputStream(codePath + "/" + tableName + "_Model.txt"),
"UTF-8")) { // 显式指定编码
Template template = cfg.getTemplate("Model.ftl");
template.process(dataModel, out);
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.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<!-- Maven插件版本 -->
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
@ -46,8 +46,8 @@
<jfinal-cos.version>2022.2</jfinal-cos.version>
<!-- 数据库相关 -->
<HikariCP.version>6.3.0</HikariCP.version>
<postgresql.version>42.7.5</postgresql.version>
<druid.version>1.2.24</druid.version>
<mysql.version>9.3.0</mysql.version>
<screw.version>1.0.5</screw.version>
<!-- 缓存相关 -->

Loading…
Cancel
Save