Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
sibu-v-mall
/
sibu-v-mall-third-api
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
95041489
由
刘嘉
编写于
2018-05-17 10:10:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
菠萝派接口- 订单下载更新数据源
1 个父辈
4b154430
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
83 行增加
和
27 行删除
com.sibu.orderHelper.dao/src/main/java/com/sibu/orderHelper/mall/member/read/MemberReadDao.java
com.sibu.orderHelper.integralMall/src/main/resources/mall-mapper/member/read/MemberReadMapper.xml
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/mall/member/read/MemberReadDao.java
查看文件 @
9504148
...
...
@@ -67,6 +67,14 @@ public interface MemberReadDao {
*/
List
<
Orders
>
getOrdersList
(
Map
<
String
,
Object
>
params
);
/**
* 订单下载总数
* @param params
* @return
*/
int
countgetOrdersList
(
Map
<
String
,
Object
>
params
);
/**
* 子订单查询
* @param orderSn
...
...
com.sibu.orderHelper.integralMall/src/main/resources/mall-mapper/member/read/MemberReadMapper.xml
查看文件 @
9504148
...
...
@@ -42,10 +42,20 @@
<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"
/>
<result
property=
"
regionName1
"
column=
"regionName1"
/>
<result
property=
"
regionName2
"
column=
"regionName2"
/>
<result
property=
"
regionName3
"
column=
"regionName3"
/>
<result
property=
"orderState"
column=
"order_state"
/>
<result
property=
"moneyOrder"
column=
"money_order"
/>
<result
property=
"moneyPaidBalance"
column=
"money_paid_balance"
/>
<result
property=
"moneyCoupon"
column=
"money_coupon"
/>
<result
property=
"moneyLogistics"
column=
"money_logistics"
/>
<result
property=
"moneyProduct"
column=
"money_product"
/>
<result
property=
"moneyActFull"
column=
"money_act_full"
/>
<result
property=
"moneyDiscount"
column=
"money_discount"
/>
<result
property=
"moneyBack"
column=
"money_back"
/>
<result
property=
"moneyIntegral"
column=
"money_integral"
/>
<result
property=
"payTime"
column=
"pay_time"
/>
</resultMap>
<!-- 根据订单号查询订单信息 只查询不是主订单的订单 -->
...
...
@@ -142,25 +152,58 @@
<select
id=
"getOrdersList"
parameterType=
"java.util.Map"
resultMap=
"orders"
>
select o.order_sn,o.order_state,o.remark,o.create_time,p.regionName AS regionName1,
c.regionName AS regionName2,a.regionName AS regionName3,
o.address_info,o.mobile,o.zip_code,o.zip_code,o.money_logistics,o.money_product-o.money_order-o.money_logistics AS couponMoney
o.address_info,o.mobile,o.zip_code,o.zip_code,o.money_logistics,o.money_product-o.money_order-o.money_logistics AS couponMoney
,
o.money_order,o.money_product,o.pay_time,o.member_name FROM orders o
LEFT JOIN regions p ON p.id = o.province_id
LEFT JOIN regions c ON c.id = o.city_id
LEFT JOIN regions a ON a.id = o.area_id
WHERE o.is_parent = 0
AND seller_id = #{sellerId} AND order_sn = #{orderSn}
<if
test=
"startTime !=null and startTime ! =''"
>
AND create_time >= #{startTime}
AND o.seller_id = #{sellerId}
<if
test=
"orderState!=null and orderState!=''"
>
AND o.order_state in
<foreach
collection=
"orderState"
item=
"state"
open=
"("
close=
")"
separator=
","
>
#{state}
</foreach>
</if>
<if
test=
"endTime !=null and endTime ! =''"
>
<if
test=
"orderSn!=null and orderSn!=''"
>
AND o.order_sn = #{orderSn}
</if>
<if
test=
"startTime!=null and startTime!=''"
>
AND o.create_time >= #{startTime}
</if>
<if
test=
"endTime!=null and endTime!=''"
>
<![CDATA[
and create_time <= #{endTime}
and
o.
create_time <= #{endTime}
]]>
</if>
ORDER BY o.
id
DESC
ORDER BY o.
create_time
DESC
limit ${PageIndex}, ${PageSize}
</select>
<!-- 订单下载总数-->
<select
id=
"countgetOrdersList"
parameterType=
"java.util.Map"
resultType=
"java.lang.Integer"
>
select count(*) FROM orders o
WHERE o.is_parent = 0
AND o.seller_id = #{sellerId}
<if
test=
"orderState!=null and orderState!=''"
>
AND o.order_state in
<foreach
collection=
"orderState"
item=
"state"
open=
"("
close=
")"
separator=
","
>
#{state}
</foreach>
</if>
<if
test=
"orderSn!=null and orderSn!=''"
>
AND o.order_sn = #{orderSn}
</if>
<if
test=
"startTime!=null and startTime!=''"
>
AND o.create_time >= #{startTime}
</if>
<if
test=
"endTime!=null and endTime!=''"
>
<![CDATA[
and o.create_time <= #{endTime}
]]>
</if>
</select>
<!-- 子订单实体-->
<resultMap
id=
"ordersProduct"
type=
"com.sibu.orderHelper.integral.pineapple.model.OrdersProduct"
>
<result
property=
"id"
column=
"id"
/>
...
...
@@ -201,9 +244,9 @@
<!-- 查询子订单-->
<select
id=
"getOrdersProductList"
resultType=
"java.
util.Map
"
resultMap=
"ordersProduct"
>
<select
id=
"getOrdersProductList"
resultType=
"java.
lang.String
"
resultMap=
"ordersProduct"
>
SELECT product_sku,id,product_name,spec_info,number,money_price,money_act_single FROM orders_product
WHERE orders_sn = #{order
s
Sn}
WHERE orders_sn = #{orderSn}
</select>
<!-- 地址实体类-->
...
...
com.sibu.orderHelper.model/src/main/java/com/sibu/orderHelper/integral/pineapple/model/Orders.java
查看文件 @
9504148
...
...
@@ -23,7 +23,7 @@ public class Orders implements Serializable{
private
Integer
memberId
;
private
String
memberName
;
private
Integer
orderState
;
private
String
payTime
;
private
Date
payTime
;
private
Integer
paymentStatus
;
private
Integer
invoiceStatus
;
private
String
invoiceTitle
;
...
...
@@ -68,7 +68,7 @@ public class Orders implements Serializable{
private
String
codconfirmTime
;
private
String
codconfirmRemark
;
private
Integer
codconfirmState
;
private
String
createTime
;
private
Date
createTime
;
private
String
updateTime
;
private
Integer
evaluateState
;
private
String
regionName1
;
...
...
com.sibu.orderHelper.service/src/main/java/com/sibu/orderHelper/integral/service/pineapple/impl/GetOrderBizServiceImpl.java
查看文件 @
9504148
...
...
@@ -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.EJavaShopOrderStateEnum
;
import
com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum
;
import
com.sibu.orderHelper.integral.pineapple.exception.BizException
;
import
com.sibu.orderHelper.integral.pineapple.model.Orders
;
...
...
@@ -26,6 +27,7 @@ import com.sibu.orderHelper.integral.reponse.DoingOrderDetailResponse;
import
com.sibu.orderHelper.integral.service.IIMDoingOrderService
;
import
com.sibu.orderHelper.integral.service.impl.IMDoingOrderService
;
import
com.sibu.orderHelper.integral.service.pineapple.converter.PlatformOrderToPineAppleOrderConverter
;
import
com.sibu.orderHelper.mall.member.read.MemberReadDao
;
import
com.sibu.orderHelper.service.redis.RedisProductSkuService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.log4j.Logger
;
...
...
@@ -52,16 +54,12 @@ import java.util.stream.Collectors;
@Service
public
class
GetOrderBizServiceImpl
extends
AbstractBizService
<
GetOrderRequest
>
{
private
static
Logger
log
=
Logger
.
getLogger
(
GetOrderBizServiceImpl
.
class
);
@Resource
private
IIMDoingOrderService
iimDoingOrderService
;
@Resource
private
IMDoingOrderDao
iMDoingOrderDao
;
@Autowired
private
PlatformOrderToPineAppleOrderConverter
platformOrderToPineAppleOrderConverter
;
@Resource
PineappleDao
pineapple
Dao
;
private
MemberReadDao
memberRead
Dao
;
@Override
public
BaseResponse
call
(
CallRequest
<
GetOrderRequest
>
callRequest
)
{
...
...
@@ -69,6 +67,10 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
if
(!
StringUtil
.
isNull
(
callRequest
.
getBizModel
().
getPlatOrderNo
())){
params
.
put
(
"orderSn"
,
callRequest
.
getBizModel
().
getPlatOrderNo
());
}
if
(!
StringUtil
.
isNull
(
callRequest
.
getBizModel
().
getOrderStatus
())){
OrderStatusEnum
orderStatusEnum
=
OrderStatusEnum
.
resolve
(
callRequest
.
getBizModel
().
getOrderStatus
());
params
.
put
(
"orderState"
,
orderStatusEnum
.
getMallOrderStatus
());
}
params
.
put
(
"sellerId"
,
callRequest
.
getSupplier
().
getId
());
if
(!
StringUtil
.
isNull
(
callRequest
.
getBizModel
().
getStartTime
())){
params
.
put
(
"startTime"
,
callRequest
.
getBizModel
().
getStartTime
());
...
...
@@ -78,9 +80,9 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
}
params
.
put
(
"PageIndex"
,(
callRequest
.
getBizModel
().
getPageIndex
()
-
1
)
*
callRequest
.
getBizModel
().
getPageSize
());
params
.
put
(
"PageSize"
,
callRequest
.
getBizModel
().
getPageSize
());
List
<
Orders
>
ordersList
=
pineapple
Dao
.
getOrdersList
(
params
);
List
<
Orders
>
ordersList
=
memberRead
Dao
.
getOrdersList
(
params
);
GetOrderResponse
response
=
new
GetOrderResponse
();
response
.
setNumTotalOrder
(
ordersList
.
size
(
));
response
.
setNumTotalOrder
(
memberReadDao
.
countgetOrdersList
(
params
));
response
.
setOrders
(
findOrders
(
ordersList
));
response
.
setCode
(
PineAppleConst
.
SUCCESS_CODE
);
return
response
;
...
...
@@ -92,8 +94,8 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
ordersList
.
stream
().
forEach
(
o
->{
OrderResponse
orderResponse
=
this
.
getOrderResponse
(
o
);
try
{
List
<
OrdersProduct
>
ordersProductList
=
pineapple
Dao
.
getOrdersProductList
(
o
.
getOrderSn
());
if
(
StringUtil
.
isNull
(
null
)){
List
<
OrdersProduct
>
ordersProductList
=
memberRead
Dao
.
getOrdersProductList
(
o
.
getOrderSn
());
if
(
StringUtil
.
isNull
(
ordersProductList
)){
throw
new
BizException
(
String
.
format
(
"获取子订单数据业务异常[%s]"
,(
o
.
getOrderSn
())));
}
List
<
OrderGoodResponse
>
goodInfos
=
new
ArrayList
<>();
...
...
@@ -101,11 +103,12 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
OrderGoodResponse
orderGoodResponse
=
this
.
getOrderGoodResponse
(
p
);
goodInfos
.
add
(
orderGoodResponse
);
});
orderResponse
.
setGoodInfos
(
goodInfos
);
orderResponseList
.
add
(
orderResponse
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取订单数据业务异常"
,
e
);
throw
new
BizException
(
"获取订单数据业务异常"
,
e
);
throw
new
BizException
(
String
.
format
(
"获取订单数据业务异常:[%s]"
,
o
.
getOrderSn
())
);
}
});
}
...
...
@@ -130,12 +133,13 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
orderResponse
.
setCity
(
orders
.
getRegionName2
());
orderResponse
.
setArea
(
orders
.
getRegionName3
());
orderResponse
.
setAddress
(
orders
.
getAddressInfo
());
orderResponse
.
setNick
(
orders
.
getMemberName
());
orderResponse
.
setPhone
(
orders
.
getMobile
());
orderResponse
.
setMobile
(
orders
.
getMobile
());
orderResponse
.
setPostFee
(
this
.
convertAndCheckFreight
(
orders
.
getMoneyLogistics
()));
orderResponse
.
setGoodsFee
(
this
.
convertAndCheckFreight
(
orders
.
getMoneyProduct
()));
orderResponse
.
setTotalMoney
(
this
.
convertAndCheckFreight
(
orders
.
getMoneyOrder
()));
orderResponse
.
setPayTime
(
this
.
buildDefaultSimpleDateFormat
().
format
(
orders
.
getPayTime
()));
orderResponse
.
setPayTime
(
orders
.
getPayTime
()==
null
?
""
:
this
.
buildDefaultSimpleDateFormat
().
format
(
orders
.
getPayTime
()));
orderResponse
.
setShouldPayType
(
"银行收款"
);
orderResponse
.
setTown
(
""
);
orderResponse
.
setTaxAmount
(
""
);
...
...
@@ -176,7 +180,7 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
orderGoodResponse
.
setRefundStatus
(
""
);
orderGoodResponse
.
setStatus
(
""
);
orderGoodResponse
.
setRemark
(
""
);
return
null
;
return
orderGoodResponse
;
}
...
...
@@ -194,7 +198,8 @@ public class GetOrderBizServiceImpl extends AbstractBizService<GetOrderRequest>
}
private
String
convertAndCheckFreight
(
BigDecimal
money
)
{
return
money
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
toPlainString
();
BigDecimal
price
=
money
==
null
?
BigDecimal
.
ZERO
:
money
;
return
price
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
toPlainString
();
}
@Override
...
...
请
注册
或
登录
后发表评论