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
0478a6a5
Commit
0478a6a5
authored
Nov 28, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BUG
parent
b6a2997f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
110 additions
and
3 deletions
+110
-3
BLessonPersonRepository.java
...rcisoft/business/blesson/dao/BLessonPersonRepository.java
+11
-0
BLessonRepository.java
...a/org/rcisoft/business/blesson/dao/BLessonRepository.java
+7
-1
FindLessonAtMessageTaskDTO.java
...soft/business/blesson/dto/FindLessonAtMessageTaskDTO.java
+22
-0
BLesson.java
...ain/java/org/rcisoft/business/blesson/entity/BLesson.java
+4
-0
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+3
-0
BMessageRepository.java
...org/rcisoft/business/bmessage/dao/BMessageRepository.java
+12
-0
messageTask.java
src/main/java/org/rcisoft/core/task/messageTask.java
+42
-2
BLessonMapper.xml
...esources/mapper/business/blesson/mapper/BLessonMapper.xml
+9
-0
No files found.
src/main/java/org/rcisoft/business/blesson/dao/BLessonPersonRepository.java
View file @
0478a6a5
...
@@ -463,6 +463,17 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
...
@@ -463,6 +463,17 @@ public interface BLessonPersonRepository extends BaseMapper<BLessonPerson> {
" where business_id=#{businessId}"
,
" where business_id=#{businessId}"
,
"</script>"
})
"</script>"
})
int
updateAtChapter
(
BLessonPerson
bLessonPerson
);
int
updateAtChapter
(
BLessonPerson
bLessonPerson
);
/**
* 根据课程Id 查询人员id
* @param lessonId
* @return
*/
@Select
(
"select business_id from b_lesson_person where 1=1 "
+
" and del_flag = 0 and flag = 1 "
+
" and lesson_id = #{lessonId} "
)
List
<
String
>
queryPersonId
(
String
lessonId
);
}
}
src/main/java/org/rcisoft/business/blesson/dao/BLessonRepository.java
View file @
0478a6a5
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
package
org
.
rcisoft
.
business
.
blesson
.
dao
;
import
org.apache.ibatis.annotations.*
;
import
org.apache.ibatis.annotations.*
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.blabel.dto.QueryLabelResDTO
;
import
org.rcisoft.business.blabel.dto.QueryLabelResDTO
;
import
org.rcisoft.business.blesson.dto.*
;
import
org.rcisoft.business.blesson.dto.*
;
import
org.rcisoft.business.blesson.entity.*
;
import
org.rcisoft.business.blesson.entity.*
;
...
@@ -1160,5 +1159,12 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
...
@@ -1160,5 +1159,12 @@ public interface BLessonRepository extends BaseMapper<BLesson> {
" </script>"
)
" </script>"
)
int
isInViewRange
(
@Param
(
"curUser"
)
CurUser
curUser
,
@Param
(
"lessonId"
)
String
lessonId
,
@Param
(
"departs"
)
List
<
String
>
departs
);
int
isInViewRange
(
@Param
(
"curUser"
)
CurUser
curUser
,
@Param
(
"lessonId"
)
String
lessonId
,
@Param
(
"departs"
)
List
<
String
>
departs
);
@Select
(
"<script>"
+
" select business_id, lesson_name "
+
" from b_lesson where 1 = 1 "
+
" and del_flag = 0 and flag = 1 "
+
" AND #{param.nowDate} between SUBDATE(train_start_date,interval #{param.timeValue} ${param.valueTypeStr}) and SUBDATE(SUBDATE(train_start_date,interval #{param.timeValue} ${param.valueTypeStr}),interval -60 second)</script>"
)
@ResultMap
(
value
=
"MessageResultMap"
)
List
<
BLesson
>
selectLessonAtMessageTask
(
@Param
(
"param"
)
FindLessonAtMessageTaskDTO
param
);
}
}
src/main/java/org/rcisoft/business/blesson/dto/FindLessonAtMessageTaskDTO.java
0 → 100644
View file @
0478a6a5
package
org
.
rcisoft
.
business
.
blesson
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
FindLessonAtMessageTaskDTO
{
private
String
corpId
;
private
String
timeValue
;
private
String
valueTypeStr
;
private
Date
nowDate
;
}
src/main/java/org/rcisoft/business/blesson/entity/BLesson.java
View file @
0478a6a5
...
@@ -270,6 +270,10 @@ public class BLesson extends IdEntity<BLesson> {
...
@@ -270,6 +270,10 @@ public class BLesson extends IdEntity<BLesson> {
@Transient
@Transient
private
Date
signStartDate
;
private
Date
signStartDate
;
@Transient
@ApiModelProperty
(
value
=
"学员id集合"
)
List
<
String
>
personList
;
public
void
initModel
(){
public
void
initModel
(){
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
// this.setDefaultUrl(global.getDEFAULT_COURSE_LOCATION());
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
0478a6a5
...
@@ -1380,6 +1380,9 @@ public class BLessonServiceImpl implements BLessonService {
...
@@ -1380,6 +1380,9 @@ public class BLessonServiceImpl implements BLessonService {
List
<
StudentTrackingRspDTO
>
studentTrackingRspDTOList
=
bLessonPersonRepository
.
userManageLesson
(
userLessonDTO
,
trainTypeSelStr
);
List
<
StudentTrackingRspDTO
>
studentTrackingRspDTOList
=
bLessonPersonRepository
.
userManageLesson
(
userLessonDTO
,
trainTypeSelStr
);
Date
now
=
new
Date
();
Date
now
=
new
Date
();
studentTrackingRspDTOList
.
forEach
(
studentTrackingRspDTO
->
{
studentTrackingRspDTOList
.
forEach
(
studentTrackingRspDTO
->
{
if
(
studentTrackingRspDTO
.
getTrainStartDate
()
==
null
||
studentTrackingRspDTO
.
getTrainOverDate
()
==
null
||
studentTrackingRspDTO
.
getTrainSignTime
()
==
null
){
return
;
}
Long
time
=
Long
.
parseLong
(
studentTrackingRspDTO
.
getTrainSignTime
())
*
60
*
1000
;
Long
time
=
Long
.
parseLong
(
studentTrackingRspDTO
.
getTrainSignTime
())
*
60
*
1000
;
Date
signStart
=
new
Date
(
studentTrackingRspDTO
.
getTrainStartDate
().
getTime
()
-
time
);
Date
signStart
=
new
Date
(
studentTrackingRspDTO
.
getTrainStartDate
().
getTime
()
-
time
);
if
(
now
.
before
(
signStart
)){
if
(
now
.
before
(
signStart
)){
...
...
src/main/java/org/rcisoft/business/bmessage/dao/BMessageRepository.java
View file @
0478a6a5
...
@@ -40,5 +40,17 @@ public interface BMessageRepository extends BaseMapper<BMessage> {
...
@@ -40,5 +40,17 @@ public interface BMessageRepository extends BaseMapper<BMessage> {
"#{item.name},#{item.timeValue},#{item.valueType},#{item.corpId},#{item.sort})"
+
"#{item.name},#{item.timeValue},#{item.valueType},#{item.corpId},#{item.sort})"
+
"</foreach></script>"
)
"</foreach></script>"
)
int
insertList
(
List
<
BMessage
>
bMessageList
);
int
insertList
(
List
<
BMessage
>
bMessageList
);
/**
* 查询 bMessage
*
*/
@Select
(
"<script>select * from b_message where 1=1 "
+
" and del_flag = 0 "
+
" and name = #{name} "
+
"</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BMessage
>
queryByNameAndCorp
(
@Param
(
"name"
)
String
name
);
}
}
src/main/java/org/rcisoft/core/task/messageTask.java
View file @
0478a6a5
...
@@ -3,23 +3,63 @@ package org.rcisoft.core.task;
...
@@ -3,23 +3,63 @@ package org.rcisoft.core.task;
//通知定时任务
//通知定时任务
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.blesson.dao.BLessonRepository
;
import
org.rcisoft.business.blesson.dto.FindLessonAtMessageTaskDTO
;
import
org.rcisoft.business.blesson.entity.BLesson
;
import
org.rcisoft.business.bmessage.dao.BMessageRepository
;
import
org.rcisoft.business.bmessage.entity.BMessage
;
import
org.rcisoft.common.util.feignDto.MTNotificationSendReqDTO
;
import
org.rcisoft.common.util.outClient.MTNotificationApiRequestClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
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.util.Date
;
import
java.util.List
;
@Component
@Component
@Slf4j
@Slf4j
public
class
messageTask
{
public
class
messageTask
{
@Autowired
BMessageRepository
bMessageRepository
;
@Autowired
BLessonRepository
bLessonRepository
;
@Scheduled
(
cron
=
"0 0/1 * * * ?"
)
@Autowired
MTNotificationApiRequestClient
mtNotificationApiRequestClient
;
// @Scheduled(cron = "0/20 * * * * ?")
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
void
work
()
throws
Exception
{
public
void
work
()
throws
Exception
{
Date
nowDate
=
new
Date
();
//判断是否开启
//判断是否开启
List
<
BMessage
>
bMessagePXJJKSList
=
bMessageRepository
.
queryByNameAndCorp
(
"PXJJKS"
);
//判断是否在设定时间内
//判断是否在设定时间内
if
(
bMessagePXJJKSList
!=
null
&&
bMessagePXJJKSList
.
size
()
>
0
){
bMessagePXJJKSList
.
forEach
(
bMessage
->
{
if
(
bMessage
!=
null
&&
"1"
.
equals
(
bMessage
.
getFlag
())){
String
valueTypeStr
=
"MINUTE"
;
if
(
"2"
.
equals
(
bMessage
.
getValueType
())){
valueTypeStr
=
"HOUR"
;
}
if
(
"3"
.
equals
(
bMessage
.
getValueType
())){
valueTypeStr
=
"DAY"
;
}
FindLessonAtMessageTaskDTO
param
=
new
FindLessonAtMessageTaskDTO
(
bMessage
.
getCorpId
(),
bMessage
.
getTimeValue
(),
valueTypeStr
,
nowDate
);
List
<
BLesson
>
bLessonList
=
bLessonRepository
.
selectLessonAtMessageTask
(
param
);
if
(
bLessonList
!=
null
&&
bLessonList
.
size
()
>
0
){
bLessonList
.
forEach
(
bLesson
->
{
// MTNotificationSendReqDTO mtNotificationSendReqDTO = new MTNotificationSendReqDTO();
});
}
}
});
}
//在时间内发送通知
//在时间内发送通知
}
}
}
}
src/main/resources/mapper/business/blesson/mapper/BLessonMapper.xml
View file @
0478a6a5
...
@@ -196,4 +196,13 @@
...
@@ -196,4 +196,13 @@
<!--<resultMap id="SupperChildListResultMap" type="org.rcisoft.business.blesson.entity.BLesson" extends="BaseResultMap">-->
<!--<resultMap id="SupperChildListResultMap" type="org.rcisoft.business.blesson.entity.BLesson" extends="BaseResultMap">-->
<!--<association column="business_id" property="labelList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId"></association>-->
<!--<association column="business_id" property="labelList" select="org.rcisoft.business.blesson.dao.BLessonRepository.queryLabelByLessonId"></association>-->
<!--</resultMap>-->
<!--</resultMap>-->
<resultMap
id=
"MessageResultMap"
type=
"org.rcisoft.business.blesson.entity.BLesson"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"lesson_name"
jdbcType=
"VARCHAR"
property=
"lessonName"
/>
<collection
property=
"personList"
ofType=
"string"
javaType=
"java.util.ArrayList"
select=
"org.rcisoft.business.blesson.dao.BLessonPersonRepository.queryPersonId"
column=
"business_id"
>
</collection>
</resultMap>
</mapper>
</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