| @@ -1,43 +1,39 @@ | |||||
| package com.simple.controller; | 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.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCouponCar; | import com.simple.domain.po.WxCouponCar; | ||||
| import com.simple.service.WxCouponCarService; | import com.simple.service.WxCouponCarService; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponCar") | @RequestMapping("wxCouponCar") | ||||
| @Api(description = "停车发券相关接口") | @Api(description = "停车发券相关接口") | ||||
| public class WxCouponCarController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxCouponCarController extends BaseController { | |||||
| @Autowired | |||||
| private WxCouponCarService wxCouponCarService; | private WxCouponCarService wxCouponCarService; | ||||
| private Logger logger = Logger.getLogger(WxCouponCarController.class); | private Logger logger = Logger.getLogger(WxCouponCarController.class); | ||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @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<WxCouponCar> page = wxCouponCarService.listAsPage(wxCouponCar, pageNum, pageSize); | final PageInfo<WxCouponCar> page = wxCouponCarService.listAsPage(wxCouponCar, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCouponCar wxCouponCar) { | public ResultData add(@RequestBody WxCouponCar wxCouponCar) { | ||||
| //Assert.notNull(wxCouponCar.getName(), "角色名不能为空"); | //Assert.notNull(wxCouponCar.getName(), "角色名不能为空"); | ||||
| @@ -55,19 +51,18 @@ public class WxCouponCarController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @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) { | public ResultData delete(Long id) { | ||||
| wxCouponCarService.deleteById(id); | wxCouponCarService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | 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) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponCarService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponCarService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -105,6 +105,9 @@ public class WxCoupon implements Serializable { | |||||
| /*面额**/ | /*面额**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | ||||
| private Integer price; | private Integer price; | ||||
| /*单位**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="单位(0:rmb分 1:小时)",name="unit") | |||||
| private Integer unit; | |||||
| /*剩余库存**/ | /*剩余库存**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | ||||
| private Integer remainInventory; | private Integer remainInventory; | ||||
| @@ -228,6 +231,12 @@ public class WxCoupon implements Serializable { | |||||
| public void setPrice(Integer _price) { | public void setPrice(Integer _price) { | ||||
| price = _price; | price = _price; | ||||
| } | } | ||||
| public Integer getUnit() { | |||||
| return unit; | |||||
| } | |||||
| public void setUnit(Integer _unit) { | |||||
| unit = _unit; | |||||
| } | |||||
| public Integer getRemainInventory() { | public Integer getRemainInventory() { | ||||
| return remainInventory; | return remainInventory; | ||||
| } | } | ||||
| @@ -20,6 +20,7 @@ | |||||
| <result column="valid_days" jdbcType="INTEGER" property="validDays" /> | <result column="valid_days" jdbcType="INTEGER" property="validDays" /> | ||||
| <result column="detail" jdbcType="VARCHAR" property="detail" /> | <result column="detail" jdbcType="VARCHAR" property="detail" /> | ||||
| <result column="price" jdbcType="INTEGER" property="price" /> | <result column="price" jdbcType="INTEGER" property="price" /> | ||||
| <result column="unit" jdbcType="INTEGER" property="unit" /> | |||||
| <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" /> | <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" /> | ||||
| <result column="inventory" jdbcType="INTEGER" property="inventory" /> | <result column="inventory" jdbcType="INTEGER" property="inventory" /> | ||||
| <result column="remark" jdbcType="VARCHAR" property="remark" /> | <result column="remark" jdbcType="VARCHAR" property="remark" /> | ||||
| @@ -30,7 +31,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `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` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -126,8 +127,13 @@ | |||||
| <if test=" null != price "> | <if test=" null != price "> | ||||
| and `price` = #{price} | and `price` = #{price} | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != unit "> | |||||
| and `unit` = #{unit} | |||||
| </if> | |||||
| <if test=" null != remainInventory "> | <if test=" null != remainInventory "> | ||||
| and `remain_inventory` = #{remainInventory} | and `remain_inventory` = #{remainInventory} | ||||
| @@ -204,6 +210,7 @@ | |||||
| <result column="valid_days" jdbcType="INTEGER" property="validDays" /> | <result column="valid_days" jdbcType="INTEGER" property="validDays" /> | ||||
| <result column="detail" jdbcType="VARCHAR" property="detail" /> | <result column="detail" jdbcType="VARCHAR" property="detail" /> | ||||
| <result column="price" jdbcType="INTEGER" property="price" /> | <result column="price" jdbcType="INTEGER" property="price" /> | ||||
| <result column="unit" jdbcType="INTEGER" property="unit" /> | |||||
| <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" /> | <result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" /> | ||||
| <result column="inventory" jdbcType="INTEGER" property="inventory" /> | <result column="inventory" jdbcType="INTEGER" property="inventory" /> | ||||
| <result column="remark" jdbcType="VARCHAR" property="remark" /> | <result column="remark" jdbcType="VARCHAR" property="remark" /> | ||||
| @@ -226,7 +233,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allCUserColumns"> | <sql id="allCUserColumns"> | ||||
| 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, | m.img_url,m.name,m.link_phone,m.status, | ||||
| s.addr,s.shop_number,s.baidu_poi, | s.addr,s.shop_number,s.baidu_poi, | ||||
| mb.building_name,mf.floor_name, | mb.building_name,mf.floor_name, | ||||
| @@ -261,7 +268,7 @@ | |||||
| <sql id="allCUserColumns2"> | <sql id="allCUserColumns2"> | ||||
| 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, | m.img_url,m.name,m.link_phone,m.status, | ||||
| s.addr,s.shop_number,s.baidu_poi, | s.addr,s.shop_number,s.baidu_poi, | ||||
| mb.building_name,mf.floor_name | mb.building_name,mf.floor_name | ||||