Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
sibu-v-mall
/
sibu-v-mall-third-api
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
b4c2c689
由
刘嘉
编写于
2018-05-15 14:13:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
菠萝派接口-订单下载
1 个父辈
3564641c
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
101 行增加
和
36 行删除
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/integral/dao/PineappleDao.java
com.sibu.orderHelper.integralMall/src/main/resources/mapper/PineappleMapper.xml
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/constant/PineAppleConst.java
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Orders.java
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/GetOrderBizServiceImpl.java
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/integral/dao/PineappleDao.java
查看文件 @
b4c2c68
...
...
@@ -75,7 +75,7 @@ public interface PineappleDao {
* @param params
* @return
*/
List
<
Order
Response
>
getOrdersList
(
Map
<
String
,
Object
>
params
);
List
<
Order
s
>
getOrdersList
(
Map
<
String
,
Object
>
params
);
/**
* 子订单查询
...
...
com.sibu.orderHelper.integralMall/src/main/resources/mapper/PineappleMapper.xml
查看文件 @
b4c2c68
...
...
@@ -37,6 +37,9 @@
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"province"
column=
"regionName1"
/>
<result
property=
"city"
column=
"regionName2"
/>
<result
property=
"area"
column=
"regionName3"
/>
</resultMap>
<!-- 根据订单号查询订单信息 只查询不是主订单的订单 -->
...
...
@@ -158,7 +161,7 @@
<!-- 下载订单实体-->
<resultMap
id=
"orderResponse"
type=
"com.sibu.orderHelper.integral.pineapple.response.OrderResponse"
>
<!--
<resultMap id="orderResponse" type="com.sibu.orderHelper.integral.pineapple.response.OrderResponse">
<result property="platOrderNo" column="order_sn" />
<result property="tradeStatus" column="order_state" />
<result property="tradeStatusDescription" column="remark" />
...
...
@@ -175,7 +178,7 @@
<result property="goodsFee" column="money_product" />
<result property="payTime" column="pay_time" />
<result property="nick" column="member_name" />
</resultMap>
</resultMap>
-->
<!-- 主订单下载-->
...
...
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/constant/PineAppleConst.java
查看文件 @
b4c2c68
package
com
.
sibu
.
orderHelper
.
integral
.
pineapple
.
constant
;
import
com.sibu.orderHelper.enums.PayOrderStatus
;
import
com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -19,45 +20,44 @@ public class PineAppleConst {
/**
* 菠萝派对应商城【等待买家付款】状态
*/
public
static
final
List
<
Integer
>
MALL_WAIT_BUYER_PAY_ORDER_STATUS
=
Arrays
.
asList
(
PayOrderStatus
.
WaitPay
.
getCode
());
public
static
final
List
<
Integer
>
MALL_WAIT_BUYER_PAY_ORDER_STATUS
=
Arrays
.
asList
(
EJavaShopOrderStateEnum
.
WaitPay
.
getCode
());
/**
* 菠萝派对应商城【等待卖家发货】状态
*/
public
static
final
List
<
Integer
>
MALL_WAIT_SELLER_DELIVER_ORDER_STATUS
=
Arrays
.
asList
(
PayOrderStatus
.
WaitShip
.
getCode
());
public
static
final
List
<
Integer
>
MALL_WAIT_SELLER_DELIVER_ORDER_STATUS
=
Arrays
.
asList
(
EJavaShopOrderStateEnum
.
WaitConfirmed
.
getCode
(),
EJavaShopOrderStateEnum
.
WaitShip
.
getCode
());
/**
* 菠萝派对应商城【等待买家确认收货】状态
*/
public
static
final
List
<
Integer
>
MALL_WAIT_BUYER_RECEIVED_ORDER_STATUS
=
Arrays
.
asList
(
PayOrderStatus
.
HasReceived
.
getCode
());
public
static
final
List
<
Integer
>
MALL_WAIT_BUYER_RECEIVED_ORDER_STATUS
=
Arrays
.
asList
(
EJavaShopOrderStateEnum
.
HasReceived
.
getCode
());
/**
* 菠萝派对应商城【交易完成】状态
*/
public
static
final
List
<
Integer
>
MALL_TRANSACTION_FINISHED_ORDER_STATUS
=
Arrays
.
asList
(
PayOrderStatus
.
HasDelive
.
getCode
(),
PayOrderStatus
.
Finished
.
getCode
());
public
static
final
List
<
Integer
>
MALL_TRANSACTION_FINISHED_ORDER_STATUS
=
Arrays
.
asList
(
EJavaShopOrderStateEnum
.
Finished
.
getCode
());
/**
* 菠萝派对应商城【交易关闭】状态
*/
public
static
final
List
<
Integer
>
MALL_TRANSACTION_CLOSED_ORDER_STATUS
=
Arrays
.
asList
(
PayOrderStatus
.
RefundFail
.
getCode
());
public
static
final
List
<
Integer
>
MALL_TRANSACTION_CLOSED_ORDER_STATUS
=
Arrays
.
asList
(
EJavaShopOrderStateEnum
.
RefundFail
.
getCode
());
/**
* 菠萝派对应商城【所有订单】
*/
public
static
final
List
<
Integer
>
MALL_ALL_ORDER
=
Arrays
.
asList
(
PayOrderStatus
.
WaitPay
.
getCode
(),
PayOrderStatus
.
WaitShip
.
getCode
(),
PayOrderStatus
.
HasReceived
.
getCode
(),
PayOrderStatus
.
HasDelive
.
getCode
(),
PayOrderStatus
.
Finished
.
getCode
(),
PayOrderStatus
.
RefundFail
.
getCode
()
EJavaShopOrderStateEnum
.
WaitPay
.
getCode
(),
EJavaShopOrderStateEnum
.
WaitConfirmed
.
getCode
(),
EJavaShopOrderStateEnum
.
WaitShip
.
getCode
(),
EJavaShopOrderStateEnum
.
HasReceived
.
getCode
(),
EJavaShopOrderStateEnum
.
Finished
.
getCode
(),
EJavaShopOrderStateEnum
.
RefundFail
.
getCode
()
);
/**
* 菠萝派对应商城【未知】状态订单
*/
public
static
final
List
<
Integer
>
MALL_UNKNOWN_ORDER_STATUS
=
Arrays
.
asList
(
PayOrderStatus
.
WaitPay
.
getCode
(),
PayOrderStatus
.
WaitShip
.
getCode
(),
PayOrderStatus
.
HasReceived
.
getCode
(),
PayOrderStatus
.
HasDelive
.
getCode
(),
PayOrderStatus
.
Finished
.
getCode
(),
PayOrderStatus
.
RefundFail
.
getCode
()
EJavaShopOrderStateEnum
.
WaitPay
.
getCode
(),
EJavaShopOrderStateEnum
.
WaitConfirmed
.
getCode
(),
EJavaShopOrderStateEnum
.
WaitShip
.
getCode
(),
EJavaShopOrderStateEnum
.
HasReceived
.
getCode
(),
EJavaShopOrderStateEnum
.
Finished
.
getCode
(),
EJavaShopOrderStateEnum
.
RefundFail
.
getCode
()
);
}
...
...
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Orders.java
查看文件 @
b4c2c68
...
...
@@ -22,7 +22,7 @@ public class Orders {
private
Integer
memberId
;
private
String
memberName
;
private
Integer
orderState
;
private
Date
payTime
;
private
String
payTime
;
private
Integer
paymentStatus
;
private
Integer
invoiceStatus
;
private
String
invoiceTitle
;
...
...
@@ -54,8 +54,8 @@ public class Orders {
private
String
email
;
private
String
zipCode
;
private
String
remark
;
private
Date
deliverTime
;
private
Date
finishTime
;
private
String
deliverTime
;
private
String
finishTime
;
private
String
tradeSn
;
private
Integer
source
;
private
Integer
logisticsId
;
...
...
@@ -64,11 +64,11 @@ public class Orders {
private
Integer
isCodconfim
;
private
Integer
codconfirmId
;
private
String
codconfirmName
;
private
Date
codconfirmTime
;
private
String
codconfirmTime
;
private
String
codconfirmRemark
;
private
Integer
codconfirmState
;
private
Date
createTime
;
private
Date
DateupdateTime
;
private
String
createTime
;
private
String
DateupdateTime
;
private
Integer
evaluateState
;
private
String
regionName1
;
private
String
regionName2
;
...
...
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/GetOrderBizServiceImpl.java
查看文件 @
b4c2c68
...
...
@@ -10,6 +10,7 @@ import com.sibu.orderHelper.integral.model.IMDoingOrderBean;
import
com.sibu.orderHelper.integral.model.IMProductBean
;
import
com.sibu.orderHelper.integral.model.IMSupplier
;
import
com.sibu.orderHelper.integral.pineapple.constant.PineAppleConst
;
import
com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum
;
import
com.sibu.orderHelper.integral.pineapple.exception.BizException
;
import
com.sibu.orderHelper.integral.pineapple.model.Orders
;
import
com.sibu.orderHelper.integral.pineapple.model.OrdersProduct
;
...
...
@@ -18,6 +19,7 @@ import com.sibu.orderHelper.integral.pineapple.request.CallRequest;
import
com.sibu.orderHelper.integral.pineapple.request.GetOrderRequest
;
import
com.sibu.orderHelper.integral.pineapple.response.BaseResponse
;
import
com.sibu.orderHelper.integral.pineapple.response.GetOrderResponse
;
import
com.sibu.orderHelper.integral.pineapple.response.OrderGoodResponse
;
import
com.sibu.orderHelper.integral.pineapple.response.OrderResponse
;
import
com.sibu.orderHelper.integral.reponse.DoingOrder1DetailResponse
;
import
com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse
;
...
...
@@ -32,6 +34,7 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
javax.xml.bind.ValidationException
;
import
java.text.MessageFormat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -73,7 +76,7 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
}
params
.
put
(
"PageIndex"
,(
callRequest
.
getBizModel
().
getPageIndex
()
-
1
)
*
callRequest
.
getBizModel
().
getPageSize
());
params
.
put
(
"PageSize"
,
callRequest
.
getBizModel
().
getPageSize
());
List
<
Order
Response
>
ordersList
=
pineappleDao
.
getOrdersList
(
params
);
List
<
Order
s
>
ordersList
=
pineappleDao
.
getOrdersList
(
params
);
GetOrderResponse
response
=
new
GetOrderResponse
();
response
.
setNumTotalOrder
(
ordersList
.
size
());
response
.
setOrders
(
null
);
...
...
@@ -81,29 +84,88 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
return
response
;
}
private
List
<
OrderResponse
>
findOrders
(
List
<
Order
Response
>
ordersList
){
List
<
OrderResponse
>
order
s
=
new
ArrayList
<>();
private
List
<
OrderResponse
>
findOrders
(
List
<
Order
s
>
ordersList
){
List
<
OrderResponse
>
order
ResponseList
=
new
ArrayList
<>();
if
(!
StringUtil
.
isNull
(
ordersList
)
&&
!
ordersList
.
isEmpty
()){
ordersList
.
stream
().
forEach
(
o
->{
OrderResponse
orderResponse
=
new
OrderResponse
(
);
OrderResponse
orderResponse
=
this
.
getOrderResponse
(
o
);
try
{
pineappleDao
.
getOrdersProductList
(
o
.
getPayOrderNo
());
List
<
OrdersProduct
>
ordersProductList
=
pineappleDao
.
getOrdersProductList
(
o
.
getOrderSn
());
if
(
StringUtil
.
isNull
(
null
)){
throw
new
BizException
(
String
.
format
(
"获取子订单数据业务异常[%s]"
,(
o
.
get
PayOrderNo
())));
throw
new
BizException
(
String
.
format
(
"获取子订单数据业务异常[%s]"
,(
o
.
get
OrderSn
())));
}
//orderResponse.setGoodInfos(orderProductList);
orders
.
add
(
orderResponse
);
List
<
OrderGoodResponse
>
goodInfos
=
new
ArrayList
<>();
ordersProductList
.
stream
().
forEach
(
p
->{
OrderGoodResponse
orderGoodResponse
=
this
.
getOrderGoodResponse
(
p
);
goodInfos
.
add
(
orderGoodResponse
);
});
orderResponse
.
setGoodInfos
(
goodInfos
);
orderResponseList
.
add
(
orderResponse
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取订单数据业务异常"
,
e
);
throw
new
BizException
(
"获取订单数据业务异常"
,
e
);
}
});
}
return
order
s
;
return
order
ResponseList
;
}
/**
* 主订单数据
* @param orders
* @return
*/
private
OrderResponse
getOrderResponse
(
Orders
orders
){
OrderStatusEnum
orderStatusEnum
=
this
.
convertAndCheckOrderStatusEnum
(
orders
);
OrderResponse
orderResponse
=
new
OrderResponse
();
orderResponse
.
setTradeStatus
(
orderStatusEnum
.
getCode
());
orderResponse
.
setTradeStatusDescription
(
orderStatusEnum
.
getMsg
());
orderResponse
.
setPlatOrderNo
(
orders
.
getOrderSn
());
orderResponse
.
setTradeStatus
(
orders
.
getOrderState
().
toString
());
orderResponse
.
setTradeStatusDescription
(
orders
.
getRemark
());
orderResponse
.
setTradeTime
(
orders
.
getCreateTime
());
orderResponse
.
setCountry
(
"中国"
);
orderResponse
.
setProvince
(
orders
.
getRegionName1
());
orderResponse
.
setCity
(
orders
.
getRegionName2
());
orderResponse
.
setArea
(
orders
.
getRegionName3
());
orderResponse
.
setAddress
(
orders
.
getAddressInfo
());
orderResponse
.
setPhone
(
orders
.
getMobile
());
orderResponse
.
setMobile
(
orders
.
getMobile
());
orderResponse
.
setPostFee
(
orders
.
getMoneyLogistics
().
toString
());
orderResponse
.
setGoodsFee
(
orders
.
getMoneyProduct
().
toString
());
orderResponse
.
setTotalMoney
(
orders
.
getMoneyOrder
().
toString
());
orderResponse
.
setPayTime
(
orders
.
getPayTime
());
orderResponse
.
setShouldPayType
(
"银行收款"
);
return
orderResponse
;
}
/**
* 子订单数据
* @param ordersProduct
* @return
*/
private
OrderGoodResponse
getOrderGoodResponse
(
OrdersProduct
ordersProduct
){
OrderGoodResponse
orderGoodResponse
=
new
OrderGoodResponse
();
orderGoodResponse
.
setProductId
(
ordersProduct
.
getProductSku
());
orderGoodResponse
.
setSubOrderNo
(
String
.
valueOf
(
ordersProduct
.
getId
()));
orderGoodResponse
.
setTradeGoodsNo
(
ordersProduct
.
getProductSku
());
orderGoodResponse
.
setTradeGoodsName
(
ordersProduct
.
getProductName
());
orderGoodResponse
.
setTradeGoodsSpec
(
ordersProduct
.
getSpecInfo
());
orderGoodResponse
.
setGoodsCount
(
String
.
valueOf
(
ordersProduct
.
getNumber
()));
orderGoodResponse
.
setPrice
(
String
.
valueOf
(
ordersProduct
.
getMoneyPrice
()));
orderGoodResponse
.
setDiscountMoney
(
String
.
valueOf
(
ordersProduct
.
getMoneyActSingle
()));
return
null
;
}
private
OrderStatusEnum
convertAndCheckOrderStatusEnum
(
Orders
orders
)
{
OrderStatusEnum
orderStatusEnum
=
OrderStatusEnum
.
resolveByPlatformOrderStatus
(
orders
.
getOrderState
());
if
(
orderStatusEnum
.
equals
(
OrderStatusEnum
.
UNKNOWN
)
||
orderStatusEnum
.
equals
(
OrderStatusEnum
.
ALL_ORDER
))
{
throw
new
BizException
(
MessageFormat
.
format
(
"订单状态【{0}】转换失败,"
,
orders
.
getOrderState
()));
}
return
orderStatusEnum
;
}
@Override
public
String
getHandleMethodName
()
{
return
"Differ.JH.Business.GetOrder"
;
...
...
请
注册
或
登录
后发表评论