Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
d84f0ccf
提交
d84f0ccf
authored
12月 10, 2019
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成汇率转换接口
上级
0bd9c725
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
435 行增加
和
199 行删除
+435
-199
TbCfOrderController.java
...aoyun/zion/chinafrica/controller/TbCfOrderController.java
+22
-4
TbCfOrderDao.java
...in/java/com/diaoyun/zion/chinafrica/dao/TbCfOrderDao.java
+18
-2
TbCfExchangeEntity.java
...om/diaoyun/zion/chinafrica/entity/TbCfExchangeEntity.java
+154
-0
TbCfOrderService.java
...com/diaoyun/zion/chinafrica/service/TbCfOrderService.java
+4
-0
TbCfOrderServiceImpl.java
...un/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
+45
-12
application.yml
src/main/resources/application.yml
+5
-5
TbCfOrderDao.xml
src/main/resources/mapper/TbCfOrderDao.xml
+187
-176
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfOrderController.java
浏览文件 @
d84f0ccf
...
@@ -31,14 +31,16 @@ public class TbCfOrderController {
...
@@ -31,14 +31,16 @@ public class TbCfOrderController {
@ApiOperation
(
"用户结算,返回订单"
)
@ApiOperation
(
"用户结算,返回订单"
)
@GetMapping
(
"/settle"
)
@GetMapping
(
"/settle"
)
public
Result
<
TbCfOrderVo
>
settleAccount
(
@ApiParam
(
"发放ID"
)
@RequestParam
(
value
=
"toitableId"
,
required
=
false
)
String
toitableId
)
throws
IOException
,
URISyntaxException
,
ExecutionException
,
InterruptedException
,
TimeoutException
{
public
Result
<
TbCfOrderVo
>
settleAccount
(
@ApiParam
(
"发放ID"
)
@RequestParam
(
value
=
"toitableId"
,
required
=
false
)
String
toitableId
)
throws
IOException
,
URISyntaxException
,
ExecutionException
,
InterruptedException
,
TimeoutException
{
return
tbCfOrderService
.
settleAccount
(
toitableId
);
return
tbCfOrderService
.
settleAccount
(
toitableId
);
}
}
@ApiOperation
(
"用户确定下单"
)
@ApiOperation
(
"用户确定下单"
)
@PostMapping
(
"/place"
)
@PostMapping
(
"/place"
)
public
Result
placeOrder
(
@ApiParam
(
"订单详情"
)
@RequestBody
TbCfOrderVo
tbCfOrderVo
,
@ApiParam
(
"发放ID"
)
@RequestParam
(
value
=
"toitableId"
,
required
=
false
)
String
toitableId
)
throws
IOException
,
URISyntaxException
,
ExecutionException
,
InterruptedException
,
TimeoutException
{
public
Result
placeOrder
(
@ApiParam
(
"订单详情"
)
@RequestBody
TbCfOrderVo
tbCfOrderVo
,
@ApiParam
(
"发放ID"
)
@RequestParam
(
value
=
"toitableId"
,
required
=
false
)
String
toitableId
)
throws
IOException
,
URISyntaxException
,
ExecutionException
,
InterruptedException
,
TimeoutException
{
return
tbCfOrderService
.
placeOrder
(
tbCfOrderVo
,
toitableId
);
return
tbCfOrderService
.
placeOrder
(
tbCfOrderVo
,
toitableId
);
}
}
/**
/**
* pageNum 页数
* pageNum 页数
* pageSize 每页大小
* pageSize 每页大小
...
@@ -63,11 +65,13 @@ public class TbCfOrderController {
...
@@ -63,11 +65,13 @@ public class TbCfOrderController {
public
Result
payForOrder
(
@ApiParam
(
"订单id"
)
@PathVariable
(
"orderId"
)
String
orderId
,
@ApiParam
(
"支付token"
)
@PathVariable
(
"token"
)
String
token
)
{
public
Result
payForOrder
(
@ApiParam
(
"订单id"
)
@PathVariable
(
"orderId"
)
String
orderId
,
@ApiParam
(
"支付token"
)
@PathVariable
(
"token"
)
String
token
)
{
return
tbCfOrderService
.
payForOrder
(
orderId
,
token
);
return
tbCfOrderService
.
payForOrder
(
orderId
,
token
);
}
}
@ApiOperation
(
"发起订单支付"
)
@ApiOperation
(
"发起订单支付"
)
@PostMapping
(
"/pay/{orderId}"
)
@PostMapping
(
"/pay/{orderId}"
)
public
Result
rePayForOrder
(
@ApiParam
(
"订单id"
)
@PathVariable
(
"orderId"
)
String
orderId
)
{
public
Result
rePayForOrder
(
@ApiParam
(
"订单id"
)
@PathVariable
(
"orderId"
)
String
orderId
)
{
return
tbCfOrderService
.
rePayForOrder
(
orderId
);
return
tbCfOrderService
.
rePayForOrder
(
orderId
);
}
}
@ApiOperation
(
"根据订单id,查询物流详情"
)
@ApiOperation
(
"根据订单id,查询物流详情"
)
@GetMapping
(
"/express/{orderId}"
)
@GetMapping
(
"/express/{orderId}"
)
public
Result
queryOrderExpressInfo
(
@ApiParam
(
"订单id"
)
@PathVariable
String
orderId
)
throws
IOException
{
public
Result
queryOrderExpressInfo
(
@ApiParam
(
"订单id"
)
@PathVariable
String
orderId
)
throws
IOException
{
...
@@ -88,4 +92,18 @@ public class TbCfOrderController {
...
@@ -88,4 +92,18 @@ public class TbCfOrderController {
public
Result
getOrderDetail
(
@PathVariable
(
"orderId"
)
String
orderId
)
{
public
Result
getOrderDetail
(
@PathVariable
(
"orderId"
)
String
orderId
)
{
return
tbCfOrderService
.
getOrderDetail
(
orderId
);
return
tbCfOrderService
.
getOrderDetail
(
orderId
);
}
}
/**
* 汇率转换(美元转换成其他)
*
* @param price
* @param currency
* @return
*/
@ApiOperation
(
"汇率转换"
)
@GetMapping
(
"/currencyConversion"
)
public
Result
currencyConversion
(
@ApiParam
(
"价格"
)
@RequestParam
(
"price"
)
String
price
,
@ApiParam
(
"兑换货币"
)
@RequestParam
(
"currency"
)
String
currency
)
{
return
tbCfOrderService
.
currencyConversion
(
price
,
currency
);
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfOrderDao.java
浏览文件 @
d84f0ccf
...
@@ -17,14 +17,16 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
...
@@ -17,14 +17,16 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
/**
/**
* 获取用户订单数据
* 获取用户订单数据
*
* @param userId
* @param userId
* @param orderStatus OrderStatusEnum
* @param orderStatus OrderStatusEnum
* @return
* @return
*/
*/
List
<
TbCfOrderEntity
>
getUserOrderList
(
String
userId
,
Integer
orderStatus
);
List
<
TbCfOrderEntity
>
getUserOrderList
(
String
userId
,
Integer
orderStatus
);
/**
/**
* 获取订单内商品
* 获取订单内商品
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
...
@@ -32,12 +34,15 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
...
@@ -32,12 +34,15 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
/**
/**
* 获取订单内商品
* 获取订单内商品
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
List
<
ItemEntity
>
getItemList
(
String
orderId
);
List
<
ItemEntity
>
getItemList
(
String
orderId
);
/**
/**
* 获取付款订单
* 获取付款订单
*
* @param beginDate
* @param beginDate
* @param endDate
* @param endDate
* @return
* @return
...
@@ -46,12 +51,14 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
...
@@ -46,12 +51,14 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
/**
/**
* 获取某段时间已发货订单数据
* 获取某段时间已发货订单数据
*
* @return
* @return
*/
*/
List
<
TbCfItemShippedEntity
>
getDeliveryList
(
Date
beginDate
,
Date
endDate
);
List
<
TbCfItemShippedEntity
>
getDeliveryList
(
Date
beginDate
,
Date
endDate
);
/**
/**
* 根据订单id获取订单实体
* 根据订单id获取订单实体
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
...
@@ -62,10 +69,19 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
...
@@ -62,10 +69,19 @@ public interface TbCfOrderDao extends BaseDao<TbCfOrderEntity> {
/**
/**
* 根据订单id和商品id查询订单记录id //后续根据此id 查询物流信息
* 根据订单id和商品id查询订单记录id //后续根据此id 查询物流信息
*
* @param orderId
* @param orderId
* @param itemId
* @param itemId
* @return
* @return
*/
*/
String
getOrdersId
(
String
orderId
,
String
itemId
);
String
getOrdersId
(
String
orderId
,
String
itemId
);
/**
* 汇率转换
*
* @param currency
* @return
*/
TbCfExchangeEntity
currencyConversion
(
String
currency
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfExchangeEntity.java
0 → 100644
浏览文件 @
d84f0ccf
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 汇率管理实体
* 表名 tb_cf_exchange
*
* @author lipengjun
* @date 2019-12-10 15:29:22
*/
public
class
TbCfExchangeEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* ID
*/
private
String
id
;
/**
* 转换类型
*/
private
String
type
;
/**
* 货币
*/
private
String
currency
;
/**
* 兑换货币
*/
private
String
exchangeCurrency
;
/**
* 汇率
*/
private
BigDecimal
exchangeRate
;
/**
* 删除标志 0:正常 1:已删除
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:转换类型
*/
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
/**
* 获取:转换类型
*/
public
String
getType
()
{
return
type
;
}
/**
* 设置:货币
*/
public
void
setCurrency
(
String
currency
)
{
this
.
currency
=
currency
;
}
/**
* 获取:货币
*/
public
String
getCurrency
()
{
return
currency
;
}
/**
* 设置:兑换货币
*/
public
void
setExchangeCurrency
(
String
exchangeCurrency
)
{
this
.
exchangeCurrency
=
exchangeCurrency
;
}
/**
* 获取:兑换货币
*/
public
String
getExchangeCurrency
()
{
return
exchangeCurrency
;
}
/**
* 设置:汇率
*/
public
void
setExchangeRate
(
BigDecimal
exchangeRate
)
{
this
.
exchangeRate
=
exchangeRate
;
}
/**
* 获取:汇率
*/
public
BigDecimal
getExchangeRate
()
{
return
exchangeRate
;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* 获取:删除标志 0:正常 1:已删除
*/
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfOrderService.java
浏览文件 @
d84f0ccf
...
@@ -3,6 +3,8 @@ package com.diaoyun.zion.chinafrica.service;
...
@@ -3,6 +3,8 @@ package com.diaoyun.zion.chinafrica.service;
import
com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity
;
import
com.diaoyun.zion.chinafrica.vo.TbCfOrderVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfOrderVo
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
import
java.net.URISyntaxException
;
...
@@ -173,4 +175,6 @@ public interface TbCfOrderService {
...
@@ -173,4 +175,6 @@ public interface TbCfOrderService {
Result
getDescriptionById
(
String
descriptionId
);
Result
getDescriptionById
(
String
descriptionId
);
Result
rePayForOrder
(
String
orderId
);
Result
rePayForOrder
(
String
orderId
);
Result
currencyConversion
(
String
price
,
String
currency
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
浏览文件 @
d84f0ccf
...
@@ -185,8 +185,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -185,8 +185,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
}
else
{
}
else
{
//获取下单的订单数据
//获取下单的订单数据
TbCfOrderVo
definiteOrder
=
ensureOrder
(
tbCfUserInfoVo
,
pageOrder
,
tbCfCartItemDetailList
,
toitableId
);
TbCfOrderVo
definiteOrder
=
ensureOrder
(
tbCfUserInfoVo
,
pageOrder
,
tbCfCartItemDetailList
,
toitableId
);
for
(
TbCfCartItemDetailVo
itemList:
tbCfCartItemDetailList
)
{
for
(
TbCfCartItemDetailVo
itemList
:
tbCfCartItemDetailList
)
{
TbCfItemOrderREntity
tbCfItemOrderREntity
=
new
TbCfItemOrderREntity
();
TbCfItemOrderREntity
tbCfItemOrderREntity
=
new
TbCfItemOrderREntity
();
tbCfItemOrderREntity
.
setOrderItemId
(
IdUtil
.
createIdbyUUID
());
tbCfItemOrderREntity
.
setOrderItemId
(
IdUtil
.
createIdbyUUID
());
tbCfItemOrderREntity
.
setOrderId
(
definiteOrder
.
getOrderId
());
tbCfItemOrderREntity
.
setOrderId
(
definiteOrder
.
getOrderId
());
tbCfItemOrderREntity
.
setItemId
(
itemList
.
getItemId
());
tbCfItemOrderREntity
.
setItemId
(
itemList
.
getItemId
());
...
@@ -353,6 +353,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -353,6 +353,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
/**
/**
* 获取某段时间的付款订单数据
* 获取某段时间的付款订单数据
*
* @return
* @return
*/
*/
@Override
@Override
...
@@ -370,8 +371,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -370,8 +371,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
}
}
return
result
;
return
result
;
}
}
/**
/**
* 获取某段时间已发货订单数据
* 获取某段时间已发货订单数据
*
* @return
* @return
*/
*/
@Override
@Override
...
@@ -385,7 +388,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -385,7 +388,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
Date
endDate
=
new
Date
(
endTime
*
1000
);
Date
endDate
=
new
Date
(
endTime
*
1000
);
List
<
TbCfItemShippedEntity
>
orderList
=
tbCfOrderDao
.
getDeliveryList
(
beginDate
,
endDate
);
List
<
TbCfItemShippedEntity
>
orderList
=
tbCfOrderDao
.
getDeliveryList
(
beginDate
,
endDate
);
// TODO 暂设为赞比亚
// TODO 暂设为赞比亚
for
(
TbCfItemShippedEntity
list:
orderList
)
{
for
(
TbCfItemShippedEntity
list
:
orderList
)
{
list
.
setCountry
(
"赞比亚"
);
list
.
setCountry
(
"赞比亚"
);
}
}
PageInfo
<
TbCfItemShippedEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
PageInfo
<
TbCfItemShippedEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
...
@@ -393,8 +396,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -393,8 +396,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
}
}
return
result
;
return
result
;
}
}
/**
/**
* 根据订单号获取详细订单数据 给第三方的接口
* 根据订单号获取详细订单数据 给第三方的接口
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
...
@@ -427,6 +432,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -427,6 +432,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
result
.
setData
(
orderEntity
);
result
.
setData
(
orderEntity
);
return
result
;
return
result
;
}
}
@Override
@Override
public
Result
deleteOrder
(
String
orderId
)
{
public
Result
deleteOrder
(
String
orderId
)
{
Result
result
=
new
Result
();
Result
result
=
new
Result
();
...
@@ -467,8 +473,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -467,8 +473,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Override
@Override
public
Result
getDescriptionById
(
String
descriptionId
)
{
public
Result
getDescriptionById
(
String
descriptionId
)
{
Result
<
ExpressTemplateVo
>
result
=
new
Result
<>();
Result
<
ExpressTemplateVo
>
result
=
new
Result
<>();
ExpressTemplateVo
tbCfExpressTemplateEntity
=
new
ExpressTemplateVo
();
ExpressTemplateVo
tbCfExpressTemplateEntity
=
new
ExpressTemplateVo
();
ExpressTemplateVo
expressTemplate
=
tbCfExpressTemplateDao
.
getDescriptionById
(
descriptionId
);
ExpressTemplateVo
expressTemplate
=
tbCfExpressTemplateDao
.
getDescriptionById
(
descriptionId
);
tbCfExpressTemplateEntity
.
setDescriptionId
(
expressTemplate
.
getDescriptionId
());
tbCfExpressTemplateEntity
.
setDescriptionId
(
expressTemplate
.
getDescriptionId
());
tbCfExpressTemplateEntity
.
setDescriptionName
(
expressTemplate
.
getDescriptionName
());
tbCfExpressTemplateEntity
.
setDescriptionName
(
expressTemplate
.
getDescriptionName
());
tbCfExpressTemplateEntity
.
setExpressFee
(
expressTemplate
.
getExpressFee
());
tbCfExpressTemplateEntity
.
setExpressFee
(
expressTemplate
.
getExpressFee
());
...
@@ -480,11 +486,37 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -480,11 +486,37 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Override
@Override
public
Result
rePayForOrder
(
String
orderId
)
{
public
Result
rePayForOrder
(
String
orderId
)
{
Result
result
=
new
Result
();
Result
result
=
new
Result
();
TbCfOrderEntity
order
=
tbCfOrderDao
.
queryObject
(
orderId
);
TbCfOrderEntity
order
=
tbCfOrderDao
.
queryObject
(
orderId
);
return
result
.
setData
(
order
);
return
result
.
setData
(
order
);
}
}
/**
* 汇率转换
*
* @param price
* @param currency
* @return
*/
@Override
public
Result
currencyConversion
(
String
price
,
String
currency
)
{
Result
result
=
new
Result
();
try
{
if
(!
StringUtils
.
isBlank
(
price
)
&&
!
StringUtils
.
isBlank
(
currency
))
{
TbCfExchangeEntity
exchangeEntity
=
tbCfOrderDao
.
currencyConversion
(
currency
.
toUpperCase
());
BigDecimal
rate
=
exchangeEntity
.
getExchangeRate
();
BigDecimal
oldPrice
=
new
BigDecimal
(
price
);
BigDecimal
resultPrice
=
oldPrice
.
multiply
(
rate
);
result
.
setData
(
resultPrice
).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
else
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
QUERY_ERROR
.
getDesc
());
}
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
QUERY_ERROR
.
getCode
()).
setMessage
(
e
.
getMessage
());
}
return
result
;
}
/**
/**
* 记录财务流水
* 记录财务流水
...
@@ -735,14 +767,14 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -735,14 +767,14 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
itemsPrice
=
itemsPrice
.
add
(
itemSourcePrice
.
multiply
(
itemNum
));
itemsPrice
=
itemsPrice
.
add
(
itemSourcePrice
.
multiply
(
itemNum
));
//计算运费
//计算运费
BigDecimal
expressCost
=
getExpressTemplate
(
tbCfCartItemDetailVo
.
getItemCategory
());
BigDecimal
expressCost
=
getExpressTemplate
(
tbCfCartItemDetailVo
.
getItemCategory
());
BigDecimal
continuationFee
=
getContinuationFee
(
tbCfCartItemDetailVo
.
getItemCategory
());
BigDecimal
continuationFee
=
getContinuationFee
(
tbCfCartItemDetailVo
.
getItemCategory
());
//expressCost = expressCost.multiply(itemNum);
//expressCost = expressCost.multiply(itemNum);
if
(
"1"
.
equals
(
itemNum
))
{
if
(
"1"
.
equals
(
itemNum
))
{
expressCost
=
expressCost
.
multiply
(
itemNum
);
expressCost
=
expressCost
.
multiply
(
itemNum
);
}
else
{
}
else
{
BigDecimal
a
=
BigDecimal
.
valueOf
(
1
);
BigDecimal
a
=
BigDecimal
.
valueOf
(
1
);
BigDecimal
dj
=
continuationFee
.
multiply
(
itemNum
.
subtract
(
a
));
BigDecimal
dj
=
continuationFee
.
multiply
(
itemNum
.
subtract
(
a
));
expressCost
=
dj
.
add
(
expressCost
);
expressCost
=
dj
.
add
(
expressCost
);
}
}
totalExpressCost
=
totalExpressCost
.
add
(
expressCost
);
totalExpressCost
=
totalExpressCost
.
add
(
expressCost
);
}
}
...
@@ -771,6 +803,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -771,6 +803,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
TbCfExpressTemplateEntity
tbCfExpressTemplateEntity
=
tbCfExpressTemplateDao
.
queryObject
(
templateId
);
TbCfExpressTemplateEntity
tbCfExpressTemplateEntity
=
tbCfExpressTemplateDao
.
queryObject
(
templateId
);
return
tbCfExpressTemplateEntity
.
getExpressFee
();
return
tbCfExpressTemplateEntity
.
getExpressFee
();
}
}
/**
/**
* 获取运费 TODO 运费模板可改为缓存
* 获取运费 TODO 运费模板可改为缓存
*
*
...
...
src/main/resources/application.yml
浏览文件 @
d84f0ccf
...
@@ -39,12 +39,12 @@ spring:
...
@@ -39,12 +39,12 @@ spring:
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
# 测试环境
# 测试环境
# url: jdbc:mysql://47.106.242.175:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
url
:
jdbc:mysql://47.106.242.175:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
# username: root
# password: diaoyun666
url
:
jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
root
username
:
root
password
:
Diaoyunnuli.8
password
:
diaoyun666
# url: jdbc:mysql://159.138.48.71:3306/chinafrica?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull&useSSL=false
# username: root
# password: Diaoyunnuli.8
# 连接池配置
# 连接池配置
initial-size
:
5
initial-size
:
5
...
...
src/main/resources/mapper/TbCfOrderDao.xml
浏览文件 @
d84f0ccf
...
@@ -34,7 +34,16 @@
...
@@ -34,7 +34,16 @@
<result
property=
"enableFlag"
column=
"enable_flag"
/>
<result
property=
"enableFlag"
column=
"enable_flag"
/>
<result
property=
"descripitionName"
column=
"descripition_name"
></result>
<result
property=
"descripitionName"
column=
"descripition_name"
></result>
</resultMap>
</resultMap>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfExchangeEntity"
id=
"tbCfExchangeMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"currency"
column=
"currency"
/>
<result
property=
"exchangeCurrency"
column=
"exchange_currency"
/>
<result
property=
"exchangeRate"
column=
"exchange_rate"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity"
>
<select
id=
"queryObject"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity"
>
select
select
`order_id`,
`order_id`,
...
@@ -129,7 +138,6 @@
...
@@ -129,7 +138,6 @@
<if
test=
"name != null and name.trim() != ''"
>
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
AND name LIKE concat('%',#{name},'%')
</if>
</if>
<choose>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
order by ${sidx} ${order}
...
@@ -153,6 +161,9 @@
...
@@ -153,6 +161,9 @@
<select
id=
"queryCouponPrice"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
<select
id=
"queryCouponPrice"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
select t2.* from tb_cf_toicoupon t1 left join tb_cf_coupon t2 on t2.coupon_id=t1.coupon_id where t1.toitable_id=#{toitableId}
select t2.* from tb_cf_toicoupon t1 left join tb_cf_coupon t2 on t2.coupon_id=t1.coupon_id where t1.toitable_id=#{toitableId}
</select>
</select>
<select
id=
"currencyConversion"
resultMap=
"tbCfExchangeMap"
>
SELECT * from tb_cf_exchange where exchange_currency=#{exchangeCurrency}
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity"
>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity"
>
insert into tb_cf_order(
insert into tb_cf_order(
`order_id`,
`order_id`,
...
@@ -219,31 +230,31 @@
...
@@ -219,31 +230,31 @@
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity"
>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity"
>
update tb_cf_order
update tb_cf_order
<set>
<set>
<if
test=
"orderNo != null"
>
`order_no` = #{orderNo},
</if>
<if
test=
"orderNo != null"
>
`order_no` = #{orderNo},
</if>
<if
test=
"orderName != null"
>
`order_name` = #{orderName},
</if>
<if
test=
"orderName != null"
>
`order_name` = #{orderName},
</if>
<if
test=
"orderTime != null"
>
`order_time` = #{orderTime},
</if>
<if
test=
"orderTime != null"
>
`order_time` = #{orderTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime},
</if>
<if
test=
"dealTime != null"
>
`deal_time` = #{dealTime},
</if>
<if
test=
"dealTime != null"
>
`deal_time` = #{dealTime},
</if>
<if
test=
"closeTime != null"
>
`close_time` = #{closeTime},
</if>
<if
test=
"closeTime != null"
>
`close_time` = #{closeTime},
</if>
<if
test=
"orderStatus != null"
>
`order_status` = #{orderStatus},
</if>
<if
test=
"orderStatus != null"
>
`order_status` = #{orderStatus},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"userName != null"
>
`user_name` = #{userName},
</if>
<if
test=
"userName != null"
>
`user_name` = #{userName},
</if>
<if
test=
"deliveryAddressId != null"
>
`delivery_address_id` = #{deliveryAddressId},
</if>
<if
test=
"deliveryAddressId != null"
>
`delivery_address_id` = #{deliveryAddressId},
</if>
<if
test=
"deliveryAddress != null"
>
`delivery_address` = #{deliveryAddress},
</if>
<if
test=
"deliveryAddress != null"
>
`delivery_address` = #{deliveryAddress},
</if>
<if
test=
"deliveryName != null"
>
`delivery_name` = #{deliveryName},
</if>
<if
test=
"deliveryName != null"
>
`delivery_name` = #{deliveryName},
</if>
<if
test=
"deliveryPhone != null"
>
`delivery_phone` = #{deliveryPhone},
</if>
<if
test=
"deliveryPhone != null"
>
`delivery_phone` = #{deliveryPhone},
</if>
<if
test=
"itemsPrice != null"
>
`items_price` = #{itemsPrice},
</if>
<if
test=
"itemsPrice != null"
>
`items_price` = #{itemsPrice},
</if>
<if
test=
"totalPrice != null"
>
`total_price` = #{totalPrice},
</if>
<if
test=
"totalPrice != null"
>
`total_price` = #{totalPrice},
</if>
<if
test=
"realityPay != null"
>
`reality_pay` = #{realityPay},
</if>
<if
test=
"realityPay != null"
>
`reality_pay` = #{realityPay},
</if>
<if
test=
"deliveryFlag != null"
>
`delivery_flag` = #{deliveryFlag},
</if>
<if
test=
"deliveryFlag != null"
>
`delivery_flag` = #{deliveryFlag},
</if>
<if
test=
"deliveryTime != null"
>
`delivery_time` = #{deliveryTime},
</if>
<if
test=
"deliveryTime != null"
>
`delivery_time` = #{deliveryTime},
</if>
<if
test=
"expressCost != null"
>
`express_cost` = #{expressCost},
</if>
<if
test=
"expressCost != null"
>
`express_cost` = #{expressCost},
</if>
<if
test=
"couponId != null"
>
`coupon_id` = #{couponId},
</if>
<if
test=
"couponId != null"
>
`coupon_id` = #{couponId},
</if>
<if
test=
"couponTitle != null"
>
`coupon_title` = #{couponTitle},
</if>
<if
test=
"couponTitle != null"
>
`coupon_title` = #{couponTitle},
</if>
<if
test=
"couponPrice != null"
>
`coupon_price` = #{couponPrice},
</if>
<if
test=
"couponPrice != null"
>
`coupon_price` = #{couponPrice},
</if>
<if
test=
"fee != null"
>
`fee` = #{fee},
</if>
<if
test=
"fee != null"
>
`fee` = #{fee},
</if>
<if
test=
"tax != null"
>
`tax` = #{tax},
</if>
<if
test=
"tax != null"
>
`tax` = #{tax},
</if>
<if
test=
"payId != null"
>
`pay_id` = #{payId},
</if>
<if
test=
"payId != null"
>
`pay_id` = #{payId},
</if>
<if
test=
"payStatus != null"
>
`pay_status` = #{payStatus},
</if>
<if
test=
"payStatus != null"
>
`pay_status` = #{payStatus},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag},
</if>
<if
test=
"descripitionName != null"
>
`descripition_name` = #{descripitionName}
</if>
<if
test=
"descripitionName != null"
>
`descripition_name` = #{descripitionName}
</if>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论