Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
V
volunteer_service
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
licc
volunteer_service
Commits
0d23ea2f
Commit
0d23ea2f
authored
Feb 07, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改方案查询记录列表接口返回参数
parent
b95df660
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
9 deletions
+26
-9
Volunteer.java
...model/src/main/java/cn/wisenergy/model/app/Volunteer.java
+9
-0
SchemeRecordServiceImpl.java
...n/wisenergy/service/app/impl/SchemeRecordServiceImpl.java
+17
-9
No files found.
wisenergy-model/src/main/java/cn/wisenergy/model/app/Volunteer.java
View file @
0d23ea2f
...
...
@@ -2,6 +2,7 @@ package cn.wisenergy.model.app;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -135,5 +136,13 @@ public class Volunteer implements Serializable {
@ApiModelProperty
(
"是否删除 1,删除;0,未删除"
)
private
Integer
isDelete
;
/**
* 方案查询时间
*/
@ApiModelProperty
(
value
=
"方案查询时间"
,
name
=
"queryTime"
)
@TableField
(
exist
=
false
)
private
Date
queryTime
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/SchemeRecordServiceImpl.java
View file @
0d23ea2f
...
...
@@ -94,7 +94,13 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
return
R
.
error
(
"入参为空!"
);
}
//1、根据用户id和方案记录id,获取志愿ids
//1、获取方案查询记录
SchemeQueryRecord
schemeQueryRecord
=
schemeRecordMapper
.
selectById
(
recordId
);
if
(
null
==
schemeQueryRecord
)
{
return
R
.
error
(
"方案查询记录信息不存在!"
);
}
//2、根据用户id和方案记录id,获取志愿ids
QueryWrapper
<
UserVolunteer
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"user_id"
,
userId
);
queryWrapper
.
eq
(
"scheme_record_id"
,
recordId
);
...
...
@@ -105,13 +111,17 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
List
<
Integer
>
ids
=
list
.
stream
().
map
(
UserVolunteer:
:
getVolunteerId
).
collect
(
Collectors
.
toList
());
List
<
Volunteer
>
result
=
volunteerMapper
.
getListByIds
(
ids
);
for
(
Volunteer
volunteer
:
result
)
{
volunteer
.
setQueryTime
(
schemeQueryRecord
.
getCreateTime
());
}
result
.
sort
(
Comparator
.
comparing
(
Volunteer:
:
getLowestMark
).
reversed
());
return
R
.
ok
(
result
);
}
/**
* 方案导出
* @param userId 用户id
*
* @param userId 用户id
* @param recordId 方案查询记录id
* @return
*/
...
...
@@ -140,7 +150,7 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
Document
document
=
new
Document
(
PageSize
.
A4
);
//创建文件名称
Long
lon
=
System
.
currentTimeMillis
();
Long
lon
=
System
.
currentTimeMillis
();
// 2.建立一个书写器(Writer)与document对象关联
OutputStream
buffer
=
new
ByteArrayOutputStream
();
...
...
@@ -151,7 +161,7 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
// 4.向文档中添加内容
PdfUtil
pdfUtil
=
new
PdfUtil
();
pdfUtil
.
generatePDF
(
document
,
result
);
pdfUtil
.
generatePDF
(
document
,
result
);
// 5.关闭文档
document
.
close
();
...
...
@@ -164,8 +174,7 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
DataOutput
output
=
new
DataOutputStream
(
response
.
getOutputStream
());
byte
[]
bytes
=
((
ByteArrayOutputStream
)
buffer
).
toByteArray
();
response
.
setContentLength
(
bytes
.
length
);
for
(
int
i
=
0
;
i
<
bytes
.
length
;
i
++
)
{
for
(
int
i
=
0
;
i
<
bytes
.
length
;
i
++)
{
output
.
writeByte
(
bytes
[
i
]);
}
...
...
@@ -174,13 +183,12 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
((
DataOutputStream
)
output
).
close
();
}
catch
(
Exception
e
)
{
return
R
.
ok
(
1
,
false
);
return
R
.
ok
(
1
,
false
);
}
return
R
.
ok
(
0
,
true
);
return
R
.
ok
(
0
,
true
);
}
/**
* 分页处理
*
...
...
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