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
fd392830
Commit
fd392830
authored
Dec 18, 2019
by
zhangqingle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加调智信通知接口fallback
parent
a0c10bdc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
3 deletions
+60
-3
BRStudentChapterServiceImpl.java
...dentchapter/service/impl/BRStudentChapterServiceImpl.java
+6
-1
MicroappFeignClientFallBack.java
...oft/common/util/fallback/MicroappFeignClientFallBack.java
+33
-0
NotificationFeignClientFallBack.java
...common/util/fallback/NotificationFeignClientFallBack.java
+17
-0
MicroappFeignClient.java
.../rcisoft/common/util/feignClient/MicroappFeignClient.java
+2
-1
NotificationFeignClient.java
...soft/common/util/feignClient/NotificationFeignClient.java
+2
-1
No files found.
src/main/java/org/rcisoft/business/brstudentchapter/service/impl/BRStudentChapterServiceImpl.java
View file @
fd392830
...
...
@@ -86,6 +86,7 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
// 判断进度 是否大于数据库已经存在的进度
double
now
=
brStudentChapter
.
getProgress
();
if
(
now
>=
old
){
// 进度大于以前的进度
now
=
now
>
1
?
1
:
now
<
0
?
0
:
now
;
currentProgress
=
(
now
*
100
)+
"%"
;
if
(
brStudentChapterDto
.
getMaxPosition
()
!=
null
){
brStudentChapter
.
setMaxPosition
(
brStudentChapterDto
.
getMaxPosition
());
...
...
@@ -93,6 +94,7 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
line
=
bRStudentChapterRepository
.
updateById
(
brStudentChapter
);
}
else
{
// 反之,只需更新最近看的时间
brStudentChapter
.
setProgress
(
old
);
old
=
old
>
1
?
1
:
old
<
0
?
0
:
old
;
currentProgress
=
(
old
*
100
)+
"%"
;
line
=
bRStudentChapterRepository
.
updateById
(
brStudentChapter
);
}
...
...
@@ -102,7 +104,9 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
brStudentChapter
=
this
.
dealBrstudentChapter
(
brStudentChapter
,
brStudentChapterDto
);
brStudentChapter
.
setStudentId
(
brStudentChapterDto
.
getStudentId
());
brStudentChapter
.
setChapterId
(
brStudentChapterDto
.
getChapterId
());
currentProgress
=
(
brStudentChapter
.
getProgress
()*
100
)+
"%"
;
// 规避 复数 和超100% 的情况
double
progress
=
brStudentChapter
.
getProgress
()
>
1
?
1
:
brStudentChapter
.
getProgress
()
<
0
?
0
:
brStudentChapter
.
getProgress
();
currentProgress
=
(
progress
*
100
)+
"%"
;
line
=
bRStudentChapterRepository
.
insertSelective
(
brStudentChapter
);
}
}
...
...
@@ -176,6 +180,7 @@ public class BRStudentChapterServiceImpl implements BRStudentChapterService {
line
=
bChapterRepository
.
updateByPrimaryKeySelective
(
bChapter
)
>
line
?
bChapterRepository
.
updateByPrimaryKeySelective
(
bChapter
):
line
;
}
Map
map
=
new
HashMap
();
// 规避 复数 和超100% 的情况
map
.
put
(
"currentProgress"
,
currentProgress
);
return
map
;
}
...
...
src/main/java/org/rcisoft/common/util/fallback/MicroappFeignClientFallBack.java
0 → 100644
View file @
fd392830
package
org
.
rcisoft
.
common
.
util
.
fallback
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.common.util.feignClient.MicroappFeignClient
;
import
org.rcisoft.common.util.feignDto.HaveJurisdictionReqDTO
;
import
org.rcisoft.core.result.Ret
;
@Slf4j
public
class
MicroappFeignClientFallBack
implements
MicroappFeignClient
{
@Override
public
Ret
isHaveApps
(
Long
UserId
,
Long
corpId
,
Long
appId
,
String
zxClientType
,
Long
zxAccountId
)
{
log
.
error
(
"---------------调智信接口 micro_app/isHaveApps 失败-------------------"
);
return
new
Ret
();
}
@Override
public
Ret
haveJurisdictionUser
(
HaveJurisdictionReqDTO
haveJurisdictionReqDTO
,
String
zxClientType
,
Long
zxAccountId
)
{
log
.
error
(
"---------------调智信接口 /micro_app/haveJurisdictionUserFast(筛选有通知权限的人) 失败-------------------"
);
return
new
Ret
();
}
@Override
public
Ret
haveJurisdictionUserFast
(
HaveJurisdictionReqDTO
haveJurisdictionReqDTO
,
String
zxClientType
,
Long
zxAccountId
)
{
log
.
error
(
"---------------调智信接口 /micro_app/haveJurisdictionUserFast(筛选有通知权限的人-优化) 失败-------------------"
);
return
new
Ret
();
}
}
src/main/java/org/rcisoft/common/util/fallback/NotificationFeignClientFallBack.java
0 → 100644
View file @
fd392830
package
org
.
rcisoft
.
common
.
util
.
fallback
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.common.util.feignClient.NotificationFeignClient
;
import
org.rcisoft.common.util.feignDto.MTNotificationSendReqDTO
;
import
org.rcisoft.core.result.NotiRet
;
@Slf4j
public
class
NotificationFeignClientFallBack
implements
NotificationFeignClient
{
@Override
public
NotiRet
sendMessage
(
MTNotificationSendReqDTO
mtNotificationSendReqDTO
,
String
zxClientType
,
Long
zxAccountId
)
{
log
.
error
(
"---------------发送通知接口报错------------------"
);
return
new
NotiRet
();
}
}
src/main/java/org/rcisoft/common/util/feignClient/MicroappFeignClient.java
View file @
fd392830
package
org
.
rcisoft
.
common
.
util
.
feignClient
;
import
org.rcisoft.common.util.fallback.MicroappFeignClientFallBack
;
import
org.rcisoft.common.util.feignDto.HaveJurisdictionReqDTO
;
import
org.rcisoft.common.util.feignDto.MTNotificationSendReqDTO
;
import
org.rcisoft.core.result.Ret
;
...
...
@@ -12,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* 智信消息客户端接口
*/
@FeignClient
(
value
=
"ZX-MICROAPP"
)
@FeignClient
(
value
=
"ZX-MICROAPP"
,
fallback
=
MicroappFeignClientFallBack
.
class
)
public
interface
MicroappFeignClient
{
/**
...
...
src/main/java/org/rcisoft/common/util/feignClient/NotificationFeignClient.java
View file @
fd392830
package
org
.
rcisoft
.
common
.
util
.
feignClient
;
import
org.rcisoft.common.util.fallback.NotificationFeignClientFallBack
;
import
org.rcisoft.core.result.NotiRet
;
import
org.rcisoft.core.result.Ret
;
import
org.rcisoft.common.util.feignDto.MTNotificationSendReqDTO
;
...
...
@@ -14,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* 智信消息客户端接口
*/
@Component
@FeignClient
(
value
=
"ZX-NOTIFICATION"
)
@FeignClient
(
value
=
"ZX-NOTIFICATION"
,
fallback
=
NotificationFeignClientFallBack
.
class
)
public
interface
NotificationFeignClient
{
/**
...
...
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