Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
bef6a06d
Commit
bef6a06d
authored
Oct 27, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tzs 导出优化
parent
9b406bba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
TemplateExportController.java
...t/module/tzs/biz/controller/TemplateExportController.java
+15
-6
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TemplateExportController.java
View file @
bef6a06d
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto
;
...
...
@@ -72,7 +73,7 @@ public class TemplateExportController extends BaseController {
throw
new
BadRequest
(
"参数校验失败."
);
}
// 判断 同一类型模板名称不能重复
TemplateExport
temp
=
templateExportServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
TemplateExport
>().
eq
(
TemplateExport:
:
getTemplateType
,
model
.
getTemplateType
()).
eq
(
TemplateExport:
:
getTemplateName
,
model
.
getTemplateName
()));
TemplateExport
temp
=
templateExportServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
TemplateExport
>().
eq
(
TemplateExport:
:
get
IsDelete
,
0
).
eq
(
TemplateExport:
:
get
TemplateType
,
model
.
getTemplateType
()).
eq
(
TemplateExport:
:
getTemplateName
,
model
.
getTemplateName
()));
if
(
temp
!=
null
)
{
throw
new
BadRequest
(
"模板名称已存在."
);
}
...
...
@@ -99,7 +100,8 @@ public class TemplateExportController extends BaseController {
if
(
StringUtils
.
isNotBlank
(
model
.
getTemplateName
()))
{
TemplateExport
temp
=
templateExportServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
TemplateExport
>().
eq
(
TemplateExport:
:
getTemplateType
,
model
.
getTemplateType
()).
eq
(
TemplateExport:
:
getTemplateName
,
model
.
getTemplateName
()).
ne
(
TemplateExport:
:
getSequenceNbr
,
sequenceNbr
));
ne
(
TemplateExport:
:
getSequenceNbr
,
sequenceNbr
).
eq
(
TemplateExport:
:
getIsDelete
,
0
));
if
(
temp
!=
null
)
{
throw
new
BadRequest
(
"模板名称已存在."
);
}
...
...
@@ -119,7 +121,14 @@ public class TemplateExportController extends BaseController {
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除模板"
,
notes
=
"根据sequenceNbr删除模板"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
// 不可删除标准模板
return
ResponseHelper
.
buildResponse
(
templateExportServiceImpl
.
removeById
(
sequenceNbr
));
TemplateExport
temp
=
templateExportServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
TemplateExport
>().
eq
(
TemplateExport:
:
getSequenceNbr
,
sequenceNbr
));
if
(
temp
.
getIsStandard
()
==
true
)
{
throw
new
BadRequest
(
"不可删除标准模板."
);
}
return
ResponseHelper
.
buildResponse
(
templateExportServiceImpl
.
update
(
new
LambdaUpdateWrapper
<
TemplateExport
>().
set
(
TemplateExport:
:
getIsDelete
,
true
).
eq
(
TemplateExport:
:
getSequenceNbr
,
sequenceNbr
)));
}
...
...
@@ -138,9 +147,9 @@ public class TemplateExportController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据
模板导出"
,
notes
=
"根据模板
导出"
)
@PostMapping
(
"/exportBy
temolate
"
)
public
void
testExport
(
@RequestBody
ExportDto
exportDto
,
HttpServletResponse
response
)
{
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据
字段类型导出"
,
notes
=
"根据字段类型
导出"
)
@PostMapping
(
"/exportBy
TypeParams
"
)
public
void
exportByTypeParams
(
@RequestBody
ExportDto
exportDto
,
HttpServletResponse
response
)
{
if
(
ValidationUtil
.
isEmpty
(
exportDto
.
getExportArray
())
||
ValidationUtil
.
isEmpty
(
exportDto
.
getDataType
())
||
ValidationUtil
.
isEmpty
(
exportDto
.
getFileName
())
...
...
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