Commit 5cc5e063 authored by 冯秋丽's avatar 冯秋丽

计划列表的mock接口

parent 170afe91
package com.servicemall.loyalty.data; package com.servicemall.loyalty.data;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.servicemall.right.data.Coupon;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import team.bangbang.common.CommonMPI; import team.bangbang.common.CommonMPI;
...@@ -78,21 +80,19 @@ public class Plan { ...@@ -78,21 +80,19 @@ public class Plan {
private Long updatorId = null; private Long updatorId = null;
/* 购买起始时间 */ /* 购买起始时间 */
@DateTimeFormat(pattern="yyyy-MM-dd") private String buyStartTime = null;
private Date buyStartTime = null;
/* 购买起始时间 (查询上线) */ /* 购买起始时间 (查询上线) */
private Date buyStartTimeTop = null; private String buyStartTimeTop = null;
/* 购买起始时间 (查询下线) */ /* 购买起始时间 (查询下线) */
private Date buyStartTimeBottom = null; private String buyStartTimeBottom = null;
/* 购买结束时间 */ /* 购买结束时间 */
@DateTimeFormat(pattern="yyyy-MM-dd") private String buyEndTime = null;
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private Date buyEndTime = null;
/* 购买结束时间 (查询上线) */ /* 购买结束时间 (查询上线) */
private Date buyEndTimeTop = null; private String buyEndTimeTop = null;
/* 购买结束时间 (查询下线) */ /* 购买结束时间 (查询下线) */
private Date buyEndTimeBottom = null; private String buyEndTimeBottom = null;
/* 创建时间 */ /* 创建时间 */
private Date createAt = null; private Date createAt = null;
...@@ -108,15 +108,17 @@ public class Plan { ...@@ -108,15 +108,17 @@ public class Plan {
/* 更新时间 (查询下线) */ /* 更新时间 (查询下线) */
private Date updateAtBottom = null; private Date updateAtBottom = null;
private List<Coupon> couponList;
/* /*
* 固定数据字典 售价类型{1:统一价格 2:车型动态价格} * 固定数据字典 售价类型{1:统一价格 2:车型动态价格}
*/ */
public static final String[] priceTypeFlags = { "售价类型{1:统一价格 2:车型动态价格}" }; public static final String[] priceTypeFlags = { "统一价格", "车型动态价格" };
/* /*
* 固定数据字典 付款方式{1:定金 2:全款} * 固定数据字典 付款方式{1:定金 2:全款}
*/ */
public static final String[] payTypeFlags = { "付款方式{1:定金 2:全款}" }; public static final String[] payTypeFlags = { "定金","全款"};
/** /**
* @return 编号 * @return 编号
...@@ -428,87 +430,84 @@ public class Plan { ...@@ -428,87 +430,84 @@ public class Plan {
this.updatorId = updatorId; this.updatorId = updatorId;
} }
/** public String getBuyStartTime() {
* @return 购买起始时间
*/
public Date getBuyStartTime() {
return buyStartTime; return buyStartTime;
} }
/** /**
* @param buyStartTime 购买起始时间 * @param buyStartTime 购买结束时间
*/ */
public void setBuyStartTime(Date buyStartTime) { public void setBuyStartTime(String buyStartTime) {
this.buyStartTime = buyStartTime; this.buyStartTime = buyStartTime;
} }
/** /**
* @return 购买起始时间(查询上线) * @return 购买起始时间(查询上线)
*/ */
public Date getBuyStartTimeTop() { public String getBuyStartTimeTop() {
return buyStartTimeTop; return buyStartTimeTop;
} }
/** /**
* @param buyStartTimeTop 购买起始时间(查询上线) * @param buyStartTimeTop 购买起始时间(查询上线)
*/ */
public void setBuyStartTimeTop(Date buyStartTimeTop) { public void setBuyStartTimeTop(String buyStartTimeTop) {
this.buyStartTimeTop = buyStartTimeTop; this.buyStartTimeTop = buyStartTimeTop;
} }
/** /**
* @return 购买起始时间(查询下线) * @return 购买起始时间(查询下线)
*/ */
public Date getBuyStartTimeBottom() { public String getBuyStartTimeBottom() {
return buyStartTimeBottom; return buyStartTimeBottom;
} }
/** /**
* @param buyStartTimeBottom 购买起始时间(查询下线) * @param buyStartTimeBottom 购买起始时间(查询下线)
*/ */
public void setBuyStartTimeBottom(Date buyStartTimeBottom) { public void setBuyStartTimeBottom(String buyStartTimeBottom) {
this.buyStartTimeBottom = buyStartTimeBottom; this.buyStartTimeBottom = buyStartTimeBottom;
} }
/** /**
* @return 购买结束时间 * @return 购买结束时间
*/ */
public Date getBuyEndTime() { public String getBuyEndTime() {
return buyEndTime; return buyEndTime;
} }
/** /**
* @param buyEndTime 购买结束时间 * @param buyEndTime 购买结束时间
*/ */
public void setBuyEndTime(Date buyEndTime) { public void setBuyEndTime(String buyEndTime) {
this.buyEndTime = buyEndTime; this.buyEndTime = buyEndTime;
} }
/** /**
* @return 购买结束时间(查询上线) * @return 购买结束时间(查询上线)
*/ */
public Date getBuyEndTimeTop() { public String getBuyEndTimeTop() {
return buyEndTimeTop; return buyEndTimeTop;
} }
/** /**
* @param buyEndTimeTop 购买结束时间(查询上线) * @param buyEndTimeTop 购买结束时间(查询上线)
*/ */
public void setBuyEndTimeTop(Date buyEndTimeTop) { public void setBuyEndTimeTop(String buyEndTimeTop) {
this.buyEndTimeTop = buyEndTimeTop; this.buyEndTimeTop = buyEndTimeTop;
} }
/** /**
* @return 购买结束时间(查询下线) * @return 购买结束时间(查询下线)
*/ */
public Date getBuyEndTimeBottom() { public String getBuyEndTimeBottom() {
return buyEndTimeBottom; return buyEndTimeBottom;
} }
/** /**
* @param buyEndTimeBottom 购买结束时间(查询下线) * @param buyEndTimeBottom 购买结束时间(查询下线)
*/ */
public void setBuyEndTimeBottom(Date buyEndTimeBottom) { public void setBuyEndTimeBottom(String buyEndTimeBottom) {
this.buyEndTimeBottom = buyEndTimeBottom; this.buyEndTimeBottom = buyEndTimeBottom;
} }
...@@ -596,6 +595,14 @@ public class Plan { ...@@ -596,6 +595,14 @@ public class Plan {
this.updateAtBottom = updateAtBottom; this.updateAtBottom = updateAtBottom;
} }
public List<Coupon> getCouponList() {
return couponList;
}
public void setCouponList(List<Coupon> couponList) {
this.couponList = couponList;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see java.lang.Object#hashCode() * @see java.lang.Object#hashCode()
*/ */
......
...@@ -347,7 +347,7 @@ public final class PlanMicro { ...@@ -347,7 +347,7 @@ public final class PlanMicro {
@ApiImplicitParam(paramType = "query", name = "pageSize", value = "分页参数 - 每页最大记录数量,默认为10", dataType = "int",required = false) @ApiImplicitParam(paramType = "query", name = "pageSize", value = "分页参数 - 每页最大记录数量,默认为10", dataType = "int",required = false)
}) })
@ResponseBody @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(); Pagination pagination = new Pagination();
...@@ -370,4 +370,30 @@ public final class PlanMicro { ...@@ -370,4 +370,30 @@ public final class PlanMicro {
result.setMessage("成功"); result.setMessage("成功");
return result; 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;
}
} }
...@@ -5,6 +5,7 @@ import javax.annotation.PostConstruct; ...@@ -5,6 +5,7 @@ import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.servicemall.right.data.Coupon; import com.servicemall.right.data.Coupon;
import com.servicemall.right.service.CouponService;
import com.servicemall.systemcommon.util.DateUtil; import com.servicemall.systemcommon.util.DateUtil;
import team.bangbang.common.CommonMPI; import team.bangbang.common.CommonMPI;
import team.bangbang.common.data.KeyValue; import team.bangbang.common.data.KeyValue;
...@@ -198,33 +199,68 @@ public final class PlanService { ...@@ -198,33 +199,68 @@ public final class PlanService {
public static List<Plan> queryPlanList(String dms_code, Pagination pagination){ public static List<Plan> queryPlanList(String dms_code, Pagination pagination){
List<Plan> planList = new ArrayList<>(); List<Plan> planList = new ArrayList<>();
Plan plan = new Plan(); Plan plan = new Plan();
plan.setBuyStartTime(new Date()); plan.setBuyStartTime(DateUtil.getTime());
// coupon.setActiveStartTime(DateUtil.getTime()); plan.setBuyEndTime(DateUtil.getTime());
// coupon.setRightName("代金券"); plan.setApplyOld("1,2,3");
// coupon.setUsedTypeFlag(1); 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");
// coupon.setTotalUseNum(-1); plan.setId(1l);
// coupon.setId(1l); plan.setUniformPrice(300.00);
// coupon.setSortValue(1); plan.setPayTypeFlag(1);
// coupon.setStatus(1); plan.setPriceTypeFlag(1);
// Map<String,Integer> map = new HashMap<String,Integer>(); plan.setFactoryGuidePrice(8888.00);
// map.put("price",10); plan.setActiveStatus(2);
// coupon.setRightContent(map.toString()); plan.setBindingUseStatus(1);
// couponList.add(coupon); plan.setBuyAmountLimit(-1);
// plan.setBuyLimitDescription("测试");
// Coupon coupon1 = new Coupon(); plan.setLoyaltyName("会员权益计划");
// coupon1.setActiveEndTime(DateUtil.getTime()); plan.setDescription("测试");
// coupon1.setActiveStartTime(DateUtil.getTime()); plan.setSelectedStatus(1);
// 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());
planList.add(plan); 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(2l);
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; 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(1l);
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;
}
} }
...@@ -12,6 +12,7 @@ import team.bangbang.common.CommonMPI; ...@@ -12,6 +12,7 @@ import team.bangbang.common.CommonMPI;
* @version 1.0 2020-12-08 * @version 1.0 2020-12-08
*/ */
public class Coupon { public class Coupon {
/* 权益编号(关键字) */ /* 权益编号(关键字) */
private Long id = null; private Long id = null;
......
...@@ -232,6 +232,8 @@ public final class CouponService { ...@@ -232,6 +232,8 @@ public final class CouponService {
coupon.setId(1l); coupon.setId(1l);
coupon.setSortValue(1); coupon.setSortValue(1);
coupon.setStatus(1); coupon.setStatus(1);
coupon.setDescription("ces");
coupon.setUseDescription("测试");
Map<String,Integer> map = new HashMap<String,Integer>(); Map<String,Integer> map = new HashMap<String,Integer>();
map.put("price",10); map.put("price",10);
coupon.setRightContent(map.toString()); coupon.setRightContent(map.toString());
...@@ -249,6 +251,8 @@ public final class CouponService { ...@@ -249,6 +251,8 @@ public final class CouponService {
Map<String,Integer> map1= new HashMap<String,Integer>(); Map<String,Integer> map1= new HashMap<String,Integer>();
map1.put("price",10); map1.put("price",10);
coupon1.setRightContent(map1.toString()); coupon1.setRightContent(map1.toString());
coupon1.setDescription("ces");
coupon1.setUseDescription("测试");
couponList.add(coupon1); couponList.add(coupon1);
return couponList; return couponList;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment