|
|
|
@ -328,6 +328,57 @@ public class CollectController extends Controller {
|
|
|
|
|
renderJson(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:重命名任务
|
|
|
|
|
*
|
|
|
|
|
* @param job_id
|
|
|
|
|
* @param job_name
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"job_id"})
|
|
|
|
|
@EmptyInterface({"job_name"})
|
|
|
|
|
public void renameJob(int job_id, String job_name) {
|
|
|
|
|
cm.renameJob(job_id, job_name);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:删除任务
|
|
|
|
|
*
|
|
|
|
|
* @param job_id
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"job_id"})
|
|
|
|
|
public void delJob(int job_id) {
|
|
|
|
|
//已发布,并且有人填写的不能删除
|
|
|
|
|
Record record = cm.getJob(job_id);
|
|
|
|
|
int publish_state = record.getInt("publish_state");
|
|
|
|
|
if (publish_state == 1) {
|
|
|
|
|
int is_finish_count = 0;
|
|
|
|
|
List<Record> list = cm.getJobFill(job_id);
|
|
|
|
|
for (Record r : list) {
|
|
|
|
|
if (r.getInt("is_finish") == 1) is_finish_count++;
|
|
|
|
|
}
|
|
|
|
|
if (is_finish_count > 0) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "任务已发布,并且存在填报记录,无法删除!");
|
|
|
|
|
renderJson(map);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cm.delJob(job_id);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:用户导入数据
|
|
|
|
|
*/
|
|
|
|
@ -498,7 +549,6 @@ public class CollectController extends Controller {
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取任务列表,支持关键字查询
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void getJobList(String job_name, int page, int limit) throws ParseException {
|
|
|
|
@ -595,56 +645,6 @@ public class CollectController extends Controller {
|
|
|
|
|
renderJson(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:重命名任务
|
|
|
|
|
*
|
|
|
|
|
* @param job_id
|
|
|
|
|
* @param job_name
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"job_id"})
|
|
|
|
|
@EmptyInterface({"job_name"})
|
|
|
|
|
public void renameJob(int job_id, String job_name) {
|
|
|
|
|
cm.renameJob(job_id, job_name);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:删除任务
|
|
|
|
|
*
|
|
|
|
|
* @param job_id
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"job_id"})
|
|
|
|
|
public void delJob(int job_id) {
|
|
|
|
|
//已发布,并且有人填写的不能删除
|
|
|
|
|
Record record = cm.getJob(job_id);
|
|
|
|
|
int publish_state = record.getInt("publish_state");
|
|
|
|
|
if (publish_state == 1) {
|
|
|
|
|
int is_finish_count = 0;
|
|
|
|
|
List<Record> list = cm.getJobFill(job_id);
|
|
|
|
|
for (Record r : list) {
|
|
|
|
|
if (r.getInt("is_finish") == 1) is_finish_count++;
|
|
|
|
|
}
|
|
|
|
|
if (is_finish_count > 0) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "任务已发布,并且存在填报记录,无法删除!");
|
|
|
|
|
renderJson(map);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cm.delJob(job_id);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:延期任务
|
|
|
|
@ -693,8 +693,8 @@ public class CollectController extends Controller {
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"job_id", "is_finish"})
|
|
|
|
|
@LayUiPageInfoInterface({"page", "limit"})
|
|
|
|
|
public void listFilledJob(int job_id, String keyword, int is_finish, int page, int limit) {
|
|
|
|
|
Page<Record> list = cm.listFilledJob(job_id, keyword, is_finish, page, limit);
|
|
|
|
|
public void viewJob(int job_id, String keyword, int is_finish, int page, int limit) {
|
|
|
|
|
Page<Record> list = cm.viewJob(job_id, keyword, is_finish, page, limit);
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -754,7 +754,7 @@ public class CollectController extends Controller {
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"is_finish"})
|
|
|
|
|
@LayUiPageInfoInterface({"page", "limit"})
|
|
|
|
|
public void getJobListByBureau(String keyword, int is_finish, int page, int limit) {
|
|
|
|
|
public void viewJobList(String keyword, int is_finish, int page, int limit) {
|
|
|
|
|
//操作人员
|
|
|
|
|
String person_id = SessionKit.get(getRequest(), getResponse(), "person_id");
|
|
|
|
|
//根据人员ID,获取人员所在的单位ID
|
|
|
|
|