Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
service_mall
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯秋丽
service_mall
Commits
5cc5e063
Commit
5cc5e063
authored
Dec 09, 2020
by
冯秋丽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计划列表的mock接口
parent
170afe91
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
128 additions
and
54 deletions
+128
-54
Plan.java
src/main/java/com/servicemall/loyalty/data/Plan.java
+35
-28
PlanMicro.java
src/main/java/com/servicemall/loyalty/micro/PlanMicro.java
+27
-1
PlanService.java
...ain/java/com/servicemall/loyalty/service/PlanService.java
+61
-25
Coupon.java
src/main/java/com/servicemall/right/data/Coupon.java
+1
-0
CouponService.java
...ain/java/com/servicemall/right/service/CouponService.java
+4
-0
No files found.
src/main/java/com/servicemall/loyalty/data/Plan.java
View file @
5cc5e063
package
com
.
servicemall
.
loyalty
.
data
;
import
java.util.Date
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.servicemall.right.data.Coupon
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
team.bangbang.common.CommonMPI
;
...
...
@@ -78,21 +80,19 @@ public class Plan {
private
Long
updatorId
=
null
;
/* 购买起始时间 */
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
buyStartTime
=
null
;
private
String
buyStartTime
=
null
;
/* 购买起始时间 (查询上线) */
private
Date
buyStartTimeTop
=
null
;
private
String
buyStartTimeTop
=
null
;
/* 购买起始时间 (查询下线) */
private
Date
buyStartTimeBottom
=
null
;
private
String
buyStartTimeBottom
=
null
;
/* 购买结束时间 */
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
buyEndTime
=
null
;
private
String
buyEndTime
=
null
;
/* 购买结束时间 (查询上线) */
private
Date
buyEndTimeTop
=
null
;
private
String
buyEndTimeTop
=
null
;
/* 购买结束时间 (查询下线) */
private
Date
buyEndTimeBottom
=
null
;
private
String
buyEndTimeBottom
=
null
;
/* 创建时间 */
private
Date
createAt
=
null
;
...
...
@@ -108,15 +108,17 @@ public class Plan {
/* 更新时间 (查询下线) */
private
Date
updateAtBottom
=
null
;
private
List
<
Coupon
>
couponList
;
/*
* 固定数据字典 售价类型{1:统一价格 2:车型动态价格}
*/
public
static
final
String
[]
priceTypeFlags
=
{
"
售价类型{1:统一价格 2:车型动态价格}
"
};
public
static
final
String
[]
priceTypeFlags
=
{
"
统一价格"
,
"车型动态价格
"
};
/*
* 固定数据字典 付款方式{1:定金 2:全款}
*/
public
static
final
String
[]
payTypeFlags
=
{
"
付款方式{1:定金 2:全款}"
};
public
static
final
String
[]
payTypeFlags
=
{
"
定金"
,
"全款"
};
/**
* @return 编号
...
...
@@ -428,87 +430,84 @@ public class Plan {
this
.
updatorId
=
updatorId
;
}
/**
* @return 购买起始时间
*/
public
Date
getBuyStartTime
()
{
public
String
getBuyStartTime
()
{
return
buyStartTime
;
}
/**
* @param buyStartTime 购买
起始
时间
* @param buyStartTime 购买
结束
时间
*/
public
void
setBuyStartTime
(
Date
buyStartTime
)
{
public
void
setBuyStartTime
(
String
buyStartTime
)
{
this
.
buyStartTime
=
buyStartTime
;
}
/**
* @return 购买起始时间(查询上线)
*/
public
Date
getBuyStartTimeTop
()
{
public
String
getBuyStartTimeTop
()
{
return
buyStartTimeTop
;
}
/**
* @param buyStartTimeTop 购买起始时间(查询上线)
*/
public
void
setBuyStartTimeTop
(
Date
buyStartTimeTop
)
{
public
void
setBuyStartTimeTop
(
String
buyStartTimeTop
)
{
this
.
buyStartTimeTop
=
buyStartTimeTop
;
}
/**
* @return 购买起始时间(查询下线)
*/
public
Date
getBuyStartTimeBottom
()
{
public
String
getBuyStartTimeBottom
()
{
return
buyStartTimeBottom
;
}
/**
* @param buyStartTimeBottom 购买起始时间(查询下线)
*/
public
void
setBuyStartTimeBottom
(
Date
buyStartTimeBottom
)
{
public
void
setBuyStartTimeBottom
(
String
buyStartTimeBottom
)
{
this
.
buyStartTimeBottom
=
buyStartTimeBottom
;
}
/**
* @return 购买结束时间
*/
public
Date
getBuyEndTime
()
{
public
String
getBuyEndTime
()
{
return
buyEndTime
;
}
/**
* @param buyEndTime 购买结束时间
*/
public
void
setBuyEndTime
(
Date
buyEndTime
)
{
public
void
setBuyEndTime
(
String
buyEndTime
)
{
this
.
buyEndTime
=
buyEndTime
;
}
/**
* @return 购买结束时间(查询上线)
*/
public
Date
getBuyEndTimeTop
()
{
public
String
getBuyEndTimeTop
()
{
return
buyEndTimeTop
;
}
/**
* @param buyEndTimeTop 购买结束时间(查询上线)
*/
public
void
setBuyEndTimeTop
(
Date
buyEndTimeTop
)
{
public
void
setBuyEndTimeTop
(
String
buyEndTimeTop
)
{
this
.
buyEndTimeTop
=
buyEndTimeTop
;
}
/**
* @return 购买结束时间(查询下线)
*/
public
Date
getBuyEndTimeBottom
()
{
public
String
getBuyEndTimeBottom
()
{
return
buyEndTimeBottom
;
}
/**
* @param buyEndTimeBottom 购买结束时间(查询下线)
*/
public
void
setBuyEndTimeBottom
(
Date
buyEndTimeBottom
)
{
public
void
setBuyEndTimeBottom
(
String
buyEndTimeBottom
)
{
this
.
buyEndTimeBottom
=
buyEndTimeBottom
;
}
...
...
@@ -596,6 +595,14 @@ public class Plan {
this
.
updateAtBottom
=
updateAtBottom
;
}
public
List
<
Coupon
>
getCouponList
()
{
return
couponList
;
}
public
void
setCouponList
(
List
<
Coupon
>
couponList
)
{
this
.
couponList
=
couponList
;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
...
...
src/main/java/com/servicemall/loyalty/micro/PlanMicro.java
View file @
5cc5e063
...
...
@@ -347,7 +347,7 @@ public final class PlanMicro {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"pageSize"
,
value
=
"分页参数 - 每页最大记录数量,默认为10"
,
dataType
=
"int"
,
required
=
false
)
})
@ResponseBody
public
ResponseBase
list
(
String
baumuster
,
String
dms_code
,
String
carAge
,
@RequestParam
(
defaultValue
=
"1"
,
required
=
false
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"10"
,
required
=
false
)
Integer
pageSize
)
{
public
ResponseBase
list
(
String
dms_code
,
String
baumuster
,
String
carAge
,
@RequestParam
(
defaultValue
=
"1"
,
required
=
false
)
Integer
pageNo
,
@RequestParam
(
defaultValue
=
"10"
,
required
=
false
)
Integer
pageSize
)
{
// 分页数据
Pagination
pagination
=
new
Pagination
();
...
...
@@ -370,4 +370,30 @@ public final class PlanMicro {
result
.
setMessage
(
"成功"
);
return
result
;
}
/**
* 查询优惠券列表
*
*
* @return
*/
@GetMapping
(
"/getplandetails"
)
@ApiOperation
(
value
=
"获取计划详情"
,
notes
=
"获取计划详情"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"loyalty_id"
,
value
=
"计划编号"
,
dataType
=
"string"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"dms_code"
,
value
=
"经销商code"
,
dataType
=
"string"
,
required
=
false
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"baumuster"
,
value
=
"车辆baumuster"
,
dataType
=
"string"
,
required
=
false
)
})
@ResponseBody
public
ResponseBase
getPlanDetails
(
@RequestParam
(
name
=
"loyalty_id"
)
String
loyalty_id
,
String
dms_code
,
String
baumuster
)
{
Plan
plan
=
PlanService
.
getPlanDetails
(
loyalty_id
,
dms_code
);
DataResponse
<
Map
<
String
,
Object
>>
result
=
new
DataResponse
<
Map
<
String
,
Object
>>();
Map
<
String
,
Object
>
datas
=
new
HashMap
<
String
,
Object
>();
datas
.
put
(
"plan"
,
plan
);
result
.
setData
(
datas
);
result
.
setMessage
(
"成功"
);
return
result
;
}
}
src/main/java/com/servicemall/loyalty/service/PlanService.java
View file @
5cc5e063
...
...
@@ -5,6 +5,7 @@ import javax.annotation.PostConstruct;
import
javax.annotation.Resource
;
import
com.servicemall.right.data.Coupon
;
import
com.servicemall.right.service.CouponService
;
import
com.servicemall.systemcommon.util.DateUtil
;
import
team.bangbang.common.CommonMPI
;
import
team.bangbang.common.data.KeyValue
;
...
...
@@ -198,33 +199,68 @@ public final class PlanService {
public
static
List
<
Plan
>
queryPlanList
(
String
dms_code
,
Pagination
pagination
){
List
<
Plan
>
planList
=
new
ArrayList
<>();
Plan
plan
=
new
Plan
();
plan
.
setBuyStartTime
(
new
Date
());
// coupon.setActiveStartTime(DateUtil.getTime());
// coupon.setRightName("代金券");
// coupon.setUsedTypeFlag(1);
// coupon.setTotalUseNum(-1);
// coupon.setId(1l);
// coupon.setSortValue(1);
// coupon.setStatus(1);
// Map<String,Integer> map = new HashMap<String,Integer>();
// map.put("price",10);
// coupon.setRightContent(map.toString());
// couponList.add(coupon);
//
// Coupon coupon1 = new Coupon();
// coupon1.setActiveEndTime(DateUtil.getTime());
// coupon1.setActiveStartTime(DateUtil.getTime());
// coupon1.setRightName("折扣券");
// coupon1.setUsedTypeFlag(2);
// coupon1.setTotalUseNum(-1);
// coupon1.setId(2l);
// coupon1.setSortValue(1);
// coupon1.setStatus(2);
// Map<String,Integer> map1= new HashMap<String,Integer>();
// map1.put("price",10);
// coupon1.setRightContent(map1.toString());
plan
.
setBuyStartTime
(
DateUtil
.
getTime
());
plan
.
setBuyEndTime
(
DateUtil
.
getTime
());
plan
.
setApplyOld
(
"1,2,3"
);
plan
.
setPlanImage
(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1607427778447&di=b0d30539b93ff6e7394b9c80801e11c7&imgtype=0&src=http%3A%2F%2Fimg000.hc360.cn%2Fm6%2FM04%2F58%2F6A%2FwKhQolWVsnmEGYk8AAAAAIA_Z48561.jpg"
);
plan
.
setId
(
1
l
);
plan
.
setUniformPrice
(
300.00
);
plan
.
setPayTypeFlag
(
1
);
plan
.
setPriceTypeFlag
(
1
);
plan
.
setFactoryGuidePrice
(
8888.00
);
plan
.
setActiveStatus
(
2
);
plan
.
setBindingUseStatus
(
1
);
plan
.
setBuyAmountLimit
(-
1
);
plan
.
setBuyLimitDescription
(
"测试"
);
plan
.
setLoyaltyName
(
"会员权益计划"
);
plan
.
setDescription
(
"测试"
);
plan
.
setSelectedStatus
(
1
);
planList
.
add
(
plan
);
Plan
plan2
=
new
Plan
();
plan2
.
setBuyStartTime
(
DateUtil
.
getTime
());
plan2
.
setBuyEndTime
(
DateUtil
.
getTime
());
plan2
.
setApplyOld
(
"1,2,3"
);
plan2
.
setPlanImage
(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1607427778447&di=b0d30539b93ff6e7394b9c80801e11c7&imgtype=0&src=http%3A%2F%2Fimg000.hc360.cn%2Fm6%2FM04%2F58%2F6A%2FwKhQolWVsnmEGYk8AAAAAIA_Z48561.jpg"
);
plan2
.
setId
(
2
l
);
plan2
.
setUniformPrice
(
300.00
);
plan2
.
setPriceTypeFlag
(
2
);
plan2
.
setPayTypeFlag
(
2
);
plan2
.
setDepositPrice
(
100.00
);
plan2
.
setFactoryGuidePrice
(
8888.00
);
plan2
.
setActiveStatus
(
2
);
plan2
.
setBindingUseStatus
(
1
);
plan2
.
setBuyAmountLimit
(-
1
);
plan2
.
setBuyLimitDescription
(
"测试"
);
plan2
.
setLoyaltyName
(
"保养特惠计划"
);
plan2
.
setDescription
(
"测试"
);
plan2
.
setSelectedStatus
(
1
);
planList
.
add
(
plan2
);
return
planList
;
}
public
static
Plan
getPlanDetails
(
String
loyalty_id
,
String
dms_code
){
Plan
plan
=
new
Plan
();
plan
.
setBuyStartTime
(
DateUtil
.
getTime
());
plan
.
setBuyEndTime
(
DateUtil
.
getTime
());
plan
.
setApplyOld
(
"1,2,3"
);
plan
.
setPlanImage
(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1607427778447&di=b0d30539b93ff6e7394b9c80801e11c7&imgtype=0&src=http%3A%2F%2Fimg000.hc360.cn%2Fm6%2FM04%2F58%2F6A%2FwKhQolWVsnmEGYk8AAAAAIA_Z48561.jpg"
);
plan
.
setActivityImage
(
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1607427778447&di=b0d30539b93ff6e7394b9c80801e11c7&imgtype=0&src=http%3A%2F%2Fimg000.hc360.cn%2Fm6%2FM04%2F58%2F6A%2FwKhQolWVsnmEGYk8AAAAAIA_Z48561.jpg"
);
plan
.
setId
(
1
l
);
plan
.
setUniformPrice
(
300.00
);
plan
.
setPriceTypeFlag
(
1
);
plan
.
setFactoryGuidePrice
(
8888.00
);
plan
.
setActiveStatus
(
2
);
plan
.
setBindingUseStatus
(
1
);
plan
.
setBuyAmountLimit
(-
1
);
plan
.
setBuyLimitDescription
(
"测试"
);
plan
.
setLoyaltyName
(
"会员权益计划"
);
plan
.
setDescription
(
"测试"
);
plan
.
setSelectedStatus
(
1
);
List
<
Coupon
>
couponList
=
CouponService
.
queryCouponList
(
dms_code
,
null
);
plan
.
setCouponList
(
couponList
);
return
plan
;
}
}
src/main/java/com/servicemall/right/data/Coupon.java
View file @
5cc5e063
...
...
@@ -12,6 +12,7 @@ import team.bangbang.common.CommonMPI;
* @version 1.0 2020-12-08
*/
public
class
Coupon
{
/* 权益编号(关键字) */
private
Long
id
=
null
;
...
...
src/main/java/com/servicemall/right/service/CouponService.java
View file @
5cc5e063
...
...
@@ -232,6 +232,8 @@ public final class CouponService {
coupon
.
setId
(
1
l
);
coupon
.
setSortValue
(
1
);
coupon
.
setStatus
(
1
);
coupon
.
setDescription
(
"ces"
);
coupon
.
setUseDescription
(
"测试"
);
Map
<
String
,
Integer
>
map
=
new
HashMap
<
String
,
Integer
>();
map
.
put
(
"price"
,
10
);
coupon
.
setRightContent
(
map
.
toString
());
...
...
@@ -249,6 +251,8 @@ public final class CouponService {
Map
<
String
,
Integer
>
map1
=
new
HashMap
<
String
,
Integer
>();
map1
.
put
(
"price"
,
10
);
coupon1
.
setRightContent
(
map1
.
toString
());
coupon1
.
setDescription
(
"ces"
);
coupon1
.
setUseDescription
(
"测试"
);
couponList
.
add
(
coupon1
);
return
couponList
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment