Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
abe0b70b
Commit
abe0b70b
authored
Aug 28, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EKP 权限-- 配置文件
parent
781ce7b4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
450 deletions
+2
-450
pom.xml
yifu-permission/pom.xml
+2
-2
MsgInfoService.java
...yifu/cloud/plus/v1/permission/service/MsgInfoService.java
+0
-52
TMessageInfoService.java
...cloud/plus/v1/permission/service/TMessageInfoService.java
+0
-45
MsgInfoServiceImpl.java
...d/plus/v1/permission/service/impl/MsgInfoServiceImpl.java
+0
-215
TMessageInfoServiceImpl.java
...s/v1/permission/service/impl/TMessageInfoServiceImpl.java
+0
-136
No files found.
yifu-permission/pom.xml
View file @
abe0b70b
...
...
@@ -7,8 +7,8 @@
<version>
1.0.0
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
yifu-
msg
</artifactId>
<description>
EKP
消息
服务
</description>
<artifactId>
yifu-
permission
</artifactId>
<description>
EKP
-权限
服务
</description>
<packaging>
pom
</packaging>
<!--项目子模块-->
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/MsgInfoService.java
deleted
100644 → 0
View file @
781ce7b4
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.msg.entity.MsgInfo
;
import
com.yifu.cloud.plus.v1.msg.vo.EkpAlertVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.util.List
;
/**
*
*
* @author fxj
* @date 2023-06-01 10:41:25
*/
public
interface
MsgInfoService
extends
IService
<
MsgInfo
>
{
/**
* 简单分页查询
* @param msgInfo
* @return
*/
IPage
<
MsgInfo
>
getMsgInfoPage
(
Page
<
MsgInfo
>
page
,
MsgInfo
msgInfo
);
List
<
MsgInfo
>
getMsgInfo
(
MsgInfo
msgInfo
);
R
<
Boolean
>
createMsg
(
EkpAlertVo
vo
);
void
updateOverTimeMsg
();
void
statusChangeTimeMsg
();
void
cancelHandledMsg
();
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/TMessageInfoService.java
deleted
100644 → 0
View file @
781ce7b4
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.msg.entity.TMessageInfo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
/**
* 消息提醒
*
* @author huyc
* @date 2023-07-26 14:19:33
*/
public
interface
TMessageInfoService
extends
IService
<
TMessageInfo
>
{
/**
* 消息提醒简单分页查询
* @param tMessageInfo 消息提醒
* @return
*/
IPage
<
TMessageInfo
>
getTMessageInfoPage
(
Page
<
TMessageInfo
>
page
,
TMessageInfo
tMessageInfo
);
R
<
Boolean
>
saveMessage
(
TMessageInfo
tMessageInfo
);
void
updateMessageInfo
(
TMessageInfo
tMessageInfo
);
R
<
Long
>
selectMessageCount
(
TMessageInfo
tMessageInfo
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/MsgInfoServiceImpl.java
deleted
100644 → 0
View file @
781ce7b4
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.msg.constant.MesConstants
;
import
com.yifu.cloud.plus.v1.msg.entity.MsgInfo
;
import
com.yifu.cloud.plus.v1.msg.mapper.MsgInfoMapper
;
import
com.yifu.cloud.plus.v1.msg.service.MsgInfoService
;
import
com.yifu.cloud.plus.v1.msg.vo.EkpAlertVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
*
*
* @author fxj
* @date 2023-06-01 10:41:25
*/
@Log4j2
@Service
public
class
MsgInfoServiceImpl
extends
ServiceImpl
<
MsgInfoMapper
,
MsgInfo
>
implements
MsgInfoService
{
/**
* 简单分页查询
* @param msgInfo
* @return
*/
@Override
public
IPage
<
MsgInfo
>
getMsgInfoPage
(
Page
<
MsgInfo
>
page
,
MsgInfo
msgInfo
){
return
baseMapper
.
getMsgInfoPage
(
page
,
msgInfo
);
}
@Override
public
List
<
MsgInfo
>
getMsgInfo
(
MsgInfo
msgInfo
)
{
return
baseMapper
.
getMsgInfo
(
msgInfo
);
}
/**
* @Author fxj
* @Description 生成 待办 变更 提醒数据
* @Date 19:36 2023/5/30
* @Param
* @return
**/
@Override
public
R
<
Boolean
>
createMsg
(
EkpAlertVo
vo
)
{
if
(
Common
.
isNotNull
(
vo
)){
if
(
Common
.
isEmpty
(
vo
.
getItem
())
||
Common
.
isEmpty
(
vo
.
getType
())
||
Common
.
isEmpty
(
vo
.
getOrderId
())
||
Common
.
isEmpty
(
vo
.
getAlertUser
())){
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
MsgInfo
save
=
null
;
// 项目订单处理
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getItem
())){
// 接单提醒
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
vo
.
getType
())){
save
=
baseMapper
.
getMsgByOrderId
(
vo
.
getOrderId
());
if
(
Common
.
isNotNull
(
save
)){
save
.
setCreateTime
(
LocalDateTime
.
now
());
save
.
setUrl
(
MesConstants
.
orderUrl
+
vo
.
getOrderId
());
save
.
setAlertUser
(
vo
.
getAlertUser
().
replace
(
"\""
,
""
));
baseMapper
.
insert
(
save
);
log
.
error
(
JSON
.
toJSONString
(
save
));
}
}
// 变更提醒
if
(
CommonConstants
.
TWO_STRING
.
equals
(
vo
.
getType
())){
save
=
baseMapper
.
getMsgByOrderId
(
vo
.
getOrderId
());
if
(
Common
.
isNotNull
(
save
)){
save
.
setCreateTime
(
LocalDateTime
.
now
());
save
.
setUrl
(
MesConstants
.
orderUrl
+
save
.
getOrderId
());
save
.
setAlertType
(
CommonConstants
.
TWO_STRING
);
save
.
setAlertUser
(
vo
.
getAlertUser
().
replace
(
"\""
,
""
));
baseMapper
.
insert
(
save
);
log
.
error
(
JSON
.
toJSONString
(
save
));
}
}
}
return
R
.
ok
();
}
else
{
return
R
.
failed
(
CommonConstants
.
PARAM_INFO_ERROR
);
}
}
/**
* @Author fxj
* @Description 定时刷新待办任务
* @Date 20:07 2023/5/30
* @Param
* @return
**/
@Transactional
@Override
public
void
updateOverTimeMsg
()
{
// 获取所有已经产生的数据 后面直接排除
List
<
MsgInfo
>
temps
=
baseMapper
.
selectList
(
Wrappers
.<
MsgInfo
>
query
().
lambda
()
.
eq
(
MsgInfo:
:
getAlertType
,
CommonConstants
.
ONE_STRING
));
Map
<
String
,
MsgInfo
>
tempMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
temps
)){
for
(
MsgInfo
msg:
temps
){
tempMap
.
put
(
msg
.
getOrderNo
(),
msg
);
}
}
List
<
MsgInfo
>
msgInfos
=
baseMapper
.
getMsgByTask
();
List
<
MsgInfo
>
saves
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
msgInfos
)){
//2. 重新生成
MsgInfo
temp
;
for
(
MsgInfo
ms:
msgInfos
){
temp
=
tempMap
.
get
(
ms
.
getOrderNo
());
if
(
Common
.
isNotNull
(
temp
)){
tempMap
.
remove
(
ms
.
getOrderNo
());
continue
;
}
ms
.
setCreateTime
(
LocalDateTime
.
now
());
ms
.
setUrl
(
MesConstants
.
orderUrl
+
ms
.
getOrderId
());
saves
.
add
(
ms
);
}
if
(
Common
.
isNotNull
(
tempMap
)){
this
.
removeByIds
(
tempMap
.
values
().
stream
().
map
(
MsgInfo:
:
getId
).
collect
(
Collectors
.
toList
()));
}
if
(
Common
.
isNotNull
(
saves
)){
this
.
saveBatch
(
saves
);
// 发给李鑫
for
(
MsgInfo
sv:
saves
){
sv
.
setId
(
null
);
sv
.
setAlertUser
(
"lixin"
);
}
this
.
saveBatch
(
saves
);
// 发给高叶卉
for
(
MsgInfo
sv:
saves
){
sv
.
setId
(
null
);
sv
.
setAlertUser
(
"gaoyh"
);
}
this
.
saveBatch
(
saves
);
}
}
}
/**
* @Author wzb
* @Description 薪资状态变更待支出提醒
* @Date 14:58 2023/7/3
* @Param
* @return
**/
@Transactional
@Override
public
void
statusChangeTimeMsg
(){
List
<
MsgInfo
>
temps
=
baseMapper
.
selectList
(
Wrappers
.<
MsgInfo
>
query
().
lambda
()
.
eq
(
MsgInfo:
:
getAlertType
,
CommonConstants
.
THREE_STRING
));
Map
<
String
,
MsgInfo
>
tempMap
=
new
HashMap
<>();
if
(
Common
.
isNotNull
(
temps
)){
for
(
MsgInfo
msg:
temps
){
tempMap
.
put
(
msg
.
getOrderNo
(),
msg
);
}
}
List
<
MsgInfo
>
msgInfos
=
baseMapper
.
getMsgByTaskOne
();
List
<
MsgInfo
>
saves
=
new
ArrayList
<>();
if
(
Common
.
isNotNull
(
msgInfos
)){
//2. 重新生成
MsgInfo
temp
;
for
(
MsgInfo
ms:
msgInfos
){
temp
=
tempMap
.
get
(
ms
.
getOrderNo
());
if
(
Common
.
isNotNull
(
temp
)){
tempMap
.
remove
(
ms
.
getOrderNo
());
continue
;
}
ms
.
setCreateTime
(
LocalDateTime
.
now
());
ms
.
setUrl
(
MesConstants
.
orderUrl
+
ms
.
getOrderId
());
saves
.
add
(
ms
);
}
if
(
Common
.
isNotNull
(
tempMap
)){
this
.
removeByIds
(
tempMap
.
values
().
stream
().
map
(
MsgInfo:
:
getId
).
collect
(
Collectors
.
toList
()));
}
this
.
saveBatch
(
saves
);
}
}
@Override
public
void
cancelHandledMsg
()
{
baseMapper
.
deleteHandledMsg
();
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/TMessageInfoServiceImpl.java
deleted
100644 → 0
View file @
781ce7b4
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
msg
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.msg.config.WxConfig
;
import
com.yifu.cloud.plus.v1.msg.entity.TMessageInfo
;
import
com.yifu.cloud.plus.v1.msg.mapper.TMessageInfoMapper
;
import
com.yifu.cloud.plus.v1.msg.service.TMessageInfoService
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 消息提醒
*
* @author huyc
* @date 2023-07-26 14:19:33
*/
@Log4j2
@Service
@AllArgsConstructor
public
class
TMessageInfoServiceImpl
extends
ServiceImpl
<
TMessageInfoMapper
,
TMessageInfo
>
implements
TMessageInfoService
{
@Autowired
private
final
UpmsDaprUtils
upmsDaprUtils
;
@Autowired
private
WxConfig
wxConfig
;
/**
* 消息提醒简单分页查询
* @param tMessageInfo 消息提醒
* @return
*/
@Override
public
IPage
<
TMessageInfo
>
getTMessageInfoPage
(
Page
<
TMessageInfo
>
page
,
TMessageInfo
tMessageInfo
){
return
baseMapper
.
getTMessageInfoPage
(
page
,
tMessageInfo
);
}
@Override
public
R
<
Boolean
>
saveMessage
(
TMessageInfo
tMessageInfo
)
{
//企业微信通知
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
tMessageInfo
.
getWxFlag
()))
{
//获取人员的账号
R
<
SysUser
>
simpleUser
=
upmsDaprUtils
.
getSimpleUser
(
tMessageInfo
.
getAlertUserId
());
if
(
null
!=
simpleUser
&&
null
!=
simpleUser
.
getData
())
{
SysUser
user
=
simpleUser
.
getData
();
if
(
Common
.
isEmpty
(
user
)
||
Common
.
isEmpty
(
user
.
getWxMessage
()))
{
return
R
.
failed
(
"未找到对应的人员信息"
);
}
else
{
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
String
authUrl
=
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
(),
wxConfig
.
getAuthUrl
(),
CommonConstants
.
ONE_STRING
+
tMessageInfo
.
getModelId
());
textcard
.
put
(
"title"
,
"审批待处理"
);
textcard
.
put
(
"url"
,
authUrl
);
StringBuilder
description
=
new
StringBuilder
();
description
.
append
(
"申请人:"
).
append
(
tMessageInfo
.
getSubmitUser
()).
append
(
"<br>"
);
description
.
append
(
"待处理人:"
).
append
(
tMessageInfo
.
getAlertUser
()).
append
(
"<br>"
);
description
.
append
(
"模块:"
).
append
(
tMessageInfo
.
getModelType
());
textcard
.
put
(
"description"
,
description
.
toString
());
requestMap
.
put
(
"touser"
,
user
.
getWxMessage
());
requestMap
.
put
(
"agentid"
,
wxConfig
.
getAgentid
());
requestMap
.
put
(
"msgtype"
,
"textcard"
);
requestMap
.
put
(
"textcard"
,
textcard
);
// 必须加上header说明
if
(!
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
))
{
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
);
}
}
}
}
baseMapper
.
insert
(
tMessageInfo
);
return
R
.
ok
();
}
@Override
public
void
updateMessageInfo
(
TMessageInfo
tMessageInfo
)
{
if
(
Common
.
isNotNull
(
tMessageInfo
)
&&
Common
.
isNotNull
(
tMessageInfo
.
getAlertUser
()))
{
TMessageInfo
tMessageInfo1
=
null
;
if
(
Common
.
isNotNull
(
tMessageInfo
.
getModelId
()))
{
tMessageInfo1
=
baseMapper
.
selectOne
(
Wrappers
.<
TMessageInfo
>
query
().
lambda
()
.
eq
(
TMessageInfo:
:
getAlertUser
,
tMessageInfo
.
getAlertUser
())
.
eq
(
TMessageInfo:
:
getModelId
,
tMessageInfo
.
getModelId
())
.
orderByDesc
(
TMessageInfo:
:
getCreateTime
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
else
if
(
Common
.
isNotNull
(
tMessageInfo
.
getInfoUrl
())){
tMessageInfo1
=
baseMapper
.
selectOne
(
Wrappers
.<
TMessageInfo
>
query
().
lambda
()
.
eq
(
TMessageInfo:
:
getAlertUser
,
tMessageInfo
.
getAlertUser
())
.
eq
(
TMessageInfo:
:
getInfoUrl
,
tMessageInfo
.
getInfoUrl
())
.
orderByDesc
(
TMessageInfo:
:
getCreateTime
).
last
(
CommonConstants
.
LAST_ONE_SQL
));
}
if
(
Common
.
isNotNull
(
tMessageInfo1
))
{
tMessageInfo1
.
setHandlerStatus
(
tMessageInfo
.
getHandlerStatus
());
}
}
}
@Override
public
R
<
Long
>
selectMessageCount
(
TMessageInfo
tMessageInfo
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
return
R
.
ok
(
baseMapper
.
selectCount
(
Wrappers
.<
TMessageInfo
>
query
().
lambda
()
.
eq
(
TMessageInfo:
:
getAlertUserId
,
user
.
getId
())
.
eq
(
TMessageInfo:
:
getHandlerStatus
,
CommonConstants
.
ONE_STRING
)));
}
}
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