From c3ccc2029942a1f80097a4fe1b58b46a3ef02b16 Mon Sep 17 00:00:00 2001 From: hupeng Date: Fri, 22 Mar 2019 16:44:51 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BB=A3=E7=A0=81][=E4=BC=98=E5=8C=96]:?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8D=A1=E5=88=B8=E5=88=97=E8=A1=A8=E4=B8=AD?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E9=87=8D=E5=A4=8D=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxCouponController.java | 43 +-- .../com/iformall/mapper/WxCouponMapper.java | 4 +- .../com/iformall/service/WxCouponService.java | 12 +- .../service/impl/WxCouponServiceImpl.java | 21 +- .../main/resources/mapper/WxCouponMapper.xml | 277 +----------------- 5 files changed, 19 insertions(+), 338 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java index a611515d9..9f90283b4 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java @@ -27,42 +27,6 @@ public class WxCouponController extends BaseController { @Autowired private WxCouponService wxCouponService; - @ApiOperation("分页列表接口") - @GetMapping("listCoupon") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - public ResultData listCoupon(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { - logger.debug("[" + getIpAddr() + "] WxCouponController::listCoupon"); - if (wxCoupon == null) wxCoupon = new WxCoupon(); - wxCoupon.setTenantId(getTenantId()); - return wxCouponService.listType(wxCoupon, pageNum, pageSize, 0); //券列表 - } - - @ApiOperation("卡分页列表接口") - @GetMapping("listCard") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - public ResultData listCard(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { - logger.debug("[" + getIpAddr() + "] WxCouponController::listCard"); - if (wxCoupon == null) wxCoupon = new WxCoupon(); - wxCoupon.setTenantId(getTenantId()); - return wxCouponService.listType(wxCoupon, pageNum, pageSize, EnumCouponType.CARD_MULTIMCH.getCode()); //卡列表 - } - - @ApiOperation("砍价分页列表接口") - @GetMapping("listPress") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - public ResultData listPress(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { - logger.debug("[" + getIpAddr() + "] WxCouponController::listPress"); - if (wxCoupon == null) wxCoupon = new WxCoupon(); - wxCoupon.setTenantId(getTenantId()); - return wxCouponService.listType(wxCoupon, pageNum, pageSize, EnumCouponType.COUPON_PRESS.getCode()); //砍价列表 - } - @ApiOperation("分页列表接口") @GetMapping("list") @ApiImplicitParams({ @@ -72,7 +36,7 @@ public class WxCouponController extends BaseController { logger.debug("[" + getIpAddr() + "] WxCouponController::list"); if (wxCoupon == null) wxCoupon = new WxCoupon(); wxCoupon.setTenantId(getTenantId()); - return wxCouponService.listType(wxCoupon, pageNum, pageSize, null); //全列表 + return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表 } @ApiOperation("新增接口") @@ -110,11 +74,6 @@ public class WxCouponController extends BaseController { return new ResultData(wxCouponService.getVoById(id)); } - @ApiOperation("卡类列表接口") - @GetMapping("findList") - public ResultData findList(@ModelAttribute WxCoupon wxCoupon) { - return new ResultData(wxCouponService.list(wxCoupon)); - } @ApiOperation("卡营销列表接口") @GetMapping("findCardCountList") diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 53883712a..15d2af352 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -10,10 +10,10 @@ public interface WxCouponMapper extends CommonMapper { List findPressData(WxCoupon wxCoupon); List findCouponData(WxCoupon wxCoupon); List findCountData(WxCoupon wxCoupon); + List findList(WxCoupon wxCoupon); - List findCardList(WxCoupon wxCoupon); List findCouponList(WxCoupon wxCoupon); - List findPressList(WxCoupon wxCoupon); + WxCouponCVo findVoDetail(@Param("id")Long id); diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index 41ea97c78..8bc4c079a 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -9,7 +9,7 @@ import com.iformall.domain.vo.WxCouponCVo; public interface WxCouponService { - ResultData listType(WxCoupon wxCoupon, Integer pageNum, Integer pageSize, Integer type); + ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize); /** * 根据实体查询分页列表 @@ -19,15 +19,7 @@ public interface WxCouponService { * @param pageSize * @return */ - PageInfo listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize, Integer type); - - /** - * 列表 - * @param record - * @return - */ - List list(WxCoupon record); - + PageInfo listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize); /** * 卡类列表,包括统计 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 19006de01..d217ca672 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -62,13 +62,14 @@ public class WxCouponServiceImpl implements WxCouponService { WxCouponChannelMapper wxCouponChannelMapper; - public ResultData listType(WxCoupon wxCoupon, Integer pageNum, Integer pageSize, Integer type) { + @Override + public ResultData list(WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { if (null == wxCoupon) wxCoupon = new WxCoupon(); wxCoupon.setSortColumns(WxCoupon.Field.Id_DESC); PageInfo page = null; if (wxCoupon.getStatus() != null && wxCoupon.getStatus() == -1) wxCoupon.setStatus(null); - page = listAsPage(wxCoupon, pageNum, pageSize, type); + page = listAsPage(wxCoupon, pageNum, pageSize); List wxCouponList = page.getList(); @@ -113,22 +114,10 @@ public class WxCouponServiceImpl implements WxCouponService { @Override - public PageInfo listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize, Integer type) { - if (type == null) { - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findList(record)); - } else if (type.equals(EnumCouponType.CARD_MULTIMCH.getCode())) { - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCardList(record)); - } else if (type.equals(EnumCouponType.COUPON_PRESS.getCode())) { - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findPressList(record)); - } else { - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponList(record)); - } + public PageInfo listAsPage(WxCoupon record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCouponList(record)); } - @Override - public List list(WxCoupon record) { - return wxCouponMapper.findList(record); - } @Override public PageInfo findCountData(WxCoupon record,Integer pageNum, Integer pageSize) { diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 95cebe1be..ea1f0853b 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -184,6 +184,7 @@ #{idItem} + and type not in @@ -201,8 +202,8 @@ - - where `type` = 100 + + and `id` = #{id} @@ -212,6 +213,10 @@ and `tenant_id` = #{tenantId} + + and `type` < 7 + + and `type` = #{type} @@ -320,140 +325,10 @@ and `press_limit_hours` = #{pressLimitHours} - - and id in - - #{idItem} - - - order by ${sortColumns} - - - - - - where `type` < 7 - - - and `id` = #{id} - - - - and `tenant_id` = #{tenantId} - - - - and `type` = #{type} - - - - and `cover_img` like concat('%', #{coverImg},'%') - - - - and `title` like concat('%', #{title},'%') - - - - and `sub_title` like concat('%', #{subTitle},'%') - - - - and `sale_price` = #{salePrice} - - - - and `use_price` = #{usePrice} - - - - and `use_limit_quantity` = #{useLimitQuantity} - - - - and `send_type` = #{sendType} - - - - and `valid_type` = #{validType} - - - - and `valid_start_date` = #{validStartDate} - - - - and `valid_end_date` = #{validEndDate} - - - - and `valid_days` = #{validDays} - - - - and `detail` like concat('%', #{detail},'%') - - - - and `price` = #{price} - - - - and `unit` = #{unit} - - - - and `remain_inventory` = #{remainInventory} - - - - and `inventory` = #{inventory} - - - - and `remark` like concat('%', #{remark},'%') - - - - and `status` = #{status} - - - - and `create_date` between #{startdate} and #{enddate} - - - - and `update_date` = #{updateDate} - - - - and `business` = #{business} - - - - and `support_transfer` = #{supportTransfer} - - - - and `subsidy_type` = #{subsidyType} - - - - and `subsidy_num` = #{subsidyNum} - - - - and `press_limit_num` = #{pressLimitNum} + + and `auto_refund` = #{autoRefund} - - and `press_limit_hours` = #{pressLimitHours} - and id in @@ -471,140 +346,6 @@ - - where `type` = 8 - - - and `id` = #{id} - - - - and `tenant_id` = #{tenantId} - - - - and `type` = #{type} - - - - and `cover_img` like concat('%', #{coverImg},'%') - - - - and `title` like concat('%', #{title},'%') - - - - and `sub_title` like concat('%', #{subTitle},'%') - - - - and `sale_price` = #{salePrice} - - - - and `use_price` = #{usePrice} - - - - and `use_limit_quantity` = #{useLimitQuantity} - - - - and `send_type` = #{sendType} - - - - and `valid_type` = #{validType} - - - - and `valid_start_date` = #{validStartDate} - - - - and `valid_end_date` = #{validEndDate} - - - - and `valid_days` = #{validDays} - - - - and `detail` like concat('%', #{detail},'%') - - - - and `price` = #{price} - - - - and `unit` = #{unit} - - - - and `remain_inventory` = #{remainInventory} - - - - and `inventory` = #{inventory} - - - - and `remark` like concat('%', #{remark},'%') - - - - and `status` = #{status} - - - - and `create_date` between #{startdate} and #{enddate} - - - - and `update_date` = #{updateDate} - - - - and `business` = #{business} - - - - and `support_transfer` = #{supportTransfer} - - - - and `subsidy_type` = #{subsidyType} - - - - and `subsidy_num` = #{subsidyNum} - - - - and `press_limit_num` = #{pressLimitNum} - - - - and `press_limit_hours` = #{pressLimitHours} - - - - and id in - - #{idItem} - - - order by ${sortColumns} - - -