Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
dbadacf7
Commit
dbadacf7
authored
Apr 09, 2020
by
luzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到时间问题
parent
e111edee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
BLessonPerson.java
...va/org/rcisoft/business/blesson/entity/BLessonPerson.java
+2
-0
BLessonPersonServiceImpl.java
...siness/blesson/service/impl/BLessonPersonServiceImpl.java
+8
-0
No files found.
src/main/java/org/rcisoft/business/blesson/entity/BLessonPerson.java
View file @
dbadacf7
...
@@ -11,6 +11,7 @@ import org.hibernate.validator.constraints.Length;
...
@@ -11,6 +11,7 @@ import org.hibernate.validator.constraints.Length;
import
org.rcisoft.business.blesson.dto.ILessonCountDTO
;
import
org.rcisoft.business.blesson.dto.ILessonCountDTO
;
import
org.rcisoft.core.entity.IdEntity
;
import
org.rcisoft.core.entity.IdEntity
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
...
@@ -81,6 +82,7 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
...
@@ -81,6 +82,7 @@ public class BLessonPerson extends IdEntity<BLessonPerson> {
private
Date
finishDate
;
private
Date
finishDate
;
@ApiModelProperty
(
value
=
"签到日期"
)
@ApiModelProperty
(
value
=
"签到日期"
)
@DateTimeFormat
(
pattern
=
"yyyy/MM/dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy/MM/dd HH:mm:ss"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy/MM/dd HH:mm:ss"
)
private
Date
signDate
;
private
Date
signDate
;
//-----------------------------
//-----------------------------
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonPersonServiceImpl.java
View file @
dbadacf7
package
org
.
rcisoft
.
business
.
blesson
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
blesson
.
service
.
impl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.blesson.dao.BAppointRepository
;
import
org.rcisoft.business.blesson.dao.BAppointRepository
;
import
org.rcisoft.business.blesson.dao.BHotRepository
;
import
org.rcisoft.business.blesson.dao.BHotRepository
;
...
@@ -33,6 +34,7 @@ import org.springframework.stereotype.Service;
...
@@ -33,6 +34,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
...
@@ -41,6 +43,7 @@ import java.util.*;
...
@@ -41,6 +43,7 @@ import java.util.*;
* @date 2019/9/10
* @date 2019/9/10
*/
*/
@Service
@Service
@Slf4j
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
class
BLessonPersonServiceImpl
implements
BLessonPersonService
{
public
class
BLessonPersonServiceImpl
implements
BLessonPersonService
{
...
@@ -366,7 +369,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
...
@@ -366,7 +369,9 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
@Override
public
PersistModel
signIn
(
QuitAndSignDTO
quitAndSignDTO
)
{
public
PersistModel
signIn
(
QuitAndSignDTO
quitAndSignDTO
)
{
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy/MM/dd HH:mm:ss"
);
BLessonPerson
bLessonPerson
=
getLessonPersonByDto
(
quitAndSignDTO
);
BLessonPerson
bLessonPerson
=
getLessonPersonByDto
(
quitAndSignDTO
);
log
.
debug
(
"=========签到1=====>>>>"
+
bLessonPerson
);
BLesson
bLesson
=
new
BLesson
();
BLesson
bLesson
=
new
BLesson
();
bLesson
.
setBusinessId
(
quitAndSignDTO
.
getLessonId
());
bLesson
.
setBusinessId
(
quitAndSignDTO
.
getLessonId
());
...
@@ -381,6 +386,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
...
@@ -381,6 +386,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
Date
now
=
new
Date
();
Date
now
=
new
Date
();
Long
time
=
Long
.
parseLong
(
bLesson
.
getTrainSignTime
())
*
60
*
1000
;
Long
time
=
Long
.
parseLong
(
bLesson
.
getTrainSignTime
())
*
60
*
1000
;
Date
signStart
=
new
Date
(
bLesson
.
getTrainStartDate
().
getTime
()
-
time
);
Date
signStart
=
new
Date
(
bLesson
.
getTrainStartDate
().
getTime
()
-
time
);
log
.
debug
(
"==========签到2========>>>>当前时间"
+
simpleDateFormat
.
format
(
now
));
//时间不在签到范围内
//时间不在签到范围内
if
(
now
.
before
(
signStart
)
||
bLesson
.
getTrainOverDate
().
before
(
now
)){
if
(
now
.
before
(
signStart
)
||
bLesson
.
getTrainOverDate
().
before
(
now
)){
throw
new
ServiceException
(
ResultServiceEnums
.
NOT_SIGN_DATE
);
throw
new
ServiceException
(
ResultServiceEnums
.
NOT_SIGN_DATE
);
...
@@ -398,8 +404,10 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
...
@@ -398,8 +404,10 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
bLessonPerson
.
setEverFinished
(
"1"
);
bLessonPerson
.
setEverFinished
(
"1"
);
}
}
bLessonPerson
.
setSignDate
(
new
Date
());
bLessonPerson
.
setSignDate
(
new
Date
());
log
.
debug
(
"========签到3======>>>>"
+
simpleDateFormat
.
format
(
bLessonPerson
.
getSignDate
()));
bLessonPerson
.
setTrainIsSign
(
"2"
);
bLessonPerson
.
setTrainIsSign
(
"2"
);
UserUtil
.
setCurrentMergeOperation
(
bLessonPerson
);
UserUtil
.
setCurrentMergeOperation
(
bLessonPerson
);
log
.
debug
(
"========签到4======>>>>"
+
bLessonPerson
);
int
line
=
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
int
line
=
bLessonPersonRepository
.
updateByPrimaryKeySelective
(
bLessonPerson
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
...
...
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