main
黄海 1 year ago
parent 5d2d6de7ee
commit 21339919fa

@ -61,9 +61,6 @@
if (r != null) return unescape(r[2]);
return null;
}
</script>
</body>
</html>

@ -69,7 +69,7 @@
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 100px !important;">是否为虚拟单位</label>
<label class="layui-form-label" style="width: 100px !important;">虚拟单位</label>
<div class="layui-input-block">
<input type="checkbox" id="virtual">
</div>

@ -68,7 +68,7 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 100px !important;">是否为虚拟单位</label>
<label class="layui-form-label" style="width: 100px !important;">虚拟单位</label>
<div class="layui-input-block">
<input type="checkbox" id="virtual">
</div>

@ -1789,163 +1789,6 @@ public class CollectController extends Controller {
/*****↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/** 以下接口,用于发布到人员的任务,获取选择单位内部门、班级、人员、年级等功能,为了以后与天喻对接,全新实现,方便以后调整*/
/**
*
*
* @param username
* @param password
*/
@Before({POST.class, RepeatIntercetpor.class})
public void doFillLogin(String username, String password) {
JSONObject resultJson = new JSONObject();
String checkCodeKey = "";
if (StrKit.isBlank(username)) {
resultJson.put("success", false);
resultJson.put("msg", "用户名不允许为空!");
renderJson(resultJson);
return;
}
if (StrKit.isBlank(password)) {
resultJson.put("success", false);
resultJson.put("msg", "密码不允许为空!");
renderJson(resultJson);
return;
}
//检查缓存中此账号错误了几次
String PassWordKey = "WrongPassWord_" + username;
int ErrCnt = 4; //最多允许错几次 4+1
int cntNum = 0; //错几次了
if (RedisKit.Exists(PassWordKey))
cntNum = Integer.parseInt(RedisKit.Get(PassWordKey));
if (cntNum > ErrCnt) {
resultJson.put("success", false);
resultJson.put("msg", "账号被停用5分钟请稍后再试");
renderJson(resultJson);
return;
}
//与前端配合RSA通用加密解密
try {
password = RsaUtils.decryptDataOnJava(password, RsaUtils.PRIVATEKEY);
} catch (Exception err) {
password = "!@#$%^&&*^*&(*)(*_)^%^$%$^%$^%";
}
String passwordEncode = CommonUtil.getLdapPassword(password);
Map loginMap = bm.getLoginInfoByUserName(username);
if (loginMap == null || !passwordEncode.equals(loginMap.get("password").toString())) {
//扩展支持连续输入用户名密码错误停用账号5分钟功能 2022.06.07
cntNum = 1;
if (RedisKit.Exists(PassWordKey))
cntNum = Integer.parseInt(RedisKit.Get(PassWordKey)) + cntNum;
int finalCntNum = cntNum;
RedisKit.incrBy(PassWordKey, finalCntNum);
RedisKit.Expire(PassWordKey, 60 * 5);
if (cntNum > ErrCnt) {
resultJson.put("success", false);
resultJson.put("msg", "密码连续输入" + (ErrCnt + 1) + "次全部错误账号将被停用5分钟");
renderJson(resultJson);
return;
}
if (cntNum == ErrCnt) {
resultJson.put("success", false);
resultJson.put("msg", "用户名或密码连续错误你还有1次机会再次错误后账号将被封掉5分钟");
renderJson(resultJson);
return;
}
resultJson.put("success", false);
resultJson.put("msg", "用户名或密码错误!");
renderJson(resultJson);
return;
}
//去掉限制
RedisKit.Del(PassWordKey);
RedisKit.Del(checkCodeKey);
//防止用户攻击修改Cookie
Map<String, Object> _map = new HashMap<>();
_map.put("person_id", loginMap.get("person_id"));
SessionKit.set(getRequest(), getResponse(), "person_id", loginMap.get("person_id").toString());
resultJson.put("success", true);
resultJson.put("person_id", loginMap.get("person_id").toString());
renderJson(resultJson);
}
/**
*
*
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getSchoolNjList() {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
List<Record> list = cm.getSchoolNjList(bureau_id);
renderJson(CommonUtil.renderJsonForLayUI(list));
}
/**
*
*
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getOrgList(String keyword) {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
List<Record> list = cm.getOrgList(bureau_id, keyword);
renderJson(CommonUtil.renderJsonForLayUI(list));
}
/**
*
*
* @param org_id id
* @param keyword
* @param page
* @param limit
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getOrgPersonList(String org_id, String keyword, int page, int limit) {
Page<Record> list = cm.getOrgPersonList(org_id, keyword, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(list));
}
/**
* +
*
* @param nj_id id
* @param keyword
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getClassList(int nj_id, String keyword, int page, int limit) {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
Page<Record> list = cm.getClassList(bureau_id, nj_id, keyword, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(list));
}
/**
*
*
@ -2094,5 +1937,189 @@ public class CollectController extends Controller {
Page<Record> dataPage = cm.getTyBureauList(keyword, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(dataPage));
}
/**
*
* ++CAS,
*
* @param username
* @param password
*/
@Before({POST.class, RepeatIntercetpor.class})
public void doFillLogin(String username, String password) {
JSONObject resultJson = new JSONObject();
String checkCodeKey = "";
if (StrKit.isBlank(username)) {
resultJson.put("success", false);
resultJson.put("msg", "用户名不允许为空!");
renderJson(resultJson);
return;
}
if (StrKit.isBlank(password)) {
resultJson.put("success", false);
resultJson.put("msg", "密码不允许为空!");
renderJson(resultJson);
return;
}
//检查缓存中此账号错误了几次
String PassWordKey = "WrongPassWord_" + username;
int ErrCnt = 4; //最多允许错几次 4+1
int cntNum = 0; //错几次了
if (RedisKit.Exists(PassWordKey))
cntNum = Integer.parseInt(RedisKit.Get(PassWordKey));
if (cntNum > ErrCnt) {
resultJson.put("success", false);
resultJson.put("msg", "账号被停用5分钟请稍后再试");
renderJson(resultJson);
return;
}
//与前端配合RSA通用加密解密
try {
password = RsaUtils.decryptDataOnJava(password, RsaUtils.PRIVATEKEY);
} catch (Exception err) {
password = "!@#$%^&&*^*&(*)(*_)^%^$%$^%$^%";
}
String passwordEncode = CommonUtil.getLdapPassword(password);
Map loginMap = bm.getLoginInfoByUserName(username);
if (loginMap == null || !passwordEncode.equals(loginMap.get("password").toString())) {
//扩展支持连续输入用户名密码错误停用账号5分钟功能 2022.06.07
cntNum = 1;
if (RedisKit.Exists(PassWordKey))
cntNum = Integer.parseInt(RedisKit.Get(PassWordKey)) + cntNum;
int finalCntNum = cntNum;
RedisKit.incrBy(PassWordKey, finalCntNum);
RedisKit.Expire(PassWordKey, 60 * 5);
if (cntNum > ErrCnt) {
resultJson.put("success", false);
resultJson.put("msg", "密码连续输入" + (ErrCnt + 1) + "次全部错误账号将被停用5分钟");
renderJson(resultJson);
return;
}
if (cntNum == ErrCnt) {
resultJson.put("success", false);
resultJson.put("msg", "用户名或密码连续错误你还有1次机会再次错误后账号将被封掉5分钟");
renderJson(resultJson);
return;
}
resultJson.put("success", false);
resultJson.put("msg", "用户名或密码错误!");
renderJson(resultJson);
return;
}
//去掉限制
RedisKit.Del(PassWordKey);
RedisKit.Del(checkCodeKey);
//防止用户攻击修改Cookie
Map<String, Object> _map = new HashMap<>();
_map.put("person_id", loginMap.get("person_id"));
SessionKit.set(getRequest(), getResponse(), "person_id", loginMap.get("person_id").toString());
resultJson.put("success", true);
resultJson.put("person_id", loginMap.get("person_id").toString());
renderJson(resultJson);
}
/**
* CAS
*/
public void doFillLoginCAS() {
//TODO
}
/**
*
*
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getSchoolNjList() {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
if (cm.THIRD_PARTY_BASE_DATA == 0) {
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
List<Record> list = cm.getSchoolNjList(bureau_id);
renderJson(CommonUtil.renderJsonForLayUI(list));
} else {
//需要重写根据第三方数据表,获取当前登录人员所在学校有哪些年级
//TODO
}
}
/**
*
*
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getOrgList(String keyword) {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
if (cm.THIRD_PARTY_BASE_DATA == 0) {
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
List<Record> list = cm.getOrgList(bureau_id, keyword);
renderJson(CommonUtil.renderJsonForLayUI(list));
} else {
//需要重写根据第三方数据表,获取当前登录人员所在单位的内部组织机构
//TODO
}
}
/**
*
*
* @param org_id id
* @param keyword
* @param page
* @param limit
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getOrgPersonList(String org_id, String keyword, int page, int limit) {
if (cm.THIRD_PARTY_BASE_DATA == 0) {
Page<Record> list = cm.getOrgPersonList(org_id, keyword, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(list));
} else {
//需要重写根据第三方数据表,获取指定部门下有哪些人员
//TODO
}
}
/**
* +
*
* @param nj_id id
* @param keyword
* @return
*/
@Before({GET.class})
@IsLoginInterface({})
public void getClassList(int nj_id, String keyword, int page, int limit) {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
if (cm.THIRD_PARTY_BASE_DATA == 0) {
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
Page<Record> list = cm.getClassList(bureau_id, nj_id, keyword, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(list));
} else {
//需要重写根据第三方数据表,获取指定年级下有哪些班级
//TODO
}
}
}

