|
|
|
@ -596,6 +596,23 @@ public class CollectController extends Controller {
|
|
|
|
|
@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);
|
|
|
|
|