Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
4df86092
提交
4df86092
authored
10月 23, 2024
作者:
刘海泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加数媒宝和马上来供应链sdk对接的接口逻辑
上级
c79f642b
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
231 行增加
和
15 行删除
+231
-15
OrderChildExceptionReportController.java
...mance/controller/OrderChildExceptionReportController.java
+33
-0
PerformanceSdkFeignController.java
...mance/controller/feign/PerformanceSdkFeignController.java
+14
-2
OrderChildExceptionReportDao.java
...com/clx/performance/dao/OrderChildExceptionReportDao.java
+1
-0
OrderChildExceptionReportDaoImpl.java
...erformance/dao/impl/OrderChildExceptionReportDaoImpl.java
+8
-0
OrderChildExceptionReport.java
.../com/clx/performance/model/OrderChildExceptionReport.java
+1
-1
OrderChildExceptionReportService.java
...performance/service/OrderChildExceptionReportService.java
+3
-0
OrderChildExceptionReportServiceImpl.java
...ce/service/impl/OrderChildExceptionReportServiceImpl.java
+128
-11
CarrierExceptionReportEnum.java
...com/clx/performance/enums/CarrierExceptionReportEnum.java
+1
-1
DealExceptionReportParam.java
...om/clx/performance/param/pc/DealExceptionReportParam.java
+42
-0
没有找到文件。
clx-performance-web/src/main/java/com/clx/performance/controller/OrderChildExceptionReportController.java
0 → 100644
浏览文件 @
4df86092
package
com
.
clx
.
performance
.
controller
;
import
com.clx.performance.param.pc.DealExceptionReportParam
;
import
com.clx.performance.service.OrderChildExceptionReportService
;
import
com.msl.common.result.Result
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
@RequestMapping
(
value
=
"/pc/carrier/exceptionReport"
)
@Validated
@Tag
(
name
=
"承运端-异常上报"
)
@AllArgsConstructor
public
class
OrderChildExceptionReportController
{
private
final
OrderChildExceptionReportService
orderChildExceptionReportService
;
@Deprecated
@Operation
(
summary
=
"异常上报处理"
,
description
=
"<br>By:刘海泉"
)
public
Result
<?>
updateDealExceptionReport
(
@RequestBody
@Validated
DealExceptionReportParam
param
)
{
orderChildExceptionReportService
.
updateDealExceptionReport
(
param
);
return
Result
.
ok
();
}
}
clx-performance-web/src/main/java/com/clx/performance/controller/feign/PerformanceSdkFeignController.java
浏览文件 @
4df86092
package
com
.
clx
.
performance
.
controller
.
feign
;
package
com
.
clx
.
performance
.
controller
.
feign
;
import
com.alibaba.fastjson.JSON
;
import
com.clx.open.sdk.request.action.*
;
import
com.clx.open.sdk.request.action.*
;
import
com.clx.open.sdk.request.dto.BatchOrderStatisticsDTO
;
import
com.clx.open.sdk.request.dto.BatchOrderStatisticsDTO
;
import
com.clx.open.sdk.request.dto.BatchOrderStatisticsInfoDTO
;
import
com.clx.open.sdk.request.dto.BatchOrderStatisticsInfoDTO
;
...
@@ -146,17 +147,22 @@ public class PerformanceSdkFeignController {
...
@@ -146,17 +147,22 @@ public class PerformanceSdkFeignController {
//数媒宝同步异常上报信息
//数媒宝同步异常上报信息
@PostMapping
(
"clx-performance/feign/sdk/smbSyncExceptionReportInfo"
)
@PostMapping
(
"clx-performance/feign/sdk/smbSyncExceptionReportInfo"
)
Result
<
String
>
smbSyncExceptionReportInfo
(
@RequestBody
@Validated
SmbSyncExceptionReportInfoAction
action
){
Result
<
String
>
smbSyncExceptionReportInfo
(
@RequestBody
@Validated
SmbSyncExceptionReportInfoAction
action
){
return
orderChildExceptionReportService
.
smbSyncExceptionReportInfo
(
action
);
log
.
info
(
"数媒宝同步异常上报信息开始,请求参数:{}"
,
JSON
.
toJSONString
(
action
));
Result
<
String
>
result
=
orderChildExceptionReportService
.
smbSyncExceptionReportInfo
(
action
);
log
.
info
(
"数媒宝同步异常上报信息结束,响应结果:{}"
,
result
);
return
result
;
}
}
//数媒宝同步异常上报结果
//数媒宝同步异常上报结果
@PostMapping
(
"clx-performance/feign/sdk/smbSyncExceptionReportResult"
)
@PostMapping
(
"clx-performance/feign/sdk/smbSyncExceptionReportResult"
)
Result
<
Object
>
smbSyncExceptionReportResult
(
@RequestBody
@Validated
SmbSyncExceptionReportResultAction
action
){
Result
<
Object
>
smbSyncExceptionReportResult
(
@RequestBody
@Validated
SmbSyncExceptionReportResultAction
action
){
log
.
info
(
"数媒宝同步异常上报结果开始,请求参数:{}"
,
JSON
.
toJSONString
(
action
));
return
orderChildExceptionReportService
.
smbSyncExceptionReportResult
(
action
);
return
orderChildExceptionReportService
.
smbSyncExceptionReportResult
(
action
);
}
}
//数媒宝撤销异常上报
//数媒宝撤销异常上报
@PostMapping
(
"clx-performance/feign/sdk/smbWithdrawExceptionReport"
)
@PostMapping
(
"clx-performance/feign/sdk/smbWithdrawExceptionReport"
)
Result
<
Object
>
smbWithdrawExceptionReport
(
@RequestBody
@Validated
SmbWithdrawExceptionReportAction
action
){
Result
<
Object
>
smbWithdrawExceptionReport
(
@RequestBody
@Validated
SmbWithdrawExceptionReportAction
action
){
log
.
info
(
"数媒宝撤销异常上报开始,请求参数:{}"
,
JSON
.
toJSONString
(
action
));
return
orderChildExceptionReportService
.
smbWithdrawExceptionReport
(
action
);
return
orderChildExceptionReportService
.
smbWithdrawExceptionReport
(
action
);
}
}
...
@@ -165,18 +171,24 @@ public class PerformanceSdkFeignController {
...
@@ -165,18 +171,24 @@ public class PerformanceSdkFeignController {
//马上来供应链同步异常上报信息
//马上来供应链同步异常上报信息
@PostMapping
(
"clx-performance/feign/sdk/mslSyncExceptionReportInfo"
)
@PostMapping
(
"clx-performance/feign/sdk/mslSyncExceptionReportInfo"
)
Result
<
String
>
mslSyncExceptionReportInfo
(
@RequestBody
@Validated
MslSyncExceptionReportInfoAction
action
){
Result
<
String
>
mslSyncExceptionReportInfo
(
@RequestBody
@Validated
MslSyncExceptionReportInfoAction
action
){
return
orderChildExceptionReportService
.
mslSyncExceptionReportInfo
(
action
);
log
.
info
(
"马上来供应链同步异常上报信息开始,请求参数:{}"
,
JSON
.
toJSONString
(
action
));
Result
<
String
>
result
=
orderChildExceptionReportService
.
mslSyncExceptionReportInfo
(
action
);
log
.
info
(
"马上来供应链同步异常上报信息结束,响应结果:{}"
,
result
);
return
result
;
}
}
//马上来供应链同步异常上报结果
//马上来供应链同步异常上报结果
@PostMapping
(
"clx-performance/feign/sdk/mslSyncExceptionReportResult"
)
@PostMapping
(
"clx-performance/feign/sdk/mslSyncExceptionReportResult"
)
Result
<
Object
>
mslSyncExceptionReportResult
(
@RequestBody
@Validated
MslSyncExceptionReportResultAction
action
){
Result
<
Object
>
mslSyncExceptionReportResult
(
@RequestBody
@Validated
MslSyncExceptionReportResultAction
action
){
log
.
info
(
"马上来供应链同步异常上报结果开始,请求参数:{}"
,
JSON
.
toJSONString
(
action
));
return
orderChildExceptionReportService
.
mslSyncExceptionReportResult
(
action
);
return
orderChildExceptionReportService
.
mslSyncExceptionReportResult
(
action
);
}
}
//马上来供应链撤销异常上报
//马上来供应链撤销异常上报
@PostMapping
(
"clx-performance/feign/sdk/mslWithdrawExceptionReport"
)
@PostMapping
(
"clx-performance/feign/sdk/mslWithdrawExceptionReport"
)
Result
<
Object
>
mslWithdrawExceptionReport
(
@RequestBody
@Validated
MslWithdrawExceptionReportAction
action
){
Result
<
Object
>
mslWithdrawExceptionReport
(
@RequestBody
@Validated
MslWithdrawExceptionReportAction
action
){
log
.
info
(
"马上来供应链撤销异常上报开始,请求参数:{}"
,
JSON
.
toJSONString
(
action
));
return
orderChildExceptionReportService
.
mslWithdrawExceptionReport
(
action
);
return
orderChildExceptionReportService
.
mslWithdrawExceptionReport
(
action
);
}
}
...
...
clx-performance-web/src/main/java/com/clx/performance/dao/OrderChildExceptionReportDao.java
浏览文件 @
4df86092
...
@@ -10,4 +10,5 @@ import com.clx.performance.model.OrderChildExceptionReport;
...
@@ -10,4 +10,5 @@ import com.clx.performance.model.OrderChildExceptionReport;
* Time 10:38
* Time 10:38
*/
*/
public
interface
OrderChildExceptionReportDao
extends
BaseDao
<
OrderChildExceptionReportMapper
,
OrderChildExceptionReport
,
Integer
>
{
public
interface
OrderChildExceptionReportDao
extends
BaseDao
<
OrderChildExceptionReportMapper
,
OrderChildExceptionReport
,
Integer
>
{
OrderChildExceptionReport
findByThirdReportNoAndSource
(
Integer
source
,
String
thirdReportNo
);
}
}
clx-performance-web/src/main/java/com/clx/performance/dao/impl/OrderChildExceptionReportDaoImpl.java
浏览文件 @
4df86092
package
com
.
clx
.
performance
.
dao
.
impl
;
package
com
.
clx
.
performance
.
dao
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.msl.common.dao.impl.BaseDaoImpl
;
import
com.msl.common.dao.impl.BaseDaoImpl
;
import
com.clx.performance.dao.OrderChildExceptionReportDao
;
import
com.clx.performance.dao.OrderChildExceptionReportDao
;
import
com.clx.performance.mapper.OrderChildExceptionReportMapper
;
import
com.clx.performance.mapper.OrderChildExceptionReportMapper
;
...
@@ -13,4 +14,11 @@ import org.springframework.stereotype.Repository;
...
@@ -13,4 +14,11 @@ import org.springframework.stereotype.Repository;
*/
*/
@Repository
@Repository
public
class
OrderChildExceptionReportDaoImpl
extends
BaseDaoImpl
<
OrderChildExceptionReportMapper
,
OrderChildExceptionReport
,
Integer
>
implements
OrderChildExceptionReportDao
{
public
class
OrderChildExceptionReportDaoImpl
extends
BaseDaoImpl
<
OrderChildExceptionReportMapper
,
OrderChildExceptionReport
,
Integer
>
implements
OrderChildExceptionReportDao
{
@Override
public
OrderChildExceptionReport
findByThirdReportNoAndSource
(
Integer
source
,
String
thirdReportNo
)
{
LambdaQueryWrapper
<
OrderChildExceptionReport
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
OrderChildExceptionReport
::
getSource
,
source
);
query
.
eq
(
OrderChildExceptionReport
::
getThirdReportNo
,
thirdReportNo
);
return
baseMapper
.
selectOne
(
query
);
}
}
}
clx-performance-web/src/main/java/com/clx/performance/model/OrderChildExceptionReport.java
浏览文件 @
4df86092
...
@@ -78,7 +78,7 @@ public class OrderChildExceptionReport implements HasKey<Integer> {
...
@@ -78,7 +78,7 @@ public class OrderChildExceptionReport implements HasKey<Integer> {
@TableField
(
"deal_time"
)
@TableField
(
"deal_time"
)
@Schema
(
description
=
"处理时间"
)
@Schema
(
description
=
"处理时间"
)
private
String
dealTime
;
private
LocalDateTime
dealTime
;
@TableField
(
"deal_result"
)
@TableField
(
"deal_result"
)
@Schema
(
description
=
"处理结果"
)
@Schema
(
description
=
"处理结果"
)
...
...
clx-performance-web/src/main/java/com/clx/performance/service/OrderChildExceptionReportService.java
浏览文件 @
4df86092
package
com
.
clx
.
performance
.
service
;
package
com
.
clx
.
performance
.
service
;
import
com.clx.open.sdk.request.action.*
;
import
com.clx.open.sdk.request.action.*
;
import
com.clx.performance.param.pc.DealExceptionReportParam
;
import
com.msl.common.result.Result
;
import
com.msl.common.result.Result
;
/**
/**
...
@@ -20,4 +21,6 @@ public interface OrderChildExceptionReportService {
...
@@ -20,4 +21,6 @@ public interface OrderChildExceptionReportService {
Result
<
Object
>
mslSyncExceptionReportResult
(
MslSyncExceptionReportResultAction
action
);
Result
<
Object
>
mslSyncExceptionReportResult
(
MslSyncExceptionReportResultAction
action
);
Result
<
Object
>
mslWithdrawExceptionReport
(
MslWithdrawExceptionReportAction
action
);
Result
<
Object
>
mslWithdrawExceptionReport
(
MslWithdrawExceptionReportAction
action
);
void
updateDealExceptionReport
(
DealExceptionReportParam
param
);
}
}
clx-performance-web/src/main/java/com/clx/performance/service/impl/OrderChildExceptionReportServiceImpl.java
浏览文件 @
4df86092
package
com
.
clx
.
performance
.
service
.
impl
;
package
com
.
clx
.
performance
.
service
.
impl
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.clx.open.sdk.callback.OpenCallBackClient
;
import
com.clx.open.sdk.callback.message.MslExceptionReportDealMessage
;
import
com.clx.open.sdk.callback.message.SmbExceptionReportDealMessage
;
import
com.clx.open.sdk.enums.ExceptionReportEnum
;
import
com.clx.open.sdk.request.action.*
;
import
com.clx.open.sdk.request.action.*
;
import
com.clx.performance.config.ThirdAppConfig
;
import
com.clx.performance.constant.RedisConstants
;
import
com.clx.performance.constant.RedisConstants
;
import
com.clx.performance.dao.OrderChildExceptionReportDao
;
import
com.clx.performance.dao.OrderChildExceptionReportDao
;
import
com.clx.performance.enums.ExceptionReportEnum
;
import
com.clx.performance.dao.OrderChildExceptionReportDealLogDao
;
import
com.clx.performance.enums.CarrierExceptionReportEnum
;
import
com.clx.performance.enums.ResultEnum
;
import
com.clx.performance.enums.SyncPlatformEnum
;
import
com.clx.performance.enums.SyncPlatformEnum
;
import
com.clx.performance.model.OrderChildExceptionReport
;
import
com.clx.performance.model.OrderChildExceptionReport
;
import
com.clx.performance.model.OrderChildExceptionReportDealLog
;
import
com.clx.performance.param.pc.DealExceptionReportParam
;
import
com.clx.performance.service.OrderChildExceptionReportService
;
import
com.clx.performance.service.OrderChildExceptionReportService
;
import
com.clx.performance.struct.OrderChildExceptionReportStruct
;
import
com.clx.performance.struct.OrderChildExceptionReportStruct
;
import
com.clx.performance.utils.LocalDateTimeUtils
;
import
com.clx.performance.utils.LocalDateTimeUtils
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.common.result.Result
;
import
com.msl.common.result.Result
;
import
com.msl.common.utils.DateUtils
;
import
com.msl.common.utils.DateUtils
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
/**
/**
...
@@ -33,7 +49,9 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
...
@@ -33,7 +49,9 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
private
final
OrderChildExceptionReportStruct
orderChildExceptionReportStruct
;
private
final
OrderChildExceptionReportStruct
orderChildExceptionReportStruct
;
private
final
OrderChildExceptionReportDao
orderChildExceptionReportDao
;
private
final
OrderChildExceptionReportDao
orderChildExceptionReportDao
;
private
final
OrderChildExceptionReportDealLogDao
orderChildExceptionReportDealLogDao
;
private
final
RedisTemplate
<
String
,
Integer
>
redisTemplate
;
private
final
RedisTemplate
<
String
,
Integer
>
redisTemplate
;
private
final
ThirdAppConfig
thirdAppConfig
;
@Override
@Override
public
Result
<
String
>
smbSyncExceptionReportInfo
(
SmbSyncExceptionReportInfoAction
action
)
{
public
Result
<
String
>
smbSyncExceptionReportInfo
(
SmbSyncExceptionReportInfoAction
action
)
{
...
@@ -43,12 +61,15 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
...
@@ -43,12 +61,15 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
@Override
@Override
public
Result
<
Object
>
smbSyncExceptionReportResult
(
SmbSyncExceptionReportResultAction
action
)
{
public
Result
<
Object
>
smbSyncExceptionReportResult
(
SmbSyncExceptionReportResultAction
action
)
{
return
null
;
updateExceptionReportResult
(
SyncPlatformEnum
.
Source
.
TRADE_PLATFORM
.
getCode
(),
action
.
getThirdReportNo
(),
action
.
getBreakContractParty
());
return
Result
.
ok
();
}
}
@Override
@Override
public
Result
<
Object
>
smbWithdrawExceptionReport
(
SmbWithdrawExceptionReportAction
action
)
{
public
Result
<
Object
>
smbWithdrawExceptionReport
(
SmbWithdrawExceptionReportAction
action
)
{
return
null
;
withdrawExceptionReport
(
SyncPlatformEnum
.
Source
.
TRADE_PLATFORM
.
getCode
(),
action
.
getThirdReportNo
());
return
Result
.
ok
();
}
}
@Override
@Override
...
@@ -59,19 +80,55 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
...
@@ -59,19 +80,55 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
@Override
@Override
public
Result
<
Object
>
mslSyncExceptionReportResult
(
MslSyncExceptionReportResultAction
action
)
{
public
Result
<
Object
>
mslSyncExceptionReportResult
(
MslSyncExceptionReportResultAction
action
)
{
return
null
;
updateExceptionReportResult
(
SyncPlatformEnum
.
Source
.
NEW_OWNER_CLIENT
.
getCode
(),
action
.
getThirdReportNo
(),
action
.
getBreakContractParty
());
return
Result
.
ok
();
}
}
@Override
@Override
public
Result
<
Object
>
mslWithdrawExceptionReport
(
MslWithdrawExceptionReportAction
action
)
{
public
Result
<
Object
>
mslWithdrawExceptionReport
(
MslWithdrawExceptionReportAction
action
)
{
return
null
;
withdrawExceptionReport
(
SyncPlatformEnum
.
Source
.
NEW_OWNER_CLIENT
.
getCode
(),
action
.
getThirdReportNo
());
return
Result
.
ok
();
}
}
public
void
updateExceptionReportResult
(
Integer
source
,
String
thirdReportNo
,
Integer
breakContractParty
){
OrderChildExceptionReport
report
=
orderChildExceptionReportDao
.
findByThirdReportNoAndSource
(
source
,
thirdReportNo
);
if
(
Objects
.
isNull
(
report
)){
log
.
warn
(
"通过第三方上报编号:{} 未找到对应数据"
,
thirdReportNo
);
throw
new
ServiceSystemException
(
ResultEnum
.
DATA_NOT_FIND
);
}
if
(
Objects
.
equals
(
report
.
getStatus
(),
CarrierExceptionReportEnum
.
Status
.
PROCESSED
.
getCode
())
||
Objects
.
equals
(
report
.
getStatus
(),
CarrierExceptionReportEnum
.
Status
.
WITHDRAWN
.
getCode
())){
throw
new
ServiceSystemException
(
ResultEnum
.
PARAM_ERROR
,
"异常数据已被处理或撤回"
);
}
report
.
setDealTime
(
LocalDateTime
.
now
());
report
.
setDealUser
(
SyncPlatformEnum
.
Source
.
getNameByCode
(
source
));
report
.
setStatus
(
CarrierExceptionReportEnum
.
Status
.
PROCESSED
.
getCode
());
report
.
setDealResult
(
ExceptionReportEnum
.
DealResult
.
getNameByCode
(
breakContractParty
));
orderChildExceptionReportDao
.
updateEntityByKey
(
report
);
}
public
void
withdrawExceptionReport
(
Integer
source
,
String
thirdReportNo
){
OrderChildExceptionReport
report
=
orderChildExceptionReportDao
.
findByThirdReportNoAndSource
(
source
,
thirdReportNo
);
if
(
Objects
.
isNull
(
report
)){
log
.
warn
(
"通过第三方上报编号:{} 未找到对应数据"
,
thirdReportNo
);
throw
new
ServiceSystemException
(
ResultEnum
.
DATA_NOT_FIND
);
}
if
(!
Objects
.
equals
(
report
.
getStatus
(),
CarrierExceptionReportEnum
.
Status
.
WAIT_DEAL
.
getCode
())){
throw
new
ServiceSystemException
(
ResultEnum
.
PARAM_ERROR
,
"非待处理数据无法撤回"
);
}
report
.
setDealTime
(
LocalDateTime
.
now
());
report
.
setDealUser
(
SyncPlatformEnum
.
Source
.
getNameByCode
(
source
));
report
.
setStatus
(
CarrierExceptionReportEnum
.
Status
.
WITHDRAWN
.
getCode
());
orderChildExceptionReportDao
.
updateEntityByKey
(
report
);
}
private
String
saveExceptionReportInfo
(
OrderChildExceptionReport
report
,
Integer
source
){
private
String
saveExceptionReportInfo
(
OrderChildExceptionReport
report
,
Integer
source
){
report
.
setReportNo
(
getReportNo
());
report
.
setReportNo
(
getReportNo
());
report
.
setSource
(
source
);
report
.
setSource
(
source
);
report
.
setStatus
(
ExceptionReportEnum
.
Status
.
WAIT_DEAL
.
getCode
());
report
.
setStatus
(
Carrier
ExceptionReportEnum
.
Status
.
WAIT_DEAL
.
getCode
());
orderChildExceptionReportDao
.
saveEntity
(
report
);
orderChildExceptionReportDao
.
saveEntity
(
report
);
return
report
.
getReportNo
();
return
report
.
getReportNo
();
}
}
...
@@ -112,15 +169,75 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
...
@@ -112,15 +169,75 @@ public class OrderChildExceptionReportServiceImpl implements OrderChildExceptio
return
RedisConstants
.
EXCEPTION_REPORT_CACHE_KEY
+
datetime
;
return
RedisConstants
.
EXCEPTION_REPORT_CACHE_KEY
+
datetime
;
}
}
public
static
void
main
(
String
[]
args
)
{
@Override
LocalDateTime
begin
=
LocalDateTime
.
now
();
public
void
updateDealExceptionReport
(
DealExceptionReportParam
param
)
{
OrderChildExceptionReport
report
=
orderChildExceptionReportDao
.
getEntityByKey
(
param
.
getId
()).
orElseThrow
(
ResultEnum
.
DATA_NOT_FIND
);
LocalDateTime
end
=
LocalDateTimeUtils
.
getDayEnd
(
begin
)
;
OrderChildExceptionReportDealLog
dealLog
=
null
;
long
seconds
=
LocalDateTimeUtils
.
betweenSecond
(
begin
,
end
);
if
(
Objects
.
equals
(
report
.
getStatus
(),
CarrierExceptionReportEnum
.
Status
.
PROCESSED
.
getCode
())
||
Objects
.
equals
(
report
.
getStatus
(),
CarrierExceptionReportEnum
.
Status
.
WITHDRAWN
.
getCode
())){
throw
new
ServiceSystemException
(
ResultEnum
.
PARAM_ERROR
,
"异常数据已被处理或撤回"
);
}
if
(
Objects
.
equals
(
param
.
getDealWay
(),
ExceptionReportEnum
.
DealWay
.
APPEAL
.
getCode
())
&&
StringUtils
.
isBlank
(
param
.
getAppealReason
())){
throw
new
ServiceSystemException
(
ResultEnum
.
PARAM_ERROR
,
"申诉原因不能为空"
);
}
if
(
Objects
.
equals
(
param
.
getDealWay
(),
ExceptionReportEnum
.
DealWay
.
APPEAL
.
getCode
())){
report
.
setStatus
(
CarrierExceptionReportEnum
.
Status
.
APPEAL_IN_PROGRESS
.
getCode
());
dealLog
=
new
OrderChildExceptionReportDealLog
();
dealLog
.
setReportNo
(
report
.
getReportNo
());
dealLog
.
setDealWay
(
param
.
getDealWay
());
dealLog
.
setAppealReason
(
param
.
getAppealReason
());
dealLog
.
setPictureUrl
(
JSON
.
toJSONString
(
param
.
getPictureUrl
()));
dealLog
.
setVideoUrl
(
JSON
.
toJSONString
(
param
.
getVideoUrl
()));
}
else
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
report
.
setStatus
(
CarrierExceptionReportEnum
.
Status
.
PROCESSED
.
getCode
());
report
.
setDealTime
(
LocalDateTime
.
now
());
report
.
setDealResult
(
ExceptionReportEnum
.
DealResult
.
CARRIER_BREAK_CONTRACT
.
getName
());
report
.
setDealUserCode
(
loginUserInfo
.
getUserNo
());
report
.
setDealUser
(
loginUserInfo
.
getUserName
());
}
System
.
out
.
println
(
seconds
);
//同步给第三方
if
(
Objects
.
equals
(
report
.
getSource
(),
SyncPlatformEnum
.
Source
.
TRADE_PLATFORM
.
getCode
())){
SmbExceptionReportDealMessage
message
=
new
SmbExceptionReportDealMessage
();
message
.
setThirdReportNo
(
report
.
getThirdReportNo
());
message
.
setDealWay
(
param
.
getDealWay
());
message
.
setAppealReason
(
param
.
getAppealReason
());
message
.
setPictureUrl
(
param
.
getPictureUrl
());
message
.
setVideoUrl
(
param
.
getVideoUrl
());
String
data
=
JSONUtil
.
parse
(
message
).
toString
();
log
.
info
(
"开始通知:{} 上报异常处理,请求参数:{}"
,
SyncPlatformEnum
.
Source
.
TRADE_PLATFORM
.
getName
(),
data
);
OpenCallBackClient
openCallBackClient
=
thirdAppConfig
.
getOpenCallBackClient
(
report
.
getSource
().
toString
());
Result
<?>
result
=
openCallBackClient
.
encryptPost
(
JSONUtil
.
parse
(
message
).
toString
(),
message
.
topic
());
log
.
info
(
"结束通知:{} 上报异常处理,请求参数:{}"
,
SyncPlatformEnum
.
Source
.
TRADE_PLATFORM
.
getName
(),
result
);
}
if
(
Objects
.
equals
(
report
.
getSource
(),
SyncPlatformEnum
.
Source
.
NEW_OWNER_CLIENT
.
getCode
())){
MslExceptionReportDealMessage
message
=
new
MslExceptionReportDealMessage
();
message
.
setThirdReportNo
(
report
.
getThirdReportNo
());
message
.
setDealWay
(
param
.
getDealWay
());
message
.
setAppealReason
(
param
.
getAppealReason
());
message
.
setPictureUrl
(
param
.
getPictureUrl
());
message
.
setVideoUrl
(
param
.
getVideoUrl
());
String
data
=
JSONUtil
.
parse
(
message
).
toString
();
log
.
info
(
"开始通知:{} 上报异常处理,请求参数:{}"
,
SyncPlatformEnum
.
Source
.
NEW_OWNER_CLIENT
.
getName
(),
data
);
OpenCallBackClient
openCallBackClient
=
thirdAppConfig
.
getOpenCallBackClient
(
report
.
getSource
().
toString
());
Result
<?>
result
=
openCallBackClient
.
encryptPost
(
data
,
message
.
topic
());
log
.
info
(
"结束通知:{} 上报异常处理,请求参数:{}"
,
SyncPlatformEnum
.
Source
.
NEW_OWNER_CLIENT
.
getName
(),
result
);
}
orderChildExceptionReportDao
.
updateEntityByKey
(
report
);
if
(
Objects
.
nonNull
(
dealLog
)){
orderChildExceptionReportDealLogDao
.
saveEntity
(
dealLog
);
}
}
}
}
}
performance-api/src/main/java/com/clx/performance/enums/ExceptionReportEnum.java
→
performance-api/src/main/java/com/clx/performance/enums/
Carrier
ExceptionReportEnum.java
浏览文件 @
4df86092
...
@@ -6,7 +6,7 @@ import lombok.Getter;
...
@@ -6,7 +6,7 @@ import lombok.Getter;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Optional
;
import
java.util.Optional
;
public
enum
ExceptionReportEnum
{
public
enum
Carrier
ExceptionReportEnum
{
;
;
@Getter
@Getter
...
...
performance-api/src/main/java/com/clx/performance/param/pc/DealExceptionReportParam.java
0 → 100644
浏览文件 @
4df86092
package
com
.
clx
.
performance
.
param
.
pc
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
/**
* @ClassName DealExceptionReportParam
* @Description
* @Author kavin
* @Date 2024/10/22 20:07
* @Version 1.0
*/
@Getter
@Setter
public
class
DealExceptionReportParam
{
@NotNull
(
message
=
"异常上报ID不能为空"
)
@Schema
(
description
=
"异常上报ID"
)
private
Integer
id
;
@NotNull
(
message
=
"处理方式不能为空"
)
@Schema
(
description
=
"处理方式 1:同意扣罚 2:申诉"
,
example
=
"枚举 ExceptionReportEnum.DealWay "
)
private
Integer
dealWay
;
@Schema
(
description
=
"申诉原因"
)
private
String
appealReason
;
@Schema
(
description
=
"图片"
)
private
List
<
String
>
pictureUrl
;
@Schema
(
description
=
"视频"
)
private
List
<
String
>
videoUrl
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论