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 {
public
final
static
String
SHOPIFY_TYPE
=
"shopify_item"
;
//所有商品
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 {
@ApiParam
(
"兑换货币"
)
@RequestParam
(
"currency"
)
String
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;
import
com.diaoyun.zion.chinafrica.vo.TbCfOrderVo
;
import
com.diaoyun.zion.master.base.Result
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.io.IOException
;
...
...
@@ -90,14 +91,15 @@ public interface TbCfOrderService {
* @param tbCfOrderVo
* @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
* @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 {
* @param orderId
* @return
*/
Result
payForOrder
(
String
orderId
,
String
token
)
;
Result
payForOrder
(
String
orderId
,
String
token
);
/**
* 根据订单id,获取物流详情
*
* @param orderId
* @return
*/
...
...
@@ -132,6 +135,7 @@ public interface TbCfOrderService {
/**
* 获取某段时间内的付款订单
*
* @param beginTime
* @param endTime
* @param pageNum
...
...
@@ -142,6 +146,7 @@ public interface TbCfOrderService {
/**
* 获取某段时间已发货订单数据
*
* @param beginTime
* @param endTime
* @param pageNum
...
...
@@ -152,6 +157,7 @@ public interface TbCfOrderService {
/**
* 根据订单号获取详细订单数据 给第三方的接口
*
* @param orderId
* @return
*/
...
...
@@ -159,6 +165,7 @@ public interface TbCfOrderService {
/**
* 删除订单 伪删除
*
* @param orderId
* @return
*/
...
...
@@ -166,6 +173,7 @@ public interface TbCfOrderService {
/**
* 根据订单号获取详细订单数据 内部使用
*
* @param orderId
* @return
*/
...
...
@@ -179,4 +187,6 @@ public interface TbCfOrderService {
Result
currencyConversion
(
String
price
,
String
currency
);
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 {
tbCfOrder
.
setPayId
(
payId
);
tbCfOrder
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
tbCfOrder
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
int
update
=
tbCfOrderDao
.
update
(
tbCfOrder
);
System
.
out
.
println
(
"update......"
+
update
);
tbCfOrderDao
.
update
(
tbCfOrder
);
}
/**
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
浏览文件 @
12fb98ed
...
...
@@ -81,6 +81,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Autowired
private
JwtTokenProvider
jwtTokenProvider
;
@Autowired
private
TbCfCancelDao
tbCfCancelDao
;
@Autowired
private
TbCfFeeService
tbCfFeeService
;
@Autowired
...
...
@@ -467,6 +469,10 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
itemDetailVoList
.
add
(
tbCfCartItemDetailVo
);
}
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
);
return
result
;
}
...
...
@@ -538,6 +544,38 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
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 {
*/
private
Integer
enableFlag
;
private
String
expire
;
public
String
getExpire
()
{
return
expire
;
}
public
void
setExpire
(
String
expire
)
{
this
.
expire
=
expire
;
}
public
String
getOrdersId
()
{
return
ordersId
;
...
...
@@ -203,6 +211,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getOrderId
()
{
return
orderId
;
}
/**
* 设置:订单号
*/
...
...
@@ -216,6 +225,7 @@ public class TbCfOrderVo implements Serializable {
public
Long
getOrderNo
()
{
return
orderNo
;
}
/**
* 设置:订单名
*/
...
...
@@ -229,6 +239,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getOrderName
()
{
return
orderName
;
}
/**
* 设置:订单创建时间
*/
...
...
@@ -242,6 +253,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getOrderTime
()
{
return
orderTime
;
}
/**
* 设置:更新时间
*/
...
...
@@ -255,6 +267,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getUpdateTime
()
{
return
updateTime
;
}
/**
* 设置:成交时间
*/
...
...
@@ -268,6 +281,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getDealTime
()
{
return
dealTime
;
}
/**
* 设置:交易关闭时间
*/
...
...
@@ -281,6 +295,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getCloseTime
()
{
return
closeTime
;
}
/**
* 设置:订单状态(0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
*/
...
...
@@ -294,6 +309,7 @@ public class TbCfOrderVo implements Serializable {
public
Integer
getOrderStatus
()
{
return
orderStatus
;
}
/**
* 设置:用户id
*/
...
...
@@ -307,6 +323,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getUserId
()
{
return
userId
;
}
/**
* 设置:用户名
*/
...
...
@@ -320,6 +337,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getUserName
()
{
return
userName
;
}
/**
* 设置:收货地址Id
*/
...
...
@@ -333,6 +351,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryAddressId
()
{
return
deliveryAddressId
;
}
/**
* 设置:收货地址
*/
...
...
@@ -346,6 +365,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryAddress
()
{
return
deliveryAddress
;
}
/**
* 设置:收货人
*/
...
...
@@ -359,6 +379,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryName
()
{
return
deliveryName
;
}
/**
* 设置:收货人手机
*/
...
...
@@ -372,6 +393,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getDeliveryPhone
()
{
return
deliveryPhone
;
}
/**
* 设置:商品总价
*/
...
...
@@ -385,6 +407,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getItemsPrice
()
{
return
itemsPrice
;
}
/**
* 设置:总价
*/
...
...
@@ -398,6 +421,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getTotalPrice
()
{
return
totalPrice
;
}
/**
* 设置:实际付款
*/
...
...
@@ -411,6 +435,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getRealityPay
()
{
return
realityPay
;
}
/**
* 设置:发货标志
*/
...
...
@@ -424,6 +449,7 @@ public class TbCfOrderVo implements Serializable {
public
Integer
getDeliveryFlag
()
{
return
deliveryFlag
;
}
/**
* 设置:发货时间
*/
...
...
@@ -437,6 +463,7 @@ public class TbCfOrderVo implements Serializable {
public
Date
getDeliveryTime
()
{
return
deliveryTime
;
}
/**
* 设置:快递费
*/
...
...
@@ -450,6 +477,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getExpressCost
()
{
return
expressCost
;
}
/**
* 设置:优惠券id
*/
...
...
@@ -463,6 +491,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getCouponId
()
{
return
couponId
;
}
/**
* 设置:优惠券标题
*/
...
...
@@ -476,6 +505,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getCouponTitle
()
{
return
couponTitle
;
}
/**
* 设置:优惠券减免价格
*/
...
...
@@ -489,6 +519,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getCouponPrice
()
{
return
couponPrice
;
}
/**
* 设置:手续费
*/
...
...
@@ -502,6 +533,7 @@ public class TbCfOrderVo implements Serializable {
public
BigDecimal
getFee
()
{
return
fee
;
}
/**
* 设置:交易号
*/
...
...
@@ -515,6 +547,7 @@ public class TbCfOrderVo implements Serializable {
public
String
getPayId
()
{
return
payId
;
}
/**
* 设置:支付状态,0未支付,1已支付
*/
...
...
src/main/java/com/diaoyun/zion/master/common/RedisCache.java
浏览文件 @
12fb98ed
差异被折叠。
点击展开。
src/main/java/com/diaoyun/zion/master/util/IdUtil.java
浏览文件 @
12fb98ed
...
...
@@ -6,7 +6,6 @@ import java.util.UUID;
/**
* ID 生成工具类<br>
*
*/
public
class
IdUtil
{
/**
...
...
@@ -19,9 +18,10 @@ public class IdUtil {
// 精确到毫秒
SimpleDateFormat
fmt
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
String
suffix
=
fmt
.
format
(
new
Date
());
suffix
=
suffix
+
Math
.
round
((
Math
.
random
()
*
100000
));
suffix
=
suffix
+
Math
.
round
((
Math
.
random
()
*
100000
));
return
suffix
;
}
/**
* 主要功能:生成流水号 yyyyMMddHHmmssSSS + 3位随机数
* 注意事项:不能超出long类型取值范围 9223372036854775807
...
...
@@ -32,8 +32,8 @@ public class IdUtil {
// 精确到毫秒
SimpleDateFormat
fmt
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
String
suffix
=
fmt
.
format
(
new
Date
());
String
prefix
=
String
.
valueOf
(
Math
.
round
(
Math
.
random
()
*
100
));
return
Long
.
valueOf
(
suffix
+
prefix
);
String
prefix
=
String
.
valueOf
(
Math
.
round
(
Math
.
random
()
*
100
));
return
Long
.
valueOf
(
suffix
+
prefix
);
}
/**
...
...
@@ -45,4 +45,6 @@ public class IdUtil {
public
static
String
createIdbyUUID
()
{
return
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
}
}
src/main/resources/application.yml
浏览文件 @
12fb98ed
...
...
@@ -21,7 +21,7 @@ spring:
#Redis数据库分片索引(默认为0)
database
:
0
# host: 192.168.1.211
host
:
49.235.150.107
host
:
127.0.0.1
port
:
6379
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
################redis有效时间###################
#登录token second 默认30分 一个星期 604800
redis.token.expiredTime
=
7776000000
#订单
30分 second
redis.order.expiredTime
=
18
00
#订单
1天 second 86400
redis.order.expiredTime
=
864
00
################腾讯翻译配置###################
tencent.translate.app_id
=
2120761040
//
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;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfIssueCouponService
;
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.util.AESUtils
;
import
com.diaoyun.zion.master.util.IdUtil
;
...
...
@@ -23,8 +25,10 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.net.URISyntaxException
;
...
...
@@ -512,14 +516,15 @@ public class ZionApplicationTests {
System
.
out
.
println
(
it
.
next
());
}
}
/* @Test
public void sendEmail() throws EmailException, TemplateException, IOException {
List<String> emailList= tbCfUserInfoService.findEmails();
for (String email:emailList){
}
String email="1203063316@qq.com";
tbCfUserInfoService.sendRegister(email);
}*/
/* @Test
public void sendEmail() throws EmailException, TemplateException, IOException {
List<String> emailList= tbCfUserInfoService.findEmails();
for (String email:emailList){
}
String email="1203063316@qq.com";
tbCfUserInfoService.sendRegister(email);
}*/
@Test
public
void
sendMessageToAll
()
{
String
phone
=
""
;
...
...
@@ -535,4 +540,48 @@ public class ZionApplicationTests {
"Happy Shopping!"
;
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论