diff --git a/mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java b/mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java index 9e85e2383..66c895b16 100644 --- a/mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java @@ -169,10 +169,8 @@ public class WxCouponController extends BaseController if (null == wxCoupon) wxCoupon = new WxCoupon(); wxCoupon.setTenantId(getTenantId()); wxCoupon.setStatus(0); - PageInfo page = null; - page = wxCouponService.findCanSendList(wxCoupon, pageNum, pageSize); - return new ResultData(page); + return new ResultData(wxCouponService.listAsPage(wxCoupon, pageNum, pageSize)); } diff --git a/mallinkCApi/src/main/java/com/simple/controller/WxCampaignController.java b/mallinkCApi/src/main/java/com/simple/controller/WxCampaignController.java index f60988ad2..99478cea9 100644 --- a/mallinkCApi/src/main/java/com/simple/controller/WxCampaignController.java +++ b/mallinkCApi/src/main/java/com/simple/controller/WxCampaignController.java @@ -63,7 +63,7 @@ public class WxCampaignController extends BaseController WxCoupon wxCoupon = new WxCoupon(); wxCoupon.setTenantId(getTenantId()); wxCoupon.setIds(list); - wxCoupon.setStatus(1); + wxCoupon.setStatus(0); List couponlist = wxCouponService.findList(wxCoupon); wxCampaign.setCoupons(couponlist); } diff --git a/mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java b/mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java index 8c1e56738..d42da68d7 100644 --- a/mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java +++ b/mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java @@ -29,11 +29,38 @@ public class WxCouponController extends BaseController { @Autowired private WxCouponService wxCouponService; + @ApiOperation("根据id(coupon)查询接口") + @GetMapping("/detailC") + @ApiImplicitParams({ + @ApiImplicitParam(name = "couponId", value = "couponChannelId", dataType = "String", paramType = "query", required = true)}) + public ResultData detail(String couponId) { + if (StringUtils.isBlank(couponId)) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空"); + } + Long couponIdL = 0L; + try { + couponIdL = Long.valueOf(couponId); + } catch (NumberFormatException e) { + logger.error("id转换失败" + couponId); + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId转换失败" + couponId); + } + WxCoupon wxCoupon = new WxCoupon(); + wxCoupon.setId(couponIdL); + wxCoupon.setTenantId(getTenantId()); + WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCoupon); + if (wxCouponCVo == null) + return new ResultData(ErrorCode.COUPON_IS_EMPTY); + + return new ResultData(wxCouponCVo); + + } + + @ApiOperation("根据id(couponChannel)查询接口") @GetMapping("/detail") @ApiImplicitParams({ @ApiImplicitParam(name = "couponChannelId", value = "couponChannelId", dataType = "String", paramType = "query", required = true)}) - public ResultData detail(String couponChannelId) { + public ResultData detailC(String couponChannelId) { if (StringUtils.isBlank(couponChannelId)) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId为空"); } diff --git a/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java index d4b4b3a7c..9cc89637a 100644 --- a/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java @@ -11,10 +11,7 @@ public interface WxCouponMapper extends CommonMapper { List findList(WxCoupon wxCoupon); - - List findCanSendList(WxCoupon wxCoupon); - - WxCouponCVo selectDetailForCUser(WxCouponChannel wxCouponChannel); + WxCouponCVo selectDetailForCUserC(WxCoupon wxCoupon); } diff --git a/mallinkService/src/main/java/com/simple/service/WxCouponService.java b/mallinkService/src/main/java/com/simple/service/WxCouponService.java index cdfc677c8..53cee462b 100644 --- a/mallinkService/src/main/java/com/simple/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/simple/service/WxCouponService.java @@ -48,14 +48,9 @@ public interface WxCouponService { * @param id */ void deleteById(Long id); - /** - * - */ - PageInfo findCanSendList(WxCoupon record, Integer pageIndex, Integer pageSize); - WxCouponCVo selectDetailForCUser(WxCouponChannel record); - + WxCouponCVo selectDetailForCUser(WxCoupon record); ResultData updateCoupon(WxCoupon wxCoupon); } diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxCouponServiceImpl.java index bdb0ea010..66017887a 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxCouponServiceImpl.java @@ -65,15 +65,15 @@ public class WxCouponServiceImpl implements WxCouponService { wxCouponMapper.deleteByPrimaryKey(id); } - @Override - public PageInfo findCanSendList(WxCoupon record, Integer pageIndex, Integer pageSize) { - return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCanSendList(record)); - } @Override public WxCouponCVo selectDetailForCUser(WxCouponChannel record) { return wxCouponMapper.selectDetailForCUser(record); } + @Override + public WxCouponCVo selectDetailForCUser(WxCoupon record) { + return wxCouponMapper.selectDetailForCUserC(record); + } @Override @Transactional diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 3a4043c37..77fe94ae0 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -171,142 +171,7 @@ order by ${sortColumns} - - where 1 = 1 - - and `id` = #{id} - - - - - and `tenant_id` like concat('%', #{tenantId},'%') - - - - - and `merchant_id` = #{merchantId} - - - - - 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 `target_ad` = #{targetAd} - - - - - 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 `remain_inventory` = #{remainInventory} - - - - - and `inventory` = #{inventory} - - - - - and `remark` like concat('%', #{remark},'%') - - - - - and `status` =0 - - - - - and `create_date` = #{createDate} - - - - - and `update_date` = #{updateDate} - - - - - and `business` like concat('%', #{business},'%') - - - - and id in - - #{idItem} - - - order by ${sortColumns} - - - - @@ -398,6 +257,31 @@ and cc.target_ad = #{targetAd} - - + + + + + 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, + m.img_url,m.name,m.link_phone,m.status, + s.addr,s.shop_number,s.baidu_poi, + mb.building_name,mf.floor_name + + +