|
|
|
@ -74,7 +74,7 @@ public class CollectController extends Controller {
|
|
|
|
|
//判断文件大小大于20b则返回错误信息,并终止上传,删除上传文件
|
|
|
|
|
long size = excelFile.getFile().length();
|
|
|
|
|
if (size > 1024 * 1024 * 2) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "xlsx文件大小大于2MB,请检查是否正确!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -117,7 +117,7 @@ public class CollectController extends Controller {
|
|
|
|
|
}
|
|
|
|
|
//通过后,记录新增加了一个任务模板文件,共N个模板,记录到数据库表中,然后提供给前台这些数据信息
|
|
|
|
|
int job_id = cm.addExcelJob(publish_role_id, person_id, kvList, upload_excel_filename);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("job_id", job_id);
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "模板上传成功!");
|
|
|
|
@ -222,7 +222,7 @@ public class CollectController extends Controller {
|
|
|
|
|
idx++;
|
|
|
|
|
}
|
|
|
|
|
if (!StrKit.isBlank(errMsg)) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", errMsg);
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -250,7 +250,7 @@ public class CollectController extends Controller {
|
|
|
|
|
writeList.add(record);
|
|
|
|
|
}
|
|
|
|
|
cm.saveSheet(job_id, sheet_index, writeList, table_name);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -284,7 +284,7 @@ public class CollectController extends Controller {
|
|
|
|
|
//检查是不是某张表中存在字段名称重复的情况
|
|
|
|
|
for (int i = 0; i < listJobSheet.size(); i++) {
|
|
|
|
|
if (cm.checkColumnNameDuplicate(job_id, i)) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "第" + (i + 1) + "个Sheet表中存在字段名称重复的情况,请检查后重新保存!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -393,7 +393,7 @@ public class CollectController extends Controller {
|
|
|
|
|
cm.saveJob(job_id, job_name, upload_excel_filename_finish);
|
|
|
|
|
|
|
|
|
|
//返回成功
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -411,7 +411,7 @@ public class CollectController extends Controller {
|
|
|
|
|
@EmptyInterface({"job_name"})
|
|
|
|
|
public void renameJob(int job_id, String job_name) {
|
|
|
|
|
cm.renameJob(job_id, job_name);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -429,7 +429,7 @@ public class CollectController extends Controller {
|
|
|
|
|
//已发布,并且有人填写的不能删除
|
|
|
|
|
Record record = cm.getJob(job_id);
|
|
|
|
|
if (record == null) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -443,7 +443,7 @@ public class CollectController extends Controller {
|
|
|
|
|
if (r.getInt("is_finish") == 1) is_finish_count++;
|
|
|
|
|
}
|
|
|
|
|
if (is_finish_count > 0) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "任务已发布,并且存在填报记录,无法删除!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -451,7 +451,7 @@ public class CollectController extends Controller {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cm.delJob(job_id);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -483,7 +483,7 @@ public class CollectController extends Controller {
|
|
|
|
|
//判断文件大小大于20b则返回错误信息,并终止上传,删除上传文件
|
|
|
|
|
long size = excelFile.getFile().length();
|
|
|
|
|
if (size > 1024 * 1024 * 20) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "xlsx文件大小大于20MB,请检查是否正确!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -707,7 +707,7 @@ public class CollectController extends Controller {
|
|
|
|
|
public void publishJob(int job_id, String deadline_time, int shiZhiSchool,
|
|
|
|
|
int shiZhiJiaoFu, int quXiaoJiaoYuJu, String bureauIds) throws ParseException {
|
|
|
|
|
cm.publishJob(job_id, deadline_time, shiZhiSchool, shiZhiJiaoFu, quXiaoJiaoYuJu, bureauIds);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -737,7 +737,7 @@ public class CollectController extends Controller {
|
|
|
|
|
@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<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -754,7 +754,7 @@ public class CollectController extends Controller {
|
|
|
|
|
@IsNumericInterface({"job_id"})
|
|
|
|
|
public void cloneJob(int job_id, String job_name) {
|
|
|
|
|
cm.cloneJob(job_id, job_name);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -898,7 +898,7 @@ public class CollectController extends Controller {
|
|
|
|
|
int publish_role_id = kvCheck.getInt("publish_role_id");
|
|
|
|
|
|
|
|
|
|
if (cm.isTableExist(table_name)) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "表名" + table_name + "已存在,无法创建,请更换后再次提交!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -906,7 +906,7 @@ public class CollectController extends Controller {
|
|
|
|
|
}
|
|
|
|
|
//检查字段名是否重复
|
|
|
|
|
if (cm.checkColumnNameDuplicate(json)) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "表名" + table_name + "中存在重复列名或与保留字冲突,不能创建,请检查!");
|
|
|
|
|
renderJson(map);
|
|
|
|
@ -915,7 +915,7 @@ public class CollectController extends Controller {
|
|
|
|
|
|
|
|
|
|
//通过检查
|
|
|
|
|
int job_id = cm.addFormJob(person_id, publish_role_id, job_name, table_name, json);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
map.put("job_id", job_id);
|
|
|
|
@ -947,14 +947,14 @@ public class CollectController extends Controller {
|
|
|
|
|
String form_table_name = cm.getJob(job_id).getStr("form_table_name");
|
|
|
|
|
|
|
|
|
|
if (!form_table_name.equals(table_name) && cm.isTableExist(table_name)) {
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", false);
|
|
|
|
|
map.put("message", "表名" + table_name + "已存在,无法创建,请更换后再次提交!");
|
|
|
|
|
renderJson(map);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
cm.updateFormJob(job_id, job_name, json, table_name);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
map.put("job_id", job_id);
|
|
|
|
@ -980,7 +980,7 @@ public class CollectController extends Controller {
|
|
|
|
|
Record rs = personModel.getLoginInfoByPersonId(person_id);
|
|
|
|
|
String bureau_id = rs.get("bureau_id");
|
|
|
|
|
cm.saveFormJob(bureau_id, person_id, table_name, json);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
map.put("job_id", job_id);
|
|
|
|
@ -1026,7 +1026,7 @@ public class CollectController extends Controller {
|
|
|
|
|
int publish_role_id = kvCheck.getInt("publish_role_id");
|
|
|
|
|
|
|
|
|
|
int group_id = cm.addGroup(group_name, bureauIds, publish_role_id);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
map.put("group_id", group_id);
|
|
|
|
@ -1046,7 +1046,7 @@ public class CollectController extends Controller {
|
|
|
|
|
@EmptyInterface({"group_name", "bureauIds"})
|
|
|
|
|
public void updateGroup(int group_id, String group_name, String bureauIds) {
|
|
|
|
|
cm.updateGroup(group_id, group_name, bureauIds);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
map.put("group_id", group_id);
|
|
|
|
@ -1085,7 +1085,7 @@ public class CollectController extends Controller {
|
|
|
|
|
@IsNumericInterface({"group_id"})
|
|
|
|
|
public void delGroup(int group_id) {
|
|
|
|
|
cm.delGroup(group_id);
|
|
|
|
|
Map map = new HashMap();
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
|
map.put("success", true);
|
|
|
|
|
map.put("message", "保存成功!");
|
|
|
|
|
map.put("group_id", group_id);
|
|
|
|
|