Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wlzwh
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
mengmeng
wlzwh
Commits
6c9514ae
Commit
6c9514ae
authored
Jul 17, 2020
by
zhangweitian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0717 修改导出EXCEL、根据姓名查询、重名判断
parent
dd34250a
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
126 additions
and
47 deletions
+126
-47
hmit-admin.iml
hmit-admin/hmit-admin.iml
+1
-8
WlUploadInfoController.java
...odules/competition/controller/WlUploadInfoController.java
+33
-8
WlUploadInfoDao.java
...java/io/hmit/modules/competition/dao/WlUploadInfoDao.java
+7
-1
WlUploadInfoDTO.java
...java/io/hmit/modules/competition/dto/WlUploadInfoDTO.java
+3
-3
WlUploadInfoEntity.java
...o/hmit/modules/competition/entity/WlUploadInfoEntity.java
+4
-4
WlUploadInfoExcel.java
.../io/hmit/modules/competition/excel/WlUploadInfoExcel.java
+6
-6
WlUploadInfoService.java
...hmit/modules/competition/service/WlUploadInfoService.java
+5
-0
WlUploadInfoServiceImpl.java
...les/competition/service/impl/WlUploadInfoServiceImpl.java
+28
-0
WlUploadInfoDao.xml
...src/main/resources/mapper/competition/WlUploadInfoDao.xml
+7
-2
hmit-api.iml
hmit-api/hmit-api.iml
+0
-5
WlUploadInfoController.java
.../main/java/io/hmit/controller/WlUploadInfoController.java
+8
-2
WlUploadInfoDao.java
hmit-api/src/main/java/io/hmit/dao/WlUploadInfoDao.java
+2
-1
WlUploadInfoDTO.java
hmit-api/src/main/java/io/hmit/dto/WlUploadInfoDTO.java
+3
-2
WlUploadInfoEntity.java
...-api/src/main/java/io/hmit/entity/WlUploadInfoEntity.java
+4
-4
WlUploadInfoService.java
...pi/src/main/java/io/hmit/service/WlUploadInfoService.java
+1
-0
WlUploadInfoServiceImpl.java
...in/java/io/hmit/service/impl/WlUploadInfoServiceImpl.java
+10
-0
WlUploadInfoDao.xml
hmit-api/src/main/resources/mapper/WlUploadInfoDao.xml
+4
-1
No files found.
hmit-admin/hmit-admin.iml
View file @
6c9514ae
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"CheckStyle-IDEA-Module"
>
<option
name=
"configuration"
>
<map
/>
</option>
</component>
<component
name=
"FacetManager"
>
<facet
type=
"jpa"
name=
"JPA"
>
<configuration>
<setting
name=
"validation-enabled"
value=
"true"
/>
<datasource-mapping>
<factory-entry
name=
"hmit-admin"
/>
</datasource-mapping>
<datasource-mapping
/>
<naming-strategy-map
/>
</configuration>
</facet>
...
...
hmit-admin/src/main/java/io/hmit/modules/competition/controller/WlUploadInfoController.java
View file @
6c9514ae
...
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -64,17 +65,31 @@ public class WlUploadInfoController {
return
new
Result
<
WlUploadInfoDTO
>().
ok
(
data
);
}
@GetMapping
(
"{name}"
)
@ApiOperation
(
"信息"
)
//@RequiresPermissions("competition:wluploadinfo:info")
public
Result
<
List
<
WlUploadInfoDTO
>>
selectInfo
(
@PathVariable
(
"name"
)
String
name
){
List
<
WlUploadInfoDTO
>
data
=
wlUploadInfoService
.
selectInfo
(
name
);
return
new
Result
<
List
<
WlUploadInfoDTO
>>().
ok
(
data
);
}
@PostMapping
@ApiOperation
(
"保存"
)
@LogOperation
(
"保存"
)
@RequiresPermissions
(
"competition:wluploadinfo:save"
)
//
@RequiresPermissions("competition:wluploadinfo:save")
public
Result
save
(
@RequestBody
WlUploadInfoDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
boolean
flag
=
wlUploadInfoService
.
isName
(
dto
.
getName
());
if
(
flag
){
wlUploadInfoService
.
save
(
dto
);
wlUploadInfoService
.
save
(
dto
);
return
new
Result
();
}
else
{
return
new
Result
().
error
();
}
return
new
Result
();
}
@PutMapping
...
...
@@ -103,14 +118,24 @@ public class WlUploadInfoController {
return
new
Result
();
}
@GetMapping
(
"export"
)
// @GetMapping("export")
// @ApiOperation("导出")
// @LogOperation("导出")
// @RequiresPermissions("competition:wluploadinfo:export")
// public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
// List<WlUploadInfoDTO> list = wlUploadInfoService.list(params);
// ExcelUtils.exportExcelToTarget(response, "比赛数据", list, WlUploadInfoExcel.class);
// }
@PostMapping
(
"export"
)
@ApiOperation
(
"导出"
)
@LogOperation
(
"导出"
)
@RequiresPermissions
(
"competition:wluploadinfo:export"
)
public
void
export
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
,
HttpServletResponse
response
)
throws
Exception
{
List
<
WlUploadInfoDTO
>
list
=
wlUploadInfoService
.
list
(
params
);
ExcelUtils
.
exportExcelToTarget
(
response
,
null
,
list
,
WlUploadInfoExcel
.
class
);
public
void
export
(
@RequestBody
List
<
Long
>
checklist
,
HttpServletResponse
response
)
throws
Exception
{
List
<
WlUploadInfoDTO
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
checklist
.
size
();
i
++){
list
.
add
(
wlUploadInfoService
.
get
(
checklist
.
get
(
i
)));
}
ExcelUtils
.
exportExcelToTarget
(
response
,
"比赛数据"
,
list
,
WlUploadInfoExcel
.
class
);
}
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/competition/dao/WlUploadInfoDao.java
View file @
6c9514ae
package
io
.
hmit
.
modules
.
competition
.
dao
;
import
io.hmit.common.dao.BaseDao
;
import
io.hmit.modules.competition.dto.WlUploadInfoDTO
;
import
io.hmit.modules.competition.entity.WlUploadInfoEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
* 比赛人员信息
*
...
...
@@ -12,5 +15,8 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
WlUploadInfoDao
extends
BaseDao
<
WlUploadInfoEntity
>
{
List
<
WlUploadInfoEntity
>
selectByName
(
String
name
);
int
isName
(
String
name
);
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/competition/dto/WlUploadInfoDTO.java
View file @
6c9514ae
...
...
@@ -25,6 +25,9 @@ public class WlUploadInfoDTO implements Serializable {
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"性别"
)
private
String
sex
;
@ApiModelProperty
(
value
=
"工作单位"
)
private
String
employer
;
...
...
@@ -52,9 +55,6 @@ public class WlUploadInfoDTO implements Serializable {
@ApiModelProperty
(
value
=
"体重"
)
private
String
weight
;
@ApiModelProperty
(
value
=
"衣服型号"
)
private
String
ctModel
;
@ApiModelProperty
(
value
=
"就餐"
)
private
String
dinner
;
...
...
hmit-admin/src/main/java/io/hmit/modules/competition/entity/WlUploadInfoEntity.java
View file @
6c9514ae
...
...
@@ -23,6 +23,10 @@ public class WlUploadInfoEntity extends BaseEntity {
* 姓名
*/
private
String
name
;
/**
* 性别
*/
private
String
sex
;
/**
* 工作单位
*/
...
...
@@ -59,10 +63,6 @@ public class WlUploadInfoEntity extends BaseEntity {
* 体重
*/
private
String
weight
;
/**
* 衣服型号
*/
private
String
ctModel
;
/**
* 就餐
*/
...
...
hmit-admin/src/main/java/io/hmit/modules/competition/excel/WlUploadInfoExcel.java
View file @
6c9514ae
...
...
@@ -17,6 +17,8 @@ public class WlUploadInfoExcel {
private
Long
id
;
@Excel
(
name
=
"姓名"
)
private
String
name
;
@Excel
(
name
=
"性别"
)
private
String
sex
;
@Excel
(
name
=
"工作单位"
)
private
String
employer
;
@Excel
(
name
=
"职称"
)
...
...
@@ -35,13 +37,11 @@ public class WlUploadInfoExcel {
private
String
height
;
@Excel
(
name
=
"体重"
)
private
String
weight
;
@Excel
(
name
=
"衣服型号"
)
private
String
ctModel
;
@Excel
(
name
=
"就餐"
)
private
String
dinner
;
@Excel
(
name
=
"创建时间"
)
private
Date
createTime
;
@Excel
(
name
=
"修改时间"
)
private
Date
updateTime
;
//
@Excel(name = "创建时间")
//
private Date createTime;
//
@Excel(name = "修改时间")
//
private Date updateTime;
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/competition/service/WlUploadInfoService.java
View file @
6c9514ae
...
...
@@ -4,6 +4,8 @@ import io.hmit.common.service.CrudService;
import
io.hmit.modules.competition.dto.WlUploadInfoDTO
;
import
io.hmit.modules.competition.entity.WlUploadInfoEntity
;
import
java.util.List
;
/**
* 比赛人员信息
*
...
...
@@ -12,4 +14,7 @@ import io.hmit.modules.competition.entity.WlUploadInfoEntity;
*/
public
interface
WlUploadInfoService
extends
CrudService
<
WlUploadInfoEntity
,
WlUploadInfoDTO
>
{
List
<
WlUploadInfoDTO
>
selectInfo
(
String
name
);
boolean
isName
(
String
name
);
}
\ No newline at end of file
hmit-admin/src/main/java/io/hmit/modules/competition/service/impl/WlUploadInfoServiceImpl.java
View file @
6c9514ae
...
...
@@ -2,13 +2,18 @@ package io.hmit.modules.competition.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.modules.activiti.dto.HistoryDetailDTO
;
import
io.hmit.modules.competition.dao.WlUploadInfoDao
;
import
io.hmit.modules.competition.dto.WlUploadInfoDTO
;
import
io.hmit.modules.competition.entity.WlUploadInfoEntity
;
import
io.hmit.modules.competition.service.WlUploadInfoService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -31,4 +36,27 @@ public class WlUploadInfoServiceImpl extends CrudServiceImpl<WlUploadInfoDao, Wl
}
@Override
public
List
<
WlUploadInfoDTO
>
selectInfo
(
String
name
)
{
List
<
WlUploadInfoEntity
>
wlList
=
baseDao
.
selectByName
(
name
);
List
<
WlUploadInfoDTO
>
finallist
=
new
ArrayList
<>();
// ConvertUtils.sourceToTarget(finallist,WlUploadInfoEntity.class);
for
(
WlUploadInfoEntity
wlUploadInfoEntity:
wlList
){
WlUploadInfoDTO
wlInfo
=
new
WlUploadInfoDTO
();
BeanUtils
.
copyProperties
(
wlUploadInfoEntity
,
wlInfo
);
finallist
.
add
(
wlInfo
);
}
return
finallist
;
}
@Override
public
boolean
isName
(
String
name
)
{
int
count
=
baseDao
.
isName
(
name
);
System
.
out
.
println
(
count
);
if
(
count
==
0
){
return
true
;
}
else
{
return
false
;
}
}
}
\ No newline at end of file
hmit-admin/src/main/resources/mapper/competition/WlUploadInfoDao.xml
View file @
6c9514ae
...
...
@@ -6,6 +6,7 @@
<resultMap
type=
"io.hmit.modules.competition.entity.WlUploadInfoEntity"
id=
"wlUploadInfoMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"sex"
column=
"sex"
/>
<result
property=
"employer"
column=
"employer"
/>
<result
property=
"job"
column=
"job"
/>
<result
property=
"email"
column=
"email"
/>
...
...
@@ -15,11 +16,15 @@
<result
property=
"phone"
column=
"phone"
/>
<result
property=
"height"
column=
"height"
/>
<result
property=
"weight"
column=
"weight"
/>
<result
property=
"ctModel"
column=
"ct_model"
/>
<result
property=
"dinner"
column=
"dinner"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"selectByName"
resultMap=
"wlUploadInfoMap"
>
select * from wl_upload_info where name like concat('%',#{name},'%')
</select>
<select
id=
"isName"
resultType=
"java.lang.Integer"
>
select count(*) from wl_upload_info where name = #{name}
</select>
</mapper>
\ No newline at end of file
hmit-api/hmit-api.iml
View file @
6c9514ae
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"CheckStyle-IDEA-Module"
>
<option
name=
"configuration"
>
<map
/>
</option>
</component>
<component
name=
"FacetManager"
>
<facet
type=
"Spring"
name=
"Spring"
>
<configuration
/>
...
...
hmit-api/src/main/java/io/hmit/controller/WlUploadInfoController.java
View file @
6c9514ae
...
...
@@ -67,13 +67,19 @@ public class WlUploadInfoController {
@PostMapping
@ApiOperation
(
"保存"
)
@LogOperation
(
"保存"
)
//@RequiresPermissions("competition:wluploadinfo:save")
public
Result
save
(
@RequestBody
WlUploadInfoDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
boolean
flag
=
wlUploadInfoService
.
isName
(
dto
.
getName
());
if
(
flag
){
wlUploadInfoService
.
save
(
dto
);
wlUploadInfoService
.
save
(
dto
);
return
new
Result
();
}
else
{
return
new
Result
().
error
();
}
return
new
Result
();
}
@PutMapping
...
...
hmit-api/src/main/java/io/hmit/dao/WlUploadInfoDao.java
View file @
6c9514ae
...
...
@@ -12,5 +12,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
WlUploadInfoDao
extends
BaseDao
<
WlUploadInfoEntity
>
{
int
isName
(
String
name
);
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/dto/WlUploadInfoDTO.java
View file @
6c9514ae
...
...
@@ -25,6 +25,9 @@ public class WlUploadInfoDTO implements Serializable {
@ApiModelProperty
(
value
=
"姓名"
)
private
String
name
;
@ApiModelProperty
(
value
=
"性别"
)
private
String
sex
;
@ApiModelProperty
(
value
=
"工作单位"
)
private
String
employer
;
...
...
@@ -52,8 +55,6 @@ public class WlUploadInfoDTO implements Serializable {
@ApiModelProperty
(
value
=
"体重"
)
private
String
weight
;
@ApiModelProperty
(
value
=
"衣服型号"
)
private
String
ctModel
;
@ApiModelProperty
(
value
=
"就餐"
)
private
String
dinner
;
...
...
hmit-api/src/main/java/io/hmit/entity/WlUploadInfoEntity.java
View file @
6c9514ae
...
...
@@ -23,6 +23,10 @@ public class WlUploadInfoEntity extends BaseEntity {
* 姓名
*/
private
String
name
;
/**
* 性别
*/
private
String
sex
;
/**
* 工作单位
*/
...
...
@@ -59,10 +63,6 @@ public class WlUploadInfoEntity extends BaseEntity {
* 体重
*/
private
String
weight
;
/**
* 衣服型号
*/
private
String
ctModel
;
/**
* 就餐
*/
...
...
hmit-api/src/main/java/io/hmit/service/WlUploadInfoService.java
View file @
6c9514ae
...
...
@@ -12,4 +12,5 @@ import io.hmit.entity.WlUploadInfoEntity;
*/
public
interface
WlUploadInfoService
extends
CrudService
<
WlUploadInfoEntity
,
WlUploadInfoDTO
>
{
boolean
isName
(
String
name
);
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/service/impl/WlUploadInfoServiceImpl.java
View file @
6c9514ae
...
...
@@ -31,4 +31,14 @@ public class WlUploadInfoServiceImpl extends CrudServiceImpl<WlUploadInfoDao, Wl
}
@Override
public
boolean
isName
(
String
name
)
{
int
count
=
baseDao
.
isName
(
name
);
System
.
out
.
println
(
count
);
if
(
count
==
0
){
return
true
;
}
else
{
return
false
;
}
}
}
\ No newline at end of file
hmit-api/src/main/resources/mapper/WlUploadInfoDao.xml
View file @
6c9514ae
...
...
@@ -6,6 +6,7 @@
<resultMap
type=
"io.hmit.entity.WlUploadInfoEntity"
id=
"wlUploadInfoMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"sex"
column=
"sex"
/>
<result
property=
"employer"
column=
"employer"
/>
<result
property=
"job"
column=
"job"
/>
<result
property=
"email"
column=
"email"
/>
...
...
@@ -15,11 +16,13 @@
<result
property=
"phone"
column=
"phone"
/>
<result
property=
"height"
column=
"height"
/>
<result
property=
"weight"
column=
"weight"
/>
<result
property=
"ctModel"
column=
"ct_model"
/>
<result
property=
"dinner"
column=
"dinner"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"isName"
resultType=
"java.lang.Integer"
>
select count(*) from wl_upload_info where name = #{name}
</select>
</mapper>
\ No newline at end of file
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