Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
26c9b5c9
提交
26c9b5c9
authored
11月 21, 2019
作者:
luojie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改优惠券的发放,弃用数据库优惠券类型,用枚举来代替
上级
6a85fd61
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
655 行增加
和
73 行删除
+655
-73
TbCfCouponController.java
...in/java/com/platform/controller/TbCfCouponController.java
+1
-11
TbCfCouponIssueController.java
...va/com/platform/controller/TbCfCouponIssueController.java
+5
-6
TbCfToiCouponController.java
...java/com/platform/controller/TbCfToiCouponController.java
+134
-0
Test.java
...admin/src/main/java/com/platform/controller/api/Test.java
+10
-13
TbCfToiCouponDao.java
...dmin/src/main/java/com/platform/dao/TbCfToiCouponDao.java
+14
-0
TbCfCouponEntity.java
...n/src/main/java/com/platform/entity/TbCfCouponEntity.java
+2
-0
TbCfToiCouponEntity.java
...rc/main/java/com/platform/entity/TbCfToiCouponEntity.java
+119
-0
TbCfCouponService.java
...src/main/java/com/platform/service/TbCfCouponService.java
+2
-1
TbCfToiCouponService.java
.../main/java/com/platform/service/TbCfToiCouponService.java
+81
-0
TbCfCouponServiceImpl.java
...java/com/platform/service/impl/TbCfCouponServiceImpl.java
+5
-1
TbCfToiCouponServiceImpl.java
...a/com/platform/service/impl/TbCfToiCouponServiceImpl.java
+72
-0
CouponIssueVo.java
...rm-admin/src/main/java/com/platform/vo/CouponIssueVo.java
+17
-0
TbCfCouponDao.xml
...min/src/main/resources/com/platform/dao/TbCfCouponDao.xml
+11
-11
TbCfToiCouponDao.xml
.../src/main/resources/com/platform/dao/TbCfToiCouponDao.xml
+116
-0
platform.properties
platform-admin/src/main/resources/prod/platform.properties
+1
-1
tbcfcoupon.html
...rm-admin/src/main/webapp/WEB-INF/page/sys/tbcfcoupon.html
+9
-8
common.js
platform-admin/src/main/webapp/js/common.js
+21
-0
tbcfcoupon.js
platform-admin/src/main/webapp/js/sys/tbcfcoupon.js
+31
-20
CouponCategoryEnum.java
.../src/main/java/com/platform/enums/CouponCategoryEnum.java
+4
-1
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfCouponController.java
浏览文件 @
26c9b5c9
...
...
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -119,17 +120,6 @@ public class TbCfCouponController {
return
R
.
ok
().
put
(
"list"
,
list
);
}
/**
*
* @param categoryId
* @return
*/
@RequestMapping
(
"/queryByCouponCategoryId"
)
@ResponseBody
public
R
queryByItemType
(
@RequestParam
(
"categoryId"
)
String
categoryId
){
List
<
TbCfCouponCategoryEntity
>
list
=
tbCfCouponCategoryService
.
queryByCouponCategoryId
(
categoryId
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
/**
* 优惠券领取情况
*/
...
...
platform-admin/src/main/java/com/platform/controller/TbCfCouponIssueController.java
浏览文件 @
26c9b5c9
...
...
@@ -2,9 +2,11 @@ package com.platform.controller;
import
com.platform.entity.TbCfCouponIssueEntity
;
import
com.platform.entity.TbCfIssueCouponEntity
;
import
com.platform.entity.TbCfToiCouponEntity
;
import
com.platform.entity.TbCfUserInfoEntity
;
import
com.platform.service.TbCfCouponIssueService
;
import
com.platform.service.TbCfIssueCouponService
;
import
com.platform.service.TbCfToiCouponService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
...
...
@@ -30,7 +32,7 @@ public class TbCfCouponIssueController {
@Autowired
private
TbCfCouponIssueService
tbCfCouponIssueService
;
@Autowired
private
TbCf
IssueCouponService
tbCfIssue
CouponService
;
private
TbCf
ToiCouponService
tbCfToi
CouponService
;
/**
* 查看列表
*/
...
...
@@ -67,7 +69,7 @@ public class TbCfCouponIssueController {
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"tbcfcouponissue:save"
)
@ResponseBody
public
R
save
(
@RequestBody
TbCfCouponIssueEntity
tbCfCouponIssue
,
TbCf
IssueCouponEntity
tbCfIssue
Coupon
)
{
public
R
save
(
@RequestBody
TbCfCouponIssueEntity
tbCfCouponIssue
,
TbCf
ToiCouponEntity
tbCfToi
Coupon
)
{
tbCfCouponIssueService
.
save
(
tbCfCouponIssue
);
int
status
=
tbCfCouponIssueService
.
queryByStatus
(
tbCfCouponIssue
.
getCouponIssueId
());
List
<
TbCfUserInfoEntity
>
userList
=
tbCfCouponIssueService
.
queryByUserStatus
(
status
);
...
...
@@ -75,15 +77,12 @@ public class TbCfCouponIssueController {
for
(
int
i
=
0
;
i
<
userList
.
size
();
i
++)
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"userId"
,
userList
.
get
(
i
).
getUserId
());
map
.
put
(
"nick"
,
userList
.
get
(
i
).
getNick
());
list
.
add
(
map
);
}
for
(
HashMap
<
String
,
String
>
m
:
list
)
{
String
userId
=
m
.
get
(
"userId"
);
String
nick
=
m
.
get
(
"nick"
);
tbCfIssueCouponService
.
save
(
tbCfCouponIssue
,
tbCfIssueCoupon
,
userId
,
nick
);
tbCfToiCouponService
.
saveAndSubmit
(
tbCfCouponIssue
,
tbCfToiCoupon
,
userId
);
}
return
R
.
ok
();
}
...
...
platform-admin/src/main/java/com/platform/controller/TbCfToiCouponController.java
0 → 100644
浏览文件 @
26c9b5c9
package
com
.
platform
.
controller
;
import
com.platform.entity.*
;
import
com.platform.service.TbCfCouponIssueService
;
import
com.platform.service.TbCfToiCouponService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* Controller
*
* @author lipengjun
* @date 2019-11-20 19:37:20
*/
@Controller
@RequestMapping
(
value
=
"tbcftoicoupon"
,
produces
=
"application/json; charset=utf-8"
)
public
class
TbCfToiCouponController
{
@Autowired
private
TbCfToiCouponService
tbCfToiCouponService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"tbcftoicoupon:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
TbCfToiCouponEntity
>
tbCfToicouponList
=
tbCfToiCouponService
.
queryList
(
query
);
int
total
=
tbCfToiCouponService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
tbCfToicouponList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{toitableId}"
)
@RequiresPermissions
(
"tbcftoicoupon:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"toitableId"
)
String
toitableId
)
{
TbCfToiCouponEntity
tbCfToicoupon
=
tbCfToiCouponService
.
queryObject
(
toitableId
);
return
R
.
ok
().
put
(
"tbCfToicoupon"
,
tbCfToicoupon
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"tbcftoicoupon:save"
)
@ResponseBody
public
R
save
(
@RequestBody
TbCfToiCouponEntity
tbCfToicoupon
)
{
tbCfToiCouponService
.
save
(
tbCfToicoupon
);
return
R
.
ok
();
}
/* *//**
* 保存并发放 提交
*//*
@RequestMapping("/saveAndSubmit")
@RequiresPermissions("tbcftoicoupon:saveAndSubmit")
@ResponseBody
public R saveAndSubmit(@RequestBody TbCfToiCouponEntity tbCfToiCoupon, TbCfCouponIssueEntity tbCfCouponIssue) {
tbCfCouponIssueService.save(tbCfCouponIssue);
int status = tbCfCouponIssueService.queryByStatus(tbCfCouponIssue.getCouponIssueId());
List<TbCfUserInfoEntity> userList= tbCfCouponIssueService.queryByUserStatus(status);
List<HashMap<String, String>> list=new ArrayList<>();
for (int i = 0; i < userList.size(); i++) {
HashMap<String, String> map = new HashMap<String, String>();
map.put("userId", userList.get(i).getUserId());
map.put("nick", userList.get(i).getNick());
list.add(map);
}
for (HashMap<String, String> m : list) {
String userId = m.get("userId");
tbCfToiCouponService.saveAndSubmit(tbCfCouponIssue, tbCfToiCoupon,userId);
}
return R.ok();
}*/
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"tbcftoicoupon:update"
)
@ResponseBody
public
R
update
(
@RequestBody
TbCfToiCouponEntity
tbCfToicoupon
)
{
tbCfToiCouponService
.
update
(
tbCfToicoupon
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"tbcftoicoupon:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
toitableIds
)
{
tbCfToiCouponService
.
deleteBatch
(
toitableIds
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
TbCfToiCouponEntity
>
list
=
tbCfToiCouponService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
platform-admin/src/main/java/com/platform/controller/api/Test.java
浏览文件 @
26c9b5c9
...
...
@@ -10,19 +10,16 @@ import java.util.List;
//转换时间,正式版删除!!!!!!
public
class
Test
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
res
=
"2019-11-01"
;
String
res1
=
"2019-11-25"
;
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
date
=
simpleDateFormat
.
parse
(
res
);
Date
date1
=
simpleDateFormat
.
parse
(
res1
);
long
it
=
date
.
getTime
()/
1000
;
long
it1
=
date1
.
getTime
()/
1000
;
String
s
=
String
.
valueOf
(
it
);
String
s1
=
String
.
valueOf
(
it1
);
System
.
out
.
println
(
s
);
System
.
out
.
println
(
s1
);
}
/* public static void main(String[] args) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
Calendar c = Calendar.getInstance();
c.add(Calendar.DATE, + 7);
Date time = c.getTime();
Date endDate = sdf.parse(sdf.format(time));
Date startDate=sdf.parse(sdf.format(new Date()));
System.out.println(startDate);
System.out.println(endDate);
}*/
/* public static void main(String[] args) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...
...
platform-admin/src/main/java/com/platform/dao/TbCfToiCouponDao.java
0 → 100644
浏览文件 @
26c9b5c9
package
com
.
platform
.
dao
;
import
com.platform.entity.TbCfToiCouponEntity
;
/**
* Dao
*
* @author lipengjun
* @date 2019-11-20 19:37:20
*/
public
interface
TbCfToiCouponDao
extends
BaseDao
<
TbCfToiCouponEntity
>
{
int
saveAndSubmit
(
TbCfToiCouponEntity
tbCfToiCoupon
);
}
platform-admin/src/main/java/com/platform/entity/TbCfCouponEntity.java
浏览文件 @
26c9b5c9
...
...
@@ -297,6 +297,8 @@ public class TbCfCouponEntity implements Serializable {
public
Date
getEndTime
()
{
return
endTime
;
}
/**
* 设置:有效开始时间
*/
...
...
platform-admin/src/main/java/com/platform/entity/TbCfToiCouponEntity.java
0 → 100644
浏览文件 @
26c9b5c9
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_cf_toicoupon
*
* @author lipengjun
* @date 2019-11-20 19:37:20
*/
public
class
TbCfToiCouponEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 发放/领取表id
*/
private
String
toitableId
;
/**
* 优惠券id
*/
private
String
couponId
;
/**
* 用户id
*/
private
String
userId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 标识(1发放,2领取,3注册)
*/
private
Integer
identification
;
/**
* 是否已使用(0已使用,1未使用)
*/
private
Integer
enableFlag
;
/**
* 设置:发放/领取表id
*/
public
void
setToitableId
(
String
toitableId
)
{
this
.
toitableId
=
toitableId
;
}
/**
* 获取:发放/领取表id
*/
public
String
getToitableId
()
{
return
toitableId
;
}
/**
* 设置:优惠券id
*/
public
void
setCouponId
(
String
couponId
)
{
this
.
couponId
=
couponId
;
}
/**
* 获取:优惠券id
*/
public
String
getCouponId
()
{
return
couponId
;
}
/**
* 设置:用户id
*/
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
/**
* 获取:用户id
*/
public
String
getUserId
()
{
return
userId
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:标识(1发放,2领取,3注册)
*/
public
void
setIdentification
(
Integer
identification
)
{
this
.
identification
=
identification
;
}
/**
* 获取:标识(1发放,2领取,3注册)
*/
public
Integer
getIdentification
()
{
return
identification
;
}
/**
* 设置:是否已使用(0已使用,1未使用)
*/
public
void
setEnableFlag
(
Integer
enableFlag
)
{
this
.
enableFlag
=
enableFlag
;
}
/**
* 获取:是否已使用(0已使用,1未使用)
*/
public
Integer
getEnableFlag
()
{
return
enableFlag
;
}
}
platform-admin/src/main/java/com/platform/service/TbCfCouponService.java
浏览文件 @
26c9b5c9
...
...
@@ -4,6 +4,7 @@ import com.platform.entity.TbCfCouponEntity;
import
com.platform.vo.CouponIssueVo
;
import
com.platform.vo.CouponTakeVo
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -42,7 +43,7 @@ public interface TbCfCouponService {
* @param tbCfCoupon 实体
* @return 保存条数
*/
int
save
(
TbCfCouponEntity
tbCfCoupon
);
int
save
(
TbCfCouponEntity
tbCfCoupon
)
;
/**
* 根据主键更新实体
...
...
platform-admin/src/main/java/com/platform/service/TbCfToiCouponService.java
0 → 100644
浏览文件 @
26c9b5c9
package
com
.
platform
.
service
;
import
com.platform.entity.TbCfCouponIssueEntity
;
import
com.platform.entity.TbCfToiCouponEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service接口
*
* @author lipengjun
* @date 2019-11-20 19:37:20
*/
public
interface
TbCfToiCouponService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfToiCouponEntity
queryObject
(
String
toitableId
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
TbCfToiCouponEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param tbCfToicoupon 实体
* @return 保存条数
*/
int
save
(
TbCfToiCouponEntity
tbCfToicoupon
);
/**
* 根据主键更新实体
*
* @param tbCfToicoupon 实体
* @return 更新条数
*/
int
update
(
TbCfToiCouponEntity
tbCfToicoupon
);
/**
* 根据主键删除
*
* @param toitableId
* @return 删除条数
*/
int
delete
(
String
toitableId
);
/**
* 根据主键批量删除
*
* @param toitableIds
* @return 删除条数
*/
int
deleteBatch
(
String
[]
toitableIds
);
/**
* 保存用户的优惠券
* @param tbCfCouponIssue
* @param tbCfToiCoupon
* @param userId
* @return
*/
int
saveAndSubmit
(
TbCfCouponIssueEntity
tbCfCouponIssue
,
TbCfToiCouponEntity
tbCfToiCoupon
,
String
userId
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfCouponServiceImpl.java
浏览文件 @
26c9b5c9
...
...
@@ -10,6 +10,9 @@ import com.platform.vo.CouponTakeVo;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -41,7 +44,7 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
}
@Override
public
int
save
(
TbCfCouponEntity
tbCfCoupon
)
{
public
int
save
(
TbCfCouponEntity
tbCfCoupon
){
tbCfCoupon
.
setCouponId
(
IdUtil
.
createIdbyUUID
());
tbCfCoupon
.
setTakeCount
(
0
);
tbCfCoupon
.
setUsedCount
(
0
);
...
...
@@ -50,6 +53,7 @@ public class TbCfCouponServiceImpl implements TbCfCouponService {
return
tbCfCouponDao
.
save
(
tbCfCoupon
);
}
@Override
public
int
update
(
TbCfCouponEntity
tbCfCoupon
)
{
return
tbCfCouponDao
.
update
(
tbCfCoupon
);
...
...
platform-admin/src/main/java/com/platform/service/impl/TbCfToiCouponServiceImpl.java
0 → 100644
浏览文件 @
26c9b5c9
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.TbCfToiCouponDao
;
import
com.platform.entity.TbCfCouponIssueEntity
;
import
com.platform.entity.TbCfToiCouponEntity
;
import
com.platform.service.TbCfToiCouponService
;
import
com.platform.utils.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service实现类
*
* @author lipengjun
* @date 2019-11-20 19:37:20
*/
@Service
(
"tbCfToiCouponService"
)
public
class
TbCfToiCouponServiceImpl
implements
TbCfToiCouponService
{
@Autowired
private
TbCfToiCouponDao
tbCfToiCouponDao
;
@Override
public
TbCfToiCouponEntity
queryObject
(
String
toitableId
)
{
return
tbCfToiCouponDao
.
queryObject
(
toitableId
);
}
@Override
public
List
<
TbCfToiCouponEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
tbCfToiCouponDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
tbCfToiCouponDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
TbCfToiCouponEntity
tbCfToicoupon
)
{
tbCfToicoupon
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
return
tbCfToiCouponDao
.
save
(
tbCfToicoupon
);
}
@Override
public
int
update
(
TbCfToiCouponEntity
tbCfToicoupon
)
{
return
tbCfToiCouponDao
.
update
(
tbCfToicoupon
);
}
@Override
public
int
delete
(
String
toitableId
)
{
return
tbCfToiCouponDao
.
delete
(
toitableId
);
}
@Override
public
int
deleteBatch
(
String
[]
toitableIds
)
{
return
tbCfToiCouponDao
.
deleteBatch
(
toitableIds
);
}
@Override
public
int
saveAndSubmit
(
TbCfCouponIssueEntity
tbCfCouponIssue
,
TbCfToiCouponEntity
tbCfToiCoupon
,
String
userId
)
{
tbCfToiCoupon
.
setToitableId
(
IdUtil
.
createIdbyUUID
());
tbCfToiCoupon
.
setCouponId
(
tbCfCouponIssue
.
getCouponId
());
tbCfToiCoupon
.
setUserId
(
userId
);
tbCfToiCoupon
.
setCreateTime
(
new
Date
());
tbCfToiCoupon
.
setIdentification
(
1
);
tbCfToiCoupon
.
setEnableFlag
(
1
);
return
tbCfToiCouponDao
.
saveAndSubmit
(
tbCfToiCoupon
);
}
}
platform-admin/src/main/java/com/platform/vo/CouponIssueVo.java
浏览文件 @
26c9b5c9
...
...
@@ -47,6 +47,10 @@ public class CouponIssueVo implements Serializable {
*/
private
Integer
enableFlag
;
/**
* 标识(1发放,2领取,3注册)
*/
private
Integer
identification
;
public
String
getCouponId
()
{
return
couponId
;
}
...
...
@@ -110,4 +114,17 @@ public class CouponIssueVo implements Serializable {
public
void
setEnableFlag
(
Integer
enableFlag
)
{
this
.
enableFlag
=
enableFlag
;
}
/**
* 设置:标识(1发放,2领取,3注册)
*/
public
void
setIdentification
(
Integer
identification
)
{
this
.
identification
=
identification
;
}
/**
* 获取:标识(1发放,2领取,3注册)
*/
public
Integer
getIdentification
()
{
return
identification
;
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfCouponDao.xml
浏览文件 @
26c9b5c9
...
...
@@ -58,7 +58,6 @@
select
a.coupon_id,
a.coupon_category_id ,
b.coupon_category_name ,
a.coupon_use,
a.coupon_title,
a.coupon_icon,
...
...
@@ -78,7 +77,7 @@
a.update_user_id,
a.update_time,
a.coupon_vaild
from tb_cf_coupon a
LEFT JOIN tb_cf_coupon_category b on a.coupon_category_id =b.coupon_category_id
from tb_cf_coupon a
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
...
...
@@ -100,7 +99,6 @@
select
a.coupon_id,
a.coupon_category_id ,
b.coupon_category_name ,
a.coupon_use,
a.coupon_title,
a.coupon_icon,
...
...
@@ -120,7 +118,7 @@
a.update_user_id,
a.update_time,
a.coupon_vaild
from tb_cf_coupon a
LEFT JOIN tb_cf_coupon_category b on a.coupon_category_id =b.coupon_category_id
from tb_cf_coupon a
WHERE 1=1 and a.coupon_vaild=0
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
...
...
@@ -245,19 +243,21 @@
where
t2.coupon_id=#{couponId} and t3.user_id=t2.user_id and t1.coupon_id=t2.coupon_id
</select>
<!--优惠券领取情况-->
<!--优惠券
发放/
领取情况-->
<select
id=
"getCouponIssueList"
resultType=
"com.platform.vo.CouponIssueVo"
>
select
select
t2.coupon_id,
t2.create_time,
t2.enable_flag,
t1.coupon_category_id,
t1.coupon_title,
t1.coupon_icon,
t3.nick,
t3.account
from tb_cf_coupon t1,tb_cf_issue_coupon t2,tb_cf_user_info t3
t3.nick,
t3.account,
t2.identification
from tb_cf_coupon t1
left join tb_cf_toicoupon t2 on t1.coupon_id=t2.coupon_id
left join tb_cf_user_info t3 on t2.user_id=t3.user_id
where
t2.coupon_id=#{couponId}
and t3.user_id=t2.user_id and t1.coupon_id=t2.coupon_id
t2.coupon_id=#{couponId}
</select>
</mapper>
\ No newline at end of file
platform-admin/src/main/resources/com/platform/dao/TbCfToiCouponDao.xml
0 → 100644
浏览文件 @
26c9b5c9
<?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.platform.dao.TbCfToiCouponDao"
>
<resultMap
type=
"com.platform.entity.TbCfToiCouponEntity"
id=
"tbCfToiCouponMap"
>
<result
property=
"toitableId"
column=
"toitable_id"
/>
<result
property=
"couponId"
column=
"coupon_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"identification"
column=
"identification"
/>
<result
property=
"enableFlag"
column=
"enable_flag"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfToiCouponEntity"
>
select
`toitable_id`,
`coupon_id`,
`user_id`,
`create_time`,
`identification`,
`enable_flag`
from tb_cf_toicoupon
where toitable_id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfToiCouponEntity"
>
select
`toitable_id`,
`coupon_id`,
`user_id`,
`create_time`,
`identification`,
`enable_flag`
from tb_cf_toicoupon
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 toitable_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_toicoupon
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfToiCouponEntity"
>
insert into tb_cf_toicoupon(
`toitable_id`,
`coupon_id`,
`user_id`,
`create_time`,
`identification`,
`enable_flag`)
values(
#{toitableId},
#{couponId},
#{userId},
#{createTime},
#{identification},
#{enableFlag})
</insert>
<insert
id=
"saveAndSubmit"
parameterType=
"com.platform.entity.TbCfToiCouponEntity"
>
insert into tb_cf_toicoupon(
`toitable_id`,
`coupon_id`,
`user_id`,
`create_time`,
`identification`,
`enable_flag`)
values(
#{toitableId},
#{couponId},
#{userId},
#{createTime},
#{identification},
#{enableFlag})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfToiCouponEntity"
>
update tb_cf_toicoupon
<set>
<if
test=
"couponId != null"
>
`coupon_id` = #{couponId},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"identification != null"
>
`identification` = #{identification},
</if>
<if
test=
"enableFlag != null"
>
`enable_flag` = #{enableFlag}
</if>
</set>
where toitable_id = #{toitableId}
</update>
<delete
id=
"delete"
>
delete from tb_cf_toicoupon where toitable_id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_toicoupon where toitable_id in
<foreach
item=
"toitableId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{toitableId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/resources/prod/platform.properties
浏览文件 @
26c9b5c9
...
...
@@ -10,4 +10,4 @@ jdbc.maxActive=30
jdbc.minPoolSize
=
2
jdbc.maxIdleTime
=
30000
jdbc.idleConnectionTestPeriod
=
100
\ No newline at end of file
jdbc.idleConnectionTestPeriod
=
100
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcfcoupon.html
浏览文件 @
26c9b5c9
...
...
@@ -27,9 +27,9 @@
<i-button
@
click=
"reloadSearch"
>
重置
</i-button>
</div>
<div
class=
"buttons-group"
>
<
i-button
type=
"info"
@
click=
"insertcoupon"
>
新增优惠券类型
</i-button
>
<
!--<i-button type="info" @click="insertcoupon">新增优惠券类型</i-button>--
>
<!-- <i-button type="info" @click="showTake">查看领取情况</i-button>-->
<i-button
type=
"info"
@
click=
"show
Issue
"
>
查看发放情况
</i-button>
<i-button
type=
"info"
@
click=
"show
Toi
"
>
查看发放情况
</i-button>
<!--<i-button type="info" @click="showUse"><i class="fa fa-plus"></i> 查看使用情况</i-button>-->
#if($shiro.hasPermission("tbcfcoupon:save"))
<i-button
type=
"info"
@
click=
"add"
><i
class=
"fa fa-plus"
></i>
新增
</i-button>
...
...
@@ -52,10 +52,10 @@
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"tbCfCoupon"
:rules=
"ruleValidate"
:label-width=
"80"
>
<Form-item
label=
"优惠券类型"
prop=
"couponCategoryId"
>
<i-select
placeholder=
"优惠券类型"
v-model=
"tbCfCoupon.couponCategoryId"
@
on-change=
"changeCouponCategory"
>
<i-select
placeholder=
"优惠券类型"
v-model=
"tbCfCoupon.couponCategoryId"
>
<i-option
v-for=
"(el,i) in
CouponCategory
"
:key =
'i'
:value=
"el.
couponCategoryId"
>
{{el.couponCategoryName
}}
</i-option>
v-for=
"(el,i) in
cateGoryOptions
"
:key =
'i'
:value=
"el.
value"
>
{{el.label
}}
</i-option>
</i-select>
</Form-item>
<Form-item
label=
"设置是否为注册就送该优惠券"
prop=
"couponVaild"
>
...
...
@@ -224,13 +224,14 @@
</el-table>
</el-dialog>
<!-- 发放详情 -->
<el-dialog
:title=
"
issueTitle"
:visible
.
sync=
"issue
Visible"
width=
"80%"
>
<el-table
:data=
"
issue
Data"
>
<el-dialog
:title=
"
toiTitle"
:visible
.
sync=
"toi
Visible"
width=
"80%"
>
<el-table
:data=
"
toi
Data"
>
<el-table-column
property=
"couponTitle"
label=
"标题"
width=
"200"
></el-table-column>
<el-table-column
property=
"nick"
label=
"用户昵称"
></el-table-column>
<el-table-column
property=
"account"
label=
"用户账号"
></el-table-column>
<el-table-column
property=
"createTime"
label=
"领取时间"
></el-table-column>
<el-table-column
property=
"enableFlag"
label=
"是否已经使用"
></el-table-column>
<el-table-column
property=
"enableFlag"
label=
"是否已经使用(0已使用,1未使用)"
></el-table-column>
<el-table-column
property=
"identification"
label=
"1发放,2领取,3注册)"
></el-table-column>
</el-table>
</el-dialog>
...
...
platform-admin/src/main/webapp/js/common.js
浏览文件 @
26c9b5c9
...
...
@@ -509,6 +509,27 @@ moneyFormat = function (cellvalue) {
}*/
return
'$'
+
cellvalue
;
};
/**
* 优惠券类型翻译
* @param cellvalue
*/
couponFormat
=
function
(
cellvalue
){
var
returnStr
=
"未知"
if
(
!!
cellvalue
||
cellvalue
==
'0'
){
if
(
cellvalue
==
'10'
){
returnStr
=
"购物返券"
;
}
else
if
(
cellvalue
==
'20'
){
returnStr
=
"注册返券"
;
}
else
if
(
cellvalue
==
'30'
){
returnStr
=
"邀请返券"
;
}
else
if
(
cellvalue
==
'40'
){
returnStr
=
"用户领券"
;
}
else
if
(
cellvalue
==
'50'
){
returnStr
=
"发放优惠券"
;
}
}
return
returnStr
;
};
/**
* 有效无效过期翻译
* @param cellvalue
...
...
platform-admin/src/main/webapp/js/sys/tbcfcoupon.js
浏览文件 @
26c9b5c9
...
...
@@ -3,22 +3,21 @@ $(function () {
url
:
'../tbcfcoupon/list'
,
colModel
:
[
{
label
:
'couponId'
,
name
:
'couponId'
,
index
:
'coupon_id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'优惠券类型Id '
,
name
:
'couponCategoryId'
,
index
:
'couponCategoryId'
,
width
:
80
,
hidden
:
true
},
{
label
:
'优惠券类型 '
,
name
:
'couponCategoryName'
,
index
:
'couponCategoryName'
,
width
:
70
},
{
label
:
'优惠券类型 '
,
name
:
'couponCategoryId'
,
index
:
'couponCategory_id'
,
width
:
60
,
formatter
:
"select"
,
editoptions
:{
value
:
"10:购物返券;20:注册返券;30:邀请返券;40:用户领券"
}},
{
label
:
'可用于类目'
,
name
:
'couponUse'
,
index
:
'coupon_use'
,
width
:
80
,
hidden
:
true
},
{
label
:
'优惠券标题'
,
name
:
'couponTitle'
,
index
:
'coupon_title'
,
width
:
80
},
{
label
:
'优惠券图片地址'
,
name
:
'couponIcon'
,
index
:
'coupon_icon'
,
width
:
70
},
{
label
:
'优惠券图片地址'
,
name
:
'couponIcon'
,
index
:
'coupon_icon'
,
width
:
70
,
hidden
:
true
},
{
label
:
'那些站点可以使用'
,
name
:
'withStationId'
,
index
:
'with_station_id'
,
width
:
80
,
hidden
:
true
},
{
label
:
'满多少金额可以使用'
,
name
:
'withAmount'
,
index
:
'with_amount'
,
width
:
80
},
{
label
:
'抵扣金额'
,
name
:
'deductAmount'
,
index
:
'deduct_amount'
,
width
:
50
},
{
label
:
'发券数量'
,
name
:
'quato'
,
index
:
'quato'
,
width
:
8
0
},
{
label
:
'发券数量'
,
name
:
'quato'
,
index
:
'quato'
,
width
:
5
0
},
{
label
:
'已领取数量'
,
name
:
'takeCount'
,
index
:
'take_count'
,
width
:
80
,
hidden
:
true
},
{
label
:
'已使用数量'
,
name
:
'usedCount'
,
index
:
'used_count'
,
width
:
80
,
hidden
:
true
},
{
label
:
'发放开始时间'
,
name
:
'startTime'
,
index
:
'start_time'
,
width
:
80
},
{
label
:
'发放结束时间'
,
name
:
'endTime'
,
index
:
'end_time'
,
width
:
80
},
{
label
:
'有效开始时间'
,
name
:
'validStartTime'
,
index
:
'valid_start_time'
,
width
:
80
},
{
label
:
'有效结束时间'
,
name
:
'validEndTime'
,
index
:
'valid_end_time'
,
width
:
80
},
{
label
:
'有效标志'
,
name
:
'status'
,
index
:
'status'
,
width
:
5
0
,
formatter
:
stateFormat
},
{
label
:
'有效标志'
,
name
:
'status'
,
index
:
'status'
,
width
:
4
0
,
formatter
:
stateFormat
},
{
label
:
'创建人'
,
name
:
'createUserId'
,
index
:
'create_user_id'
,
width
:
80
,
hidden
:
true
},
{
label
:
'创建时间'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
80
},
{
label
:
'修改人'
,
name
:
'updateUserId'
,
index
:
'update_user_id'
,
width
:
80
,
hidden
:
true
},
...
...
@@ -50,13 +49,26 @@ let vm = new Vue({
el
:
'#rrapp'
,
data
:
{
takeVisible
:
false
,
issueVisible
:
false
,
toiVisible
:
false
,
useVisible
:
false
,
takeTitle
:
"领取详情(已领取数:0)"
,
issueTitle
:
"领取详情(已领取数
:0)"
,
toiTitle
:
"发放/领取详情(数量
:0)"
,
//领取优惠券情况
takeData
:[],
issueData
:[],
toiData
:[],
cateGoryOptions
:[{
value
:
'10'
,
label
:
'购物返券'
},{
value
:
'20'
,
label
:
'注册返券'
},{
value
:
'30'
,
label
:
'邀请返券'
},{
value
:
'40'
,
label
:
'用户领券'
}],
userStatusOptions
:[{
value
:
'10'
,
label
:
'未下单的用户'
...
...
@@ -128,7 +140,7 @@ let vm = new Vue({
}
},
methods
:
{
changeCouponCategory
(){
/*
changeCouponCategory(){
let url = `/africa_shop/tbcfcouponcategory/queryByCouponCategoryId?categoryId=${this.tbCfCoupon.couponCategoryId}`;
console.log('url',url)
let that = this;
...
...
@@ -144,7 +156,7 @@ let vm = new Vue({
}
}
});
},
},
*/
query
:
function
()
{
vm
.
reload
();
},
...
...
@@ -164,7 +176,7 @@ let vm = new Vue({
vm
.
getInfo
(
couponId
);
},
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
tbCfCoupon
.
couponId
==
null
?
"../tbcfcoupon/save"
:
"../tbcfcoupon/update"
;
let
url
=
vm
.
tbCfCoupon
.
couponId
==
null
?
"../tbcfcoupon/save"
:
"../tbcfcoupon/update"
;
Ajax
.
request
({
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
tbCfCoupon
),
...
...
@@ -243,13 +255,13 @@ let vm = new Vue({
vm
.
takeVisible
=
true
;
vm
.
getCouponTakeList
(
couponId
);
},
//获取发放详情
show
Issue
:
function
()
{
//获取发放
/领取
详情
show
Toi
:
function
()
{
let
couponId
=
getSelectedRow
(
"#jqGrid"
);
if
(
couponId
==
null
)
{
return
;
}
vm
.
issue
Visible
=
true
;
vm
.
toi
Visible
=
true
;
vm
.
getCouponIssueList
(
couponId
);
},
//获取优惠券领取情况
...
...
@@ -267,18 +279,18 @@ let vm = new Vue({
}
});
},
//获取优惠券发放情况
//获取优惠券发放
/领取
情况
getCouponIssueList
:
function
(
couponId
)
{
Ajax
.
request
({
url
:
"../tbcfcoupon/issue/"
+
couponId
,
async
:
true
,
successCallback
:
function
(
r6
)
{
vm
.
issue
Data
=
r6
.
list
;
vm
.
toi
Data
=
r6
.
list
;
var
length
=
0
;
if
(
!!
vm
.
issue
Data
)
{
length
=
vm
.
issue
Data
.
length
;
if
(
!!
vm
.
toi
Data
)
{
length
=
vm
.
toi
Data
.
length
;
}
vm
.
issueTitle
=
"领取详情(已领取数
:"
+
length
+
")"
;
vm
.
toiTitle
=
"发放/领取详情(数量
:"
+
length
+
")"
;
}
});
},
...
...
@@ -291,7 +303,6 @@ let vm = new Vue({
edit
:
function
(){
this
.
showEdit
=
false
vm
.
title
=
"设置优惠券发放"
;
vm
.
reload
();
vm
.
tbCfCoupon
=
{};
},
...
...
platform-common/src/main/java/com/platform/enums/CouponCategoryEnum.java
浏览文件 @
26c9b5c9
...
...
@@ -10,7 +10,10 @@ public enum CouponCategoryEnum implements EnumItemable<CouponCategoryEnum> {
SHOP
(
"购物返券"
,
10
),
REGISTER
(
"注册返券"
,
20
),
INVITE
(
"邀请返券"
,
30
);
INVITE
(
"邀请返券"
,
30
),
TAKE
(
"用户领券"
,
40
),
ISSUE
(
"发放优惠券"
,
50
);
private
String
label
;
private
Integer
value
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论