Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rpc-scrm-shopmall
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 53348141
authored
Mar 03, 2026
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fear(score): 积分手动调整功能
1 parent
18d95f50
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
11 deletions
rpc-scrm-shopmall-api/src/main/java/cn/com/glsx/scrm/shopmall/dto/integral/IntegralTransferOutOperationDTO.java
rpc-scrm-shopmall-api/src/main/java/cn/com/glsx/scrm/shopmall/dto/integral/motivation/ShopmallStaffMotivationDTO.java
rpc-scrm-shopmall-api/src/main/java/cn/com/glsx/scrm/shopmall/enums/integral/StaffMotivationGenerateTypeEnum.java
rpc-scrm-shopmall/src/main/java/cn/com/glsx/scrm/shopmall/service/integral/IntegralTransferOutService.java
rpc-scrm-shopmall/src/main/java/cn/com/glsx/scrm/shopmall/service/integral/StaffMotivationService.java
rpc-scrm-shopmall/src/main/resources/META-INF/orm/IntegralChannelAccountMapper.xml
rpc-scrm-shopmall-api/src/main/java/cn/com/glsx/scrm/shopmall/dto/integral/IntegralTransferOutOperationDTO.java
View file @
5334814
...
@@ -28,4 +28,7 @@ public class IntegralTransferOutOperationDTO extends IntegralTransferOutOperatio
...
@@ -28,4 +28,7 @@ public class IntegralTransferOutOperationDTO extends IntegralTransferOutOperatio
@ApiModelProperty
(
notes
=
"代征主体编码"
)
@ApiModelProperty
(
notes
=
"代征主体编码"
)
private
String
levyCode
;
private
String
levyCode
;
@ApiModelProperty
(
notes
=
"银行通道编码"
)
private
String
levyChannelCode
;
}
}
rpc-scrm-shopmall-api/src/main/java/cn/com/glsx/scrm/shopmall/dto/integral/motivation/ShopmallStaffMotivationDTO.java
View file @
5334814
package
cn
.
com
.
glsx
.
scrm
.
shopmall
.
dto
.
integral
.
motivation
;
package
cn
.
com
.
glsx
.
scrm
.
shopmall
.
dto
.
integral
.
motivation
;
import
cn.com.glsx.scrm.shopmall.enums.integral.StaffMotivationAuditSourceEnum
;
import
cn.com.glsx.scrm.shopmall.enums.integral.StaffMotivationAuditSourceEnum
;
import
cn.com.glsx.scrm.shopmall.enums.integral.StaffMotivationGenerateTypeEnum
;
import
cn.com.glsx.scrm.shopmall.model.ShopmallStaffMotivation
;
import
cn.com.glsx.scrm.shopmall.model.ShopmallStaffMotivation
;
import
cn.com.glsx.scrm.shopmall.model.ShopmallStaffMotivationOperation
;
import
cn.com.glsx.scrm.shopmall.model.ShopmallStaffMotivationOperation
;
import
cn.com.glsx.stoassistant.enums.ScoreInfoNameEnum
;
import
cn.com.glsx.stoassistant.enums.ScoreInfoNameEnum
;
...
@@ -50,6 +51,9 @@ public class ShopmallStaffMotivationDTO extends ShopmallStaffMotivation implemen
...
@@ -50,6 +51,9 @@ public class ShopmallStaffMotivationDTO extends ShopmallStaffMotivation implemen
*/
*/
private
boolean
containDeleted
;
private
boolean
containDeleted
;
/**
* @see StaffMotivationGenerateTypeEnum
*/
@ApiModelProperty
(
notes
=
"生成方式, 默认0 手动抵扣1"
)
@ApiModelProperty
(
notes
=
"生成方式, 默认0 手动抵扣1"
)
private
Integer
generateType
=
0
;
private
Integer
generateType
=
0
;
...
...
rpc-scrm-shopmall-api/src/main/java/cn/com/glsx/scrm/shopmall/enums/integral/StaffMotivationGenerateTypeEnum.java
0 → 100644
View file @
5334814
package
cn
.
com
.
glsx
.
scrm
.
shopmall
.
enums
.
integral
;
import
lombok.Getter
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.Objects
;
@Getter
@Slf4j
public
enum
StaffMotivationGenerateTypeEnum
{
UNKNOWN
(-
1
,
"未知"
),
//0待审批、1已审批、2已失效
ORDER
(
0
,
"订单收益(系统默认)"
),
MANUAL_DEDUCT
(
1
,
"手动抵扣/撤销抵扣"
),
MANUAL_OPERATE
(
2
,
"手动增加/手动扣减"
),
;
private
final
Integer
value
;
private
final
String
name
;
StaffMotivationGenerateTypeEnum
(
Integer
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
public
static
StaffMotivationGenerateTypeEnum
getByValue
(
Integer
value
)
{
for
(
StaffMotivationGenerateTypeEnum
temp
:
StaffMotivationGenerateTypeEnum
.
values
())
{
if
(
Objects
.
equals
(
temp
.
getValue
(),
value
))
{
return
temp
;
}
}
return
UNKNOWN
;
}
}
rpc-scrm-shopmall/src/main/java/cn/com/glsx/scrm/shopmall/service/integral/IntegralTransferOutService.java
View file @
5334814
...
@@ -447,6 +447,7 @@ public class IntegralTransferOutService {
...
@@ -447,6 +447,7 @@ public class IntegralTransferOutService {
listReq
.
setChannelProvider
(
null
);
listReq
.
setChannelProvider
(
null
);
listReq
.
setPaymentEntityCode
(
null
);
listReq
.
setPaymentEntityCode
(
null
);
listReq
.
setLevyCode
(
null
);
listReq
.
setLevyCode
(
null
);
listReq
.
setLevyChannelCode
(
null
);
List
<
IntegralTransferOutDTO
>
list
=
integralTransferOutMapper
.
list
(
listReq
);
List
<
IntegralTransferOutDTO
>
list
=
integralTransferOutMapper
.
list
(
listReq
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
throw
new
RpcServiceException
(
"没有符合记录的提现记录"
);
throw
new
RpcServiceException
(
"没有符合记录的提现记录"
);
...
@@ -466,6 +467,7 @@ public class IntegralTransferOutService {
...
@@ -466,6 +467,7 @@ public class IntegralTransferOutService {
operationDTO
.
setChannelProvider
(
request
.
getPayChannelProvider
());
operationDTO
.
setChannelProvider
(
request
.
getPayChannelProvider
());
operationDTO
.
setPaymentEntityCode
(
request
.
getPaymentEntityCode
());
operationDTO
.
setPaymentEntityCode
(
request
.
getPaymentEntityCode
());
operationDTO
.
setLevyCode
(
request
.
getLevyCode
());
operationDTO
.
setLevyCode
(
request
.
getLevyCode
());
operationDTO
.
setLevyChannelCode
(
request
.
getLevyChannelCode
());
return
thiz
.
batchPay
(
operationDTO
);
return
thiz
.
batchPay
(
operationDTO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
...
@@ -797,6 +799,7 @@ public class IntegralTransferOutService {
...
@@ -797,6 +799,7 @@ public class IntegralTransferOutService {
.
channelProvider
(
request
.
getChannelProvider
())
.
channelProvider
(
request
.
getChannelProvider
())
.
paymentEntityCode
(
request
.
getPaymentEntityCode
())
.
paymentEntityCode
(
request
.
getPaymentEntityCode
())
.
levyCode
(
request
.
getLevyCode
())
.
levyCode
(
request
.
getLevyCode
())
.
levyChannelCode
(
request
.
getLevyChannelCode
())
.
build
()
.
build
()
);
);
Long
allPayAmount
=
list
.
stream
().
mapToLong
(
IntegralTransferOut:
:
getPayAmount
).
sum
();
Long
allPayAmount
=
list
.
stream
().
mapToLong
(
IntegralTransferOut:
:
getPayAmount
).
sum
();
...
@@ -851,6 +854,7 @@ public class IntegralTransferOutService {
...
@@ -851,6 +854,7 @@ public class IntegralTransferOutService {
.
channel
(
request
.
getChannel
())
.
channel
(
request
.
getChannel
())
.
paymentEntityCode
(
request
.
getPaymentEntityCode
())
.
paymentEntityCode
(
request
.
getPaymentEntityCode
())
.
levyCode
(
request
.
getLevyCode
())
.
levyCode
(
request
.
getLevyCode
())
.
levyChannelCode
(
request
.
getLevyChannelCode
())
.
build
();
.
build
();
IntegralChannelAccountDTO
detail
=
integralChannelAccountMapper
.
getOne
(
req
);
IntegralChannelAccountDTO
detail
=
integralChannelAccountMapper
.
getOne
(
req
);
if
(
detail
==
null
)
{
if
(
detail
==
null
)
{
...
...
rpc-scrm-shopmall/src/main/java/cn/com/glsx/scrm/shopmall/service/integral/StaffMotivationService.java
View file @
5334814
...
@@ -26,10 +26,7 @@ import cn.com.glsx.scrm.equity.enums.DeleteFlagEnum;
...
@@ -26,10 +26,7 @@ import cn.com.glsx.scrm.equity.enums.DeleteFlagEnum;
import
cn.com.glsx.scrm.shopmall.dto.integral.IntegralTransferOutDTO
;
import
cn.com.glsx.scrm.shopmall.dto.integral.IntegralTransferOutDTO
;
import
cn.com.glsx.scrm.shopmall.dto.integral.motivation.ShopmallStaffMotivationDTO
;
import
cn.com.glsx.scrm.shopmall.dto.integral.motivation.ShopmallStaffMotivationDTO
;
import
cn.com.glsx.scrm.shopmall.dto.integral.motivation.ShopmallStaffMotivationOrderScoreDTO
;
import
cn.com.glsx.scrm.shopmall.dto.integral.motivation.ShopmallStaffMotivationOrderScoreDTO
;
import
cn.com.glsx.scrm.shopmall.enums.integral.IntegralTransferOutOperationResultEnum
;
import
cn.com.glsx.scrm.shopmall.enums.integral.*
;
import
cn.com.glsx.scrm.shopmall.enums.integral.StaffMotivationAuditSourceEnum
;
import
cn.com.glsx.scrm.shopmall.enums.integral.StaffMotivationFailTypeEnum
;
import
cn.com.glsx.scrm.shopmall.enums.integral.StaffMotivationStatusEnum
;
import
cn.com.glsx.scrm.shopmall.mapper.ShopmallStaffMotivationMapper
;
import
cn.com.glsx.scrm.shopmall.mapper.ShopmallStaffMotivationMapper
;
import
cn.com.glsx.scrm.shopmall.mapper.ShopmallStaffMotivationOperationMapper
;
import
cn.com.glsx.scrm.shopmall.mapper.ShopmallStaffMotivationOperationMapper
;
import
cn.com.glsx.scrm.shopmall.model.IntegralTransferOut
;
import
cn.com.glsx.scrm.shopmall.model.IntegralTransferOut
;
...
@@ -129,8 +126,9 @@ public class StaffMotivationService {
...
@@ -129,8 +126,9 @@ public class StaffMotivationService {
List
<
ShopmallStaffMotivationDTO
>
itemList
=
new
ArrayList
<>();
List
<
ShopmallStaffMotivationDTO
>
itemList
=
new
ArrayList
<>();
// 已存在的记录
// 已存在的记录
List
<
ShopmallStaffMotivationDTO
>
existList
=
staffMotivationMapper
.
findByOrderCode
(
item
.
getOrderCode
(),
item
.
getStaffUuid
(),
item
.
getGenerateType
());
List
<
ShopmallStaffMotivationDTO
>
existList
=
staffMotivationMapper
.
findByOrderCode
(
item
.
getOrderCode
(),
item
.
getStaffUuid
(),
item
.
getGenerateType
());
boolean
isManualOperate
=
Objects
.
equals
(
StaffMotivationGenerateTypeEnum
.
MANUAL_OPERATE
.
getValue
(),
item
.
getGenerateType
());
// 修改
// 修改
if
(
CollectionUtils
.
isNotEmpty
(
existList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
existList
)
&&
!
isManualOperate
)
{
if
(
existList
.
size
()
>
1
)
{
if
(
existList
.
size
()
>
1
)
{
log
.
info
(
"存在多条相同订单审批记录:{}-{}"
,
item
.
getOrderCode
(),
item
.
getGenerateType
());
log
.
info
(
"存在多条相同订单审批记录:{}-{}"
,
item
.
getOrderCode
(),
item
.
getGenerateType
());
}
}
...
@@ -156,8 +154,9 @@ public class StaffMotivationService {
...
@@ -156,8 +154,9 @@ public class StaffMotivationService {
// 新增
// 新增
}
else
{
}
else
{
// 无法进行新建失效记录
// 无法进行新建失效记录
if
(!
ScoreInfoNameEnum
.
isManualGenerateType
(
item
.
getInfoNameEnum
()))
{
if
(!
ScoreInfoNameEnum
.
isDeductGenerateType
(
item
.
getInfoNameEnum
())
RpcAssert
.
assertIsTrue
(!
StaffMotivationStatusEnum
.
FAILURE
.
getValue
().
equals
(
item
.
getStatus
()),
DefaultErrorEnum
.
DATA_NOT_EXIST
,
"无前置收益订单可失效"
);
&&
Objects
.
equals
(
StaffMotivationStatusEnum
.
FAILURE
.
getValue
(),
item
.
getStatus
()))
{
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVICE_ERROR
,
"无前置收益订单可失效"
);
}
}
MerchantStaffResponse
staff
=
getStaff
(
item
.
getStaffUuid
());
MerchantStaffResponse
staff
=
getStaff
(
item
.
getStaffUuid
());
...
@@ -176,6 +175,10 @@ public class StaffMotivationService {
...
@@ -176,6 +175,10 @@ public class StaffMotivationService {
itemList
.
forEach
(
i
->
{
itemList
.
forEach
(
i
->
{
switch
(
StaffMotivationStatusEnum
.
getByValue
(
i
.
getStatus
())){
switch
(
StaffMotivationStatusEnum
.
getByValue
(
i
.
getStatus
())){
case
READY_AUDIT:
case
READY_AUDIT:
if
(
Objects
.
equals
(
StaffMotivationGenerateTypeEnum
.
MANUAL_OPERATE
.
getValue
(),
i
.
getGenerateType
()))
{
// 手动操作,待审批,增加操作记录
this
.
addOperationItem
(
i
,
item
);
}
break
;
break
;
case
COMPLETE_AUDIT:
case
COMPLETE_AUDIT:
// 增加积分记录
// 增加积分记录
...
@@ -209,6 +212,9 @@ public class StaffMotivationService {
...
@@ -209,6 +212,9 @@ public class StaffMotivationService {
if
(!
item
.
getSupervisorStatus
().
equals
(
StaffMotivationStatusEnum
.
READY_AUDIT
.
getValue
()))
{
if
(!
item
.
getSupervisorStatus
().
equals
(
StaffMotivationStatusEnum
.
READY_AUDIT
.
getValue
()))
{
return
;
return
;
}
}
if
(!
Objects
.
equals
(
item
.
getGenerateType
(),
StaffMotivationGenerateTypeEnum
.
ORDER
.
getValue
()))
{
return
;
}
log
.
info
(
"将需要审核的订单进行督导企微通知"
);
log
.
info
(
"将需要审核的订单进行督导企微通知"
);
Integer
merchantId
=
env
.
getProperty
(
"score.audit.work.wechat.merchant.id"
,
Integer
.
class
,
44210895
);
Integer
merchantId
=
env
.
getProperty
(
"score.audit.work.wechat.merchant.id"
,
Integer
.
class
,
44210895
);
// 查询门店设置的督导用户
// 查询门店设置的督导用户
...
@@ -278,7 +284,7 @@ public class StaffMotivationService {
...
@@ -278,7 +284,7 @@ public class StaffMotivationService {
log
.
warn
(
"增加来自员工阳光激励的积分失败, 未知类型"
);
log
.
warn
(
"增加来自员工阳光激励的积分失败, 未知类型"
);
return
;
return
;
}
}
if
(
DeleteFlagEnum
.
D
.
getValue
().
equals
(
item
.
getDeletedFlag
())
&&
!
ScoreInfoNameEnum
.
is
Manual
GenerateType
(
infoNameEnum
))
{
if
(
DeleteFlagEnum
.
D
.
getValue
().
equals
(
item
.
getDeletedFlag
())
&&
!
ScoreInfoNameEnum
.
is
Deduct
GenerateType
(
infoNameEnum
))
{
log
.
info
(
"删除的审批记录无须生成积分, motivationId: {}"
,
item
.
getId
());
log
.
info
(
"删除的审批记录无须生成积分, motivationId: {}"
,
item
.
getId
());
return
;
return
;
}
}
...
@@ -416,7 +422,16 @@ public class StaffMotivationService {
...
@@ -416,7 +422,16 @@ public class StaffMotivationService {
public
void
addOperationItem
(
ShopmallStaffMotivationDTO
newItem
,
ShopmallStaffMotivationDTO
req
)
{
public
void
addOperationItem
(
ShopmallStaffMotivationDTO
newItem
,
ShopmallStaffMotivationDTO
req
)
{
ShopmallStaffMotivationOperation
o
=
new
ShopmallStaffMotivationOperation
();
ShopmallStaffMotivationOperation
o
=
new
ShopmallStaffMotivationOperation
();
o
.
setStaffMotivationId
(
newItem
.
getId
());
o
.
setStaffMotivationId
(
newItem
.
getId
());
if
(
Objects
.
equals
(
newItem
.
getFailType
(),
StaffMotivationFailTypeEnum
.
REFUND
.
getValue
()))
{
o
.
setRemark
(
String
.
format
(
"退款操作: %s"
,
newItem
.
getIntegralIncome
().
toString
()));
o
.
setRemark
(
String
.
format
(
"退款操作: %s"
,
newItem
.
getIntegralIncome
().
toString
()));
}
if
(
Objects
.
equals
(
newItem
.
getGenerateType
(),
StaffMotivationGenerateTypeEnum
.
MANUAL_OPERATE
.
getValue
()))
{
String
remark
=
""
;
if
(
Objects
.
equals
(
req
.
getInfoNameEnum
(),
ScoreInfoNameEnum
.
MOTIVATION_MANUAL_ADD
))
{
remark
=
String
.
format
(
"手动增加积分%s"
,
newItem
.
getIntegralIncome
().
toString
());
}
o
.
setRemark
(
String
.
format
(
"退款操作: %s"
,
newItem
.
getIntegralIncome
().
toString
()));
}
o
.
setType
(
1
);
o
.
setType
(
1
);
o
.
setResult
(
IntegralTransferOutOperationResultEnum
.
SUCCESS
.
getValue
());
o
.
setResult
(
IntegralTransferOutOperationResultEnum
.
SUCCESS
.
getValue
());
o
.
setOperator
(
req
.
getOperator
());
o
.
setOperator
(
req
.
getOperator
());
...
@@ -579,8 +594,9 @@ public class StaffMotivationService {
...
@@ -579,8 +594,9 @@ public class StaffMotivationService {
@Override
@Override
public
void
afterCommit
()
{
public
void
afterCommit
()
{
log
.
info
(
"ready to insert staff score after audit. res.id: {}"
,
res
.
getId
());
log
.
info
(
"ready to insert staff score after audit. res.id: {}"
,
res
.
getId
());
if
(
res
.
getStatus
().
equals
(
StaffMotivationStatusEnum
.
COMPLETE_AUDIT
.
getValue
())
&&
requestDTO
.
getAuditResult
().
equals
(
0
))
{
ShopmallStaffMotivationDTO
item
=
staffMotivationMapper
.
findById
(
res
.
getId
());
insertStaffScore
(
res
,
ScoreInfoNameEnum
.
SCORE_INCOME
);
if
(
Objects
.
equals
(
item
.
getStatus
(),
StaffMotivationStatusEnum
.
COMPLETE_AUDIT
.
getValue
())
&&
requestDTO
.
getAuditResult
().
equals
(
0
))
{
insertStaffScore
(
item
,
ScoreInfoNameEnum
.
SCORE_INCOME
);
}
}
}
}
});
});
...
@@ -704,7 +720,9 @@ public class StaffMotivationService {
...
@@ -704,7 +720,9 @@ public class StaffMotivationService {
RpcAssert
.
assertNotNull
(
motivation
,
DefaultErrorEnum
.
DATA_NOT_EXIST
,
"审批记录不存在"
);
RpcAssert
.
assertNotNull
(
motivation
,
DefaultErrorEnum
.
DATA_NOT_EXIST
,
"审批记录不存在"
);
// 已失效的只查当前记录的操作
// 已失效的只查当前记录的操作
if
(
StaffMotivationStatusEnum
.
FAILURE
.
getValue
().
equals
(
motivation
.
getStatus
()))
{
// 手动调整的积分审批记录只查当前记录的操作
boolean
isManualOperate
=
Objects
.
equals
(
motivation
.
getGenerateType
(),
StaffMotivationGenerateTypeEnum
.
MANUAL_OPERATE
.
getValue
());
if
(
StaffMotivationStatusEnum
.
FAILURE
.
getValue
().
equals
(
motivation
.
getStatus
())
||
isManualOperate
)
{
req
.
setIds
(
Lists
.
newArrayList
(
req
.
getId
()));
req
.
setIds
(
Lists
.
newArrayList
(
req
.
getId
()));
}
else
{
}
else
{
List
<
ShopmallStaffMotivationDTO
>
motivationDTOS
=
staffMotivationMapper
.
findByOrderCode
(
motivation
.
getOrderCode
(),
motivation
.
getStaffUuid
(),
motivation
.
getGenerateType
());
List
<
ShopmallStaffMotivationDTO
>
motivationDTOS
=
staffMotivationMapper
.
findByOrderCode
(
motivation
.
getOrderCode
(),
motivation
.
getStaffUuid
(),
motivation
.
getGenerateType
());
...
...
rpc-scrm-shopmall/src/main/resources/META-INF/orm/IntegralChannelAccountMapper.xml
View file @
5334814
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
<if
test=
"levyCode != null and levyCode != ''"
>
<if
test=
"levyCode != null and levyCode != ''"
>
and ca.levy_code = #{levyCode}
and ca.levy_code = #{levyCode}
</if>
</if>
<if
test=
"levyChannelCode != null and levyChannelCode != ''"
>
and ca.levy_channel_code = #{levyChannelCode}
</if>
</where>
</where>
</select>
</select>
...
@@ -90,6 +93,9 @@
...
@@ -90,6 +93,9 @@
<if
test=
"levyCode != null and levyCode != ''"
>
<if
test=
"levyCode != null and levyCode != ''"
>
and ca.levy_code = #{levyCode}
and ca.levy_code = #{levyCode}
</if>
</if>
<if
test=
"levyChannelCode != null and levyChannelCode != ''"
>
and ca.levy_channel_code = #{levyChannelCode}
</if>
</where>
</where>
order by ca.id desc
order by ca.id desc
limit 1
limit 1
...
...
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