main
黄海 2 years ago
parent c0684d54ce
commit 5a60be77a6

@ -692,7 +692,7 @@ public class CollectController extends Controller {
//获取登录人员第一个发布任务的角色是什么
int publish_role_id = kvCheck.getInt("publish_role_id");
Page<Record> list = cm.getJobList(bureau_id, publish_role_id, job_name,self_or_next, page, limit);
Page<Record> list = cm.getJobList(bureau_id, publish_role_id, job_name, self_or_next, page, limit);
renderJson(CommonUtil.renderJsonForLayUI(list));
}
@ -1106,7 +1106,8 @@ public class CollectController extends Controller {
@Before({POST.class, RepeatIntercetpor.class})
@IsLoginInterface({})
@EmptyInterface({"job_name", "json", "table_name"})
public void addFormJob(int target_type_id, String job_name, String json, String table_name) {
public void addFormJob(int target_type_id, String job_name, String json, String table_name, int self_or_next) {
if (self_or_next == 0) self_or_next = 2;
if (target_type_id == 0) target_type_id = 1;//默认是发布到单位
boolean isMatch = table_name.matches("[a-z][a-z0-9_]*");
if (!isMatch) {
@ -1154,7 +1155,7 @@ public class CollectController extends Controller {
}
//通过检查
int job_id = cm.addFormJob(target_type_id, bureau_id, person_id, publish_role_id, job_name, table_name, json);
int job_id = cm.addFormJob(target_type_id, bureau_id, person_id, publish_role_id, job_name, table_name, json,self_or_next);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");

@ -756,8 +756,7 @@ public class CollectModel {
1120,1121,1122,2120,2121,2122 forward_count
1122,2122 forward_finish_count
*/
if (self_or_next == 1) kv.set("self", 1);
else kv.set("next", 2);
kv.set("self_or_next", self_or_next);
SqlPara sqlPara = Db.getSqlPara("Collect.getJobList", kv);
Page<Record> pageRecord = Db.paginate(page, limit, sqlPara);
@ -1447,7 +1446,7 @@ public class CollectModel {
* @return
*/
public int addFormJob(int target_type_id, String bureau_id, String person_id, int publish_role_id, String
job_name, String table_name, String json) {
job_name, String table_name, String json, int self_or_next) {
table_name = table_name.toLowerCase();
//1、保存任务信息
Record record = new Record();
@ -1462,6 +1461,7 @@ public class CollectModel {
record.set("form_table_name", table_name);
record.set("target_type_id", target_type_id);
record.set("form_json", json);
record.set("self_or_next", self_or_next);
Db.save("t_collect_job", "job_id", record);
int job_id = record.getInt("job_id");
//2、需要在这里建表因为发布时不管建表只管可见范围

@ -1,27 +1,23 @@
#namespace("Collect")
-- 获取任务列表
#sql("getJobList")
select DISTINCT t1.*,
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1111,1211,2311)) as finish_count,
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1110,1111,1210,1211,2310,2311)) as total_count,
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1120,1121,1122,2120,2121,2122)) as forward_count, --
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1122,2122)) as forward_finish_count, --
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id and t2.is_check=1) as already_check_sheet,
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id) as all_sheet
from t_collect_job as t1 LEFT JOIN t_collect_job_target AS t3 ON t1.job_id = t3.job_id
where t1.publish_role_id = #para(publish_role_id) and t1.bureau_id=#para(bureau_id)
#if(job_name)
and t1.job_name like #para(job_name, "like")
#end
#if(self)
and t3.bureau_id = t3.target_id;
#end
#if(next)
and t3.bureau_id <> t3.target_id
#end
order by t1.job_id desc
select t1.*,
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1111,1211,2311)) as finish_count,
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1110,1111,1210,1211,2310,2311)) as total_count,
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1120,1121,1122,2120,2121,2122)) as forward_count, --
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1122,2122)) as forward_finish_count, --
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id and t2.is_check=1) as already_check_sheet,
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id) as all_sheet
from t_collect_job as t1
where t1.publish_role_id = #para(publish_role_id) and t1.bureau_id=#para(bureau_id)
#if(job_name)
and t1.job_name like #para(job_name, "like")
#end
and t1.self_or_next= #para(self_or_next)
order by t1.job_id desc
#end
-- 获取单位类型
#sql("getBureauType")
select 5 as id ,'市直教辅单位' as name

Loading…
Cancel
Save