Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
sibu-v-mall
/
sibu-v-mall-third-api
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
c40e01b1
由
刘嘉
编写于
2018-05-17 10:55:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
菠萝派接口- 检测退款换数据源
1 个父辈
95041489
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
9 行删除
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/mall/member/read/MemberReadDao.java
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/CheckRefundStatusBizServiceImpl.java
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/mall/member/read/MemberReadDao.java
查看文件 @
c40e01b
...
...
@@ -124,7 +124,7 @@ public interface MemberReadDao {
* @param id
* @return
*/
List
<
SellerComplaint
>
getSellerComplaintBy
Order
Id
(
@Param
(
"orderId"
)
Integer
id
);
List
<
SellerComplaint
>
getSellerComplaintById
(
@Param
(
"orderId"
)
Integer
id
);
List
<
Seller
>
getSeller
(
@Param
(
"id"
)
String
id
);
...
...
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/CheckRefundStatusBizServiceImpl.java
查看文件 @
c40e01b
...
...
@@ -8,6 +8,7 @@ import com.sibu.orderHelper.enums.*;
import
com.sibu.orderHelper.integral.dao.PineappleDao
;
import
com.sibu.orderHelper.integral.model.CheckRefundStatusBean
;
import
com.sibu.orderHelper.integral.model.IMDoingOrderBean
;
import
com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum
;
import
com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum
;
import
com.sibu.orderHelper.integral.pineapple.enums.PineappleExchangeEnum
;
import
com.sibu.orderHelper.integral.pineapple.exception.BizException
;
...
...
@@ -18,6 +19,7 @@ import com.sibu.orderHelper.integral.pineapple.model.SellerComplaint;
import
com.sibu.orderHelper.integral.pineapple.request.CallRequest
;
import
com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse
;
import
com.sibu.orderHelper.integral.request.CheckRefundStatusRequest
;
import
com.sibu.orderHelper.mall.member.read.MemberReadDao
;
import
org.apache.log4j.Logger
;
import
org.springframework.stereotype.Service
;
...
...
@@ -29,21 +31,25 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
private
static
Logger
log
=
Logger
.
getLogger
(
CheckRefundStatusBizServiceImpl
.
class
);
@Resource
private
PineappleDao
pineapple
Dao
;
private
MemberReadDao
memberRead
Dao
;
@Override
public
CheckRefundStatusResponse
call
(
CallRequest
<
CheckRefundStatusRequest
>
callRequest
)
throws
Exception
{
CheckRefundStatusResponse
checkRefundStatusResponse
=
new
CheckRefundStatusResponse
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orderSn
"
,
callRequest
.
getBizModel
().
getOrderID
());
params
.
put
(
"orderSn"
,
callRequest
.
getBizModel
().
getOrderID
());
params
.
put
(
"sellerId"
,
callRequest
.
getSupplier
().
getId
());
Orders
orders
=
pineapple
Dao
.
getOrdersByMap
(
params
);
Orders
orders
=
memberRead
Dao
.
getOrdersByMap
(
params
);
if
(
StringUtil
.
isNull
(
orders
)){
log
.
error
(
String
.
format
(
"修改订单备注,获取订单数据业务异常,订单号:[%s]"
,
callRequest
.
getBizModel
().
getOrderID
()));
throw
new
BizException
(
String
.
format
(
"修改订单备注,获取订单数据业务异常,订单号:[%s]"
,
callRequest
.
getBizModel
().
getOrderID
()));
log
.
error
(
String
.
format
(
"检测订单退款,获取订单数据业务异常,订单号:[%s]"
,
callRequest
.
getBizModel
().
getOrderID
()));
throw
new
BizException
(
String
.
format
(
"检测订单退款,获取订单数据业务异常,订单号:[%s]"
,
callRequest
.
getBizModel
().
getOrderID
()));
}
if
(
orders
.
getOrderState
()
==
EJavaShopOrderStateEnum
.
RefundFail
.
getCode
()){
log
.
error
(
String
.
format
(
"检测订单退款,该订单已关闭,订单号:[%s]"
,
callRequest
.
getBizModel
().
getOrderID
()));
throw
new
BizException
(
String
.
format
(
"检测订单退款,该订单已关闭,订单号:[%s]"
,
callRequest
.
getBizModel
().
getOrderID
()));
}
//1.查询退货表有没有记录
List
<
MemberProductBack
>
memberProductBackList
=
pineapple
Dao
.
getMemberProductBackByOrderSn
(
callRequest
.
getBizModel
().
getOrderID
());
List
<
MemberProductBack
>
memberProductBackList
=
memberRead
Dao
.
getMemberProductBackByOrderSn
(
callRequest
.
getBizModel
().
getOrderID
());
//5.如果退货表有记录,退款状态为店铺收货,判断退款金额状态
if
(!
StringUtil
.
isNull
(
memberProductBackList
)
&&
!
memberProductBackList
.
isEmpty
()){
MemberProductBack
memberProductBack
=
memberProductBackList
.
stream
().
findFirst
().
get
();
...
...
@@ -60,6 +66,14 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
checkRefundStatusResponse
.
setCode
(
PineappleEnum
.
SUCCESS
.
getCode
());
checkRefundStatusResponse
.
setMessage
(
PineappleEnum
.
SUCCESS
.
getMsg
());
return
checkRefundStatusResponse
;
}
else
{
checkRefundStatusResponse
.
setRefundStatus
(
PineappleRefundEnum
.
JH_06
.
getCode
());
checkRefundStatusResponse
.
setSubmessage
(
PineappleRefundEnum
.
JH_06
.
getMsg
());
checkRefundStatusResponse
.
setRefundStatusdescription
(
PineappleRefundEnum
.
JH_06
.
getMsg
());
checkRefundStatusResponse
.
setChildrenrefundStatus
(
new
ArrayList
());
checkRefundStatusResponse
.
setCode
(
PineappleEnum
.
SUCCESS
.
getCode
());
checkRefundStatusResponse
.
setMessage
(
PineappleEnum
.
SUCCESS
.
getMsg
());
return
checkRefundStatusResponse
;
}
}
checkRefundStatusResponse
.
setRefundStatus
(
refundEnum
.
getCode
());
...
...
@@ -72,7 +86,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
}
}
//2.查询换货表有没有记录
List
<
MemberProductExchange
>
memberProductExchangeList
=
pineapple
Dao
.
getMemberProductExchangeByOrderSn
(
callRequest
.
getBizModel
().
getOrderID
());
List
<
MemberProductExchange
>
memberProductExchangeList
=
memberRead
Dao
.
getMemberProductExchangeByOrderSn
(
callRequest
.
getBizModel
().
getOrderID
());
if
(!
StringUtil
.
isNull
(
memberProductExchangeList
)
&&
!
memberProductExchangeList
.
isEmpty
()){
MemberProductExchange
memberProductExchange
=
memberProductExchangeList
.
stream
().
findFirst
().
get
();
if
(!
StringUtil
.
isNull
(
memberProductExchange
)){
...
...
@@ -88,7 +102,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
}
//3.如果都没有记录需要查询seller_complaint(投诉表),根据order_id订单id查询
List
<
SellerComplaint
>
sellerComplaintList
=
pineappleDao
.
getSellerComplaintByOrder
Id
(
orders
.
getId
());
List
<
SellerComplaint
>
sellerComplaintList
=
memberReadDao
.
getSellerComplaintBy
Id
(
orders
.
getId
());
if
(!
StringUtil
.
isNull
(
sellerComplaintList
)
&&
!
sellerComplaintList
.
isEmpty
()){
checkRefundStatusResponse
.
setRefundStatus
(
PineappleRefundEnum
.
JH_99
.
getCode
());
checkRefundStatusResponse
.
setSubmessage
(
PineappleRefundEnum
.
JH_99
.
getMsg
());
...
...
请
注册
或
登录
后发表评论