Commit 480ddf1a authored by 冯秋丽's avatar 冯秋丽

计划列表

parent 500cc3aa
......@@ -2,6 +2,8 @@ package com.servicemall.loyalty.data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import team.bangbang.common.CommonMPI;
/**
......@@ -76,6 +78,7 @@ public class Plan {
private Long updatorId = null;
/* 购买起始时间 */
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date buyStartTime = null;
/* 购买起始时间 (查询上线) */
private Date buyStartTimeTop = null;
......@@ -83,6 +86,8 @@ public class Plan {
private Date buyStartTimeBottom = null;
/* 购买结束时间 */
@DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private Date buyEndTime = null;
/* 购买结束时间 (查询上线) */
private Date buyEndTimeTop = null;
......
......@@ -6,10 +6,9 @@ import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import com.servicemall.right.data.Coupon;
import com.servicemall.right.service.CouponService;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
......@@ -19,7 +18,6 @@ import team.bangbang.common.data.Pagination;
import team.bangbang.common.data.response.ResponseBase;
import team.bangbang.common.data.response.DataResponse;
import team.bangbang.common.log.OperationLog;
import team.bangbang.spring.parameter.EntityParam;
import com.servicemall.loyalty.data.Plan;
import com.servicemall.loyalty.service.PlanService;
......@@ -333,4 +331,45 @@ public final class PlanMicro {
return (PlanService.getObject(form, str) != null);
}
/**
* 查询优惠券列表
*
*
* @return
*/
@PostMapping("/queryloyaltyplanlist")
@ApiOperation(value = "获取计划列表", notes = "车龄不是必填其他都是必填", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "dms_code", value = "经销商code", dataType = "string",required = true),
@ApiImplicitParam(paramType = "query", name = "baumuster", value = "车辆baumuster", dataType = "string",required = true),
@ApiImplicitParam(paramType = "query", name = "carAge", value = "车龄", dataType = "string"),
@ApiImplicitParam(paramType = "query", name = "pageNo", value = "分页参数 - 页号,默认为1", dataType = "int",required = true),
@ApiImplicitParam(paramType = "query", name = "pageSize", value = "分页参数 - 每页最大记录数量,默认为10", dataType = "int",required = true)
})
@ResponseBody
public ResponseBase list(String baumuster,String dms_code, String carAge,Integer pageNo,Integer pageSize) {
// 分页数据
Pagination pagination = new Pagination();
pagination.setRecordCount(Integer.MAX_VALUE);
pagination.setMaxResults(pageSize);
pagination.setPageNo(pageNo);
// 统计符合条件的结果记录数量
int recordCount = 0;
pagination.setRecordCount(recordCount);
List<Plan> playList = PlanService.queryPlanList(dms_code,pagination);
DataResponse<Map<String, Object>> result = new DataResponse<Map<String, Object>>();
Map<String, Object> datas = new HashMap<String, Object>();
datas.put("list", playList);
datas.put("pagination", pagination);
result.setData(datas);
result.setMessage("成功");
return result;
}
}
package com.servicemall.loyalty.service;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.*;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import com.servicemall.right.data.Coupon;
import com.servicemall.systemcommon.util.DateUtil;
import team.bangbang.common.CommonMPI;
import team.bangbang.common.data.KeyValue;
import team.bangbang.common.data.Pagination;
......@@ -195,4 +195,36 @@ public final class PlanService {
return CommonMPI.getDictionaryList(Plan.payTypeFlags);
}
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());
planList.add(plan);
return planList;
}
}
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