main
黄海 1 year ago
parent c5d4dd2389
commit aff1d34ff9

@ -884,12 +884,15 @@ public class CollectController extends Controller {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
//根据人员ID获取人员所在的单位ID
Record rs = personModel.getLoginInfoByPersonId(person_id);
String bureau_id = rs.get("bureau_id");
String bureau_id = "";
if (cm.THIRD_PARTY_BASE_DATA == 0) {
Record rs = personModel.getLoginInfoByPersonId(person_id);
bureau_id = rs.get("bureau_id");
} else {
bureau_id = cm.getTyPersonBureau(person_id);
}
Record record = cm.getJob(job_id, bureau_id, target_id, status_code);
//不仅要回原来的信息,还需要增加一些属性:如果是上级转发过来的,那么上级要求的完成时间是什么,具体的完成要求是什么
renderJson(record);
}
@ -1160,9 +1163,14 @@ public class CollectController extends Controller {
if (StrKit.isBlank(target_id)) {
//操作人员
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
//根据人员ID获取人员所在的单位ID
Record rs = personModel.getLoginInfoByPersonId(person_id);
target_id = rs.get("bureau_id");
if (cm.THIRD_PARTY_BASE_DATA == 0) {
//根据人员ID获取人员所在的单位ID
Record rs = personModel.getLoginInfoByPersonId(person_id);
target_id = rs.get("bureau_id");
} else {
target_id = cm.getTyPersonBureau(person_id);
}
}
List<Record> list = cm.getJobUploadList(job_id, target_id);
renderJson(CommonUtil.renderJsonForLayUI(list));
@ -1848,15 +1856,29 @@ public class CollectController extends Controller {
break;
}
}
String ourBureau_id = "";
//根据人员ID获取人员所在的单位ID
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);
String person_name = "";
String s_class_id = "";
if (cm.THIRD_PARTY_BASE_DATA == 0) {
Record rs = personModel.getLoginInfoByPersonId(person_id);
ourBureau_id = rs.get("bureau_id");
person_name = rs.getStr("person_name");//人员姓名
s_class_id = rs.getStr("s_class_id");
} else {
String bureau_id = cm.getTyPersonBureau(person_id);
ourBureau_id = cm.getMyBureauByTyBureauId(bureau_id).getStr("org_id");
LoginPersonModel personModel = new LoginPersonModel();
Record record = personModel.getTyPersonInfo(person_id);
person_name = record.getStr("person_name");
if (record.getInt("identity_id") == 5) {
s_class_id = "-1";//老师没有班级概念
} else {
s_class_id = record.getStr("org_id");
}
}
String bureau_name = bm.getOrgInfoById(ourBureau_id).getStr("org_name");//单位名称
cm.saveFormJob(job_id, status_code, ourBureau_id, bureau_name, s_class_id, person_id, person_name, json);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");

@ -1736,9 +1736,20 @@ public class CollectModel {
Record record = new Record();
if (!s_class_id.equals("-1")) {//学生
ClassModel cm = new ClassModel();
String class_name = cm.getClassInfoByClassId(s_class_id).getString("class_name");
record.set("class_id", s_class_id);
record.set("class_name", class_name);
if (THIRD_PARTY_BASE_DATA == 0) {
String class_name = cm.getClassInfoByClassId(s_class_id).getString("class_name");
record.set("class_id", s_class_id);
record.set("class_name", class_name);
} else {
if (!s_class_id.equals("-1")) {
String class_name = getTyClassInfoByClassId(s_class_id).getStr("class_name");
record.set("class_id", s_class_id);
record.set("class_name", class_name);
} else {
record.set("class_id", "");
record.set("class_name", "");
}
}
}
record.set("job_id", job_id);
record.set("area_id", area_id);
@ -1857,6 +1868,18 @@ public class CollectModel {
if (writeList.size() > 0) Db.batchSave("t_collect_checkbox", writeList, 100);
}
/**
*
*
* @param s_class_id
* @return
*/
public Record getTyClassInfoByClassId(String s_class_id) {
String sql = "select org_name as class_name from ds_base_class where org_id=?";
Record record = Db.findFirst(sql, s_class_id);
return record;
}
/**
*
*
@ -2917,4 +2940,33 @@ public class CollectModel {
List<Record> list = Db.find(sql, bureau_id);
return list;
}
/**
*
*
* @param person_id
* @return
*/
public String getTyPersonBureau(String person_id) {
String sql = "select bureau_id from ds_base_teacher where user_id=? limit 1";
Record record = Db.findFirst(sql, person_id);
if (record != null) {
return record.getStr("bureau_id");
} else {
sql = "select bureau_id from ds_base_student where user_id=? limit 1";
record = Db.findFirst(sql, person_id);
return record.getStr("bureau_id");
}
}
/**
* IDID
*
* @param bureau_id
* @return
*/
public Record getMyBureauByTyBureauId(String bureau_id) {
String sql = "select * from t_base_organization where third_party_id=?";
return Db.findFirst(sql, bureau_id);
}
}

