main
黄海 2 years ago
parent 7ec7271fde
commit cb54ac75a8

@ -568,4 +568,55 @@ public class CollectController extends Controller {
map.put("message", "保存成功!");
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) {
cm.delJob(job_id);
Map map = new HashMap();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
/**
*
*
* @param job_id
*/
@Before({POST.class})
@IsLoginInterface({})
@IsNumericInterface({"job_id"})
@EmptyInterface({"deadline_time"})
public void extensionJob(int job_id, String deadline_time) throws ParseException {
cm.extensionJob(job_id, deadline_time);
Map map = new HashMap();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
}

@ -3,11 +3,14 @@ package com.dsideal.QingLong.Collect.Model;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.io.FileUtil;
import com.dsideal.QingLong.Collect.Const.DataTypeConst;
import com.dsideal.QingLong.Interceptor.EmptyInterface;
import com.dsideal.QingLong.Interceptor.IsLoginInterface;
import com.dsideal.QingLong.Interceptor.IsNumericInterface;
import com.dsideal.QingLong.Util.ChineseCharacterUtil;
import com.dsideal.QingLong.Util.CommonUtil;
import com.jfinal.aop.Before;
import com.jfinal.ext.interceptor.GET;
import com.jfinal.ext.interceptor.POST;
import com.jfinal.kit.Kv;
import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Db;
@ -1024,4 +1027,49 @@ public class CollectModel {
}
Db.batchSave("t_collect_job_bureau", list, 100);
}
/**
*
*
* @param job_id
* @param job_name
*/
public void renameJob(int job_id, String job_name) {
String sql = "update t_collect_job set job_name=? where job_id=?";
Db.update(sql, job_name, job_id);
}
/**
*
*
* @param job_id
*/
public void delJob(int job_id) {
String sql = "delete from t_collect_job where job_id=?";
Db.update(sql, job_id);
sql = "delete from t_collect_job_bureau where job_id=?";
Db.update(sql, job_id);
sql = "delete from t_collect_job_sheet where job_id=?";
Db.update(sql, job_id);
sql = "delete from t_collect_job_sheet_col where job_id=?";
Db.update(sql, job_id);
sql = "delete from t_collect_mapping where job_id=?";
Db.update(sql, job_id);
}
/**
*
*
* @param job_id
*/
public void extensionJob(int job_id, String deadline_time) throws ParseException {
String sql = "update t_collect_job set deadline_time=? where job_id=?";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = dateFormat.parse(deadline_time);
Db.update(sql, date, job_id);
}
}
Loading…
Cancel
Save