diff --git a/mallinkCApi/src/main/java/com/simple/controller/WxCouponCarController.java b/mallinkCApi/src/main/java/com/simple/controller/WxCouponCarController.java index eaa69c093..092b6460e 100644 --- a/mallinkCApi/src/main/java/com/simple/controller/WxCouponCarController.java +++ b/mallinkCApi/src/main/java/com/simple/controller/WxCouponCarController.java @@ -1,43 +1,39 @@ package com.simple.controller; -import io.swagger.annotations.Api; -import org.apache.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.Assert; -import org.springframework.web.bind.annotation.*; - import com.github.pagehelper.PageInfo; import com.simple.common.Result; import com.simple.common.ResultData; - import com.simple.domain.po.WxCouponCar; import com.simple.service.WxCouponCarService; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("wxCouponCar") @Api(description = "停车发券相关接口") -public class WxCouponCarController extends BaseController -{ - @Autowired +public class WxCouponCarController extends BaseController { + @Autowired private WxCouponCarService wxCouponCarService; private Logger logger = Logger.getLogger(WxCouponCarController.class); - - @ApiOperation("分页列表接口") + + @ApiOperation("分页列表接口") @GetMapping("list") - @ApiImplicitParams({ - @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), - @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) - public ResultData list(@ModelAttribute WxCouponCar wxCouponCar,Integer pageNum, Integer pageSize) { - if (null == wxCouponCar) wxCouponCar = new WxCouponCar(); + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData list(@ModelAttribute WxCouponCar wxCouponCar, Integer pageNum, Integer pageSize) { + if (null == wxCouponCar) wxCouponCar = new WxCouponCar(); final PageInfo page = wxCouponCarService.listAsPage(wxCouponCar, pageNum, pageSize); return new ResultData(page); } - @ApiOperation("新增接口") + @ApiOperation("新增接口") @PostMapping("add") public ResultData add(@RequestBody WxCouponCar wxCouponCar) { //Assert.notNull(wxCouponCar.getName(), "角色名不能为空"); @@ -55,19 +51,18 @@ public class WxCouponCarController extends BaseController @ApiOperation("根据id删除接口") @GetMapping("/del") - @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) + @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) public ResultData delete(Long id) { wxCouponCarService.deleteById(id); return new ResultData(Result.SUCCESS, "删除成功", null); } - - @ApiOperation("根据id查询接口") - @GetMapping("/findById") - @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) + + @ApiOperation("根据id查询接口") + @GetMapping("/findById") + @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) public ResultData findById(Long id) { - return new ResultData(Result.SUCCESS,"查询成功",wxCouponCarService.getById(id)); + return new ResultData(Result.SUCCESS, "查询成功", wxCouponCarService.getById(id)); } - - - + + } diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java index b654829dc..74536b3e9 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java @@ -105,6 +105,9 @@ public class WxCoupon implements Serializable { /*面额**/ @io.swagger.annotations.ApiModelProperty(value="面额",name="price") private Integer price; + /*单位**/ + @io.swagger.annotations.ApiModelProperty(value="单位(0:rmb分 1:小时)",name="unit") + private Integer unit; /*剩余库存**/ @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") private Integer remainInventory; @@ -228,6 +231,12 @@ public class WxCoupon implements Serializable { public void setPrice(Integer _price) { price = _price; } + public Integer getUnit() { + return unit; + } + public void setUnit(Integer _unit) { + unit = _unit; + } public Integer getRemainInventory() { return remainInventory; } diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 77fe94ae0..6586311f0 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -20,6 +20,7 @@ + @@ -30,7 +31,7 @@ - `id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`target_ad`,`send_type`,`valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`remain_inventory`,`inventory`,`remark`,`status`,`create_date`,`update_date`,`business` + `id`,`tenant_id`,`merchant_id`,`type`,`cover_img`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`target_ad`,`send_type`,`valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`,`remark`,`status`,`create_date`,`update_date`,`business` @@ -126,8 +127,13 @@ and `price` = #{price} - - + + + + and `unit` = #{unit} + + + and `remain_inventory` = #{remainInventory} @@ -204,6 +210,7 @@ + @@ -226,7 +233,7 @@ - c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.target_ad,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, + c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.target_ad,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, m.img_url,m.name,m.link_phone,m.status, s.addr,s.shop_number,s.baidu_poi, mb.building_name,mf.floor_name, @@ -261,7 +268,7 @@ - c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.target_ad,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, + c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.target_ad,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, m.img_url,m.name,m.link_phone,m.status, s.addr,s.shop_number,s.baidu_poi, mb.building_name,mf.floor_name