Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
Z
zion
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
zion
Commits
94e67b20
提交
94e67b20
authored
9月 27, 2019
作者:
zhengfg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、支付成功返回优惠券id
2、根据订单id获取订单详情 3、反馈信息批量提交 4、增加获取用户信息接口 5、根据订单获取优惠券详情 等等
上级
fe99d0c0
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
540 行增加
和
42 行删除
+540
-42
ThirdPartyController.java
...com/diaoyun/zion/chinafrica/api/ThirdPartyController.java
+2
-2
TokenVerification.java
...com/diaoyun/zion/chinafrica/client/TokenVerification.java
+1
-0
TbCfCouponController.java
...oyun/zion/chinafrica/controller/TbCfCouponController.java
+9
-2
TbCfFeedbackController.java
...un/zion/chinafrica/controller/TbCfFeedbackController.java
+3
-2
TbCfOrderController.java
...aoyun/zion/chinafrica/controller/TbCfOrderController.java
+9
-0
TbCfUserInfoController.java
...un/zion/chinafrica/controller/TbCfUserInfoController.java
+9
-0
TbCfCouponDao.java
...n/java/com/diaoyun/zion/chinafrica/dao/TbCfCouponDao.java
+8
-0
TbCfFeedbackRecordDao.java
...om/diaoyun/zion/chinafrica/dao/TbCfFeedbackRecordDao.java
+8
-0
TbCfCouponEntity.java
.../com/diaoyun/zion/chinafrica/entity/TbCfCouponEntity.java
+1
-1
TbCfStoreEntity.java
...a/com/diaoyun/zion/chinafrica/entity/TbCfStoreEntity.java
+6
-6
CouponCategoryEnum.java
...com/diaoyun/zion/chinafrica/enums/CouponCategoryEnum.java
+33
-0
TbCfCouponService.java
...om/diaoyun/zion/chinafrica/service/TbCfCouponService.java
+15
-0
TbCfFeedbackRecordService.java
...un/zion/chinafrica/service/TbCfFeedbackRecordService.java
+8
-0
TbCfOrderService.java
...com/diaoyun/zion/chinafrica/service/TbCfOrderService.java
+9
-2
TbCfUserInfoService.java
.../diaoyun/zion/chinafrica/service/TbCfUserInfoService.java
+6
-0
TbCfCouponServiceImpl.java
...n/zion/chinafrica/service/impl/TbCfCouponServiceImpl.java
+18
-2
TbCfFeedbackRecordServiceImpl.java
...hinafrica/service/impl/TbCfFeedbackRecordServiceImpl.java
+26
-4
TbCfOrderServiceImpl.java
...un/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
+55
-18
TbCfUserInfoServiceImpl.java
...zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
+22
-2
TbCfFeedbackRecordListVo.java
.../diaoyun/zion/chinafrica/vo/TbCfFeedbackRecordListVo.java
+20
-0
TbCfFinanceVo.java
...in/java/com/diaoyun/zion/chinafrica/vo/TbCfFinanceVo.java
+161
-0
TbCfCouponDao.xml
src/main/resources/mapper/TbCfCouponDao.xml
+6
-0
TbCfFeedbackRecordDao.xml
src/main/resources/mapper/TbCfFeedbackRecordDao.xml
+19
-0
TbCfUserInfoDao.xml
src/main/resources/mapper/TbCfUserInfoDao.xml
+1
-1
index.html
src/main/resources/static/page/index.html
+85
-0
bg.png
src/main/resources/static/page/static/bg.png
+0
-0
没有找到文件。
src/main/java/com/diaoyun/zion/chinafrica/api/ThirdPartyController.java
浏览文件 @
94e67b20
...
@@ -74,8 +74,8 @@ public class ThirdPartyController {
...
@@ -74,8 +74,8 @@ public class ThirdPartyController {
*/
*/
@ApiOperation
(
value
=
"根据订单号获取详细订单数据"
)
@ApiOperation
(
value
=
"根据订单号获取详细订单数据"
)
@GetMapping
(
value
=
"/order/detail/{orderId}"
)
@GetMapping
(
value
=
"/order/detail/{orderId}"
)
public
Result
getOrderDetail
(
@PathVariable
(
"orderId"
)
String
orderId
)
{
public
Result
getOrderDetail
Third
(
@PathVariable
(
"orderId"
)
String
orderId
)
{
return
tbCfOrderService
.
getOrderDetail
(
orderId
);
return
tbCfOrderService
.
getOrderDetail
Third
(
orderId
);
}
}
...
...
src/main/java/com/diaoyun/zion/chinafrica/client/TokenVerification.java
浏览文件 @
94e67b20
...
@@ -39,6 +39,7 @@ public class TokenVerification {
...
@@ -39,6 +39,7 @@ public class TokenVerification {
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfProblemController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfProblemController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfContactController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfContactController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfStoreController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfStoreController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfHomePageController.*(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfUserInfoController.resetPassWord(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfUserInfoController.resetPassWord(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfFeedbackController.getFeedbackList(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfFeedbackController.getFeedbackList(..))"
+
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfUserInfoController.getUserIdentifyCode(..))"
)
"&&!execution(* com.diaoyun.zion.chinafrica.controller.TbCfUserInfoController.getUserIdentifyCode(..))"
)
...
...
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfCouponController.java
浏览文件 @
94e67b20
...
@@ -33,8 +33,8 @@ public class TbCfCouponController {
...
@@ -33,8 +33,8 @@ public class TbCfCouponController {
private
TbCfCouponService
tbCfCouponService
;
private
TbCfCouponService
tbCfCouponService
;
@ApiOperation
(
"领取优惠券"
)
@ApiOperation
(
"领取优惠券"
)
@GetMapping
(
"/{couponId}"
)
@GetMapping
(
"/
take/
{couponId}"
)
public
Result
<
TbCfCouponEntity
>
takeCoupon
(
@ApiParam
(
"优惠券"
)
@PathVariable
(
"couponId"
)
String
couponId
)
{
public
Result
<
TbCfCouponEntity
>
takeCoupon
(
@ApiParam
(
"优惠券
Id
"
)
@PathVariable
(
"couponId"
)
String
couponId
)
{
return
tbCfCouponService
.
takeCoupon
(
couponId
);
return
tbCfCouponService
.
takeCoupon
(
couponId
);
}
}
...
@@ -44,5 +44,12 @@ public class TbCfCouponController {
...
@@ -44,5 +44,12 @@ public class TbCfCouponController {
return
tbCfCouponService
.
getUserCoupons
();
return
tbCfCouponService
.
getUserCoupons
();
}
}
@ApiOperation
(
"获取优惠券详情"
)
@GetMapping
(
"/{couponId}"
)
public
Result
<
TbCfCouponEntity
>
queryCouponDetail
(
@ApiParam
(
"优惠券Id"
)
@PathVariable
(
"couponId"
)
String
couponId
)
{
return
tbCfCouponService
.
queryCouponDetail
(
couponId
);
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfFeedbackController.java
浏览文件 @
94e67b20
...
@@ -4,6 +4,7 @@ import com.diaoyun.zion.chinafrica.entity.TbCfFeedbackEntity;
...
@@ -4,6 +4,7 @@ import com.diaoyun.zion.chinafrica.entity.TbCfFeedbackEntity;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeedbackRecordService
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeedbackRecordService
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeedbackService
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeedbackService
;
import
com.diaoyun.zion.chinafrica.vo.TbCfFeedbackRecordListVo
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -28,8 +29,8 @@ public class TbCfFeedbackController {
...
@@ -28,8 +29,8 @@ public class TbCfFeedbackController {
@ApiOperation
(
"提交反馈"
)
@ApiOperation
(
"提交反馈"
)
@PostMapping
@PostMapping
public
Result
<
TbCfFeedbackRecordEntity
>
saveFeedback
(
@ApiParam
(
"反馈情况"
)
@RequestBody
TbCfFeedbackRecordEntity
tbCfFeedbackRecordEntity
)
{
public
Result
saveFeedbackList
(
@ApiParam
(
"反馈情况"
)
@RequestBody
TbCfFeedbackRecordListVo
tbCfFeedbackRecordListVo
)
{
return
tbCfFeedbackRecordService
.
saveFeedback
(
tbCfFeedbackRecordEntity
);
return
tbCfFeedbackRecordService
.
saveFeedback
List
(
tbCfFeedbackRecordListVo
);
}
}
@ApiOperation
(
"获取反馈问题"
)
@ApiOperation
(
"获取反馈问题"
)
...
...
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfOrderController.java
浏览文件 @
94e67b20
...
@@ -82,4 +82,13 @@ public class TbCfOrderController {
...
@@ -82,4 +82,13 @@ public class TbCfOrderController {
public
Result
deleteOrder
(
@ApiParam
(
"订单id"
)
@PathVariable
String
orderId
)
{
public
Result
deleteOrder
(
@ApiParam
(
"订单id"
)
@PathVariable
String
orderId
)
{
return
tbCfOrderService
.
deleteOrder
(
orderId
);
return
tbCfOrderService
.
deleteOrder
(
orderId
);
}
}
/**
* 根据订单号获取详细订单数据
*/
@ApiOperation
(
value
=
"根据订单号获取详细订单数据"
)
@GetMapping
(
value
=
"/detail/{orderId}"
)
public
Result
getOrderDetail
(
@PathVariable
(
"orderId"
)
String
orderId
)
{
return
tbCfOrderService
.
getOrderDetail
(
orderId
);
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/controller/TbCfUserInfoController.java
浏览文件 @
94e67b20
...
@@ -92,5 +92,14 @@ public class TbCfUserInfoController extends BaseController {
...
@@ -92,5 +92,14 @@ public class TbCfUserInfoController extends BaseController {
return
tbCfUserInfoService
.
resetPassWord
(
account
,
newPassword
,
captcha
);
return
tbCfUserInfoService
.
resetPassWord
(
account
,
newPassword
,
captcha
);
}
}
/**
* 获取用户信息
*/
@ApiOperation
(
value
=
"获取用户信息"
)
@GetMapping
public
Result
<
TbCfUserInfoVo
>
getUserInfo
()
{
return
tbCfUserInfoService
.
getUserInfo
();
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfCouponDao.java
浏览文件 @
94e67b20
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
package
com
.
diaoyun
.
zion
.
chinafrica
.
dao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfTakeCouponEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -42,4 +43,11 @@ public interface TbCfCouponDao extends BaseDao<TbCfCouponEntity> {
...
@@ -42,4 +43,11 @@ public interface TbCfCouponDao extends BaseDao<TbCfCouponEntity> {
* @return
* @return
*/
*/
List
<
TbCfCouponEntity
>
queryUserExpiredoupon
(
String
userId
,
Date
nowTime
);
List
<
TbCfCouponEntity
>
queryUserExpiredoupon
(
String
userId
,
Date
nowTime
);
/**
* 根据优惠券种类获取优惠券
* @param couponCategory
* @return
*/
List
<
TbCfCouponEntity
>
getCouponByCategory
(
Integer
couponCategory
,
Date
nowTime
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/dao/TbCfFeedbackRecordDao.java
浏览文件 @
94e67b20
...
@@ -4,6 +4,8 @@ package com.diaoyun.zion.chinafrica.dao;
...
@@ -4,6 +4,8 @@ package com.diaoyun.zion.chinafrica.dao;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
com.diaoyun.zion.master.dao.BaseDao
;
import
java.util.List
;
/**
/**
* 用户反馈记录表Dao
* 用户反馈记录表Dao
*
*
...
@@ -12,4 +14,10 @@ import com.diaoyun.zion.master.dao.BaseDao;
...
@@ -12,4 +14,10 @@ import com.diaoyun.zion.master.dao.BaseDao;
*/
*/
public
interface
TbCfFeedbackRecordDao
extends
BaseDao
<
TbCfFeedbackRecordEntity
>
{
public
interface
TbCfFeedbackRecordDao
extends
BaseDao
<
TbCfFeedbackRecordEntity
>
{
/**
* 批量保存反馈问题
* @param feedbackList
* @return
*/
int
saveBatch
(
List
<
TbCfFeedbackRecordEntity
>
feedbackList
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfCouponEntity.java
浏览文件 @
94e67b20
...
@@ -26,7 +26,7 @@ public class TbCfCouponEntity implements Serializable {
...
@@ -26,7 +26,7 @@ public class TbCfCouponEntity implements Serializable {
/**
/**
* 优惠券类型
* 优惠券类型
*/
*/
@ApiModelProperty
(
"优惠券类型
(暂无用)
"
)
@ApiModelProperty
(
"优惠券类型"
)
private
Integer
couponCategory
;
private
Integer
couponCategory
;
/**
/**
* 可用于类目
* 可用于类目
...
...
src/main/java/com/diaoyun/zion/chinafrica/entity/TbCfStoreEntity.java
浏览文件 @
94e67b20
...
@@ -38,11 +38,11 @@ public class TbCfStoreEntity implements Serializable {
...
@@ -38,11 +38,11 @@ public class TbCfStoreEntity implements Serializable {
*/
*/
private
String
storeImg
;
private
String
storeImg
;
/**
/**
* 所属
店铺
* 所属
平台
*/
*/
private
String
platformCode
;
private
String
platformCode
;
/**
/**
*
店铺
名
*
平台
名
*/
*/
private
String
platformName
;
private
String
platformName
;
/**
/**
...
@@ -143,27 +143,27 @@ public class TbCfStoreEntity implements Serializable {
...
@@ -143,27 +143,27 @@ public class TbCfStoreEntity implements Serializable {
return
storeImg
;
return
storeImg
;
}
}
/**
/**
* 设置:所属
店铺
* 设置:所属
平台
*/
*/
public
void
setPlatformCode
(
String
platformCode
)
{
public
void
setPlatformCode
(
String
platformCode
)
{
this
.
platformCode
=
platformCode
;
this
.
platformCode
=
platformCode
;
}
}
/**
/**
* 获取:所属
店铺
* 获取:所属
平台
*/
*/
public
String
getPlatformCode
()
{
public
String
getPlatformCode
()
{
return
platformCode
;
return
platformCode
;
}
}
/**
/**
* 设置:
店铺
名
* 设置:
平台
名
*/
*/
public
void
setPlatformName
(
String
platformName
)
{
public
void
setPlatformName
(
String
platformName
)
{
this
.
platformName
=
platformName
;
this
.
platformName
=
platformName
;
}
}
/**
/**
* 获取:
店铺
名
* 获取:
平台
名
*/
*/
public
String
getPlatformName
()
{
public
String
getPlatformName
()
{
return
platformName
;
return
platformName
;
...
...
src/main/java/com/diaoyun/zion/chinafrica/enums/CouponCategoryEnum.java
0 → 100644
浏览文件 @
94e67b20
package
com
.
diaoyun
.
zion
.
chinafrica
.
enums
;
import
com.diaoyun.zion.master.enums.EnumItemable
;
/**
* 优惠券类型
*
* @author G
*/
public
enum
CouponCategoryEnum
implements
EnumItemable
<
CouponCategoryEnum
>
{
SHOP
(
"购物返券"
,
10
),
REGISTER
(
"注册"
,
20
),
INVITE
(
"邀请"
,
30
);
private
String
label
;
private
Integer
value
;
CouponCategoryEnum
(
String
label
,
Integer
value
)
{
this
.
label
=
label
;
this
.
value
=
value
;
}
public
String
getLabel
()
{
return
this
.
label
;
}
public
Integer
getValue
()
{
return
this
.
value
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfCouponService.java
浏览文件 @
94e67b20
...
@@ -77,10 +77,25 @@ public interface TbCfCouponService {
...
@@ -77,10 +77,25 @@ public interface TbCfCouponService {
* @return
* @return
*/
*/
Result
takeCoupon
(
String
couponId
);
Result
takeCoupon
(
String
couponId
);
/**
* 领取优惠券
* @param couponId
* @param userId
*/
void
takeCoupon
(
String
couponId
,
String
userId
);
/**
/**
* 获取用户所有优惠券
* 获取用户所有优惠券
* @return
* @return
*/
*/
Result
<
UserCouponVo
>
getUserCoupons
();
Result
<
UserCouponVo
>
getUserCoupons
();
/**
* 获取优惠券详情
* @param couponId
* @return
*/
Result
<
TbCfCouponEntity
>
queryCouponDetail
(
String
couponId
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfFeedbackRecordService.java
浏览文件 @
94e67b20
...
@@ -2,6 +2,7 @@ package com.diaoyun.zion.chinafrica.service;
...
@@ -2,6 +2,7 @@ package com.diaoyun.zion.chinafrica.service;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.chinafrica.vo.TbCfFeedbackRecordListVo
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
import
java.util.List
;
import
java.util.List
;
...
@@ -77,4 +78,11 @@ public interface TbCfFeedbackRecordService {
...
@@ -77,4 +78,11 @@ public interface TbCfFeedbackRecordService {
* @return
* @return
*/
*/
Result
saveFeedback
(
TbCfFeedbackRecordEntity
tbCfFeedbackRecordEntity
);
Result
saveFeedback
(
TbCfFeedbackRecordEntity
tbCfFeedbackRecordEntity
);
/**
* 批量保存客户反馈
* @param tbCfFeedbackRecordListVo
* @return
*/
Result
saveFeedbackList
(
TbCfFeedbackRecordListVo
tbCfFeedbackRecordListVo
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfOrderService.java
浏览文件 @
94e67b20
...
@@ -150,11 +150,11 @@ public interface TbCfOrderService {
...
@@ -150,11 +150,11 @@ public interface TbCfOrderService {
Result
getDeliveryList
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
);
Result
getDeliveryList
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
);
/**
/**
* 根据订单号获取详细订单数据
* 根据订单号获取详细订单数据
给第三方的接口
* @param orderId
* @param orderId
* @return
* @return
*/
*/
Result
getOrderDetail
(
String
orderId
);
Result
getOrderDetail
Third
(
String
orderId
);
/**
/**
* 删除订单 伪删除
* 删除订单 伪删除
...
@@ -162,4 +162,11 @@ public interface TbCfOrderService {
...
@@ -162,4 +162,11 @@ public interface TbCfOrderService {
* @return
* @return
*/
*/
Result
deleteOrder
(
String
orderId
);
Result
deleteOrder
(
String
orderId
);
/**
* 根据订单号获取详细订单数据 内部使用
* @param orderId
* @return
*/
Result
getOrderDetail
(
String
orderId
);
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/TbCfUserInfoService.java
浏览文件 @
94e67b20
...
@@ -152,4 +152,10 @@ public interface TbCfUserInfoService {
...
@@ -152,4 +152,10 @@ public interface TbCfUserInfoService {
* @return
* @return
*/
*/
Result
resetPassWord
(
String
account
,
String
newPassword
,
Integer
captcha
);
Result
resetPassWord
(
String
account
,
String
newPassword
,
Integer
captcha
);
/**
* 获取用户信息
* @return
*/
Result
<
TbCfUserInfoVo
>
getUserInfo
();
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfCouponServiceImpl.java
浏览文件 @
94e67b20
...
@@ -100,10 +100,11 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
...
@@ -100,10 +100,11 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
TbCfUserInfoVo
tbCfUserInfoVo
=
tokenManager
.
validate
(
token
);
TbCfUserInfoVo
tbCfUserInfoVo
=
tokenManager
.
validate
(
token
);
//判断用户是否已经领取
//判断用户是否已经领取
boolean
takeFlag
=
repeatTakeCoupon
(
tbCfUserInfoVo
.
getUserId
(),
couponId
);
boolean
takeFlag
=
false
;
//可以重复领取
repeatTakeCoupon(tbCfUserInfoVo.getUserId(),couponId);
if
(
takeFlag
)
{
if
(
takeFlag
)
{
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"You have already received this coupon"
);
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"You have already received this coupon"
);
}
else
{
}
else
{
// TODO 发放流程有bug,需要修复
TbCfCouponEntity
tbCfCouponEntity
=
grabCoupon
(
couponId
);
TbCfCouponEntity
tbCfCouponEntity
=
grabCoupon
(
couponId
);
if
(
tbCfCouponEntity
!=
null
)
{
if
(
tbCfCouponEntity
!=
null
)
{
//发放优惠券
//发放优惠券
...
@@ -114,10 +115,19 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
...
@@ -114,10 +115,19 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"The coupon has been snapped up"
);
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"The coupon has been snapped up"
);
}
}
}
}
return
result
;
return
result
;
}
}
@Override
public
void
takeCoupon
(
String
couponId
,
String
userId
)
{
TbCfCouponEntity
tbCfCouponEntity
=
grabCoupon
(
couponId
);
if
(
tbCfCouponEntity
!=
null
)
{
//发放优惠券
giveOutCoupon
(
userId
,
tbCfCouponEntity
);
}
else
{
}
}
@Override
@Override
public
Result
<
UserCouponVo
>
getUserCoupons
()
{
public
Result
<
UserCouponVo
>
getUserCoupons
()
{
UserCouponVo
userCouponVo
=
new
UserCouponVo
();
UserCouponVo
userCouponVo
=
new
UserCouponVo
();
...
@@ -136,6 +146,12 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
...
@@ -136,6 +146,12 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
return
new
Result
<>(
userCouponVo
);
return
new
Result
<>(
userCouponVo
);
}
}
@Override
public
Result
<
TbCfCouponEntity
>
queryCouponDetail
(
String
couponId
)
{
TbCfCouponEntity
tbCfCouponEntity
=
tbCfCouponDao
.
queryObject
(
couponId
);
return
new
Result
<>(
tbCfCouponEntity
);
}
/**
/**
* 抢优惠券
* 抢优惠券
* 若能抢到,则返回优惠券,否则返回空
* 若能抢到,则返回优惠券,否则返回空
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfFeedbackRecordServiceImpl.java
浏览文件 @
94e67b20
...
@@ -3,6 +3,7 @@ package com.diaoyun.zion.chinafrica.service.impl;
...
@@ -3,6 +3,7 @@ package com.diaoyun.zion.chinafrica.service.impl;
import
com.diaoyun.zion.chinafrica.dao.TbCfFeedbackRecordDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfFeedbackRecordDao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeedbackRecordService
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeedbackRecordService
;
import
com.diaoyun.zion.chinafrica.vo.TbCfFeedbackRecordListVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.StateConstant
;
import
com.diaoyun.zion.master.base.StateConstant
;
...
@@ -75,19 +76,40 @@ public class TbCfFeedbackRecordServiceImpl implements TbCfFeedbackRecordService
...
@@ -75,19 +76,40 @@ public class TbCfFeedbackRecordServiceImpl implements TbCfFeedbackRecordService
@Override
@Override
public
Result
saveFeedback
(
TbCfFeedbackRecordEntity
tbCfFeedbackRecordEntity
)
{
public
Result
saveFeedback
(
TbCfFeedbackRecordEntity
tbCfFeedbackRecordEntity
)
{
Result
result
=
new
Result
();
Result
result
=
new
Result
();
//获取用户
//获取用户
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
TbCfUserInfoVo
tbCfUserInfoVo
=
tokenManager
.
validate
(
token
);
TbCfUserInfoVo
tbCfUserInfoVo
=
tokenManager
.
validate
(
token
);
tbCfFeedbackRecordEntity
.
setRecordId
(
IdUtil
.
createIdbyUUID
());
tbCfFeedbackRecordEntity
.
setRecordId
(
IdUtil
.
createIdbyUUID
());
tbCfFeedbackRecordEntity
.
setUserId
(
tbCfUserInfoVo
.
getUserId
());
tbCfFeedbackRecordEntity
.
setUserId
(
tbCfUserInfoVo
.
getUserId
());
tbCfFeedbackRecordEntity
.
setCreateTime
(
new
Date
());
tbCfFeedbackRecordEntity
.
setCreateTime
(
new
Date
());
int
res
=
tbCfFeedbackRecordDao
.
save
(
tbCfFeedbackRecordEntity
);
int
res
=
tbCfFeedbackRecordDao
.
save
(
tbCfFeedbackRecordEntity
);
if
(
res
>
0
)
{
if
(
res
>
0
)
{
result
.
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
result
.
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
else
{
}
else
{
result
.
setCode
(
ResultCodeEnum
.
DAO_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
DAO_ERROR
.
getDesc
());
result
.
setCode
(
ResultCodeEnum
.
DAO_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
DAO_ERROR
.
getDesc
());
}
}
return
result
;
return
result
;
}
}
@Override
public
Result
saveFeedbackList
(
TbCfFeedbackRecordListVo
tbCfFeedbackRecordListVo
)
{
Result
result
=
new
Result
();
//获取用户
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
TbCfUserInfoVo
tbCfUserInfoVo
=
tokenManager
.
validate
(
token
);
if
(!
tbCfFeedbackRecordListVo
.
getFeedbackList
().
isEmpty
())
{
List
<
TbCfFeedbackRecordEntity
>
feedbackList
=
tbCfFeedbackRecordListVo
.
getFeedbackList
();
for
(
TbCfFeedbackRecordEntity
feedback
:
feedbackList
)
{
feedback
.
setRecordId
(
IdUtil
.
createIdbyUUID
());
feedback
.
setUserId
(
tbCfUserInfoVo
.
getUserId
());
feedback
.
setCreateTime
(
new
Date
());
}
int
res
=
tbCfFeedbackRecordDao
.
saveBatch
(
feedbackList
);
result
.
setMessage
(
"Successfully save "
+
res
+
" feedback"
);
}
else
{
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"no feedback"
);
}
return
result
;
}
}
}
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfOrderServiceImpl.java
浏览文件 @
94e67b20
...
@@ -4,12 +4,15 @@ import com.diaoyun.zion.chinafrica.bis.impl.StripePay;
...
@@ -4,12 +4,15 @@ import com.diaoyun.zion.chinafrica.bis.impl.StripePay;
import
com.diaoyun.zion.chinafrica.constant.KeyConstant
;
import
com.diaoyun.zion.chinafrica.constant.KeyConstant
;
import
com.diaoyun.zion.chinafrica.dao.*
;
import
com.diaoyun.zion.chinafrica.dao.*
;
import
com.diaoyun.zion.chinafrica.entity.*
;
import
com.diaoyun.zion.chinafrica.entity.*
;
import
com.diaoyun.zion.chinafrica.enums.CouponCategoryEnum
;
import
com.diaoyun.zion.chinafrica.enums.DeliveryStatusEnum
;
import
com.diaoyun.zion.chinafrica.enums.DeliveryStatusEnum
;
import
com.diaoyun.zion.chinafrica.enums.OrderStatusEnum
;
import
com.diaoyun.zion.chinafrica.enums.OrderStatusEnum
;
import
com.diaoyun.zion.chinafrica.service.SpiderService
;
import
com.diaoyun.zion.chinafrica.service.SpiderService
;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeeService
;
import
com.diaoyun.zion.chinafrica.service.TbCfFeeService
;
import
com.diaoyun.zion.chinafrica.service.TbCfOrderService
;
import
com.diaoyun.zion.chinafrica.service.TbCfOrderService
;
import
com.diaoyun.zion.chinafrica.vo.TbCfCartItemDetailVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfCartItemDetailVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfFinanceVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfOrderVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfOrderVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
...
@@ -80,6 +83,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -80,6 +83,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Autowired
@Autowired
private
TbCfFeeService
tbCfFeeService
;
private
TbCfFeeService
tbCfFeeService
;
@Autowired
@Autowired
private
TbCfCouponService
tbCfCouponService
;
@Autowired
private
SpiderService
spiderService
;
private
SpiderService
spiderService
;
@Resource
@Resource
...
@@ -177,13 +182,13 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -177,13 +182,13 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
}
}
@Override
@Override
public
Result
getUserOrderList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
orderStatus
)
{
public
Result
getUserOrderList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
orderStatus
)
{
Result
<
PageInfo
<
TbCfOrderVo
>>
result
=
new
Result
<>();
Result
<
PageInfo
<
TbCfOrderVo
>>
result
=
new
Result
<>();
//获取用户
//获取用户
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
TbCfUserInfoVo
tbCfUserInfoVo
=
tokenManager
.
validate
(
token
);
TbCfUserInfoVo
tbCfUserInfoVo
=
tokenManager
.
validate
(
token
);
//订单数据
//订单数据
List
<
TbCfOrderEntity
>
orderList
=
tbCfOrderDao
.
getUserOrderList
(
tbCfUserInfoVo
.
getUserId
(),
orderStatus
);
List
<
TbCfOrderEntity
>
orderList
=
tbCfOrderDao
.
getUserOrderList
(
tbCfUserInfoVo
.
getUserId
(),
orderStatus
);
startPage
(
pageNum
,
pageSize
);
startPage
(
pageNum
,
pageSize
);
PageInfo
<
TbCfOrderEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
PageInfo
<
TbCfOrderEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
//获取订单后,再获取订单内商品
//获取订单后,再获取订单内商品
...
@@ -238,7 +243,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -238,7 +243,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Override
@Override
public
Result
payForOrder
(
String
orderId
,
String
token
)
{
public
Result
payForOrder
(
String
orderId
,
String
token
)
{
Result
<
TbCfFinance
Entity
>
result
=
new
Result
<>();
Result
<
TbCfFinance
Vo
>
result
=
new
Result
<>();
TbCfOrderVo
tbCfOrderVo
=
(
TbCfOrderVo
)
orderRedisCache
.
get
(
KeyConstant
.
ORDER_DET
+
orderId
);
TbCfOrderVo
tbCfOrderVo
=
(
TbCfOrderVo
)
orderRedisCache
.
get
(
KeyConstant
.
ORDER_DET
+
orderId
);
if
(
tbCfOrderVo
!=
null
)
{
if
(
tbCfOrderVo
!=
null
)
{
BigDecimal
realityPay
=
tbCfOrderVo
.
getRealityPay
();
BigDecimal
realityPay
=
tbCfOrderVo
.
getRealityPay
();
...
@@ -256,7 +261,18 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -256,7 +261,18 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
changeOrderState
(
charge
.
getId
(),
tbCfOrderVo
);
changeOrderState
(
charge
.
getId
(),
tbCfOrderVo
);
//生成流水记录
//生成流水记录
TbCfFinanceEntity
tbCfFinance
=
createFinance
(
charge
,
tbCfOrderVo
);
TbCfFinanceEntity
tbCfFinance
=
createFinance
(
charge
,
tbCfOrderVo
);
result
.
setData
(
tbCfFinance
);
TbCfFinanceVo
tbCfFinanceVo
=
new
TbCfFinanceVo
();
BeanUtils
.
copyProperties
(
tbCfFinance
,
tbCfFinanceVo
);
//赠送购物返券
List
<
TbCfCouponEntity
>
couponList
=
tbCfCouponDao
.
getCouponByCategory
(
CouponCategoryEnum
.
SHOP
.
getValue
(),
new
Date
());
if
(!
couponList
.
isEmpty
())
{
//领取优惠券
Result
couponResult
=
tbCfCouponService
.
takeCoupon
(
couponList
.
get
(
0
).
getCouponId
());
if
(
couponResult
.
getCode
()
==
ResultCodeEnum
.
SUCCESS
.
getCode
())
{
tbCfFinanceVo
.
setCouponId
(
couponList
.
get
(
0
).
getCouponId
());
}
}
result
.
setData
(
tbCfFinanceVo
);
}
else
{
}
else
{
result
.
setCode
(
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
()).
setMessage
(
"Payment failed!"
);
result
.
setCode
(
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
()).
setMessage
(
"Payment failed!"
);
}
}
...
@@ -293,14 +309,14 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -293,14 +309,14 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Override
@Override
public
Result
getOrderListByTime
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
)
{
public
Result
getOrderListByTime
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
)
{
Result
result
=
new
Result
<>();
Result
result
=
new
Result
<>();
if
((
endTime
-
beginTime
)>
31
*
24
*
60
*
60
)
{
if
((
endTime
-
beginTime
)
>
31
*
24
*
60
*
60
)
{
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"Time interval is too long"
);
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"Time interval is too long"
);
}
else
{
}
else
{
startPage
(
pageNum
,
pageSize
);
startPage
(
pageNum
,
pageSize
);
Date
beginDate
=
new
Date
(
beginTime
*
1000
);
Date
beginDate
=
new
Date
(
beginTime
*
1000
);
Date
endDate
=
new
Date
(
endTime
*
1000
);
Date
endDate
=
new
Date
(
endTime
*
1000
);
List
<
TbCfOrderEntity
>
orderList
=
tbCfOrderDao
.
getOrderListByTime
(
beginDate
,
endDate
);
List
<
TbCfOrderEntity
>
orderList
=
tbCfOrderDao
.
getOrderListByTime
(
beginDate
,
endDate
);
PageInfo
<
TbCfOrderEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
PageInfo
<
TbCfOrderEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
result
.
setData
(
pageInfo
);
result
.
setData
(
pageInfo
);
}
}
...
@@ -309,14 +325,14 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -309,14 +325,14 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
@Override
@Override
public
Result
getDeliveryList
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
)
{
public
Result
getDeliveryList
(
long
beginTime
,
long
endTime
,
Integer
pageNum
,
Integer
pageSize
)
{
Result
result
=
new
Result
<>();
Result
result
=
new
Result
<>();
if
((
endTime
-
beginTime
)>
31
*
24
*
60
*
60
)
{
if
((
endTime
-
beginTime
)
>
31
*
24
*
60
*
60
)
{
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"Time interval is too long"
);
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"Time interval is too long"
);
}
else
{
}
else
{
startPage
(
pageNum
,
pageSize
);
startPage
(
pageNum
,
pageSize
);
Date
beginDate
=
new
Date
(
beginTime
*
1000
);
Date
beginDate
=
new
Date
(
beginTime
*
1000
);
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
);
PageInfo
<
TbCfItemShippedEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
PageInfo
<
TbCfItemShippedEntity
>
pageInfo
=
new
PageInfo
<>(
orderList
);
result
.
setData
(
pageInfo
);
result
.
setData
(
pageInfo
);
}
}
...
@@ -324,7 +340,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -324,7 +340,7 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
}
}
@Override
@Override
public
Result
getOrderDetail
(
String
orderId
)
{
public
Result
getOrderDetail
Third
(
String
orderId
)
{
Result
<
TbCfOrderVo
>
result
=
new
Result
<>();
Result
<
TbCfOrderVo
>
result
=
new
Result
<>();
TbCfOrderEntity
tbCfOrderEntity
=
tbCfOrderDao
.
queryObject
(
orderId
);
TbCfOrderEntity
tbCfOrderEntity
=
tbCfOrderDao
.
queryObject
(
orderId
);
TbCfOrderVo
tbCfOrderVo
=
new
TbCfOrderVo
();
TbCfOrderVo
tbCfOrderVo
=
new
TbCfOrderVo
();
...
@@ -357,8 +373,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -357,8 +373,8 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
tbCfOrder
.
setOrderId
(
orderId
);
tbCfOrder
.
setOrderId
(
orderId
);
tbCfOrder
.
setUpdateTime
(
new
Date
());
tbCfOrder
.
setUpdateTime
(
new
Date
());
tbCfOrder
.
setEnableFlag
(
StateConstant
.
INVALID
);
tbCfOrder
.
setEnableFlag
(
StateConstant
.
INVALID
);
int
res
=
tbCfOrderDao
.
update
(
tbCfOrder
);
int
res
=
tbCfOrderDao
.
update
(
tbCfOrder
);
if
(
res
>
0
)
{
if
(
res
>
0
)
{
result
.
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
result
.
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
}
else
{
}
else
{
result
.
setCode
(
ResultCodeEnum
.
DAO_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
DAO_ERROR
.
getDesc
());
result
.
setCode
(
ResultCodeEnum
.
DAO_ERROR
.
getCode
()).
setMessage
(
ResultCodeEnum
.
DAO_ERROR
.
getDesc
());
...
@@ -366,6 +382,26 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -366,6 +382,26 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
return
result
;
return
result
;
}
}
@Override
public
Result
getOrderDetail
(
String
orderId
)
{
Result
<
TbCfOrderVo
>
result
=
new
Result
<>();
TbCfOrderEntity
tbCfOrderEntity
=
tbCfOrderDao
.
queryObject
(
orderId
);
TbCfOrderVo
tbCfOrderVo
=
new
TbCfOrderVo
();
BeanUtils
.
copyProperties
(
tbCfOrderEntity
,
tbCfOrderVo
);
//获取订单内商品
List
<
TbCfItemDetailEntity
>
tbCfItemDetailList
=
tbCfOrderDao
.
getOrderItemList
(
orderId
);
//返回的订单商品详情
List
<
TbCfCartItemDetailVo
>
itemDetailVoList
=
new
ArrayList
<>();
for
(
TbCfItemDetailEntity
tbCfItemDetail
:
tbCfItemDetailList
)
{
TbCfCartItemDetailVo
tbCfCartItemDetailVo
=
new
TbCfCartItemDetailVo
();
BeanUtils
.
copyProperties
(
tbCfItemDetail
,
tbCfCartItemDetailVo
);
itemDetailVoList
.
add
(
tbCfCartItemDetailVo
);
}
tbCfOrderVo
.
setItemDetailList
(
itemDetailVoList
);
result
.
setData
(
tbCfOrderVo
);
return
result
;
}
/**
/**
* 记录财务流水
* 记录财务流水
*
*
...
@@ -615,11 +651,12 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
...
@@ -615,11 +651,12 @@ public class TbCfOrderServiceImpl implements TbCfOrderService {
/**
/**
* 获取运费 TODO 运费模板可改为缓存
* 获取运费 TODO 运费模板可改为缓存
*
* @param templateId
* @param templateId
* @return
* @return
*/
*/
private
BigDecimal
getExpressTemplate
(
String
templateId
)
{
private
BigDecimal
getExpressTemplate
(
String
templateId
)
{
TbCfExpressTemplateEntity
tbCfExpressTemplateEntity
=
tbCfExpressTemplateDao
.
queryObject
(
templateId
);
TbCfExpressTemplateEntity
tbCfExpressTemplateEntity
=
tbCfExpressTemplateDao
.
queryObject
(
templateId
);
return
tbCfExpressTemplateEntity
.
getExpressFee
();
return
tbCfExpressTemplateEntity
.
getExpressFee
();
}
}
...
...
src/main/java/com/diaoyun/zion/chinafrica/service/impl/TbCfUserInfoServiceImpl.java
浏览文件 @
94e67b20
...
@@ -4,8 +4,12 @@ import com.diaoyun.zion.chinafrica.client.SessionUser;
...
@@ -4,8 +4,12 @@ import com.diaoyun.zion.chinafrica.client.SessionUser;
import
com.diaoyun.zion.chinafrica.client.SessionUtils
;
import
com.diaoyun.zion.chinafrica.client.SessionUtils
;
import
com.diaoyun.zion.chinafrica.constant.EmailTemplateConstant
;
import
com.diaoyun.zion.chinafrica.constant.EmailTemplateConstant
;
import
com.diaoyun.zion.chinafrica.constant.KeyConstant
;
import
com.diaoyun.zion.chinafrica.constant.KeyConstant
;
import
com.diaoyun.zion.chinafrica.dao.TbCfCouponDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfUserInfoDao
;
import
com.diaoyun.zion.chinafrica.dao.TbCfUserInfoDao
;
import
com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity
;
import
com.diaoyun.zion.chinafrica.entity.TbCfUserInfoEntity
;
import
com.diaoyun.zion.chinafrica.enums.CouponCategoryEnum
;
import
com.diaoyun.zion.chinafrica.service.TbCfCouponService
;
import
com.diaoyun.zion.chinafrica.service.TbCfUserInfoService
;
import
com.diaoyun.zion.chinafrica.service.TbCfUserInfoService
;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.chinafrica.vo.TbCfUserInfoVo
;
import
com.diaoyun.zion.master.base.Result
;
import
com.diaoyun.zion.master.base.Result
;
...
@@ -57,6 +61,10 @@ import java.util.Map;
...
@@ -57,6 +61,10 @@ import java.util.Map;
public
class
TbCfUserInfoServiceImpl
implements
TbCfUserInfoService
{
public
class
TbCfUserInfoServiceImpl
implements
TbCfUserInfoService
{
@Autowired
@Autowired
private
TbCfUserInfoDao
tbCfUserInfoDao
;
private
TbCfUserInfoDao
tbCfUserInfoDao
;
@Autowired
private
TbCfCouponDao
tbCfCouponDao
;
@Autowired
private
TbCfCouponService
tbCfCouponService
;
@Autowired
@Autowired
private
PasswordEncoder
passwordEncoder
;
private
PasswordEncoder
passwordEncoder
;
...
@@ -136,7 +144,6 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -136,7 +144,6 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
public
Result
registerAndLogin
(
TbCfUserInfoVo
tbCfUserInfoVo
)
{
public
Result
registerAndLogin
(
TbCfUserInfoVo
tbCfUserInfoVo
)
{
Result
result
=
new
Result
();
Result
result
=
new
Result
();
Integer
identifyCode
=
(
Integer
)
captchaRedisCache
.
get
(
KeyConstant
.
CAPTCHA
+
tbCfUserInfoVo
.
getAccount
());
Integer
identifyCode
=
(
Integer
)
captchaRedisCache
.
get
(
KeyConstant
.
CAPTCHA
+
tbCfUserInfoVo
.
getAccount
());
;
if
(
identifyCode
==
null
||
identifyCode
.
intValue
()
!=
tbCfUserInfoVo
.
getCaptcha
().
intValue
())
{
if
(
identifyCode
==
null
||
identifyCode
.
intValue
()
!=
tbCfUserInfoVo
.
getCaptcha
().
intValue
())
{
result
.
setCode
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
());
result
.
setCode
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
());
result
.
setMessage
(
"Verification code error"
);
result
.
setMessage
(
"Verification code error"
);
...
@@ -166,6 +173,13 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -166,6 +173,13 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
tokenManager
.
addToken
(
token
,
tbCfUserInfoVo
);
tokenManager
.
addToken
(
token
,
tbCfUserInfoVo
);
result
.
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
result
.
setMessage
(
ResultCodeEnum
.
SUCCESS
.
getDesc
());
result
.
setData
(
tbCfUserInfoVo
);
result
.
setData
(
tbCfUserInfoVo
);
//赠送用户优惠券
//获取购物返券
List
<
TbCfCouponEntity
>
couponList
=
tbCfCouponDao
.
getCouponByCategory
(
CouponCategoryEnum
.
REGISTER
.
getValue
(),
new
Date
());
if
(!
couponList
.
isEmpty
())
{
//领取优惠券
tbCfCouponService
.
takeCoupon
(
couponList
.
get
(
0
).
getCouponId
(),
tbCfUserInfoVo
.
getUserId
());
}
}
else
{
}
else
{
result
.
setCode
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
());
result
.
setCode
(
ResultCodeEnum
.
VALIDATE_ERROR
.
getCode
());
result
.
setMessage
(
"The mailbox or nick has been registered"
);
result
.
setMessage
(
"The mailbox or nick has been registered"
);
...
@@ -233,7 +247,6 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -233,7 +247,6 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
}
else
{
}
else
{
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"update wrong"
);
result
.
setCode
(
ResultCodeEnum
.
ERROR
.
getCode
()).
setMessage
(
"update wrong"
);
}
}
return
result
;
return
result
;
}
}
...
@@ -360,6 +373,13 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
...
@@ -360,6 +373,13 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
return
result
;
return
result
;
}
}
@Override
public
Result
<
TbCfUserInfoVo
>
getUserInfo
()
{
String
token
=
jwtTokenProvider
.
resolveToken
(
request
);
TbCfUserInfoVo
loginUser
=
tokenManager
.
validate
(
token
);
return
new
Result
<>(
loginUser
);
}
/**
/**
* 获取用户类型
* 获取用户类型
...
...
src/main/java/com/diaoyun/zion/chinafrica/vo/TbCfFeedbackRecordListVo.java
0 → 100644
浏览文件 @
94e67b20
package
com
.
diaoyun
.
zion
.
chinafrica
.
vo
;
import
com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity
;
import
java.util.List
;
/**
* 反馈问题vo映射
*/
public
class
TbCfFeedbackRecordListVo
{
private
List
<
TbCfFeedbackRecordEntity
>
feedbackList
;
public
List
<
TbCfFeedbackRecordEntity
>
getFeedbackList
()
{
return
feedbackList
;
}
public
void
setFeedbackList
(
List
<
TbCfFeedbackRecordEntity
>
feedbackList
)
{
this
.
feedbackList
=
feedbackList
;
}
}
src/main/java/com/diaoyun/zion/chinafrica/vo/TbCfFinanceVo.java
0 → 100644
浏览文件 @
94e67b20
package
com
.
diaoyun
.
zion
.
chinafrica
.
vo
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 财务明细实体
* 表名 tb_cf_finance
*
* @author G
* @date 2019-08-14 09:11:48
*/
public
class
TbCfFinanceVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 财务报表id
*/
private
String
finaceId
;
/**
* 订单id
*/
private
String
orderId
;
/**
* 用户id
*/
private
String
userId
;
/**
* 支付款项
*/
private
BigDecimal
payAccount
;
/**
* 支付流水号
*/
private
String
payId
;
/**
* 支付方式
*/
private
String
payWayCode
;
/**
* 支付时间
*/
private
Date
payTime
;
/**
* 支付结果页面
*/
private
String
receiptUrl
;
/**
* 支付会返回可领取优惠券id
*/
private
String
couponId
;
/**
* 设置:财务报表id
*/
public
void
setFinaceId
(
String
finaceId
)
{
this
.
finaceId
=
finaceId
;
}
/**
* 获取:财务报表id
*/
public
String
getFinaceId
()
{
return
finaceId
;
}
/**
* 设置:订单id
*/
public
void
setOrderId
(
String
orderId
)
{
this
.
orderId
=
orderId
;
}
/**
* 获取:订单id
*/
public
String
getOrderId
()
{
return
orderId
;
}
/**
* 设置:用户id
*/
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
/**
* 获取:用户id
*/
public
String
getUserId
()
{
return
userId
;
}
/**
* 设置:支付款项
*/
public
void
setPayAccount
(
BigDecimal
payAccount
)
{
this
.
payAccount
=
payAccount
;
}
/**
* 获取:支付款项
*/
public
BigDecimal
getPayAccount
()
{
return
payAccount
;
}
/**
* 设置:支付流水号
*/
public
void
setPayId
(
String
payId
)
{
this
.
payId
=
payId
;
}
/**
* 获取:支付流水号
*/
public
String
getPayId
()
{
return
payId
;
}
/**
* 设置:支付方式
*/
public
void
setPayWayCode
(
String
payWayCode
)
{
this
.
payWayCode
=
payWayCode
;
}
/**
* 获取:支付方式
*/
public
String
getPayWayCode
()
{
return
payWayCode
;
}
/**
* 设置:支付时间
*/
public
void
setPayTime
(
Date
payTime
)
{
this
.
payTime
=
payTime
;
}
/**
* 获取:支付时间
*/
public
Date
getPayTime
()
{
return
payTime
;
}
public
String
getReceiptUrl
()
{
return
receiptUrl
;
}
public
void
setReceiptUrl
(
String
receiptUrl
)
{
this
.
receiptUrl
=
receiptUrl
;
}
public
String
getCouponId
()
{
return
couponId
;
}
public
void
setCouponId
(
String
couponId
)
{
this
.
couponId
=
couponId
;
}
}
src/main/resources/mapper/TbCfCouponDao.xml
浏览文件 @
94e67b20
...
@@ -204,4 +204,10 @@
...
@@ -204,4 +204,10 @@
and
<![CDATA[ t2.valid_end_time<#{nowTime}]]>
and t1.enable_flag=1
and
<![CDATA[ t2.valid_end_time<#{nowTime}]]>
and t1.enable_flag=1
</select>
</select>
<!--根据优惠券种类获取发放中的优惠券-->
<select
id=
"getCouponByCategory"
resultType=
"com.diaoyun.zion.chinafrica.entity.TbCfCouponEntity"
>
select * from tb_cf_coupon where coupon_category=#{couponCategory} and
<![CDATA[ start_time<=#{nowTime}]]>
and
<![CDATA[end_time>=#{nowTime}]]>
and status=1;
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapper/TbCfFeedbackRecordDao.xml
浏览文件 @
94e67b20
...
@@ -92,4 +92,23 @@
...
@@ -92,4 +92,23 @@
</foreach>
</foreach>
</delete>
</delete>
<!--批量保存反馈-->
<insert
id=
"saveBatch"
parameterType=
"com.diaoyun.zion.chinafrica.entity.TbCfFeedbackRecordEntity"
>
insert into tb_cf_feedback_record(
`record_id`,
`user_id`,
`feedback_id`,
`answer`,
`create_time`)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
#{item.recordId},
#{item.userId},
#{item.feedbackId},
#{item.answer},
#{item.createTime})
</foreach>
</insert>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/mapper/TbCfUserInfoDao.xml
浏览文件 @
94e67b20
...
@@ -161,7 +161,7 @@
...
@@ -161,7 +161,7 @@
<if
test=
"nick != null"
>
`nick` = #{nick},
</if>
<if
test=
"nick != null"
>
`nick` = #{nick},
</if>
<if
test=
"phone != null"
>
`phone` = #{phone},
</if>
<if
test=
"phone != null"
>
`phone` = #{phone},
</if>
<if
test=
"phoneFlag != null"
>
`phone_flag` = #{phoneFlag},
</if>
<if
test=
"phoneFlag != null"
>
`phone_flag` = #{phoneFlag},
</if>
<
if
test=
"password != null"
>
`password` = #{password},
</if
>
<
!--<if test="password != null">`password` = #{password},</if>--
>
<if
test=
"lastLoginTime != null"
>
`last_login_time` = #{lastLoginTime},
</if>
<if
test=
"lastLoginTime != null"
>
`last_login_time` = #{lastLoginTime},
</if>
<if
test=
"lastLoginIp != null"
>
`last_login_ip` = #{lastLoginIp},
</if>
<if
test=
"lastLoginIp != null"
>
`last_login_ip` = #{lastLoginIp},
</if>
<if
test=
"loginCount != null"
>
`login_count` = #{loginCount},
</if>
<if
test=
"loginCount != null"
>
`login_count` = #{loginCount},
</if>
...
...
src/main/resources/static/page/index.html
0 → 100644
浏览文件 @
94e67b20
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui"
>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
content=
"yes"
name=
"apple-mobile-web-app-capable"
>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"black-translucent"
>
<meta
name=
"format-detection"
content=
"telephone=no"
>
<meta
name=
"full-screen"
content=
"yes"
>
<meta
name=
"x5-fullscreen"
content=
"true"
>
<title>
Download Afri-eshop APP
</title>
</head>
<body>
<div
id=
"app"
>
<div
class=
"btn"
onclick=
"Href()"
>
Download Now!
</div>
</div>
</body>
<script>
function
Href
(){
var
u
=
navigator
.
userAgent
,
app
=
navigator
.
appVersion
;
var
isAndroid
=
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
;
//g
var
isIOS
=
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
);
//ios终端
if
(
isAndroid
){
window
.
location
.
href
=
'https://baidu.com'
}
if
(
isIOS
){
window
.
location
.
href
=
'https://www.sina.com.cn'
}
}
</script>
</html>
<style>
@media
screen
and
(
min-width
:
375px
)
{
html
{
font-size
:
75px
;
}
}
@media
screen
and
(
min-width
:
320px
)
{
html
{
font-size
:
50px
;
}
}
@media
screen
and
(
min-width
:
768px
)
{
html
{
font-size
:
100px
;
}
}
html
,
body
{
width
:
100%
;
height
:
100%
;
margin
:
0
;
padding
:
0
;
}
#app
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
background
:
url("./static/bg.png")
no-repeat
;
background-size
:
100%
100%
;
}
.btn
{
position
:
absolute
;
left
:
50%
;
top
:
22rem
;
transform
:
translate
(
-50%
,
0
);
width
:
18rem
;
height
:
3.2rem
;
line-height
:
3.2rem
;
background
:
#FEE606
;
border-radius
:
0.3rem
;
text-align
:
center
;
z-index
:
3
;
font-size
:
1.1rem
;
}
</style>
src/main/resources/static/page/static/bg.png
0 → 100644
浏览文件 @
94e67b20
230.4 KB
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论