Просмотр исходного кода

[停车券保存][新增]:停车券新增,券新增unit支持时间单位

release_toaliyun_real
Stormeye.Wu 7 лет назад
Родитель
Сommit
ba85e3322f
3 измененных файлов: 43 добавлений и 32 удалений
  1. +22
    -27
      mallinkCApi/src/main/java/com/simple/controller/WxCouponCarController.java
  2. +9
    -0
      mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java
  3. +12
    -5
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 22
- 27
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<WxCouponCar> 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));
}


}

+ 9
- 0
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;
}


+ 12
- 5
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -20,6 +20,7 @@
<result column="valid_days" jdbcType="INTEGER" property="validDays" />
<result column="detail" jdbcType="VARCHAR" property="detail" />
<result column="price" jdbcType="INTEGER" property="price" />
<result column="unit" jdbcType="INTEGER" property="unit" />
<result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" />
<result column="inventory" jdbcType="INTEGER" property="inventory" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
@@ -30,7 +31,7 @@
</resultMap>
<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 id="dynamicWhereConditions">
@@ -126,8 +127,13 @@
<if test=" null != price ">
and `price` = #{price}
</if>
</if>

<if test=" null != unit ">
and `unit` = #{unit}

</if>

<if test=" null != remainInventory ">
and `remain_inventory` = #{remainInventory}
@@ -204,6 +210,7 @@
<result column="valid_days" jdbcType="INTEGER" property="validDays" />
<result column="detail" jdbcType="VARCHAR" property="detail" />
<result column="price" jdbcType="INTEGER" property="price" />
<result column="unit" jdbcType="INTEGER" property="unit" />
<result column="remain_inventory" jdbcType="INTEGER" property="remainInventory" />
<result column="inventory" jdbcType="INTEGER" property="inventory" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
@@ -226,7 +233,7 @@
</resultMap>

<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,
s.addr,s.shop_number,s.baidu_poi,
mb.building_name,mf.floor_name,
@@ -261,7 +268,7 @@


<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,
s.addr,s.shop_number,s.baidu_poi,
mb.building_name,mf.floor_name


Загрузка…
Отмена
Сохранить