main
黄海 2 years 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,9 +1789,158 @@ public class CollectController extends Controller {
/*****↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/** 以下接口,用于发布到人员的任务,获取选择单位内部门、班级、人员、年级等功能,为了以后与天喻对接,全新实现,方便以后调整*/
/**
*
*
* @param job_id
* @param json
*/
@Before({POST.class, RepeatIntercetpor.class})
@IsLoginInterface({})
@IsNumericInterface({"job_id", "status_code"})
@EmptyInterface({"json"})
public void saveFormJob(int job_id, int status_code, String json) {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
//检查form表单录入的text域是不是符合输入要求不符合的进行提示
Record rJob = cm.getJob(job_id);
String form_jsonStr = rJob.getStr("form_json");
//读取原来的结构,根据原来结构的类型进行判断,获取现在需要用什么样的读取方式
JSONArray ja = cm.parseGridJson(form_jsonStr);
Map<String, Integer> _map = new HashMap<>();
Map<String, String> _mapLabel = new HashMap<>();
for (int i = 0; i < ja.size(); i++) {
JSONObject j2 = ja.getJSONObject(i);
int data_type_id = DataType.getFormDataType(j2);
_map.put(j2.getString("id"), data_type_id);//哪个字段是什么类型
if (j2.getString("tag").equals("input")) {
_mapLabel.put(j2.getString("id"), j2.getString("label"));
}
}
//开始检查
JSONObject jo = JSONObject.parseObject(json);
for (Map.Entry<String, Object> entry : jo.entrySet()) {
String key = entry.getKey();
int data_type_id = _map.get(key);
String value = entry.getValue().toString();
switch (data_type_id) {
case 0:
continue;
case 1://文本
break;
case 2://数字
if (!CommonUtil.isNumeric(value)) {
Map<String, Object> map = new HashMap<>();
map.put("success", false);
map.put("message", _mapLabel.get(key) + "中输入的数据与要求的整数格式不一致,请重新输入!");
renderJson(map);
return;
}
break;
case 3://小数
if (!CommonUtil.isDecimal(value)) {
Map<String, Object> map = new HashMap<>();
map.put("success", false);
map.put("message", _mapLabel.get(key) + "中输入的数据与要求的小数格式不一致,请重新输入!");
renderJson(map);
return;
}
break;
case 4: //日期
if (!CommonUtil.isDate(value)) {
Map<String, Object> map = new HashMap<>();
map.put("success", false);
map.put("message", _mapLabel.get(key) + "中输入的数据与要求的日期格式不一致,请重新输入!");
renderJson(map);
return;
}
break;
default:
break;
}
}
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
String person_name = rs.getStr("person_name");//人员姓名
String bureau_name = bm.getOrgInfoById(bureau_id).getStr("org_name");//单位名称
String s_class_id = rs.getStr("s_class_id");
cm.saveFormJob(job_id, status_code, bureau_id, bureau_name, s_class_id, person_id, person_name, json);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
map.put("job_id", job_id);
renderJson(map);
}
/**
*
*
* http://10.10.21.20:9000/QingLong/collect/getAllBureau?is_match=1&page=1&limit=20
*/
@Before({GET.class, RepeatIntercetpor.class})
@IsNumericInterface({"is_match", "page", "limit"})
public void getAllBureau(int is_match, int page, int limit) {
int cnt = cm.OneKeyMatch();
Page<Record> dataPage = cm.getAllBureau(is_match, page, limit);
Map<String, Object> result = new HashMap<>();
result.put("code", 0);
result.put("msg", "");
result.put("cnt", cnt);//本次成功同步的单位个数
result.put("count", dataPage.getTotalRow());
result.put("data", dataPage.getList());
renderJson(result);
}
/**
* ID
*
* @throws InterruptedException
*/
@Before({GET.class, RepeatIntercetpor.class})
@EmptyInterface({"third_party_id", "org_id"})
public void matchBureau(String org_id, String third_party_id) {
cm.matchBureau(org_id, third_party_id);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
/**
* ID
*
* @throws InterruptedException
*/
@Before({GET.class, RepeatIntercetpor.class})
@EmptyInterface({"third_party_id", "org_id"})
public void disMatchBureau(String org_id) {
cm.disMatchBureau(org_id);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
/**
*
*
* @param keyword
*/
@Before({GET.class})
@IsLoginInterface({})
@IsNumericInterface({"page", "limit"})
public void getTyBureauList(String keyword, int page, int limit) {
Page<Record> dataPage = cm.getTyBureauList(keyword, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(dataPage));
}
/**
*
* ++CAS,
*
* @param username
* @param password
@ -1874,6 +2023,13 @@ public class CollectController extends Controller {
renderJson(resultJson);
}
/**
* CAS
*/
public void doFillLoginCAS() {
//TODO
}
/**
*
*
@ -1884,12 +2040,17 @@ public class CollectController extends Controller {
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
}
}
/**
@ -1902,12 +2063,17 @@ public class CollectController extends Controller {
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
}
}
/**
@ -1922,8 +2088,13 @@ public class CollectController extends Controller {
@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
}
}
/**
@ -1938,161 +2109,17 @@ public class CollectController extends Controller {
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
}
/**
*
*
* @param job_id
* @param json
*/
@Before({POST.class, RepeatIntercetpor.class})
@IsLoginInterface({})
@IsNumericInterface({"job_id", "status_code"})
@EmptyInterface({"json"})
public void saveFormJob(int job_id, int status_code, String json) {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
//检查form表单录入的text域是不是符合输入要求不符合的进行提示
Record rJob = cm.getJob(job_id);
String form_jsonStr = rJob.getStr("form_json");
//读取原来的结构,根据原来结构的类型进行判断,获取现在需要用什么样的读取方式
JSONArray ja = cm.parseGridJson(form_jsonStr);
Map<String, Integer> _map = new HashMap<>();
Map<String, String> _mapLabel = new HashMap<>();
for (int i = 0; i < ja.size(); i++) {
JSONObject j2 = ja.getJSONObject(i);
int data_type_id = DataType.getFormDataType(j2);
_map.put(j2.getString("id"), data_type_id);//哪个字段是什么类型
if (j2.getString("tag").equals("input")) {
_mapLabel.put(j2.getString("id"), j2.getString("label"));
}
}
//开始检查
JSONObject jo = JSONObject.parseObject(json);
for (Map.Entry<String, Object> entry : jo.entrySet()) {
String key = entry.getKey();
int data_type_id = _map.get(key);
String value = entry.getValue().toString();
switch (data_type_id) {
case 0:
continue;
case 1://文本
break;
case 2://数字
if (!CommonUtil.isNumeric(value)) {
Map<String, Object> map = new HashMap<>();
map.put("success", false);
map.put("message", _mapLabel.get(key) + "中输入的数据与要求的整数格式不一致,请重新输入!");
renderJson(map);
return;
}
break;
case 3://小数
if (!CommonUtil.isDecimal(value)) {
Map<String, Object> map = new HashMap<>();
map.put("success", false);
map.put("message", _mapLabel.get(key) + "中输入的数据与要求的小数格式不一致,请重新输入!");
renderJson(map);
return;
}
break;
case 4: //日期
if (!CommonUtil.isDate(value)) {
Map<String, Object> map = new HashMap<>();
map.put("success", false);
map.put("message", _mapLabel.get(key) + "中输入的数据与要求的日期格式不一致,请重新输入!");
renderJson(map);
return;
}
break;
default:
break;
}
}
//根据人员ID获取人员所在的单位ID
LoginPersonModel personModel = new LoginPersonModel();
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
String person_name = rs.getStr("person_name");//人员姓名
String bureau_name = bm.getOrgInfoById(bureau_id).getStr("org_name");//单位名称
String s_class_id = rs.getStr("s_class_id");
cm.saveFormJob(job_id, status_code, bureau_id, bureau_name, s_class_id, person_id, person_name, json);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
map.put("job_id", job_id);
renderJson(map);
}
/**
*
* http://10.10.21.20:9000/QingLong/collect/getAllBureau?is_match=1&page=1&limit=20
*/
@Before({GET.class, RepeatIntercetpor.class})
@IsNumericInterface({"is_match", "page", "limit"})
public void getAllBureau(int is_match, int page, int limit) {
int cnt = cm.OneKeyMatch();
Page<Record> dataPage = cm.getAllBureau(is_match, page, limit);
Map<String, Object> result = new HashMap<>();
result.put("code", 0);
result.put("msg", "");
result.put("cnt", cnt);//本次成功同步的单位个数
result.put("count", dataPage.getTotalRow());
result.put("data", dataPage.getList());
renderJson(result);
}
/**
* ID
*
* @throws InterruptedException
*/
@Before({GET.class, RepeatIntercetpor.class})
@EmptyInterface({"third_party_id", "org_id"})
public void matchBureau(String org_id, String third_party_id) {
cm.matchBureau(org_id, third_party_id);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
/**
* ID
*
* @throws InterruptedException
*/
@Before({GET.class, RepeatIntercetpor.class})
@EmptyInterface({"third_party_id", "org_id"})
public void disMatchBureau(String org_id) {
cm.disMatchBureau(org_id);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
/**
*
*
* @param keyword
*/
@Before({GET.class})
@IsLoginInterface({})
@IsNumericInterface({"page", "limit"})
public void getTyBureauList(String keyword, int page, int limit) {
Page<Record> dataPage = cm.getTyBureauList(keyword, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(dataPage));
}
}

@ -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) {
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) {
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,6 +986,7 @@ public class CollectModel {
* @return
*/
public List<Record> getBanJiStudent(String bureau_id, String classIds) {
if (THIRD_PARTY_BASE_DATA == 0) {
List<Record> res = new ArrayList<>();
if (StrKit.isBlank(classIds)) return res;
for (String class_id : classIds.split(",")) {
@ -980,6 +995,10 @@ public class CollectModel {
res.addAll(list);
}
return res;
} else {
//TODO
return null;
}
}
/**

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