Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangkb
indicators
Commits
cb862375
Commit
cb862375
authored
Jul 24, 2020
by
张祺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改模板保存,不限制一个任务一条记录
parent
6fa651a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
ExcelTempCtrl.java
...com/keymobile/indicators/api/hytobacco/ExcelTempCtrl.java
+6
-8
ExcelTemplateMapper.xml
src/main/resources/mybatis/mapping/ExcelTemplateMapper.xml
+1
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/ExcelTempCtrl.java
View file @
cb862375
...
...
@@ -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
());
...
...
src/main/resources/mybatis/mapping/ExcelTemplateMapper.xml
View file @
cb862375
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment