Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 381a1b2f
authored
Mar 04, 2022
by
邓敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
亚平换电脑BUG
1 parent
b29efd27
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
src/main/java/com/subsidy/controller/ClassDictController.java
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
src/main/resources/mapper/MemberMapper.xml
src/main/java/com/subsidy/controller/ClassDictController.java
View file @
381a1b2
...
...
@@ -38,7 +38,7 @@ public class ClassDictController {
@PostMapping
(
"getAllClasses"
)
@ApiOperation
(
"获取某公司下的所有班级 companyId 所选企业id className 班级名称 openStatus 开放状态 startDate 开始时间 endDate 结束时间"
)
@LoginRequired
(
value
=
{
ConstantUtils
.
ADMINISTER_TERMINATE
})
//
@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
public
ResponseVO
getAllClasses
(
@RequestBody
ClassDictDO
classDictDO
)
throws
Exception
{
return
ResponseData
.
generateCreatedResponse
(
0
,
classDictService
.
getAllClasses
(
classDictDO
));
}
...
...
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
View file @
381a1b2
...
...
@@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -88,10 +89,12 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
List
<
GetAllClassesVO
>
getAllClassesVOS
=
this
.
baseMapper
.
getAllClasses
(
classDictDO
);
for
(
GetAllClassesVO
getAllClassesVO
:
getAllClassesVOS
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
fmt
.
parse
(
getAllClassesVO
.
getEndDate
()));
calendar
.
set
(
Calendar
.
DATE
,
calendar
.
get
(
Calendar
.
DATE
)
+
1
);
if
(
new
Date
().
before
(
fmt
.
parse
(
getAllClassesVO
.
getStartDate
())))
{
getAllClassesVO
.
setOpenStatus
(
"1"
);
//待开始
}
else
if
(
new
Date
().
after
(
fmt
.
parse
(
getAllClassesVO
.
getEndDate
()
)))
{
}
else
if
(
new
Date
().
after
(
calendar
.
getTime
(
)))
{
getAllClassesVO
.
setOpenStatus
(
"2"
);
}
else
{
getAllClassesVO
.
setOpenStatus
(
"0"
);
...
...
src/main/resources/mapper/MemberMapper.xml
View file @
381a1b2
...
...
@@ -137,7 +137,7 @@
AND t.member_id = #{memberId}
<if
test=
"status ==1"
>
AND DATE_FORMAT(now(), '%Y-%m-%d') >= DATE_FORMAT(start_date, '%Y-%m-%d')
AND DATE_FORMAT(now(), '%Y-%m-%d')
<
DATE_FORMAT(end_date, '%Y-%m-%d')
AND DATE_FORMAT(now(), '%Y-%m-%d')
<
=
DATE_FORMAT(end_date, '%Y-%m-%d')
</if>
<if
test=
"status ==2"
>
AND DATE_FORMAT(now(), '%Y-%m-%d')
<
DATE_FORMAT(start_date, '%Y-%m-%d')
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment