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
5c5e034f
Commit
5c5e034f
authored
Apr 24, 2025
by
huyuchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.10' into MVP1.7.10
parents
7a92fab3
2558dfee
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
444 additions
and
11 deletions
+444
-11
TEmployeeInfoController.java
.../v1/yifu/archives/controller/TEmployeeInfoController.java
+9
-1
TEmployeeInfoMapper.java
...oud/plus/v1/yifu/archives/mapper/TEmployeeInfoMapper.java
+3
-0
TEmployeeInfoService.java
...d/plus/v1/yifu/archives/service/TEmployeeInfoService.java
+2
-0
TEmployeeInfoServiceImpl.java
.../yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
+10
-0
TEmployeeInfoMapper.xml
...ves-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
+13
-0
Common.java
.../com/yifu/cloud/plus/v1/yifu/common/core/util/Common.java
+16
-0
ArchivesDaprUtil.java
...cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
+15
-0
InsuranceAlertWx.java
...fu/cloud/plus/v1/yifu/insurances/vo/InsuranceAlertWx.java
+43
-0
InsuranceAlertWxVo.java
.../cloud/plus/v1/yifu/insurances/vo/InsuranceAlertWxVo.java
+37
-0
TInsurancesWarnController.java
...yifu/insurances/controller/TInsurancesWarnController.java
+13
-0
TInsuranceDetailMapper.java
.../insurances/mapper/insurances/TInsuranceDetailMapper.java
+1
-1
TInsuranceWarnMapper.java
...fu/insurances/mapper/insurances/TInsuranceWarnMapper.java
+4
-0
TInsuranceWarnService.java
...u/insurances/service/insurance/TInsuranceWarnService.java
+3
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+1
-1
TInsuranceWarnServiceImpl.java
...ces/service/insurance/impl/TInsuranceWarnServiceImpl.java
+250
-8
TInsuranceWarnMapper.xml
...main/resources/mapper/insurances/TInsuranceWarnMapper.xml
+12
-0
UpdateOverdueTask.java
...com/yifu/cloud/plus/v1/job/compont/UpdateOverdueTask.java
+12
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TEmployeeInfoController.java
View file @
5c5e034f
...
...
@@ -48,6 +48,7 @@ import javax.servlet.http.HttpServletResponse;
import
javax.validation.Valid
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
...
...
@@ -597,5 +598,12 @@ public class TEmployeeInfoController {
public
R
<
String
>
updateEmpPhone
(
@RequestParam
String
id
,
@RequestParam
String
empPhoneOld
,
@RequestParam
String
empPhoneNew
)
{
return
tEmployeeInfoService
.
updateEmpPhone
(
id
,
empPhoneOld
,
empPhoneNew
);
}
/**
* 远程接口获取非在职档案(无档案或已离职)
*/
@Inner
@PostMapping
(
"/inner/getEmpOnlineMap"
)
public
Set
<
String
>
getCustomerUserMap
(
@RequestBody
List
<
String
>
empIdCardList
)
{
return
tEmployeeInfoService
.
getEmpOnlineMap
(
empIdCardList
);
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/mapper/TEmployeeInfoMapper.java
View file @
5c5e034f
...
...
@@ -26,6 +26,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Set
;
/**
* 人员档案表
...
...
@@ -143,4 +144,6 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
List
<
HcmEmployeeInfoVO
>
getHcmEmpInfoList
(
@Param
(
"idCardList"
)
List
<
String
>
idCardList
);
void
updateEmployeeAgeTask
();
Set
<
String
>
getEmpOnlineMap
(
@Param
(
"empIdCardList"
)
List
<
String
>
empIdCardList
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TEmployeeInfoService.java
View file @
5c5e034f
...
...
@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.InputStream
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 人员档案表
...
...
@@ -291,4 +292,5 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
**/
R
<
TEmployeeInfo
>
getByEmpNameAndCard
(
String
empName
,
String
empIdCard
);
Set
<
String
>
getEmpOnlineMap
(
List
<
String
>
empIdCardList
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeInfoServiceImpl.java
View file @
5c5e034f
...
...
@@ -4283,5 +4283,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return
R
.
failed
(
"无该员工信息"
);
}
}
/**
* 远程接口获取非在职档案(无档案或已离职)
*/
@Override
public
Set
<
String
>
getEmpOnlineMap
(
List
<
String
>
empIdCardList
)
{
if
(
empIdCardList
==
null
||
empIdCardList
.
isEmpty
())
{
return
null
;
// 返回空
}
return
baseMapper
.
getEmpOnlineMap
(
empIdCardList
);
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TEmployeeInfoMapper.xml
View file @
5c5e034f
...
...
@@ -1400,4 +1400,17 @@
<update
id=
"updateEmployeeAgeTask"
>
update t_employee_info set EMP_AGE = YEAR(CURRENT_DATE())-YEAR(STR_TO_DATE(SUBSTRING(EMP_IDCARD,7,4),'%Y')) where EMP_IDCARD is not null and DELETE_FLAG='0' and SUBSTRING(EMP_IDCARD,7,1) in ('1','2')
</update>
<select
id=
"getEmpOnlineMap"
resultType=
"java.lang.String"
>
SELECT EMP_IDCARD
FROM t_employee_info
WHERE EMP_IDCARD IN
<foreach
item=
"idCard"
index=
"index"
collection=
"empIdCardList"
open=
"("
separator=
","
close=
")"
>
#{idCard}
</foreach>
and FILE_STATUS = '1'
<!-- 已减档 -->
and DELETE_FLAG ='0'
<!-- 未删除 -->
</select>
</mapper>
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/Common.java
View file @
5c5e034f
...
...
@@ -40,6 +40,22 @@ public class Common {
public
static
boolean
isEmpty
(
String
str
)
{
return
null
==
str
||
""
.
equals
(
str
.
trim
())
||
"null"
.
equals
(
str
.
trim
())
||
"undefinded"
.
equals
(
str
.
trim
());
}
/**
* @Author fxj
* @Description 字符串空 转换为0 异常转换为0
* @Date 15:17 2025/4/24
**/
public
static
int
isEmptyToZero
(
String
str
)
{
if
(
isEmpty
(
str
)){
return
0
;
}
try
{
return
Integer
.
parseInt
(
str
);
}
catch
(
Exception
e
){
return
0
;
}
}
/**
* 截取startStr和endStr中间的字符串(开区间)
*
...
...
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/ArchivesDaprUtil.java
View file @
5c5e034f
...
...
@@ -22,6 +22,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @Author fxj
...
...
@@ -574,4 +575,18 @@ public class ArchivesDaprUtil {
}
return
res
;
}
/**
* @Author fxj
* @Description 远程接口获取非在职档案(无档案或已离职)
* @Date 10:51 2025/4/24
**/
public
R
<
Set
<
String
>>
getEmpOnlineMap
(
List
<
String
>
empIdCardList
){
R
<
Set
>
res
=
HttpDaprUtil
.
invokeMethodPost
(
daprArchivesProperties
.
getAppUrl
(),
daprArchivesProperties
.
getAppId
(),
"/temployeeinfo/inner/getEmpOnlineMap"
,
JSON
.
toJSONString
(
empIdCardList
),
Set
.
class
,
SecurityConstants
.
FROM_IN
);
if
(
Common
.
isEmpty
(
res
)){
return
R
.
failed
(
"获取档案派单信息失败!"
);
}
Set
<
String
>
map
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
res
.
getData
()),
new
TypeReference
<
Set
<
String
>>(){});
return
R
.
ok
(
map
);
}
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceAlertWx.java
0 → 100644
View file @
5c5e034f
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author fxj
* @Description 企业微信推送商险到期提醒
* @Date 19:13 2025/4/23
* @Param
* @return
**/
@Data
@Tag
(
name
=
"企业微信推送商险待办信息"
)
public
class
InsuranceAlertWx
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2689686777914935788L
;
/**
* 项目编码
*/
@Schema
(
description
=
"项目编码"
)
private
String
deptNo
;
/**
* 项目名称
*/
@Schema
(
description
=
"项目名称"
)
private
String
projectName
;
/**
* 临期
*/
@Schema
(
description
=
"临期"
)
private
String
lq
;
/**
* 过期
*/
@Schema
(
description
=
"过期"
)
private
String
gq
;
}
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/InsuranceAlertWxVo.java
0 → 100644
View file @
5c5e034f
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @Author fxj
* @Description 企业微信推送商险到期提醒组装信息
* @Date 19:13 2025/4/23
* @Param
* @return
**/
@Data
@Tag
(
name
=
"企业微信推送商险待办信息组装信息"
)
public
class
InsuranceAlertWxVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2689686777914935788L
;
/**
* 项目数
*/
@Schema
(
description
=
"项目数"
)
private
int
domainNum
;
/**
* 临期数
*/
@Schema
(
description
=
"临期数"
)
private
int
lqNum
;
/**
* 过期数
*/
@Schema
(
description
=
"过期数"
)
private
int
gqNum
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/controller/TInsurancesWarnController.java
View file @
5c5e034f
...
...
@@ -139,4 +139,17 @@ public class TInsurancesWarnController {
public
void
createInsuranceAlert
()
{
insuranceWarnService
.
createInsuranceAlert
();
}
/**
* @Author fxj
* @Description 每日09:00推送一条整合的待办数据——只推送前端客服,详情去HRO处理——消息待定:项目名称-项目编码、商险临期人数:**;商险过期人数:**;
* ——项目数:***、商险临期人数:***、商险过期人数:***,请及时至HRO系统进行处理,以免人员脱保!;
* @Date 18:55 2025/4/23
**/
@Operation
(
description
=
"每天9:00推送整合后的待办商险数据给对应项目的前端客服信息"
)
@Inner
@PostMapping
(
"/inner/pushInsuranceAlertToWx"
)
public
void
pushInsuranceAlertToWx
()
{
insuranceWarnService
.
pushInsuranceAlertToWx
();
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/insurances/TInsuranceDetailMapper.java
View file @
5c5e034f
...
...
@@ -318,7 +318,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
int
noPageCountDiy
(
@Param
(
"param"
)
InsuranceSearchVo
searchVo
);
void
batchexpireIgnore
(
@Param
(
"idList"
)
List
<
String
>
idList
);
void
batchexpireIgnore
(
@Param
(
"idList"
)
List
<
String
>
idList
,
@Param
(
"remark"
)
String
remark
);
void
batchexpireAlertIgnore
(
@Param
(
"idList"
)
List
<
String
>
idList
,
@Param
(
"remark"
)
String
remark
);
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/insurances/TInsuranceWarnMapper.java
View file @
5c5e034f
...
...
@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAlertWx
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
...
...
@@ -22,4 +23,7 @@ public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
* @return {@link List < TInsuranceAlert >}
*/
List
<
TInsuranceAlert
>
selectInsuranceAlert
();
List
<
InsuranceAlertWx
>
getInsuranceAlertToWx
();
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/TInsuranceWarnService.java
View file @
5c5e034f
...
...
@@ -12,4 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert;
public
interface
TInsuranceWarnService
extends
IService
<
TInsuranceAlert
>
{
void
createInsuranceAlert
();
void
pushInsuranceAlertToWx
();
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
5c5e034f
...
...
@@ -7915,7 +7915,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Common
.
isEmpty
(
ids
)
||
Common
.
isEmpty
(
remark
)){
return
R
.
failed
(
CommonConstants
.
PARAM_IS_NOT_ERROR
);
}
baseMapper
.
batchexpireIgnore
(
ids
);
baseMapper
.
batchexpireIgnore
(
ids
,
remark
);
//更新商险到期提醒表
baseMapper
.
batchexpireAlertIgnore
(
ids
,
remark
);
return
R
.
ok
();
...
...
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceWarnServiceImpl.java
View file @
5c5e034f
...
...
@@ -2,29 +2,36 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUsersVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo
;
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.DateUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
com.yifu.cloud.plus.v1.yifu.insurances.config.WxConfig
;
import
com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.SysConfig
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.SysConfigMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceWarnMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceWarnService
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAlertWx
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAlertWxVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.
util.List
;
import
java.util.
Map
;
import
org.springframework.web.client.RestTemplate
;
import
java.
time.LocalDateTime
;
import
java.util.
*
;
import
java.util.stream.Collectors
;
...
...
@@ -42,7 +49,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
@Autowired
private
SysConfigMapper
sysConfigMapper
;
@Autowired
private
WxConfig
wxConfig
;
@Override
public
void
createInsuranceAlert
()
{
//批量删除所有未忽略的提醒数据
...
...
@@ -87,9 +95,63 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
}
catch
(
Exception
e
){
log
.
error
(
"商险不购买提醒初始化停用客服异常:"
,
e
);
}
//处理已经离职数据,分批请求,每次请求1000条数据,返回在职人员信息
R
<
Set
<
String
>>
onlineSet
;
R
<
Set
<
String
>>
onlineSetTemp
=
new
R
<>();
if
(
list
.
size
()
<=
1000
){
onlineSetTemp
=
archivesDaprUtil
.
getEmpOnlineMap
(
list
.
stream
().
map
(
TInsuranceAlert:
:
getEmpIdcardNo
).
collect
(
Collectors
.
toList
()));
}
else
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
i
%
1000
==
0
)
{
onlineSet
=
archivesDaprUtil
.
getEmpOnlineMap
(
list
.
stream
().
map
(
TInsuranceAlert:
:
getEmpIdcardNo
).
collect
(
Collectors
.
toList
()));
if
(
null
!=
onlineSet
&&
Common
.
isNotNull
(
onlineSet
.
getData
()))
{
onlineSetTemp
.
getData
().
addAll
(
onlineSet
.
getData
());
}
}
}
}
//如果不存在离职人员直接走生成逻辑
if
(
Common
.
isNotKong
(
onlineSetTemp
.
getData
())){
// 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
removeLeaver
(
list
,
onlineSetTemp
);
}
//不为空生成数据
if
(
Common
.
isNotKong
(
list
)){
this
.
saveOrUpdateBatch
(
list
);
}
}
}
/**
* @Author fxj
* @Description 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
* @Date 14:24 2025/4/24
* @Param
* @return
**/
private
void
removeLeaver
(
List
<
TInsuranceAlert
>
list
,
R
<
Set
<
String
>>
onlineSetTemp
)
{
// 边界条件检查
if
(
list
==
null
||
list
.
isEmpty
())
{
return
;
// 如果列表为空或为 null,直接返回
}
// 使用 Iterator 安全地遍历并移除元素
Iterator
<
TInsuranceAlert
>
iterator
=
list
.
iterator
();
Set
<
String
>
idCardSet
=
null
;
if
(
onlineSetTemp
!=
null
&&
onlineSetTemp
.
getData
()
!=
null
)
{
idCardSet
=
new
HashSet
<>(
onlineSetTemp
.
getData
());
// 提高查找效率
}
else
{
idCardSet
=
new
HashSet
<>();
// 如果 onlineSetTemp 数据为空,初始化为空集合
}
// 提高查找效率
while
(
iterator
.
hasNext
())
{
TInsuranceAlert
vo
=
iterator
.
next
();
String
empIdcardNo
=
vo
.
getEmpIdcardNo
();
// 如果身份证号存在于集合中,则移除该对象
if
(
empIdcardNo
!=
null
&&
idCardSet
.
contains
(
empIdcardNo
))
{
iterator
.
remove
();
}
}
}
/**
* @Author fxj
...
...
@@ -146,7 +208,10 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
Map
<
String
,
SysUser
>
sysUserMap
,
Map
<
String
,
TSettleDomain
>
domainHashMap
,
SysConfig
sysConfig
)
{
if
(
Common
.
isNotNull
(
userMap
)
&&
Common
.
isNotKong
(
domainHashMap
)){
if
(
Common
.
isEmpty
(
userMap
)){
userMap
=
new
HashMap
<>();
}
if
(
Common
.
isNotKong
(
domainHashMap
)){
TSettleDomain
domain
;
SysUser
user
;
String
loginName
;
...
...
@@ -182,4 +247,181 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
}
}
}
/**
* @Author fxj
* @Description 每日09:00推送一条整合的待办数据——只推送前端客服,详情去HRO处理——消息待定:项目名称-项目编码、商险临期人数:**;商险过期人数:**;
* ——项目数:***、商险临期人数:***、商险过期人数:***,请及时至HRO系统进行处理,以免人员脱保!;
* @Date 18:55 2025/4/23
**/
@Override
public
void
pushInsuranceAlertToWx
()
{
try
{
//先获取每个人的项目提醒信息
List
<
InsuranceAlertWx
>
list
=
baseMapper
.
getInsuranceAlertToWx
();
if
(
Common
.
isNotKong
(
list
)){
Map
<
String
,
TSettleDomain
>
domainHashMap
=
null
;
Map
<
String
,
StringBuilder
>
pushMap
=
new
HashMap
<>();
Map
<
String
,
SysUser
>
sysUserMap
=
new
HashMap
<>();
List
<
String
>
codes
=
new
ArrayList
<>();
list
.
stream
().
forEach
(
vo
->
{
codes
.
add
(
vo
.
getDeptNo
());
});
if
(
Common
.
isNotKong
(
codes
))
{
//获取对应项目信息
R
<
TSettleDomainListVo
>
infoByCodes
=
archivesDaprUtil
.
getSettleInfoByCodes
(
codes
);
if
(
null
!=
infoByCodes
&&
Common
.
isNotNull
(
infoByCodes
.
getData
())
&&
Common
.
isNotNull
(
infoByCodes
.
getData
().
getMapVO
()))
{
domainHashMap
=
infoByCodes
.
getData
().
getMapVO
();
}
}
sysUserMap
=
getMapInfo
(
domainHashMap
,
codes
);
//组装推送到企业微信的信息
extracted
(
list
,
domainHashMap
,
pushMap
,
sysUserMap
);
//开始推送信息到企业微信
if
(
Common
.
isNotKong
(
pushMap
)){
pushMap
.
forEach
((
k
,
v
)
->
{
sendMessageToWx
(
k
,
v
);
});
}
}
}
catch
(
Exception
e
){
log
.
error
(
"推送商险待办信息到企业微信异常"
,
e
);
}
}
/**
* @Author fxj
* @Description 组装推送到企业微信的信息
* @Date 20:20 2025/4/23
**/
private
void
extracted
(
List
<
InsuranceAlertWx
>
list
,
Map
<
String
,
TSettleDomain
>
domainHashMap
,
Map
<
String
,
StringBuilder
>
pushMap
,
Map
<
String
,
SysUser
>
sysUserMap
)
{
if
(
Common
.
isNotNull
(
domainHashMap
)
&&
Common
.
isNotNull
(
sysUserMap
)){
TSettleDomain
domain
;
SysUser
user
;
StringBuilder
content
;
Map
<
String
,
InsuranceAlertWxVo
>
tempMap
=
new
HashMap
<>();
InsuranceAlertWxVo
temp
;
String
deptNo
;
//计算每个前端客服有多少个项目并保存到map
Map
<
String
,
Integer
>
countMap
=
new
HashMap
<>();
for
(
InsuranceAlertWx
wx:
list
)
{
deptNo
=
wx
.
getDeptNo
();
if
(
Common
.
isEmpty
(
deptNo
))
{
continue
;
// 跳过无效的 deptNo
}
domain
=
domainHashMap
.
get
(
deptNo
);
if
(
Common
.
isEmpty
(
domain
)
||
Common
.
isEmpty
(
domain
.
getCsLoginName
())){
continue
;
}
String
csLoginName
=
domain
.
getCsLoginName
();
countMap
.
put
(
csLoginName
,
countMap
.
getOrDefault
(
csLoginName
,
0
)
+
1
);
}
for
(
InsuranceAlertWx
wx:
list
)
{
deptNo
=
wx
.
getDeptNo
();
if
(
Common
.
isEmpty
(
deptNo
))
{
continue
;
// 跳过无效的 deptNo
}
domain
=
domainHashMap
.
get
(
deptNo
);
if
(
Common
.
isEmpty
(
domain
)
||
Common
.
isEmpty
(
domain
.
getCsLoginName
())){
continue
;
}
user
=
sysUserMap
.
get
(
domain
.
getCsLoginName
());
if
(
Common
.
isEmpty
(
user
)
||
Common
.
isEmpty
(
user
.
getWxMessage
()))
{
continue
;
// 跳过无效的 user 或 wxMessage
}
temp
=
tempMap
.
computeIfAbsent
(
user
.
getWxMessage
(),
k
->
new
InsuranceAlertWxVo
());
temp
.
setDomainNum
(
countMap
.
get
(
domain
.
getCsLoginName
()));
temp
.
setGqNum
(
temp
.
getGqNum
()+
Common
.
isEmptyToZero
(
wx
.
getGq
()));
temp
.
setLqNum
(
temp
.
getLqNum
()+
Common
.
isEmptyToZero
(
wx
.
getLq
()));
tempMap
.
put
(
user
.
getWxMessage
(),
temp
);
}
for
(
InsuranceAlertWx
wx:
list
){
deptNo
=
wx
.
getDeptNo
();
if
(
Common
.
isEmpty
(
deptNo
))
{
continue
;
// 跳过无效的 deptNo
}
domain
=
domainHashMap
.
get
(
deptNo
);
if
(
Common
.
isEmpty
(
domain
)){
continue
;
}
user
=
sysUserMap
.
get
(
domain
.
getCsLoginName
());
if
(
Common
.
isEmpty
(
user
)
||
Common
.
isEmpty
(
user
.
getWxMessage
()))
{
continue
;
// 跳过无效的 user 或 wxMessage
}
temp
=
tempMap
.
get
(
user
.
getWxMessage
());
if
(
Common
.
isEmpty
(
temp
)){
continue
;
}
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
user
.
getLockFlag
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
user
.
getDelFlag
())){
content
=
pushMap
.
get
(
user
.
getWxMessage
());
if
(
Common
.
isEmpty
(
content
)){
content
=
new
StringBuilder
();
content
.
append
(
String
.
format
(
"项目数:%d、商险临期人数:%d、商险过期人数:%d,<br/>"
,
temp
.
getDomainNum
(),
temp
.
getGqNum
(),
temp
.
getLqNum
()));
pushMap
.
put
(
user
.
getWxMessage
(),
content
);
}
}
}
}
}
/**
* @Author fxj
* @Description 初始化 项目信息及项目对应用户信息
* @Date 19:49 2025/4/23
**/
private
Map
<
String
,
SysUser
>
getMapInfo
(
Map
<
String
,
TSettleDomain
>
domainHashMap
,
List
<
String
>
codes
)
{
Map
<
String
,
SysUser
>
sysUserMap
=
null
;
if
(
Common
.
isNotKong
(
codes
))
{
// 获取项目对应的前端客服用户信息--客服账号需要正常
if
(
Common
.
isNotKong
(
domainHashMap
))
{
// 逗号拼接用户名,最后去除最后的逗号
String
userNames
=
domainHashMap
.
values
().
stream
()
.
map
(
val
->
val
.
getCsLoginName
())
// 提取 CsLoginName
.
filter
(
name
->
name
!=
null
)
// 过滤掉 null 值
.
collect
(
Collectors
.
toSet
())
//去重
.
stream
()
.
collect
(
Collectors
.
joining
(
CommonConstants
.
COMMA_STRING
));
if
(
userNames
.
length
()
>
CommonConstants
.
ZERO_INT
)
{
R
<
SysUserListVo
>
res
=
upmsDaprUtils
.
getUserIdsByUserNames
(
userNames
);
List
<
SysUser
>
users
=
null
;
if
(
Common
.
isNotNull
(
res
)
&&
Common
.
isNotNull
(
res
.
getData
())
&&
Common
.
isNotNull
(
res
.
getData
().
getUserList
()))
{
users
=
res
.
getData
().
getUserList
();
}
if
(
Common
.
isNotKong
(
users
))
{
sysUserMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
k
->
k
.
getUsername
(),
v
->
v
));
}
}
}
}
return
sysUserMap
;
}
//发送企业微信待办
private
void
sendMessageToWx
(
String
useruserWx
,
StringBuilder
content
)
{
if
(
Common
.
isEmpty
(
useruserWx
)
||
Common
.
isEmpty
(
content
))
{
return
;
}
StringBuilder
sendUser
=
null
;
if
(
Common
.
isNotKong
(
useruserWx
))
{
sendUser
=
new
StringBuilder
(
useruserWx
);
}
if
(
sendUser
!=
null
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
textcard
=
new
HashMap
<>();
textcard
.
put
(
"title"
,
"<b>商险待办提醒</b>"
);
textcard
.
put
(
"url"
,
String
.
format
(
SecurityConstants
.
WX_GET_MESSAGE_AUTH_URL
,
wxConfig
.
getCorpid
(),
wxConfig
.
getDomainName
()
+
"/auth/oauth/wxLogin"
,
"66"
));
content
.
append
(
"请及时至HRO系统进行处理,以免人员脱保!"
);
textcard
.
put
(
"description"
,
content
.
toString
());
requestMap
.
put
(
"touser"
,
sendUser
);
requestMap
.
put
(
"agentid"
,
wxConfig
.
getAgentid
());
requestMap
.
put
(
"msgtype"
,
"textcard"
);
requestMap
.
put
(
"textcard"
,
textcard
);
// 必须加上header说明
if
(!
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
))
{
wxConfig
.
sendTextCard
(
restTemplate
,
requestMap
);
}
}
}
}
\ No newline at end of file
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceWarnMapper.xml
View file @
5c5e034f
...
...
@@ -144,4 +144,16 @@
AND ll.endTime = a.POLICY_END
where a.DELETE_FLAG = '0'
</select>
<resultMap
id=
"PushWxResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAlertWx"
>
<result
property=
"projectName"
column=
"DEPT_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"deptNo"
column=
"DEPT_NO"
jdbcType=
"VARCHAR"
/>
<result
property=
"lq"
column=
"lq"
jdbcType=
"VARCHAR"
/>
<result
property=
"gq"
column=
"gq"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"getInsuranceAlertToWx"
resultMap=
"PushWxResultMap"
>
select a.DEPT_NAME,a.DEPT_NO,
SUM(case when a.IS_OVERDUE='0' THEN 1 ELSE 0 END) as 'lq',
SUM(CASE WHEN a.IS_OVERDUE='1' THEN 1 ELSE 0 END) as 'gq'
from t_insurance_alert a GROUP BY a.DEPT_NO,a.IS_OVERDUE
</select>
</mapper>
yifu-job/yifu-job-api/src/main/java/com/yifu/cloud/plus/v1/job/compont/UpdateOverdueTask.java
View file @
5c5e034f
...
...
@@ -98,4 +98,16 @@ public class UpdateOverdueTask {
"/temployeeinsurancepre/inner/pushDisConfrimInsurances"
,
""
,
Void
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"-------------每天三点二十推送商险待确认信息-定时任务开始------------"
);
}
/**
* @Author fxj
* @Description 每天刷新商险待办信息到微信
* @Date 20:22 2025/4/23
**/
public
void
everyDaypushInsuranceAlertToWx
()
{
log
.
info
(
"-------------每天刷新商险待办信息到微信-定时任务开始------------"
);
HttpDaprUtil
.
invokeMethodPost
(
daprInsurancesProperties
.
getAppUrl
(),
daprInsurancesProperties
.
getAppId
(),
"/insuranceWarn/inner/pushInsuranceAlertToWx"
,
""
,
Void
.
class
,
SecurityConstants
.
FROM_IN
);
log
.
info
(
"-------------每天刷新商险待办信息到微信-定时任务结束------------"
);
}
}
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