Commit cb862375 by 张祺

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

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