Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
12fb98ed
提交
12fb98ed
authored
12月 18, 2019
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
订单取消接口,订单支付倒计时
上级
2de1d02b
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
618 行增加
和
227 行删除
+618
-227
KeyConstant.java
...ava/com/diaoyun/zion/chinafrica/constant/KeyConstant.java
+2
-0
TbCfOrderController.java
...aoyun/zion/chinafrica/controller/TbCfOrderController.java
+13
-0
TbCfCancelDao.java
...n/java/com/diaoyun/zion/chinafrica/dao/TbCfCancelDao.java
+15
-0
TbCfCancelEntity.java
.../com/diaoyun/zion/chinafrica/entity/TbCfCancelEntity.java
+119
-0
TbCfOrderService.java
...com/diaoyun/zion/chinafrica/service/TbCfOrderService.java
+13
-3
FlutterWaveServiceImpl.java
.../zion/chinafrica/service/impl/FlutterWaveServiceImpl.java
+1
-2
TbCfOrderServiceImpl.java
...un/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
+38
-0
TbCfOrderVo.java
...main/java/com/diaoyun/zion/chinafrica/vo/TbCfOrderVo.java
+33
-0
RedisCache.java
src/main/java/com/diaoyun/zion/master/common/RedisCache.java
+217
-207
IdUtil.java
src/main/java/com/diaoyun/zion/master/util/IdUtil.java
+6
-4
application.yml
src/main/resources/application.yml
+1
-1
TbCfCancelDao.xml
src/main/resources/mapper/TbCfCancelDao.xml
+101
-0
domain.properties
src/main/resources/properties/domain.properties
+2
-2
ZionApplicationTests.java
src/test/java/com/diaoyun/zion/ZionApplicationTests.java
+57
-8
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/constant/KeyConstant.java
浏览文件 @
12fb98ed
...
@@ -38,5 +38,7 @@ public class KeyConstant {
...
@@ -38,5 +38,7 @@ public class KeyConstant {
public
final
static
String
SHOPIFY_TYPE
=
"shopify_item"
;
public
final
static
String
SHOPIFY_TYPE
=
"shopify_item"
;
//所有商品
//所有商品
public
final
static
String
SHOPIFY_ITEMS_ALL
=
"shopify_item_all"
;
public
final
static
String
SHOPIFY_ITEMS_ALL
=
"shopify_item_all"
;
//订单失效
public
final
static
Integer
ORDER_EXPIRE
=
0
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfOrderController.java
浏览文件 @
12fb98ed
...
@@ -106,4 +106,17 @@ public class TbCfOrderController {
...
@@ -106,4 +106,17 @@ public class TbCfOrderController {
@ApiParam
(
"兑换货币"
)
@RequestParam
(
"currency"
)
String
currency
)
{
@ApiParam
(
"兑换货币"
)
@RequestParam
(
"currency"
)
String
currency
)
{
return
tbCfOrderService
.
currencyConversion
(
price
,
currency
);
return
tbCfOrderService
.
currencyConversion
(
price
,
currency
);
}
}
/**
* 取消订单
*
* @param orderId
* @return
*/
@ApiOperation
(
value
=
"取消订单"
)
@GetMapping
(
"/cancelOrder"
)
public
Result
cancelOrder
(
@ApiParam
(
"订单id"
)
@RequestParam
(
"orderId"
)
String
orderId
,
@ApiParam
(
"原因"
)
@RequestParam
(
"reason"
)
String
reason
)
{
return
tbCfOrderService
.
cancelOrder
(
orderId
,
reason
);
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfCancelDao.java
0 → 100644
浏览文件 @
12fb98ed
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCancelEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
/**
* Dao
*
* @author lipengjun
* @date 2019-12-18 11:39:52
*/
public
interface
TbCfCancelDao
extends
BaseDao
<
TbCfCancelEntity
>
{
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfCancelEntity.java
0 → 100644
浏览文件 @
12fb98ed
package
com
.
diaoyun
.
zion
.
chinafrica
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_cf_cancel
*
* @author lipengjun
* @date 2019-12-18 11:39:52
*/
public
class
TbCfCancelEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* ID
*/
private
String
id
;
/**
* 订单ID
*/
private
String
orderId
;
/**
* 取消订单的原因
*/
private
String
cancelReason
;
/**
* 删除标记
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:订单ID
*/
public
void
setOrderId
(
String
orderId
)
{
this
.
orderId
=
orderId
;
}
/**
* 获取:订单ID
*/
public
String
getOrderId
()
{
return
orderId
;
}
/**
* 设置:取消订单的原因
*/
public
void
setCancelReason
(
String
cancelReason
)
{
this
.
cancelReason
=
cancelReason
;
}
/**
* 获取:取消订单的原因
*/
public
String
getCancelReason
()
{
return
cancelReason
;
}
/**
* 设置:删除标记
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* 获取:删除标记
*/
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
浏览文件 @
12fb98ed
...
@@ -4,6 +4,7 @@ import com.diaoyun.zion.chinafrica.entity.TbCfOrderEntity;
...
@@ -4,6 +4,7 @@ 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
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -90,14 +91,15 @@ public interface TbCfOrderService {
...
@@ -90,14 +91,15 @@ public interface TbCfOrderService {
* @param tbCfOrderVo
* @param tbCfOrderVo
* @return
* @return
*/
*/
Result
placeOrder
(
TbCfOrderVo
tbCfOrderVo
,
String
toitableId
)
throws
IOException
,
URISyntaxException
,
ExecutionException
,
InterruptedException
,
TimeoutException
;
Result
placeOrder
(
TbCfOrderVo
tbCfOrderVo
,
String
toitableId
)
throws
IOException
,
URISyntaxException
,
ExecutionException
,
InterruptedException
,
TimeoutException
;
/**
/**
* 获取用户订单列表
* 获取用户订单列表
*
* @param orderStatus 订单状态 OrderStatusEnum
* @param orderStatus 订单状态 OrderStatusEnum
* @return
* @return
*/
*/
Result
getUserOrderList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
orderStatus
)
throws
InterruptedException
;
Result
getUserOrderList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
orderStatus
)
throws
InterruptedException
;
/**
/**
* 取消订单
* 取消订单
...
@@ -121,10 +123,11 @@ public interface TbCfOrderService {
...
@@ -121,10 +123,11 @@ public interface TbCfOrderService {
* @param orderId
* @param orderId
* @return
* @return
*/
*/
Result
payForOrder
(
String
orderId
,
String
token
)
;
Result
payForOrder
(
String
orderId
,
String
token
);
/**
/**
* 根据订单id,获取物流详情
* 根据订单id,获取物流详情
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
...
@@ -132,6 +135,7 @@ public interface TbCfOrderService {
...
@@ -132,6 +135,7 @@ public interface TbCfOrderService {
/**
/**
* 获取某段时间内的付款订单
* 获取某段时间内的付款订单
*
* @param beginTime
* @param beginTime
* @param endTime
* @param endTime
* @param pageNum
* @param pageNum
...
@@ -142,6 +146,7 @@ public interface TbCfOrderService {
...
@@ -142,6 +146,7 @@ public interface TbCfOrderService {
/**
/**
* 获取某段时间已发货订单数据
* 获取某段时间已发货订单数据
*
* @param beginTime
* @param beginTime
* @param endTime
* @param endTime
* @param pageNum
* @param pageNum
...
@@ -152,6 +157,7 @@ public interface TbCfOrderService {
...
@@ -152,6 +157,7 @@ public interface TbCfOrderService {
/**
/**
* 根据订单号获取详细订单数据 给第三方的接口
* 根据订单号获取详细订单数据 给第三方的接口
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
...
@@ -159,6 +165,7 @@ public interface TbCfOrderService {
...
@@ -159,6 +165,7 @@ public interface TbCfOrderService {
/**
/**
* 删除订单 伪删除
* 删除订单 伪删除
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
...
@@ -166,6 +173,7 @@ public interface TbCfOrderService {
...
@@ -166,6 +173,7 @@ public interface TbCfOrderService {
/**
/**
* 根据订单号获取详细订单数据 内部使用
* 根据订单号获取详细订单数据 内部使用
*
* @param orderId
* @param orderId
* @return
* @return
*/
*/
...
@@ -179,4 +187,6 @@ public interface TbCfOrderService {
...
@@ -179,4 +187,6 @@ public interface TbCfOrderService {
Result
currencyConversion
(
String
price
,
String
currency
);
Result
currencyConversion
(
String
price
,
String
currency
);
Result
getDeliveryLists
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
);
Result
getDeliveryLists
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
);
Result
cancelOrder
(
String
orderId
,
String
reason
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/FlutterWaveServiceImpl.java
浏览文件 @
12fb98ed
...
@@ -257,8 +257,7 @@ public class FlutterWaveServiceImpl implements FlutterWaveService {
...
@@ -257,8 +257,7 @@ public class FlutterWaveServiceImpl implements FlutterWaveService {
tbCfOrder
.
setPayId
(
payId
);
tbCfOrder
.
setPayId
(
payId
);
tbCfOrder
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
tbCfOrder
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
tbCfOrder
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
tbCfOrder
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
int
update
=
tbCfOrderDao
.
update
(
tbCfOrder
);
tbCfOrderDao
.
update
(
tbCfOrder
);
System
.
out
.
println
(
"update......"
+
update
);
}
}
/**
/**
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
浏览文件 @
12fb98ed
...
@@ -81,6 +81,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -81,6 +81,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Autowired
@Autowired
private
JwtTokenProvider
jwtTokenProvider
;
private
JwtTokenProvider
jwtTokenProvider
;
@Autowired
private
TbCfCancelDao
tbCfCancelDao
;
@Autowired
@Autowired
private
TbCfFeeService
tbCfFeeService
;
private
TbCfFeeService
tbCfFeeService
;
@Autowired
@Autowired
...
@@ -467,6 +469,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -467,6 +469,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
itemDetailVoList
.
add
(
tbCfCartItemDetailVo
);
itemDetailVoList
.
add
(
tbCfCartItemDetailVo
);
}
}
tbCfOrderVo
.
setItemDetailList
(
itemDetailVoList
);
tbCfOrderVo
.
setItemDetailList
(
itemDetailVoList
);
String
expire
=
orderRedisCache
.
expire
(
KeyConstant
.
ORDER_DET
+
orderId
);
if
(!
StringUtils
.
isBlank
(
expire
)
&&
"10"
.
equals
(
String
.
valueOf
(
tbCfOrderVo
.
getOrderStatus
())))
{
tbCfOrderVo
.
setExpire
(
expire
);
}
result
.
setData
(
tbCfOrderVo
);
result
.
setData
(
tbCfOrderVo
);
return
result
;
return
result
;
}
}
...
@@ -538,6 +544,38 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -538,6 +544,38 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
return
result
;
return
result
;
}
}
/**
* 取消订单
*
* @param orderId
* @return
*/
@Override
public
Result
cancelOrder
(
String
orderId
,
String
reason
)
{
Result
result
=
new
Result
();
try
{
TbCfOrderVo
tbCfOrderVo
=
(
TbCfOrderVo
)
orderRedisCache
.
get
(
KeyConstant
.
ORDER_DET
+
orderId
);
if
(!
StringUtils
.
isBlank
(
orderId
))
{
if
(
tbCfOrderVo
!=
null
)
{
orderRedisCache
.
set
(
KeyConstant
.
ORDER_DET
+
orderId
,
KeyConstant
.
ORDER_EXPIRE
);
}
//订单取消原因
TbCfCancelEntity
cancelEntity
=
new
TbCfCancelEntity
();
cancelEntity
.
setId
(
IdUtil
.
createIdbyUUID
());
cancelEntity
.
setOrderId
(
orderId
);
cancelEntity
.
setCancelReason
(
reason
);
cancelEntity
.
setDelFlag
(
1
);
cancelEntity
.
setCreateTime
(
new
Date
());
cancelEntity
.
setUpdateTime
(
new
Date
());
tbCfCancelDao
.
save
(
cancelEntity
);
}
result
.
setCode
(
ResultCodeEnum
.
SUCCESS
.
getCode
()).
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
catch
(
Exception
e
)
{
result
.
setCode
(
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
()).
setMessage
(
e
.
getMessage
());
}
return
result
;
}
/**
/**
* 记录财务流水
* 记录财务流水
...
...
src/main/java/com/diaoyun/zion/chinafrica/vo/TbCfOrderVo.java
浏览文件 @
12fb98ed
...
@@ -180,7 +180,15 @@ public class TbCfOrderVo implements Serializable {
...
@@ -180,7 +180,15 @@ public class TbCfOrderVo implements Serializable {
*/
*/
private
Integer
enableFlag
;
private
Integer
enableFlag
;
private
String
expire
;
public
String
getExpire
()
{
return
expire
;
}
public
void
setExpire
(
String
expire
)
{
this
.
expire
=
expire
;
}
public
String
getOrdersId
()
{
public
String
getOrdersId
()
{
return
ordersId
;
return
ordersId
;
...
@@ -203,6 +211,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -203,6 +211,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getOrderId
()
{
public
String
getOrderId
()
{
return
orderId
;
return
orderId
;
}
}
/**
/**
* 设置:订单号
* 设置:订单号
*/
*/
...
@@ -216,6 +225,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -216,6 +225,7 @@ public class TbCfOrderVo implements Serializable {
public
Long
getOrderNo
()
{
public
Long
getOrderNo
()
{
return
orderNo
;
return
orderNo
;
}
}
/**
/**
* 设置:订单名
* 设置:订单名
*/
*/
...
@@ -229,6 +239,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -229,6 +239,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getOrderName
()
{
public
String
getOrderName
()
{
return
orderName
;
return
orderName
;
}
}
/**
/**
* 设置:订单创建时间
* 设置:订单创建时间
*/
*/
...
@@ -242,6 +253,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -242,6 +253,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getOrderTime
()
{
public
Date
getOrderTime
()
{
return
orderTime
;
return
orderTime
;
}
}
/**
/**
* 设置:更新时间
* 设置:更新时间
*/
*/
...
@@ -255,6 +267,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -255,6 +267,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getUpdateTime
()
{
public
Date
getUpdateTime
()
{
return
updateTime
;
return
updateTime
;
}
}
/**
/**
* 设置:成交时间
* 设置:成交时间
*/
*/
...
@@ -268,6 +281,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -268,6 +281,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getDealTime
()
{
public
Date
getDealTime
()
{
return
dealTime
;
return
dealTime
;
}
}
/**
/**
* 设置:交易关闭时间
* 设置:交易关闭时间
*/
*/
...
@@ -281,6 +295,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -281,6 +295,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getCloseTime
()
{
public
Date
getCloseTime
()
{
return
closeTime
;
return
closeTime
;
}
}
/**
/**
* 设置:订单状态(0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
* 设置:订单状态(0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
*/
*/
...
@@ -294,6 +309,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -294,6 +309,7 @@ public class TbCfOrderVo implements Serializable {
public
Integer
getOrderStatus
()
{
public
Integer
getOrderStatus
()
{
return
orderStatus
;
return
orderStatus
;
}
}
/**
/**
* 设置:用户id
* 设置:用户id
*/
*/
...
@@ -307,6 +323,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -307,6 +323,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getUserId
()
{
public
String
getUserId
()
{
return
userId
;
return
userId
;
}
}
/**
/**
* 设置:用户名
* 设置:用户名
*/
*/
...
@@ -320,6 +337,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -320,6 +337,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getUserName
()
{
public
String
getUserName
()
{
return
userName
;
return
userName
;
}
}
/**
/**
* 设置:收货地址Id
* 设置:收货地址Id
*/
*/
...
@@ -333,6 +351,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -333,6 +351,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryAddressId
()
{
public
String
getDeliveryAddressId
()
{
return
deliveryAddressId
;
return
deliveryAddressId
;
}
}
/**
/**
* 设置:收货地址
* 设置:收货地址
*/
*/
...
@@ -346,6 +365,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -346,6 +365,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryAddress
()
{
public
String
getDeliveryAddress
()
{
return
deliveryAddress
;
return
deliveryAddress
;
}
}
/**
/**
* 设置:收货人
* 设置:收货人
*/
*/
...
@@ -359,6 +379,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -359,6 +379,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryName
()
{
public
String
getDeliveryName
()
{
return
deliveryName
;
return
deliveryName
;
}
}
/**
/**
* 设置:收货人手机
* 设置:收货人手机
*/
*/
...
@@ -372,6 +393,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -372,6 +393,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryPhone
()
{
public
String
getDeliveryPhone
()
{
return
deliveryPhone
;
return
deliveryPhone
;
}
}
/**
/**
* 设置:商品总价
* 设置:商品总价
*/
*/
...
@@ -385,6 +407,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -385,6 +407,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getItemsPrice
()
{
public
BigDecimal
getItemsPrice
()
{
return
itemsPrice
;
return
itemsPrice
;
}
}
/**
/**
* 设置:总价
* 设置:总价
*/
*/
...
@@ -398,6 +421,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -398,6 +421,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getTotalPrice
()
{
public
BigDecimal
getTotalPrice
()
{
return
totalPrice
;
return
totalPrice
;
}
}
/**
/**
* 设置:实际付款
* 设置:实际付款
*/
*/
...
@@ -411,6 +435,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -411,6 +435,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getRealityPay
()
{
public
BigDecimal
getRealityPay
()
{
return
realityPay
;
return
realityPay
;
}
}
/**
/**
* 设置:发货标志
* 设置:发货标志
*/
*/
...
@@ -424,6 +449,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -424,6 +449,7 @@ public class TbCfOrderVo implements Serializable {
public
Integer
getDeliveryFlag
()
{
public
Integer
getDeliveryFlag
()
{
return
deliveryFlag
;
return
deliveryFlag
;
}
}
/**
/**
* 设置:发货时间
* 设置:发货时间
*/
*/
...
@@ -437,6 +463,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -437,6 +463,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getDeliveryTime
()
{
public
Date
getDeliveryTime
()
{
return
deliveryTime
;
return
deliveryTime
;
}
}
/**
/**
* 设置:快递费
* 设置:快递费
*/
*/
...
@@ -450,6 +477,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -450,6 +477,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getExpressCost
()
{
public
BigDecimal
getExpressCost
()
{
return
expressCost
;
return
expressCost
;
}
}
/**
/**
* 设置:优惠券id
* 设置:优惠券id
*/
*/
...
@@ -463,6 +491,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -463,6 +491,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getCouponId
()
{
public
String
getCouponId
()
{
return
couponId
;
return
couponId
;
}
}
/**
/**
* 设置:优惠券标题
* 设置:优惠券标题
*/
*/
...
@@ -476,6 +505,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -476,6 +505,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getCouponTitle
()
{
public
String
getCouponTitle
()
{
return
couponTitle
;
return
couponTitle
;
}
}
/**
/**
* 设置:优惠券减免价格
* 设置:优惠券减免价格
*/
*/
...
@@ -489,6 +519,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -489,6 +519,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getCouponPrice
()
{
public
BigDecimal
getCouponPrice
()
{
return
couponPrice
;
return
couponPrice
;
}
}
/**
/**
* 设置:手续费
* 设置:手续费
*/
*/
...
@@ -502,6 +533,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -502,6 +533,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getFee
()
{
public
BigDecimal
getFee
()
{
return
fee
;
return
fee
;
}
}
/**
/**
* 设置:交易号
* 设置:交易号
*/
*/
...
@@ -515,6 +547,7 @@ public class TbCfOrderVo implements Serializable {
...
@@ -515,6 +547,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getPayId
()
{
public
String
getPayId
()
{
return
payId
;
return
payId
;
}
}
/**
/**
* 设置:支付状态,0未支付,1已支付
* 设置:支付状态,0未支付,1已支付
*/
*/
...
...
src/main/java/com/diaoyun/zion/master/common/RedisCache.java
浏览文件 @
12fb98ed
...
@@ -19,213 +19,223 @@ import java.util.concurrent.TimeUnit;
...
@@ -19,213 +19,223 @@ import java.util.concurrent.TimeUnit;
@Component
(
"redisCache"
)
@Component
(
"redisCache"
)
public
class
RedisCache
<
T
>
{
public
class
RedisCache
<
T
>
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Autowired
@Autowired
@Qualifier
(
"redisTemplate"
)
@Qualifier
(
"redisTemplate"
)
private
RedisTemplate
<
String
,
T
>
redisTemplate
;
private
RedisTemplate
<
String
,
T
>
redisTemplate
;
public
static
final
String
KEY_SET_PREFIX
=
"_set:"
;
public
static
final
String
KEY_SET_PREFIX
=
"_set:"
;
public
static
final
String
KEY_LIST_PREFIX
=
"_list:"
;
public
static
final
String
KEY_LIST_PREFIX
=
"_list:"
;
public
T
get
(
String
key
)
{
public
T
get
(
String
key
)
{
logger
.
debug
(
"get key [{}]"
,
key
);
logger
.
debug
(
"get key [{}]"
,
key
);
try
{
try
{
if
(
key
==
null
)
{
if
(
key
==
null
)
{
return
null
;
return
null
;
}
}
else
{
else
{
return
redisTemplate
.
opsForValue
().
get
(
key
);
return
redisTemplate
.
opsForValue
().
get
(
key
);
}
}
}
catch
(
Throwable
t
)
{
}
logger
.
error
(
"get key [{}] exception!"
,
key
,
t
);
catch
(
Throwable
t
)
{
throw
new
CacheException
(
t
);
logger
.
error
(
"get key [{}] exception!"
,
key
,
t
);
}
throw
new
CacheException
(
t
);
}
}
}
public
T
set
(
String
key
,
T
value
)
{
logger
.
debug
(
"set key [{}]"
,
key
);
public
T
set
(
String
key
,
T
value
)
{
try
{
logger
.
debug
(
"set key [{}]"
,
key
);
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
try
{
return
value
;
redisTemplate
.
opsForValue
().
set
(
key
,
value
);
}
catch
(
Throwable
t
)
{
return
value
;
logger
.
error
(
"set key [{}] exception!"
,
key
,
t
);
}
throw
new
CacheException
(
t
);
catch
(
Throwable
t
)
{
}
logger
.
error
(
"set key [{}] exception!"
,
key
,
t
);
}
throw
new
CacheException
(
t
);
}
public
T
set
(
String
key
,
T
value
,
long
timeout
)
{
}
logger
.
debug
(
"set key [{}]"
,
key
);
try
{
public
T
set
(
String
key
,
T
value
,
long
timeout
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
TimeUnit
.
SECONDS
);
logger
.
debug
(
"set key [{}]"
,
key
);
return
value
;
try
{
}
catch
(
Throwable
t
)
{
redisTemplate
.
opsForValue
().
set
(
key
,
value
,
timeout
,
TimeUnit
.
SECONDS
);
logger
.
error
(
"set key [{}] exception!"
,
key
,
t
);
return
value
;
throw
new
CacheException
(
t
);
}
}
catch
(
Throwable
t
)
{
}
logger
.
error
(
"set key [{}] exception!"
,
key
,
t
);
throw
new
CacheException
(
t
);
public
void
delete
(
String
key
)
{
}
logger
.
debug
(
"delete key [{}]"
,
key
);
}
try
{
redisTemplate
.
delete
(
key
);
public
void
delete
(
String
key
)
{
}
catch
(
Throwable
t
)
{
logger
.
debug
(
"delete key [{}]"
,
key
);
logger
.
error
(
"delete key [{}] exception!"
,
key
,
t
);
try
{
throw
new
CacheException
(
t
);
redisTemplate
.
delete
(
key
);
}
}
}
catch
(
Throwable
t
)
{
logger
.
error
(
"delete key [{}] exception!"
,
key
,
t
);
@SuppressWarnings
(
"unchecked"
)
throw
new
CacheException
(
t
);
public
void
setSet
(
String
k
,
T
value
,
long
time
)
{
}
String
key
=
KEY_SET_PREFIX
+
k
;
}
logger
.
debug
(
"setSet key [{}]"
,
key
);
try
{
@SuppressWarnings
(
"unchecked"
)
SetOperations
<
String
,
T
>
valueOps
=
redisTemplate
.
opsForSet
();
public
void
setSet
(
String
k
,
T
value
,
long
time
)
{
valueOps
.
add
(
key
,
value
);
String
key
=
KEY_SET_PREFIX
+
k
;
if
(
time
>
0
)
logger
.
debug
(
"setSet key [{}]"
,
key
);
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
try
{
}
catch
(
Throwable
t
)
{
SetOperations
<
String
,
T
>
valueOps
=
redisTemplate
.
opsForSet
();
logger
.
error
(
"setSet key [{}] exception!"
,
key
,
t
);
valueOps
.
add
(
key
,
value
);
throw
new
CacheException
(
t
);
if
(
time
>
0
)
}
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
}
}
catch
(
Throwable
t
)
{
public
void
setSet
(
String
k
,
T
value
)
{
logger
.
error
(
"setSet key [{}] exception!"
,
key
,
t
);
setSet
(
k
,
value
,
-
1
);
throw
new
CacheException
(
t
);
}
}
}
@SuppressWarnings
(
"unchecked"
)
public
void
setSet
(
String
k
,
Set
<
T
>
v
,
long
time
)
{
public
void
setSet
(
String
k
,
T
value
)
{
String
key
=
KEY_SET_PREFIX
+
k
;
setSet
(
k
,
value
,
-
1
);
logger
.
debug
(
"setSet key [{}]"
,
key
);
}
try
{
SetOperations
<
String
,
T
>
setOps
=
redisTemplate
.
opsForSet
();
@SuppressWarnings
(
"unchecked"
)
setOps
.
add
(
key
,
(
T
[])
v
.
toArray
());
public
void
setSet
(
String
k
,
Set
<
T
>
v
,
long
time
)
{
if
(
time
>
0
)
String
key
=
KEY_SET_PREFIX
+
k
;
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
logger
.
debug
(
"setSet key [{}]"
,
key
);
}
catch
(
Throwable
t
)
{
try
{
logger
.
error
(
"setSet key [{}] exception!"
,
key
,
t
);
SetOperations
<
String
,
T
>
setOps
=
redisTemplate
.
opsForSet
();
throw
new
CacheException
(
t
);
setOps
.
add
(
key
,
(
T
[])
v
.
toArray
());
}
if
(
time
>
0
)
}
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
}
public
void
setSet
(
String
k
,
Set
<
T
>
v
)
{
catch
(
Throwable
t
)
{
setSet
(
k
,
v
,
-
1
);
logger
.
error
(
"setSet key [{}] exception!"
,
key
,
t
);
}
throw
new
CacheException
(
t
);
}
public
Set
<
T
>
getSet
(
String
k
)
{
}
String
key
=
KEY_SET_PREFIX
+
k
;
logger
.
debug
(
"getSet key [{}]"
,
key
);
public
void
setSet
(
String
k
,
Set
<
T
>
v
)
{
try
{
setSet
(
k
,
v
,
-
1
);
SetOperations
<
String
,
T
>
setOps
=
redisTemplate
.
opsForSet
();
}
return
setOps
.
members
(
key
);
}
catch
(
Throwable
t
)
{
public
Set
<
T
>
getSet
(
String
k
)
{
logger
.
error
(
"getSet key [{}] exception!"
,
key
,
t
);
String
key
=
KEY_SET_PREFIX
+
k
;
throw
new
CacheException
(
t
);
logger
.
debug
(
"getSet key [{}]"
,
key
);
}
try
{
}
SetOperations
<
String
,
T
>
setOps
=
redisTemplate
.
opsForSet
();
return
setOps
.
members
(
key
);
public
void
setList
(
String
k
,
T
v
,
long
time
)
{
}
String
key
=
KEY_LIST_PREFIX
+
k
;
catch
(
Throwable
t
)
{
logger
.
debug
(
"setList key [{}]"
,
key
);
logger
.
error
(
"getSet key [{}] exception!"
,
key
,
t
);
try
{
throw
new
CacheException
(
t
);
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
}
listOps
.
rightPush
(
key
,
v
);
}
if
(
time
>
0
)
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
public
void
setList
(
String
k
,
T
v
,
long
time
)
{
}
catch
(
Throwable
t
)
{
String
key
=
KEY_LIST_PREFIX
+
k
;
logger
.
error
(
"setList key [{}] exception!"
,
key
,
t
);
logger
.
debug
(
"setList key [{}]"
,
key
);
throw
new
CacheException
(
t
);
try
{
}
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
}
listOps
.
rightPush
(
key
,
v
);
if
(
time
>
0
)
public
void
setList
(
String
k
,
List
<
T
>
v
,
long
time
)
{
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
String
key
=
KEY_LIST_PREFIX
+
k
;
}
logger
.
debug
(
"setList key [{}]"
,
key
);
catch
(
Throwable
t
)
{
try
{
logger
.
error
(
"setList key [{}] exception!"
,
key
,
t
);
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
throw
new
CacheException
(
t
);
listOps
.
rightPushAll
(
key
,
v
);
}
if
(
time
>
0
)
}
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
}
catch
(
Throwable
t
)
{
public
void
setList
(
String
k
,
List
<
T
>
v
,
long
time
)
{
logger
.
error
(
"setList key [{}] exception!"
,
key
,
t
);
String
key
=
KEY_LIST_PREFIX
+
k
;
throw
new
CacheException
(
t
);
logger
.
debug
(
"setList key [{}]"
,
key
);
}
try
{
}
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
listOps
.
rightPushAll
(
key
,
v
);
public
void
setList
(
String
k
,
List
<
T
>
v
)
{
if
(
time
>
0
)
setList
(
k
,
v
,
-
1
);
redisTemplate
.
expire
(
key
,
time
,
TimeUnit
.
SECONDS
);
}
}
catch
(
Throwable
t
)
{
public
List
<
T
>
getList
(
String
k
,
long
start
,
long
end
)
{
logger
.
error
(
"setList key [{}] exception!"
,
key
,
t
);
String
key
=
KEY_LIST_PREFIX
+
k
;
throw
new
CacheException
(
t
);
logger
.
debug
(
"setList key [{}]"
,
key
);
}
try
{
}
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
return
listOps
.
range
(
key
,
start
,
end
);
public
void
setList
(
String
k
,
List
<
T
>
v
)
{
}
catch
(
Throwable
t
)
{
setList
(
k
,
v
,
-
1
);
logger
.
error
(
"getList key [{}] exception!"
,
key
,
t
);
}
throw
new
CacheException
(
t
);
}
public
List
<
T
>
getList
(
String
k
,
long
start
,
long
end
)
{
}
String
key
=
KEY_LIST_PREFIX
+
k
;
logger
.
debug
(
"setList key [{}]"
,
key
);
public
long
getListSize
(
String
k
)
{
try
{
String
key
=
KEY_LIST_PREFIX
+
k
;
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
logger
.
debug
(
"setList key [{}]"
,
key
);
return
listOps
.
range
(
key
,
start
,
end
);
try
{
}
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
catch
(
Throwable
t
)
{
return
listOps
.
size
(
key
);
logger
.
error
(
"getList key [{}] exception!"
,
key
,
t
);
}
catch
(
Throwable
t
)
{
throw
new
CacheException
(
t
);
logger
.
error
(
"getListSize key [{}] exception!"
,
key
,
t
);
}
throw
new
CacheException
(
t
);
}
}
}
public
long
getListSize
(
String
k
)
{
String
key
=
KEY_LIST_PREFIX
+
k
;
public
long
getListSize
(
ListOperations
<
String
,
String
>
listOps
,
String
k
)
{
logger
.
debug
(
"setList key [{}]"
,
key
);
String
key
=
KEY_LIST_PREFIX
+
k
;
try
{
logger
.
debug
(
"getListSize key [{}]"
,
key
);
ListOperations
<
String
,
T
>
listOps
=
redisTemplate
.
opsForList
();
try
{
return
listOps
.
size
(
key
);
return
listOps
.
size
(
key
);
}
}
catch
(
Throwable
t
)
{
catch
(
Throwable
t
)
{
logger
.
error
(
"getListSize key [{}] exception!"
,
key
,
t
);
logger
.
error
(
"getListSize key [{}] exception!"
,
key
,
t
);
throw
new
CacheException
(
t
);
throw
new
CacheException
(
t
);
}
}
}
}
public
void
setMap
(
String
key
,
String
mapkey
,
T
mapValue
)
{
public
long
getListSize
(
ListOperations
<
String
,
String
>
listOps
,
String
k
)
{
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
String
key
=
KEY_LIST_PREFIX
+
k
;
hashOperations
.
putIfAbsent
(
key
,
mapkey
,
mapValue
);
logger
.
debug
(
"getListSize key [{}]"
,
key
);
}
try
{
return
listOps
.
size
(
key
);
public
void
deleteMap
(
String
key
,
String
mapkey
)
{
}
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
catch
(
Throwable
t
)
{
hashOperations
.
delete
(
key
,
mapkey
);
logger
.
error
(
"getListSize key [{}] exception!"
,
key
,
t
);
}
throw
new
CacheException
(
t
);
}
public
T
getMap
(
String
key
,
String
mapkey
)
{
}
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
return
hashOperations
.
get
(
key
,
mapkey
);
public
void
setMap
(
String
key
,
String
mapkey
,
T
mapValue
)
{
}
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
hashOperations
.
putIfAbsent
(
key
,
mapkey
,
mapValue
);
public
List
<
T
>
getMapValues
(
String
key
)
{
}
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
return
hashOperations
.
values
(
key
);
public
void
deleteMap
(
String
key
,
String
mapkey
)
{
}
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
hashOperations
.
delete
(
key
,
mapkey
);
public
void
setRedisTemplate
(
RedisTemplate
<
String
,
T
>
redisTemplate
)
{
}
this
.
redisTemplate
=
redisTemplate
;
}
public
T
getMap
(
String
key
,
String
mapkey
)
{
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
public
String
expire
(
String
key
)
{
return
hashOperations
.
get
(
key
,
mapkey
);
Long
expire
=
redisTemplate
.
getExpire
(
key
);
}
String
hour
=
getHour
(
expire
.
toString
());
return
hour
;
public
List
<
T
>
getMapValues
(
String
key
)
{
}
HashOperations
<
String
,
String
,
T
>
hashOperations
=
redisTemplate
.
opsForHash
();
return
hashOperations
.
values
(
key
);
public
String
getHour
(
String
date
)
{
}
Integer
dt
=
Integer
.
parseInt
(
date
);
if
(
dt
<
0
)
return
"0s"
;
public
void
setRedisTemplate
(
RedisTemplate
<
String
,
T
>
redisTemplate
)
{
if
(
dt
<
60
)
return
dt
+
"s"
;
this
.
redisTemplate
=
redisTemplate
;
if
(
dt
<
3600
)
{
}
int
min
=
Math
.
round
(
dt
/
60
);
int
seconds
=
Math
.
round
(
dt
-
(
min
*
60
));
return
Math
.
round
(
dt
/
60
)
+
"min"
+
(
seconds
==
0
?
""
:
seconds
+
"s"
);
}
int
hour
=
Math
.
round
(
dt
/
3600
);
int
minute
=
Math
.
round
((
dt
-
(
hour
*
3600
))
/
60
);
return
hour
+
"h"
+
(
minute
==
0
?
""
:
minute
+
"min"
);
}
}
}
\ No newline at end of file
src/main/java/com/diaoyun/zion/master/util/IdUtil.java
浏览文件 @
12fb98ed
...
@@ -6,7 +6,6 @@ import java.util.UUID;
...
@@ -6,7 +6,6 @@ import java.util.UUID;
/**
/**
* ID 生成工具类<br>
* ID 生成工具类<br>
*
*/
*/
public
class
IdUtil
{
public
class
IdUtil
{
/**
/**
...
@@ -19,9 +18,10 @@ public class IdUtil {
...
@@ -19,9 +18,10 @@ public class IdUtil {
// 精确到毫秒
// 精确到毫秒
SimpleDateFormat
fmt
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
SimpleDateFormat
fmt
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
String
suffix
=
fmt
.
format
(
new
Date
());
String
suffix
=
fmt
.
format
(
new
Date
());
suffix
=
suffix
+
Math
.
round
((
Math
.
random
()
*
100000
));
suffix
=
suffix
+
Math
.
round
((
Math
.
random
()
*
100000
));
return
suffix
;
return
suffix
;
}
}
/**
/**
* 主要功能:生成流水号 yyyyMMddHHmmssSSS + 3位随机数
* 主要功能:生成流水号 yyyyMMddHHmmssSSS + 3位随机数
* 注意事项:不能超出long类型取值范围 9223372036854775807
* 注意事项:不能超出long类型取值范围 9223372036854775807
...
@@ -32,8 +32,8 @@ public class IdUtil {
...
@@ -32,8 +32,8 @@ public class IdUtil {
// 精确到毫秒
// 精确到毫秒
SimpleDateFormat
fmt
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
SimpleDateFormat
fmt
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
String
suffix
=
fmt
.
format
(
new
Date
());
String
suffix
=
fmt
.
format
(
new
Date
());
String
prefix
=
String
.
valueOf
(
Math
.
round
(
Math
.
random
()
*
100
));
String
prefix
=
String
.
valueOf
(
Math
.
round
(
Math
.
random
()
*
100
));
return
Long
.
valueOf
(
suffix
+
prefix
);
return
Long
.
valueOf
(
suffix
+
prefix
);
}
}
/**
/**
...
@@ -45,4 +45,6 @@ public class IdUtil {
...
@@ -45,4 +45,6 @@ public class IdUtil {
public
static
String
createIdbyUUID
()
{
public
static
String
createIdbyUUID
()
{
return
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
return
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
}
}
}
}
src/main/resources/application.yml
浏览文件 @
12fb98ed
...
@@ -21,7 +21,7 @@ spring:
...
@@ -21,7 +21,7 @@ spring:
#Redis数据库分片索引(默认为0)
#Redis数据库分片索引(默认为0)
database
:
0
database
:
0
# host: 192.168.1.211
# host: 192.168.1.211
host
:
49.235.150.107
host
:
127.0.0.1
port
:
6379
port
:
6379
password
:
password
:
...
...
src/main/resources/mapper/TbCfCancelDao.xml
0 → 100644
浏览文件 @
12fb98ed
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.diaoyun.zion.chinafrica.dao.TbCfCancelDao"
>
<resultMap
type=
"com.diaoyun.zion.chinafrica.entity.TbCfCancelEntity"
id=
"tbCfCancelMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"cancelReason"
column=
"cancel_reason"
/>
<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.TbCfCancelEntity"
>
select
`id`,
`order_id`,
`cancel_reason`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_cancel
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCancelEntity"
>
select
`id`,
`order_id`,
`cancel_reason`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_cancel
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_cancel
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCancelEntity"
>
insert into tb_cf_cancel(
`id`,
`order_id`,
`cancel_reason`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{orderId},
#{cancelReason},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfCancelEntity"
>
update tb_cf_cancel
<set>
<if
test=
"orderId != null"
>
`order_id` = #{orderId},
</if>
<if
test=
"cancelReason != null"
>
`cancel_reason` = #{cancelReason},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from tb_cf_cancel where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_cancel where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/properties/domain.properties
浏览文件 @
12fb98ed
...
@@ -21,8 +21,8 @@ email.subject=Verification Code from Afrishop
...
@@ -21,8 +21,8 @@ email.subject=Verification Code from Afrishop
################redis有效时间###################
################redis有效时间###################
#登录token second 默认30分 一个星期 604800
#登录token second 默认30分 一个星期 604800
redis.token.expiredTime
=
7776000000
redis.token.expiredTime
=
7776000000
#订单
30分 second
#订单
1天 second 86400
redis.order.expiredTime
=
18
00
redis.order.expiredTime
=
864
00
################腾讯翻译配置###################
################腾讯翻译配置###################
tencent.translate.app_id
=
2120761040
tencent.translate.app_id
=
2120761040
//
tencent.translate.app_id
=
2124562134
//
tencent.translate.app_id
=
2124562134
...
...
src/test/java/com/diaoyun/zion/ZionApplicationTests.java
浏览文件 @
12fb98ed
...
@@ -7,6 +7,8 @@ import com.diaoyun.zion.chinafrica.service.SpiderService;
...
@@ -7,6 +7,8 @@ import com.diaoyun.zion.chinafrica.service.SpiderService;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfIssueCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfIssueCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfUserInfoService
;
import
com.diaoyun.zion.chinafrica.service.TbCfUserInfoService
;
import
com.diaoyun.zion.chinafrica.vo.TbCfOrderVo
;
import
com.diaoyun.zion.master.common.RedisCache
;
import
com.diaoyun.zion.master.thread.TaskLimitSemaphore
;
import
com.diaoyun.zion.master.thread.TaskLimitSemaphore
;
import
com.diaoyun.zion.master.util.AESUtils
;
import
com.diaoyun.zion.master.util.AESUtils
;
import
com.diaoyun.zion.master.util.IdUtil
;
import
com.diaoyun.zion.master.util.IdUtil
;
...
@@ -23,8 +25,10 @@ import org.junit.runner.RunWith;
...
@@ -23,8 +25,10 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
import
java.io.*
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.net.URISyntaxException
;
import
java.net.URISyntaxException
;
...
@@ -512,14 +516,15 @@ public class ZionApplicationTests {
...
@@ -512,14 +516,15 @@ public class ZionApplicationTests {
System
.
out
.
println
(
it
.
next
());
System
.
out
.
println
(
it
.
next
());
}
}
}
}
/* @Test
public void sendEmail() throws EmailException, TemplateException, IOException {
/* @Test
List<String> emailList= tbCfUserInfoService.findEmails();
public void sendEmail() throws EmailException, TemplateException, IOException {
for (String email:emailList){
List<String> emailList= tbCfUserInfoService.findEmails();
}
for (String email:emailList){
String email="1203063316@qq.com";
}
tbCfUserInfoService.sendRegister(email);
String email="1203063316@qq.com";
}*/
tbCfUserInfoService.sendRegister(email);
}*/
@Test
@Test
public
void
sendMessageToAll
()
{
public
void
sendMessageToAll
()
{
String
phone
=
""
;
String
phone
=
""
;
...
@@ -535,4 +540,48 @@ public class ZionApplicationTests {
...
@@ -535,4 +540,48 @@ public class ZionApplicationTests {
"Happy Shopping!"
;
"Happy Shopping!"
;
SMSUtil
.
sendMessageByText
(
/*phone.trim()*/
"+8613751400455,+8618607444177"
,
text
);
SMSUtil
.
sendMessageByText
(
/*phone.trim()*/
"+8613751400455,+8618607444177"
,
text
);
}
}
@Resource
private
RedisCache
<
Object
>
orderRedisCache
;
@Test
public
void
testRedis
()
{
// String hour = orderRedisCache.expire("order_detf28b71d685a34c528180782520fef886");
String
hour
=
getHour
(
"3662"
);
System
.
out
.
println
(
hour
);
}
public
String
getHour
(
String
date
)
{
Integer
dt
=
Integer
.
parseInt
(
date
);
if
(
dt
<
0
)
return
"0s"
;
if
(
dt
<
60
)
return
dt
+
"s"
;
if
(
dt
<
3600
)
{
int
min
=
Math
.
round
(
dt
/
60
);
int
seconds
=
Math
.
round
(
dt
-
(
min
*
60
));
return
Math
.
round
(
dt
/
60
)
+
"min"
+
(
seconds
==
0
?
""
:
seconds
+
"s"
);
}
int
hour
=
Math
.
round
(
dt
/
3600
);
int
minute
=
Math
.
round
((
dt
-
(
hour
*
3600
))
/
60
);
return
hour
+
"h"
+
(
minute
==
0
?
""
:
minute
+
"min"
);
// //分钟
// Integer dt = Integer.parseInt(date) ;
// if (dt < 60) return dt + "分钟";
// int hour = Math.round(dt / 60);
// int minute = Math.round(dt - (hour * 60));
// return hour + "小时" + (minute == 0 ? "" : minute + "分钟");
}
@Test
public
void
test01
()
{
System
.
out
.
println
(
orderRedisCache
.
expire
(
"order_detf28b71d685a34c528180782520fef886"
));
orderRedisCache
.
set
(
"order_detf28b71d685a34c528180782520fef886"
,
0
);
System
.
out
.
println
(
orderRedisCache
.
expire
(
"order_detf28b71d685a34c528180782520fef886"
));
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论