@ -20,6 +20,7 @@ import com.hankcs.hanlp.tokenizer.StandardTokenizer;
import com.jfinal.aop.Before;
import com.jfinal.ext.interceptor.GET;
import com.jfinal.kit.Kv;
import com.jfinal.kit.PropKit;
import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
@ -41,6 +42,9 @@ import java.util.regex.Pattern;
public class CollectModel {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
//是否对接第三方基础数据
public int THIRD_PARTY_BASE_DATA = PropKit.getInt("third_party_base_data");
/**
*
*/
@ -949,8 +953,13 @@ public class CollectModel {
* @return
*/
public List<Record> getAllTeacher(String bureau_id) {
String sql = "select person_id,person_name from t_sys_loginperson where bureau_id=? and identity_id=5";
return Db.find(sql, bureau_id);
if (THIRD_PARTY_BASE_DATA == 0) {
String sql = "select person_id,person_name from t_sys_loginperson where bureau_id=? and identity_id=5";
return Db.find(sql, bureau_id);
} else {
//TODO
return null;
}
}
/**
@ -960,8 +969,13 @@ public class CollectModel {
* @return
*/
public List<Record> getAllStudent(String bureau_id) {
String sql = "select person_id,person_name from t_sys_loginperson where bureau_id=? and identity_id=6";
return Db.find(sql, bureau_id);
if (THIRD_PARTY_BASE_DATA == 0) {
String sql = "select person_id,person_name from t_sys_loginperson where bureau_id=? and identity_id=6";
return Db.find(sql, bureau_id);
} else {
//TODO
return null;
}
}
/**
@ -972,14 +986,19 @@ public class CollectModel {
* @return
*/
public List<Record> getBanJiStudent(String bureau_id, String classIds) {
List<Record> res = new ArrayList<>();
if (StrKit.isBlank(classIds)) return res;
for (String class_id : classIds.split(",")) {
String sql = "select person_id,person_name from t_sys_loginperson where bureau_id=? and identity_id=6 and s_class_id=?";
List<Record> list = Db.find(sql, bureau_id, class_id);
res.addAll(list);
if (THIRD_PARTY_BASE_DATA == 0) {
List<Record> res = new ArrayList<>();
if (StrKit.isBlank(classIds)) return res;
for (String class_id : classIds.split(",")) {
String sql = "select person_id,person_name from t_sys_loginperson where bureau_id=? and identity_id=6 and s_class_id=?";
List<Record> list = Db.find(sql, bureau_id, class_id);
res.addAll(list);
}
return res;
} else {
//TODO
return null;
}
return res;
}
/**

@ -97,4 +97,7 @@ webHook=https://oapi.dingtalk.com/robot/send?access_token=4cf17e59830115b68c269c
# DingDing的Secret
Secret=SECd1f1038b6958ab37b8ac8fd61e9e154106d72d7d4ef4dd435d10a11ffdf27215
# 日报发布的WEB服务器IP或域名
publishPath=http://10.10.21.20/QingLong/Logs/
publishPath=http://10.10.21.20/QingLong/Logs/
# 数据采集系统是否对接第三方基础数据
third_party_base_data=0
Loading…
Cancel
Save