|
|
|
@ -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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|