|
|
|
@ -7,9 +7,14 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.dsideal.QingLong.Collect.Const.DataType;
|
|
|
|
|
import com.dsideal.QingLong.Global.Model.GlobalModel;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsLoginInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsNumericInterface;
|
|
|
|
|
import com.dsideal.QingLong.LoginPerson.Model.LoginPersonModel;
|
|
|
|
|
import com.dsideal.QingLong.Util.ChineseCharacterUtil;
|
|
|
|
|
import com.dsideal.QingLong.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.QingLong.Util.PoiUtil;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.kit.Kv;
|
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
|
@ -781,18 +786,26 @@ public class CollectModel {
|
|
|
|
|
* @param org_type_id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Page<Record> getBureauList(int org_type_id, String org_name, int page, int limit) {
|
|
|
|
|
public Page<Record> getBureauList(String area_id, int org_type_id, String org_name, int page, int limit) {
|
|
|
|
|
Kv kv = Kv.create();
|
|
|
|
|
if (org_type_id != -1) kv.set("org_type_id", org_type_id);
|
|
|
|
|
GlobalModel gm = new GlobalModel();
|
|
|
|
|
String city_id = gm.getGlobalValueByKey("install_area");
|
|
|
|
|
kv.set("city_id", city_id);
|
|
|
|
|
if (StrKit.isBlank(area_id)) {
|
|
|
|
|
GlobalModel gm = new GlobalModel();
|
|
|
|
|
String city_id = gm.getGlobalValueByKey("install_area");
|
|
|
|
|
kv.set("city_id", city_id);
|
|
|
|
|
} else {
|
|
|
|
|
kv.set("area_id", area_id);
|
|
|
|
|
}
|
|
|
|
|
if (!StrKit.isBlank(org_name)) kv.set("org_name", org_name);
|
|
|
|
|
SqlPara sqlPara = Db.getSqlPara("Collect.getBureauList", kv);
|
|
|
|
|
Page<Record> pageRecord = Db.paginate(page, limit, sqlPara);
|
|
|
|
|
return pageRecord;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Page<Record> getBureauList(int org_type_id, String org_name, int page, int limit) {
|
|
|
|
|
return getBureauList(null, org_type_id, org_name, page, limit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:发布任务
|
|
|
|
|
*
|
|
|
|
@ -1367,4 +1380,80 @@ public class CollectModel {
|
|
|
|
|
System.out.println(number);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:转发任务
|
|
|
|
|
* 县区教育局资产管理干事 268
|
|
|
|
|
*
|
|
|
|
|
* @param job_id 任务ID
|
|
|
|
|
* @param deadline_time 截止时间
|
|
|
|
|
* @param allSchool 所有学校
|
|
|
|
|
* @param allJiaoFu 所有教辅单位
|
|
|
|
|
* @param bureauIds 单位列表
|
|
|
|
|
* @param groupIds 组列表
|
|
|
|
|
*/
|
|
|
|
|
public int ForwardJob(int job_id, String deadline_time, int allSchool,
|
|
|
|
|
int allJiaoFu, String bureauIds, String groupIds, String person_id) throws ParseException {
|
|
|
|
|
Record jobRecord = getJob(job_id);
|
|
|
|
|
jobRecord.remove("job_id");
|
|
|
|
|
jobRecord.set("deadline_time", deadline_time);//截止时间是新的
|
|
|
|
|
jobRecord.set("publish_role_id", 268);
|
|
|
|
|
jobRecord.set("parent_id", job_id);
|
|
|
|
|
Db.save("t_collect_job", "job_id", jobRecord);
|
|
|
|
|
int child_job_id = jobRecord.getInt("job_id");
|
|
|
|
|
|
|
|
|
|
//获取当前登录人员所在的县区ID
|
|
|
|
|
LoginPersonModel lm = new LoginPersonModel();
|
|
|
|
|
Record personRecord = lm.getLoginInfoByPersonId(person_id);
|
|
|
|
|
String area_id = personRecord.getStr("area_id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取此县区的所有学校
|
|
|
|
|
Set<String> bureauSet = new HashSet<>();
|
|
|
|
|
if (allSchool == 1) {
|
|
|
|
|
Page<Record> list = getBureauList(area_id, 16, null, 1, 9999);
|
|
|
|
|
for (Record record : list.getList()) {
|
|
|
|
|
bureauSet.add(record.getStr("org_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//获取此县区的所有教辅单位
|
|
|
|
|
if (allJiaoFu == 1) {
|
|
|
|
|
Page<Record> list = getBureauList(area_id, 14, null, 1, 9999);
|
|
|
|
|
for (Record record : list.getList()) {
|
|
|
|
|
bureauSet.add(record.getStr("org_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StrKit.isBlank(bureauIds)) {
|
|
|
|
|
for (String s : bureauIds.split(",")) {
|
|
|
|
|
bureauSet.add(s);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!StrKit.isBlank(groupIds)) {
|
|
|
|
|
for (String group_id : groupIds.split(",")) {
|
|
|
|
|
List<Record> list = getGroup(Integer.parseInt(group_id));
|
|
|
|
|
for (Record record : list) {
|
|
|
|
|
bureauSet.add(record.getStr("bureau_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//写主表
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
Date date = dateFormat.parse(deadline_time);
|
|
|
|
|
String sql = "update t_collect_job set publish_time=now(),publish_state=1,deadline_time=? where job_id=?";
|
|
|
|
|
Db.update(sql, date, child_job_id);
|
|
|
|
|
sql = "delete from t_collect_job_target where job_id=?";
|
|
|
|
|
Db.update(sql, child_job_id);
|
|
|
|
|
//写任务分派表
|
|
|
|
|
List<Record> list = new ArrayList<>();
|
|
|
|
|
for (String s : bureauSet) {
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record.set("job_id", job_id);
|
|
|
|
|
record.set("bureau_id", s);
|
|
|
|
|
record.set("is_finish", 0);
|
|
|
|
|
list.add(record);
|
|
|
|
|
}
|
|
|
|
|
Db.batchSave("t_collect_job_target", list, 100);
|
|
|
|
|
return child_job_id;
|
|
|
|
|
}
|
|
|
|
|
}
|