Commit cb862375 by 张祺

修改模板保存,不限制一个任务一条记录

parent 6fa651a7
...@@ -4,7 +4,6 @@ import com.alibaba.excel.EasyExcel; ...@@ -4,7 +4,6 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.builder.ExcelWriterBuilder; import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy; import com.alibaba.excel.write.merge.OnceAbsoluteMergeStrategy;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.keymobile.indicators.constant.Constants; import com.keymobile.indicators.constant.Constants;
...@@ -24,7 +23,6 @@ import lombok.extern.slf4j.Slf4j; ...@@ -24,7 +23,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import scala.collection.immutable.Stream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
...@@ -129,12 +127,12 @@ public class ExcelTempCtrl { ...@@ -129,12 +127,12 @@ public class ExcelTempCtrl {
@ApiOperation("保存excel模板") @ApiOperation("保存excel模板")
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody ExcelTemplate template) { public Result save(@RequestBody ExcelTemplate template) {
if (StringUtils.isNotBlank(template.getTaskId())) { // if (StringUtils.isNotBlank(template.getTaskId())) {
ExcelTemplate temp = excelTemplateService.getByTaskId(template.getTaskId()); // ExcelTemplate temp = excelTemplateService.getByTaskId(template.getTaskId());
if (temp != null && !temp.getId().equals(template.getId())) { // if (temp != null && !temp.getId().equals(template.getId())) {
return Result.genFailedResult("该任务已经存在设置好的模板!"); // return Result.genFailedResult("该任务已经存在设置好的模板!");
} // }
} // }
Task task = taskService.getById(template.getTaskId(), false, false); Task task = taskService.getById(template.getTaskId(), false, false);
template.setRuleId(task.getRuleId()); template.setRuleId(task.getRuleId());
template.setRuleLevel(task.getRuleLevel()); template.setRuleLevel(task.getRuleLevel());
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
select * select *
from data_enter_excel_temp from data_enter_excel_temp
where state = 1 and task_id = #{taskId} where state = 1 and task_id = #{taskId}
order by update_time desc
limit 1 limit 1
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment