Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-staff
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9be841b0
authored
Jan 21, 2026
by
张富康
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0
2 parents
4ce824a0
18b0e184
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
217 additions
and
20 deletions
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthSalarySlipSend.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/job/StaffMonthSalaryJob.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/EffectiveReferralReviewMiniProgramService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/EffectiveReferralReviewService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthSalarySlipService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/util/DateUtils.java
rpc-dj-staff/src/main/resources/META-INF/orm/EffectiveReferralReviewMapper.xml
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthSalarySlipSendMapper.xml
rpc-dj-staff/src/test/java/cn/com/glsx/dj/staff/service/StaffMonthSalaryServiceTest.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/StaffMonthSalarySlipSend.java
View file @
9be841b
...
@@ -54,6 +54,12 @@ public class StaffMonthSalarySlipSend implements Serializable {
...
@@ -54,6 +54,12 @@ public class StaffMonthSalarySlipSend implements Serializable {
private
String
staffPhone
;
private
String
staffPhone
;
/**
/**
* 入职日期
*/
@Column
(
name
=
"entry_date"
)
private
String
entryDate
;
/**
* 业务类型(0:轻改,1:权益;2:延保)多个逗号分隔
* 业务类型(0:轻改,1:权益;2:延保)多个逗号分隔
*/
*/
@Column
(
name
=
"business_types"
)
@Column
(
name
=
"business_types"
)
...
@@ -87,7 +93,7 @@ public class StaffMonthSalarySlipSend implements Serializable {
...
@@ -87,7 +93,7 @@ public class StaffMonthSalarySlipSend implements Serializable {
* 绩效等级(1.S,2.A,3.B,4.B+,5.B-,6.C,7.D)
* 绩效等级(1.S,2.A,3.B,4.B+,5.B-,6.C,7.D)
*/
*/
@Column
(
name
=
"performance_level"
)
@Column
(
name
=
"performance_level"
)
private
Byte
performanceLevel
;
private
String
performanceLevel
;
/**
/**
* 绩效工资(取根据绩效打分后的实发绩效工资)
* 绩效工资(取根据绩效打分后的实发绩效工资)
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/job/StaffMonthSalaryJob.java
View file @
9be841b
...
@@ -2,11 +2,14 @@ package cn.com.glsx.dj.staff.job;
...
@@ -2,11 +2,14 @@ package cn.com.glsx.dj.staff.job;
import
cn.com.glsx.dj.smartcarlife.constant.CommonConstants
;
import
cn.com.glsx.dj.smartcarlife.constant.CommonConstants
;
import
cn.com.glsx.dj.smartcarlife.model.StaffBaseInfo
;
import
cn.com.glsx.dj.smartcarlife.model.StaffBaseInfo
;
import
cn.com.glsx.dj.staff.mapper.StaffMonthSalaryBaseInfoMapper
;
import
cn.com.glsx.dj.staff.mapper.StaffMonthSalarySlipSendMapper
;
import
cn.com.glsx.dj.staff.mapper.StaffMonthSalarySlipSendMapper
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalaryBaseInfo
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlipSend
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlipSend
;
import
cn.com.glsx.dj.staff.service.common.QWManager
;
import
cn.com.glsx.dj.staff.service.common.QWManager
;
import
cn.com.glsx.dj.staff.service.salary.StaffMonthSalarySlipService
;
import
cn.com.glsx.dj.staff.service.salary.StaffMonthSalarySlipService
;
import
cn.com.glsx.dj.staff.util.DateUtils
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.scrm.wechat.dto.workwechat.message.WorkWechatTextCardMessageDTO
;
import
cn.com.glsx.scrm.wechat.dto.workwechat.message.WorkWechatTextCardMessageDTO
;
...
@@ -19,13 +22,13 @@ import com.dangdang.ddframe.job.api.simple.SimpleJob;
...
@@ -19,13 +22,13 @@ import com.dangdang.ddframe.job.api.simple.SimpleJob;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf
;
import
org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.core.task.TaskExecutor
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -44,6 +47,8 @@ public class StaffMonthSalaryJob implements SimpleJob {
...
@@ -44,6 +47,8 @@ public class StaffMonthSalaryJob implements SimpleJob {
private
QWManager
qwManager
;
private
QWManager
qwManager
;
@Autowired
@Autowired
private
StaffMonthSalarySlipSendMapper
staffMonthSalarySlipSendMapper
;
private
StaffMonthSalarySlipSendMapper
staffMonthSalarySlipSendMapper
;
@Autowired
private
StaffMonthSalaryBaseInfoMapper
staffMonthSalaryBaseInfoMapper
;
@Override
@Override
public
void
execute
(
ShardingContext
shardingContext
)
{
public
void
execute
(
ShardingContext
shardingContext
)
{
...
@@ -92,16 +97,76 @@ public class StaffMonthSalaryJob implements SimpleJob {
...
@@ -92,16 +97,76 @@ public class StaffMonthSalaryJob implements SimpleJob {
private
Integer
saveSendMsg
(
StaffMonthSalarySlip
monthSalary
)
{
private
Integer
saveSendMsg
(
StaffMonthSalarySlip
monthSalary
)
{
StaffMonthSalarySlipSend
staffMonthSalarySlipSend
=
new
StaffMonthSalarySlipSend
();
StaffMonthSalarySlipSend
staffMonthSalarySlipSend
=
new
StaffMonthSalarySlipSend
();
BeanUtils
.
copyProperties
(
monthSalary
,
staffMonthSalarySlipSend
);
staffMonthSalarySlipSend
.
setStaffName
(
monthSalary
.
getStaffName
());
staffMonthSalarySlipSend
.
setStaffPhone
(
monthSalary
.
getStaffPhone
());
staffMonthSalarySlipSend
.
setBusinessTypes
(
monthSalary
.
getBusinessTypes
());
staffMonthSalarySlipSend
.
setSalaryMonth
(
DateUtils
.
formatMonthToChinese1
(
monthSalary
.
getSalaryMonth
()));
staffMonthSalarySlipSend
.
setFinalDataFlag
(
monthSalary
.
getFinalDataFlag
());
staffMonthSalarySlipSend
.
setActualWorkDay
(
monthSalary
.
getActualWorkDay
());
staffMonthSalarySlipSend
.
setMinimumSalary
(
monthSalary
.
getMinimumSalary
());
staffMonthSalarySlipSend
.
setPerformanceLevel
(
monthSalary
.
getPerformanceLevel
()
==
null
?
null
:
parsePerformanceLevelString
((
int
)
monthSalary
.
getPerformanceLevel
()));
staffMonthSalarySlipSend
.
setPerformanceSalary
(
monthSalary
.
getPerformanceSalary
());
staffMonthSalarySlipSend
.
setCommissionPrice
(
monthSalary
.
getCommissionPrice
());
staffMonthSalarySlipSend
.
setDailyDeductMoney
(
monthSalary
.
getDailyDeductMoney
());
staffMonthSalarySlipSend
.
setPadDeductMoney
(
monthSalary
.
getPadDeductMoney
());
staffMonthSalarySlipSend
.
setDeferExpenses
(
monthSalary
.
getDeferExpenses
());
staffMonthSalarySlipSend
.
setDeferIncome
(
monthSalary
.
getDeferIncome
());
staffMonthSalarySlipSend
.
setOtherDeduction
(
monthSalary
.
getOtherDeduction
());
staffMonthSalarySlipSend
.
setOtherRewards
(
monthSalary
.
getOtherRewards
());
staffMonthSalarySlipSend
.
setSalary
(
monthSalary
.
getSalary
());
staffMonthSalarySlipSend
.
setCreatedBy
(
monthSalary
.
getCreatedBy
());
staffMonthSalarySlipSend
.
setUpdatedBy
(
monthSalary
.
getUpdatedBy
());
staffMonthSalarySlipSend
.
setDeletedFlag
(
monthSalary
.
getDeletedFlag
());
staffMonthSalarySlipSend
.
setId
(
null
);
staffMonthSalarySlipSend
.
setId
(
null
);
staffMonthSalarySlipSend
.
setUuid
(
monthSalary
.
getStaffPhone
()
+
"-"
+
UUID
.
randomUUID
());
staffMonthSalarySlipSend
.
setUuid
(
monthSalary
.
getStaffPhone
()
+
"-"
+
UUID
.
randomUUID
());
staffMonthSalarySlipSend
.
setCreatedDate
(
new
Date
());
staffMonthSalarySlipSend
.
setCreatedDate
(
new
Date
());
staffMonthSalarySlipSend
.
setUpdatedDate
(
new
Date
());
staffMonthSalarySlipSend
.
setUpdatedDate
(
new
Date
());
staffMonthSalarySlipSend
.
setStatus
(
1
);
staffMonthSalarySlipSend
.
setStatus
(
1
);
// 封装入职日期
staffMonthSalarySlipSend
.
setEntryDate
(
buildEntryDate
(
monthSalary
));
staffMonthSalarySlipSendMapper
.
insertUseGeneratedKeys
(
staffMonthSalarySlipSend
);
staffMonthSalarySlipSendMapper
.
insertUseGeneratedKeys
(
staffMonthSalarySlipSend
);
return
staffMonthSalarySlipSend
.
getId
();
return
staffMonthSalarySlipSend
.
getId
();
}
}
public
static
String
parsePerformanceLevelString
(
Integer
performanceLevel
)
{
if
(
performanceLevel
==
null
)
{
return
null
;
}
List
<
Integer
>
levels
=
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
,
6
,
7
);
if
(
levels
.
contains
(
performanceLevel
))
{
switch
(
performanceLevel
)
{
case
1
:
return
"S"
;
case
2
:
return
"A"
;
case
3
:
return
"B"
;
case
4
:
return
"B+"
;
case
5
:
return
"B-"
;
case
6
:
return
"C"
;
case
7
:
return
"D"
;
}
}
log
.
error
(
"绩效等级转换异常:{}"
,
performanceLevel
);
return
null
;
}
private
String
buildEntryDate
(
StaffMonthSalarySlip
monthSalary
)
{
StaffMonthSalaryBaseInfo
staffMonthSalaryBaseInfo
=
new
StaffMonthSalaryBaseInfo
();
staffMonthSalaryBaseInfo
.
setStaffPhone
(
monthSalary
.
getStaffPhone
());
staffMonthSalaryBaseInfo
.
setSalaryMonth
(
monthSalary
.
getSalaryMonth
());
staffMonthSalaryBaseInfo
.
setDeletedFlag
(
"N"
);
List
<
StaffMonthSalaryBaseInfo
>
list
=
staffMonthSalaryBaseInfoMapper
.
select
(
staffMonthSalaryBaseInfo
);
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
return
list
.
get
(
0
).
getEntryDate
();
}
return
null
;
}
/**
/**
* 发送
* 发送
*
*
...
@@ -110,8 +175,11 @@ public class StaffMonthSalaryJob implements SimpleJob {
...
@@ -110,8 +175,11 @@ public class StaffMonthSalaryJob implements SimpleJob {
*/
*/
private
void
sendMessage
(
StaffMonthSalarySlip
monthSalary
,
Integer
id
)
{
private
void
sendMessage
(
StaffMonthSalarySlip
monthSalary
,
Integer
id
)
{
log
.
info
(
"发送员工:{},手机号:{} 工资计算结果"
,
monthSalary
.
getStaffName
(),
monthSalary
.
getStaffPhone
());
log
.
info
(
"发送员工:{},手机号:{} 工资计算结果"
,
monthSalary
.
getStaffName
(),
monthSalary
.
getStaffPhone
());
// 获取企微员工标识门店号
Integer
merchantId
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.merchantId"
,
Integer
.
class
,
44202977
);
Integer
merchantId
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.merchantId"
,
Integer
.
class
,
44202977
);
String
agentId
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.agentId"
,
String
.
class
);
// 发送自建应用消息对应(wechat-build-server)配置门店号
Integer
sendConfigMerchantId
=
env
.
getProperty
(
"staff.month.salary.send.qw.config.merchantId"
,
Integer
.
class
,
442029771
);
String
agentId
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.agentId"
,
String
.
class
,
"1000024"
);
String
titleEnv
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.title"
,
String
.
class
,
"%s工资条系统数据"
);
String
titleEnv
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.title"
,
String
.
class
,
"%s工资条系统数据"
);
String
descriptionEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.description"
,
String
.
class
,
"您好!感谢您这一月的辛勤工作,以下是您%s月的系统数据工资条,请查收!如有疑问请联系您的管辖上级处理。"
);
String
descriptionEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.description"
,
String
.
class
,
"您好!感谢您这一月的辛勤工作,以下是您%s月的系统数据工资条,请查收!如有疑问请联系您的管辖上级处理。"
);
String
urlEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.url"
,
String
.
class
);
String
urlEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.url"
,
String
.
class
);
...
@@ -126,7 +194,7 @@ public class StaffMonthSalaryJob implements SimpleJob {
...
@@ -126,7 +194,7 @@ public class StaffMonthSalaryJob implements SimpleJob {
return
;
return
;
}
}
SendWorkWechatMessageRequestDTO
requestDTO
=
new
SendWorkWechatMessageRequestDTO
();
SendWorkWechatMessageRequestDTO
requestDTO
=
new
SendWorkWechatMessageRequestDTO
();
requestDTO
.
setMerchantId
(
m
erchantId
);
requestDTO
.
setMerchantId
(
sendConfigM
erchantId
);
requestDTO
.
setAgentId
(
agentId
);
requestDTO
.
setAgentId
(
agentId
);
requestDTO
.
setToUser
(
userId
);
requestDTO
.
setToUser
(
userId
);
requestDTO
.
setMsgType
(
WorkWechatAppMessageTypeEnum
.
TEXTCARD
.
getValue
());
requestDTO
.
setMsgType
(
WorkWechatAppMessageTypeEnum
.
TEXTCARD
.
getValue
());
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/EffectiveReferralReviewMiniProgramService.java
View file @
9be841b
...
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.stereotype.Service
;
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
;
...
@@ -29,6 +30,7 @@ import tk.mybatis.mapper.entity.Example;
...
@@ -29,6 +30,7 @@ import tk.mybatis.mapper.entity.Example;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
...
@@ -42,6 +44,12 @@ public class EffectiveReferralReviewMiniProgramService {
...
@@ -42,6 +44,12 @@ public class EffectiveReferralReviewMiniProgramService {
@Autowired
@Autowired
private
CommonProxyRemote
commonProxyRemote
;
private
CommonProxyRemote
commonProxyRemote
;
@Autowired
private
EffectiveReferralReviewQwService
effectiveReferralReviewQwService
;
@Autowired
private
TaskExecutor
taskExecutor
;
public
List
<
EffectiveReferralReviewCommonDTO
>
effectiveReferralStoreList
(
EffectiveReferralReviewCommonDTO
request
)
{
public
List
<
EffectiveReferralReviewCommonDTO
>
effectiveReferralStoreList
(
EffectiveReferralReviewCommonDTO
request
)
{
//筛选项:门店名字(模糊搜索),状态:未提交、已提交,月份:2026-01,
//筛选项:门店名字(模糊搜索),状态:未提交、已提交,月份:2026-01,
//特殊逻辑:根据商户门店id去重,根据门店首字母倒序。要根据门店的不同业务场景的数据判断是否已提交和未提交。
//特殊逻辑:根据商户门店id去重,根据门店首字母倒序。要根据门店的不同业务场景的数据判断是否已提交和未提交。
...
@@ -196,6 +204,24 @@ public class EffectiveReferralReviewMiniProgramService {
...
@@ -196,6 +204,24 @@ public class EffectiveReferralReviewMiniProgramService {
referralReviewCommonDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
EffectiveReferralReviewCommonDTO:
:
getId
,
item
->
item
));
referralReviewCommonDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
EffectiveReferralReviewCommonDTO:
:
getId
,
item
->
item
));
//3、根据id更新引荐数、上传凭证、备注、状态
//3、根据id更新引荐数、上传凭证、备注、状态
AtomicReference
<
Boolean
>
sendMessageFlag
=
new
AtomicReference
<>(
false
);
updateEffectiveReferralInfo
(
dto
,
referralReviewCommonDTOSMap
,
sendMessageFlag
);
//4、异步发送企微
sendMessageAsync
(
sendMessageFlag
,
referralReviewCommonDTOS
.
get
(
0
));
return
true
;
}
/**
* 更新引荐数、上传凭证、备注、状态
*
* @param dto
* @param referralReviewCommonDTOSMap
* @param sendMessageFlag
*/
private
void
updateEffectiveReferralInfo
(
StoreEffectiveReferralSubmitDTO
dto
,
Map
<
Integer
,
EffectiveReferralReviewCommonDTO
>
referralReviewCommonDTOSMap
,
AtomicReference
<
Boolean
>
sendMessageFlag
)
{
dto
.
getEffectiveReferralCountDTOS
().
forEach
(
dto
.
getEffectiveReferralCountDTOS
().
forEach
(
item
->
{
item
->
{
EffectiveReferralReview
review
=
new
EffectiveReferralReview
();
EffectiveReferralReview
review
=
new
EffectiveReferralReview
();
...
@@ -211,6 +237,7 @@ public class EffectiveReferralReviewMiniProgramService {
...
@@ -211,6 +237,7 @@ public class EffectiveReferralReviewMiniProgramService {
&&
!
item
.
getEffectiveReferralCount
().
equals
(
referralReviewCommonDTOSMap
.
get
(
item
.
getId
()).
getTotalDeliveryCount
()))
{
&&
!
item
.
getEffectiveReferralCount
().
equals
(
referralReviewCommonDTOSMap
.
get
(
item
.
getId
()).
getTotalDeliveryCount
()))
{
review
.
setIsNeedReviewed
(
1
);
review
.
setIsNeedReviewed
(
1
);
review
.
setIsReviewed
(
0
);
review
.
setIsReviewed
(
0
);
sendMessageFlag
.
set
(
true
);
}
}
else
{
else
{
review
.
setIsNeedReviewed
(
0
);
review
.
setIsNeedReviewed
(
0
);
...
@@ -225,7 +252,20 @@ public class EffectiveReferralReviewMiniProgramService {
...
@@ -225,7 +252,20 @@ public class EffectiveReferralReviewMiniProgramService {
effectiveReferralReviewMapper
.
updateByPrimaryKeySelective
(
review
);
effectiveReferralReviewMapper
.
updateByPrimaryKeySelective
(
review
);
}
}
);
);
return
true
;
}
/**
* @description: 异步发送企微
* @param: [sendMessageFlag, referralReviewCommonDTOS]
* @return: void
*/
private
void
sendMessageAsync
(
AtomicReference
<
Boolean
>
sendMessageFlag
,
EffectiveReferralReviewCommonDTO
reviewCommonDTO
)
{
taskExecutor
.
execute
(()
->
{
if
(
sendMessageFlag
.
get
())
{
effectiveReferralReviewQwService
.
qwOnlineNotification
(
reviewCommonDTO
.
getReviewMonth
(),
reviewCommonDTO
.
getMerchantId
(),
reviewCommonDTO
.
getSceneType
());
}
}
);
}
}
/**
/**
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/EffectiveReferralReviewService.java
View file @
9be841b
...
@@ -3,19 +3,18 @@ package cn.com.glsx.dj.staff.service.perfSalary;
...
@@ -3,19 +3,18 @@ package cn.com.glsx.dj.staff.service.perfSalary;
import
cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO
;
import
cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewCommonDTO
;
import
cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO
;
import
cn.com.glsx.dj.staff.dto.perfSalary.EffectiveReferralReviewDTO
;
import
cn.com.glsx.dj.staff.dto.performance.PerformanceTimeCycleDTO
;
import
cn.com.glsx.dj.staff.dto.performance.PerformanceTimeCycleDTO
;
import
cn.com.glsx.dj.staff.dto.salary.StaffSalaryDetailDTO
;
import
cn.com.glsx.dj.staff.enums.PerformanceTimeCycleCodeEnum
;
import
cn.com.glsx.dj.staff.enums.PerformanceTimeCycleCodeEnum
;
import
cn.com.glsx.dj.staff.mapper.perfSalary.EffectiveReferralReviewMapper
;
import
cn.com.glsx.dj.staff.mapper.perfSalary.EffectiveReferralReviewMapper
;
import
cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview
;
import
cn.com.glsx.dj.staff.model.perfSalary.EffectiveReferralReview
;
import
cn.com.glsx.dj.staff.service.staffPerformance.PerformanceTimeCycleService
;
import
cn.com.glsx.dj.staff.service.staffPerformance.PerformanceTimeCycleService
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.stereotype.Service
;
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
;
...
@@ -36,6 +35,13 @@ public class EffectiveReferralReviewService {
...
@@ -36,6 +35,13 @@ public class EffectiveReferralReviewService {
@Resource
@Resource
private
PerformanceTimeCycleService
performanceTimeCycleService
;
private
PerformanceTimeCycleService
performanceTimeCycleService
;
@Autowired
private
EffectiveReferralReviewQwService
effectiveReferralReviewQwService
;
@Autowired
private
TaskExecutor
taskExecutor
;
/**
/**
* 查询门店有效数列表
* 查询门店有效数列表
*
*
...
@@ -98,9 +104,17 @@ public class EffectiveReferralReviewService {
...
@@ -98,9 +104,17 @@ public class EffectiveReferralReviewService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
void
effectiveReferralAudit
(
EffectiveReferralReviewCommonDTO
dto
)
{
public
void
effectiveReferralAudit
(
EffectiveReferralReviewCommonDTO
dto
)
{
//1、查询有效引荐数表关联门店表
List
<
EffectiveReferralReviewCommonDTO
>
referralReviewCommonDTOS
=
effectiveReferralReviewMapper
.
selectStoreEffectiveReferralList
(
dto
);
if
(
referralReviewCommonDTOS
.
isEmpty
())
{
throw
new
RpcServiceException
(
"无效的主键id"
);
}
EffectiveReferralReviewCommonDTO
effectiveReferralDTO
=
referralReviewCommonDTOS
.
get
(
0
);
//2、更新有效引荐数表
EffectiveReferralReview
effectiveReferralReview
=
new
EffectiveReferralReview
();
EffectiveReferralReview
effectiveReferralReview
=
new
EffectiveReferralReview
();
Date
curDate
=
new
Date
();
Date
curDate
=
new
Date
();
//将curDate 转化为 yyyy-MM
effectiveReferralReview
.
setId
(
dto
.
getId
());
effectiveReferralReview
.
setId
(
dto
.
getId
());
effectiveReferralReview
.
setReviewedEffectiveCount
(
dto
.
getReviewedEffectiveCount
());
effectiveReferralReview
.
setReviewedEffectiveCount
(
dto
.
getReviewedEffectiveCount
());
effectiveReferralReview
.
setIsReviewed
(
1
);
effectiveReferralReview
.
setIsReviewed
(
1
);
...
@@ -110,6 +124,11 @@ public class EffectiveReferralReviewService {
...
@@ -110,6 +124,11 @@ public class EffectiveReferralReviewService {
effectiveReferralReview
.
setUpdatedBy
(
dto
.
getUpdatedBy
());
effectiveReferralReview
.
setUpdatedBy
(
dto
.
getUpdatedBy
());
effectiveReferralReview
.
setUpdatedDate
(
curDate
);
effectiveReferralReview
.
setUpdatedDate
(
curDate
);
effectiveReferralReviewMapper
.
updateByPrimaryKeySelective
(
effectiveReferralReview
);
effectiveReferralReviewMapper
.
updateByPrimaryKeySelective
(
effectiveReferralReview
);
//3、异步发送企微通知
taskExecutor
.
execute
(()
->
{
effectiveReferralReviewQwService
.
changeCountManagerQwNotification
(
effectiveReferralDTO
.
getMerchantName
(),
effectiveReferralDTO
.
getManagerPhone
());
});
}
}
/*public String effectiveReferralExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
/*public String effectiveReferralExportData(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/salary/StaffMonthSalarySlipService.java
View file @
9be841b
...
@@ -373,7 +373,7 @@ public class StaffMonthSalarySlipService {
...
@@ -373,7 +373,7 @@ public class StaffMonthSalarySlipService {
}
}
}
}
p
rivate
Byte
parseByte
(
String
performanceLevel
,
String
errorMsg
)
{
p
ublic
static
Byte
parseByte
(
String
performanceLevel
,
String
errorMsg
)
{
if
(
StringUtils
.
isBlank
(
performanceLevel
))
{
if
(
StringUtils
.
isBlank
(
performanceLevel
))
{
return
null
;
return
null
;
}
}
...
@@ -471,6 +471,7 @@ public class StaffMonthSalarySlipService {
...
@@ -471,6 +471,7 @@ public class StaffMonthSalarySlipService {
try
{
try
{
// 按手机号、扣款月份、行为扣款类型查询
// 按手机号、扣款月份、行为扣款类型查询
StaffMonthBdmCount
bdmCount
=
new
StaffMonthBdmCount
();
StaffMonthBdmCount
bdmCount
=
new
StaffMonthBdmCount
();
bdmCount
.
setStaffName
(
staffMonthBdmCount
.
getStaffName
());
bdmCount
.
setStaffPhone
(
staffMonthBdmCount
.
getStaffPhone
());
bdmCount
.
setStaffPhone
(
staffMonthBdmCount
.
getStaffPhone
());
bdmCount
.
setDeductMonth
(
staffMonthBdmCount
.
getDeductMonth
());
bdmCount
.
setDeductMonth
(
staffMonthBdmCount
.
getDeductMonth
());
bdmCount
.
setBehaviorDeductType
(
staffMonthBdmCount
.
getBehaviorDeductType
());
bdmCount
.
setBehaviorDeductType
(
staffMonthBdmCount
.
getBehaviorDeductType
());
...
@@ -702,9 +703,32 @@ public class StaffMonthSalarySlipService {
...
@@ -702,9 +703,32 @@ public class StaffMonthSalarySlipService {
if
(
list
==
null
||
list
.
isEmpty
())
{
if
(
list
==
null
||
list
.
isEmpty
())
{
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATA_NOT_EXIST
,
"未找到员工月工资明细数据"
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
DATA_NOT_EXIST
,
"未找到员工月工资明细数据"
);
}
}
StaffMonthSalarySlipSend
slip
=
list
.
get
(
0
);
StaffMonthSalarySlipSend
monthSalary
=
list
.
get
(
0
);
StaffMonthSalarySlipSendDTO
resp
=
new
StaffMonthSalarySlipSendDTO
();
StaffMonthSalarySlipSendDTO
resp
=
new
StaffMonthSalarySlipSendDTO
();
BeanUtils
.
copyProperties
(
slip
,
resp
);
staffMonthSalarySlipSend
.
setStaffName
(
monthSalary
.
getStaffName
());
staffMonthSalarySlipSend
.
setStaffPhone
(
monthSalary
.
getStaffPhone
());
staffMonthSalarySlipSend
.
setBusinessTypes
(
monthSalary
.
getBusinessTypes
());
staffMonthSalarySlipSend
.
setSalaryMonth
(
monthSalary
.
getSalaryMonth
());
staffMonthSalarySlipSend
.
setFinalDataFlag
(
monthSalary
.
getFinalDataFlag
());
staffMonthSalarySlipSend
.
setActualWorkDay
(
monthSalary
.
getActualWorkDay
());
staffMonthSalarySlipSend
.
setMinimumSalary
(
monthSalary
.
getMinimumSalary
());
staffMonthSalarySlipSend
.
setPerformanceLevel
(
monthSalary
.
getPerformanceLevel
());
staffMonthSalarySlipSend
.
setPerformanceSalary
(
monthSalary
.
getPerformanceSalary
());
staffMonthSalarySlipSend
.
setCommissionPrice
(
monthSalary
.
getCommissionPrice
());
staffMonthSalarySlipSend
.
setDailyDeductMoney
(
monthSalary
.
getDailyDeductMoney
());
staffMonthSalarySlipSend
.
setPadDeductMoney
(
monthSalary
.
getPadDeductMoney
());
staffMonthSalarySlipSend
.
setDeferExpenses
(
monthSalary
.
getDeferExpenses
());
staffMonthSalarySlipSend
.
setDeferIncome
(
monthSalary
.
getDeferIncome
());
staffMonthSalarySlipSend
.
setOtherDeduction
(
monthSalary
.
getOtherDeduction
());
staffMonthSalarySlipSend
.
setOtherRewards
(
monthSalary
.
getOtherRewards
());
staffMonthSalarySlipSend
.
setSalary
(
monthSalary
.
getSalary
());
staffMonthSalarySlipSend
.
setCreatedBy
(
monthSalary
.
getCreatedBy
());
staffMonthSalarySlipSend
.
setUpdatedBy
(
monthSalary
.
getUpdatedBy
());
staffMonthSalarySlipSend
.
setDeletedFlag
(
monthSalary
.
getDeletedFlag
());
staffMonthSalarySlipSend
.
setId
(
monthSalary
.
getId
());
staffMonthSalarySlipSend
.
setCreatedDate
(
monthSalary
.
getCreatedDate
());
staffMonthSalarySlipSend
.
setUpdatedDate
(
monthSalary
.
getUpdatedDate
());
staffMonthSalarySlipSend
.
setStatus
(
monthSalary
.
getStatus
());
return
resp
;
return
resp
;
}
}
}
}
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/util/DateUtils.java
View file @
9be841b
...
@@ -12,6 +12,7 @@ import org.apache.commons.lang.StringUtils;
...
@@ -12,6 +12,7 @@ import org.apache.commons.lang.StringUtils;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.*
;
import
java.time.*
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
...
@@ -1506,5 +1507,28 @@ public class DateUtils extends cn.com.glsx.framework.core.util.DateUtils {
...
@@ -1506,5 +1507,28 @@ public class DateUtils extends cn.com.glsx.framework.core.util.DateUtils {
}
}
}
}
public
static
String
formatMonthToChinese1
(
String
monthStr
)
{
if
(
monthStr
==
null
||
monthStr
.
trim
().
isEmpty
())
{
throw
new
IllegalArgumentException
(
"输入字符串不能为空"
);
}
// 验证格式
if
(!
monthStr
.
matches
(
"\\d{4}-\\d{2}"
))
{
throw
new
RuntimeException
(
"输入格式不正确,应为 yyyy-MM"
);
}
SimpleDateFormat
inputFormat
=
new
SimpleDateFormat
(
"yyyy-MM"
);
SimpleDateFormat
outputFormat
=
new
SimpleDateFormat
(
"yyyy年MM月"
);
Date
date
=
null
;
try
{
date
=
inputFormat
.
parse
(
monthStr
);
}
catch
(
ParseException
e
)
{
log
.
error
(
"{} - 输入字符串格式错误"
,
monthStr
);
throw
new
RuntimeException
(
e
);
}
return
outputFormat
.
format
(
date
);
}
}
}
rpc-dj-staff/src/main/resources/META-INF/orm/EffectiveReferralReviewMapper.xml
View file @
9be841b
...
@@ -145,6 +145,9 @@
...
@@ -145,6 +145,9 @@
#{item}
#{item}
</foreach>
</foreach>
</if>
</if>
<if
test=
"id != null "
>
AND serr.id = #{id}
</if>
ORDER BY serr.id DESC
ORDER BY serr.id DESC
</select>
</select>
...
...
rpc-dj-staff/src/main/resources/META-INF/orm/StaffMonthSalarySlipSendMapper.xml
View file @
9be841b
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<result
column=
"staff_name"
property=
"staffName"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_name"
property=
"staffName"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_phone"
property=
"staffPhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_phone"
property=
"staffPhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"business_types"
property=
"businessTypes"
jdbcType=
"VARCHAR"
/>
<result
column=
"business_types"
property=
"businessTypes"
jdbcType=
"VARCHAR"
/>
<result
column=
"entry_date"
property=
"entryDate"
jdbcType=
"VARCHAR"
/>
<result
column=
"salary_month"
property=
"salaryMonth"
jdbcType=
"CHAR"
/>
<result
column=
"salary_month"
property=
"salaryMonth"
jdbcType=
"CHAR"
/>
<result
column=
"final_data_flag"
property=
"finalDataFlag"
jdbcType=
"VARCHAR"
/>
<result
column=
"final_data_flag"
property=
"finalDataFlag"
jdbcType=
"VARCHAR"
/>
<result
column=
"actual_work_day"
property=
"actualWorkDay"
jdbcType=
"DECIMAL"
/>
<result
column=
"actual_work_day"
property=
"actualWorkDay"
jdbcType=
"DECIMAL"
/>
...
@@ -36,7 +37,7 @@
...
@@ -36,7 +37,7 @@
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
id, uuid,status, err_msg, staff_name, staff_phone, business_types, salary_month, final_data_flag,
id, uuid,status, err_msg, staff_name, staff_phone,
entry_date,
business_types, salary_month, final_data_flag,
actual_work_day, minimum_salary, performance_level, performance_salary, commission_price,
actual_work_day, minimum_salary, performance_level, performance_salary, commission_price,
daily_deduct_money, pad_deduct_money, defer_expenses, defer_income, other_deduction,
daily_deduct_money, pad_deduct_money, defer_expenses, defer_income, other_deduction,
other_rewards, salary, created_by, created_date, updated_by, updated_date, deleted_flag
other_rewards, salary, created_by, created_date, updated_by, updated_date, deleted_flag
...
...
rpc-dj-staff/src/test/java/cn/com/glsx/dj/staff/service/StaffMonthSalaryServiceTest.java
View file @
9be841b
package
cn
.
com
.
glsx
.
dj
.
staff
.
service
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
service
;
import
cn.com.glsx.dj.sale.service.BaseServiceTest
;
import
cn.com.glsx.dj.sale.service.BaseServiceTest
;
import
cn.com.glsx.dj.staff.dto.salary.StaffMonthSalarySlipSendDTO
;
import
cn.com.glsx.dj.staff.dto.salary.StaffSalaryDetailDTO
;
import
cn.com.glsx.dj.staff.dto.salary.StaffSalaryDetailDTO
;
import
cn.com.glsx.dj.staff.dto.salary.StaffSalaryDetailRequestDTO
;
import
cn.com.glsx.dj.staff.dto.salary.StaffSalaryDetailRequestDTO
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
import
cn.com.glsx.dj.staff.model.StaffMonthSalarySlip
;
...
@@ -28,27 +29,38 @@ public class StaffMonthSalaryServiceTest extends BaseServiceTest {
...
@@ -28,27 +29,38 @@ public class StaffMonthSalaryServiceTest extends BaseServiceTest {
@Autowired
@Autowired
private
QWManager
qwManager
;
private
QWManager
qwManager
;
@Test
public
void
testStatStaffMonthSalary
()
{
StaffMonthSalarySlipSendDTO
requestDTO
=
new
StaffMonthSalarySlipSendDTO
();
requestDTO
.
setUuid
(
"18126301457-"
);
StaffMonthSalarySlipSendDTO
staffSalarySend
=
staffMonthSalarySlipService
.
getStaffSalarySend
(
requestDTO
);
System
.
out
.
println
(
staffSalarySend
);
}
@Test
@Test
public
void
testSendMessage
()
{
public
void
testSendMessage
()
{
Integer
merchantId
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.merchantId"
,
Integer
.
class
,
44202977
);
// Integer merchantId = env.getProperty("staff.month.salary.send.qw.notice.merchantId", Integer.class, 44202977);
// 发送自建应用消息对应(wechat-build-server)配置门店号
Integer
sendConfigMerchantId
=
env
.
getProperty
(
"staff.month.salary.send.qw.config.merchantId"
,
Integer
.
class
,
442029771
);
String
agentId
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.agentId"
,
String
.
class
,
"1000024"
);
String
userId
=
qwManager
.
getUserId
(
merchantId
,
"17620387810"
);
String
titleEnv
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.title"
,
String
.
class
,
"%s工资条系统数据"
);
String
titleEnv
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.title"
,
String
.
class
,
"%s工资条系统数据"
);
String
descriptionEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.description"
,
String
.
class
,
"您好!感谢您这一月的辛勤工作,以下是您%s月的系统数据工资条,请查收!如有疑问请联系您的管辖上级处理。"
);
String
descriptionEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.description"
,
String
.
class
,
"您好!感谢您这一月的辛勤工作,以下是您%s月的系统数据工资条,请查收!如有疑问请联系您的管辖上级处理。"
);
String
urlEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.url"
,
String
.
class
,
"http://3.cn"
);
String
urlEvn
=
env
.
getProperty
(
"staff.month.salary.send.qw.notice.url"
,
String
.
class
,
"http://3.cn"
);
// 保存发送信息
// 保存发送信息
SendWorkWechatMessageRequestDTO
requestDTO
=
new
SendWorkWechatMessageRequestDTO
();
SendWorkWechatMessageRequestDTO
requestDTO
=
new
SendWorkWechatMessageRequestDTO
();
requestDTO
.
setMerchantId
(
44202909
);
requestDTO
.
setMerchantId
(
sendConfigMerchantId
);
requestDTO
.
setToUser
(
"GL1764"
);
requestDTO
.
setToUser
(
userId
);
requestDTO
.
setMsgType
(
WorkWechatAppMessageTypeEnum
.
TEXTCARD
.
getValue
());
requestDTO
.
setMsgType
(
WorkWechatAppMessageTypeEnum
.
TEXTCARD
.
getValue
());
String
title
=
String
.
format
(
titleEnv
,
"2025-12"
.
substring
(
0
,
4
));
String
title
=
String
.
format
(
titleEnv
,
"2025-12"
.
substring
(
0
,
4
));
String
description
=
String
.
format
(
descriptionEvn
,
"2025-12"
.
substring
(
5
,
7
));
String
description
=
String
.
format
(
descriptionEvn
,
"2025-12"
.
substring
(
5
,
7
));
WorkWechatTextCardMessageDTO
textCard
=
new
WorkWechatTextCardMessageDTO
();
WorkWechatTextCardMessageDTO
textCard
=
new
WorkWechatTextCardMessageDTO
();
textCard
.
setTitle
(
title
);
textCard
.
setTitle
(
title
);
textCard
.
setDescription
(
description
);
textCard
.
setDescription
(
description
);
//
textCard.setUrl(urlEvn);
textCard
.
setUrl
(
urlEvn
);
requestDTO
.
setTextCard
(
textCard
);
requestDTO
.
setTextCard
(
textCard
);
requestDTO
.
setAgentId
(
"1000146"
);
requestDTO
.
setAgentId
(
agentId
);
SendWorkWechatMessageResponseDTO
responseDTO
=
null
;
SendWorkWechatMessageResponseDTO
responseDTO
=
null
;
try
{
try
{
responseDTO
=
qwManager
.
sendMessage
(
requestDTO
);
responseDTO
=
qwManager
.
sendMessage
(
requestDTO
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment