|
|
|
@@ -9,6 +9,7 @@ import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.po.WxMerchant; |
|
|
|
import com.iformall.enums.EnumCouponStatus; |
|
|
|
import com.iformall.enums.EnumMerchantStatus; |
|
|
|
import com.iformall.service.WxCouponChannelService; |
|
|
|
import com.iformall.service.WxCouponService; |
|
|
|
import com.iformall.service.WxMerchantService; |
|
|
|
@@ -146,9 +147,11 @@ public class WxCouponController extends BaseController { |
|
|
|
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) |
|
|
|
public ResultData findById(Long id) { |
|
|
|
WxCoupon c = wxCouponService.getById(id); |
|
|
|
WxMerchant merchant = wxMerchantService.getById(c.getMerchantId()); |
|
|
|
if(merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) |
|
|
|
return new ResultData(Result.ERROR, "此券的商户已禁用"); |
|
|
|
WxCounponDto dto = new WxCounponDto(); |
|
|
|
org.springframework.beans.BeanUtils.copyProperties(c, dto); |
|
|
|
WxMerchant merchant = wxMerchantService.getById(c.getMerchantId()); |
|
|
|
dto.setWxMerchant(merchant); |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", dto); |
|
|
|
} |
|
|
|
|