Browse Source

[C端][修改]:修改coupon详情页的接口

release_toaliyun_real
hupeng 7 years ago
parent
commit
d3e28b29cf
5 changed files with 19 additions and 23 deletions
  1. +5
    -6
      mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java
  2. +2
    -1
      mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java
  3. +2
    -1
      mallinkService/src/main/java/com/simple/service/WxCouponService.java
  4. +2
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxCouponServiceImpl.java
  5. +8
    -14
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 5
- 6
mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java View File

@@ -1,6 +1,7 @@
package com.simple.controller;

import com.simple.common.ErrorCode;
import com.simple.domain.po.WxCouponChannel;
import com.simple.domain.vo.WxCouponCVo;
import io.swagger.annotations.Api;
import org.apache.log4j.Logger;
@@ -29,12 +30,10 @@ public class WxCouponController extends BaseController {

@ApiOperation("根据id查询接口")
@GetMapping("/detail")
@ApiImplicitParam(name = "couponId", value = "id", dataType = "String", paramType = "query", required = true)
public ResultData detail(String couponId) {
WxCoupon wxCoupon = new WxCoupon();
wxCoupon.setTenantId(getTenantId());
wxCoupon.setId(Long.valueOf(couponId));
WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCoupon);
public ResultData detail(@ModelAttribute WxCouponChannel wxCouponChannel) {
if(wxCouponChannel == null) wxCouponChannel = new WxCouponChannel();
wxCouponChannel.setTenantId(getTenantId());
WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCouponChannel);
if (wxCouponCVo == null)
return new ResultData(ErrorCode.COUPON_IS_EMPTY);



+ 2
- 1
mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java View File

@@ -2,6 +2,7 @@ package com.simple.mapper;

import java.util.*;
import com.simple.common.CommonMapper;
import com.simple.domain.po.WxCouponChannel;
import com.simple.domain.vo.WxCouponCVo;
import org.apache.ibatis.annotations.Param;
import com.simple.domain.po.WxCoupon;
@@ -15,6 +16,6 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
List<WxCoupon> findCanSendList(WxCoupon wxCoupon);


WxCouponCVo selectDetailForCUser(WxCoupon wxCoupon);
WxCouponCVo selectDetailForCUser(WxCouponChannel wxCouponChannel);
}

+ 2
- 1
mallinkService/src/main/java/com/simple/service/WxCouponService.java View File

@@ -3,6 +3,7 @@ package com.simple.service;
import java.util.*;
import com.github.pagehelper.PageInfo;
import com.simple.domain.po.WxCoupon;
import com.simple.domain.po.WxCouponChannel;
import com.simple.domain.vo.WxCouponCVo;

public interface WxCouponService {
@@ -61,6 +62,6 @@ public interface WxCouponService {
PageInfo<WxCoupon> findCanSendList(WxCoupon record, Integer pageIndex, Integer pageSize);


WxCouponCVo selectDetailForCUser(WxCoupon record);
WxCouponCVo selectDetailForCUser(WxCouponChannel record);

}

+ 2
- 1
mallinkService/src/main/java/com/simple/service/impl/WxCouponServiceImpl.java View File

@@ -4,6 +4,7 @@ import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.domain.po.WxCoupon;
import com.simple.domain.po.WxCouponChannel;
import com.simple.domain.vo.WxCouponCVo;
import com.simple.mapper.WxCouponMapper;
import com.simple.service.WxCouponService;
@@ -62,7 +63,7 @@ public class WxCouponServiceImpl implements WxCouponService {
}

@Override
public WxCouponCVo selectDetailForCUser(WxCoupon record) {
public WxCouponCVo selectDetailForCUser(WxCouponChannel record) {
return wxCouponMapper.selectDetailForCUser(record);
}



+ 8
- 14
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -510,30 +510,24 @@
mb.building_name,mf.floor_name
</sql>

<sql id="listCUserColumns">
c.id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.remain_inventory,c.inventory,c.business,
m.name
</sql>


<select id="selectDetailForCUser" parameterType="com.simple.domain.po.WxCoupon" resultMap="CUserResultMap">
<select id="selectDetailForCUser" parameterType="com.simple.domain.po.WxCouponChannel" resultMap="CUserResultMap">
select <include refid="allCUserColumns" />
from wx_coupon c,wx_merchant m,
from wx_coupon_channel cc,
wx_coupon c,wx_merchant m,
wx_shop s,wx_merchant_shop ms,
wx_mall_building mb,
wx_mall_floor mf
where c.merchant_id = m.id
<if test=" null != id ">
and c.id = #{id}
<if test=" null != couponId ">
and c.id = #{couponId}
and cc.coupon_id = #{couponId}
</if>
<if test=" null != tenantId ">
and c.tenant_id = #{tenantId}
</if>
<if test=" null != business ">
and c.business like concat('%', #{business},'%')
</if>
<if test=" null != type ">
and c.type = #{type}
<if test=" null != targetAd ">
and cc.target_ad = #{targetAd}
</if>
and ms.merchant_id = m.id
and ms.shop_id = s.id


Loading…
Cancel
Save