@ -532,21 +532,7 @@ public class LoginPersonController extends Controller {
renderJson(kv);
return;
}
String user_id = jo.getJSONObject("result").getString("user_id");
String user_name = jo.getJSONObject("result").getString("name");
Record bureauRecord = model.getTyPersonBureauInfo(user_id);
String org_id = bureauRecord.getStr("org_id");
String org_name = bureauRecord.getStr("org_name");
kv.set("success", true);
kv.set("message", "验证票据成功!");
kv.set("user_id", user_id);
kv.set("user_name", user_name);
kv.set("org_id", org_id);
kv.set("org_name", org_name);
System.out.println(kv);
//写入session
SessionKit.set(getRequest(), getResponse(), "person_id", user_id);
//跳转到个人访问页

@ -288,16 +288,32 @@ public class LoginPersonModel {
}
/***下面的代码用于与天喻平台对接*************************************************************/
/**
* from=0 :
* from=1 :
*
* @param person_id
* @param from
* @return
*/
public Record getTyPersonBureauInfo(String person_id, int from) {
if (from == 0) {
String sql = "select bureau_id from t_sys_loginperson where person_id=?";
Record personRecord = Db.findFirst(sql, person_id);
String bureau_id = personRecord.getStr("bureau_id");
sql = "select third_party_id from t_base_organization where org_id=?";
Record thirdRecord = Db.findFirst(sql, bureau_id);
sql = "select org_id as bureau_id,org_name as bureau_name from ds_base_bureau where org_id=?";
String org_id = thirdRecord.getStr("third_party_id");
Record res = Db.findFirst(sql, org_id);
return res;
} else {
return null;
}
}
public Record getTyPersonBureauInfo(String person_id) {
String sql = "select bureau_id from t_sys_loginperson where person_id=?";
Record personRecord = Db.findFirst(sql, person_id);
String bureau_id = personRecord.getStr("bureau_id");
sql = "select third_party_id from t_base_organization where org_id=?";
Record thirdRecord = Db.findFirst(sql, bureau_id);
sql = "select org_id as bureau_id,org_name as bureau_name from ds_base_bureau where org_id=?";
String org_id = thirdRecord.getStr("third_party_id");
Record res = Db.findFirst(sql, org_id);
return res;
return getTyPersonBureauInfo(person_id, 0);
}
/**
@ -308,12 +324,15 @@ public class LoginPersonModel {
*/
public Record getTyPersonInfo(String user_id) {
//-- 老师
String sql = "select name as person_name from ds_base_teacher where user_id=? limit 1";
String sql = "select name as person_name,org_id from ds_base_teacher where user_id=? limit 1";
Record record = Db.findFirst(sql, user_id);
// -- 学生
if (record == null) {
sql = "select name as person_name from ds_base_student where user_id=? limit 1";
sql = "select name as person_name,org_id from ds_base_student where user_id=? limit 1";
record = Db.findFirst(sql, user_id);
record.set("identity_id", 6);
} else {
record.set("identity_id", 5);
}
return record;
}

@ -186,7 +186,7 @@
#end
-- 天喻人员
#sql("getTyOrgPersonList")
select user_id as person_id,name as person_name,gender as xb from ds_base_teacher where org_id=#para(org_id)
select distinct user_id as person_id,name as person_name,gender as xb from ds_base_teacher where org_id=#para(org_id)
#if(keyword)
and name like #para(keyword, "like")
#end

Loading…
Cancel
Save