Sfoglia il codice sorgente

[券详情][修改]:订单下单接口调试

release_toaliyun_real
Stormeye.Wu 7 anni fa
parent
commit
2eb9a0c0f5
2 ha cambiato i file con 24 aggiunte e 3 eliminazioni
  1. +17
    -3
      mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java
  2. +7
    -0
      mallinkCApi/src/main/java/com/simple/controller/WxOrderController.java

+ 17
- 3
mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java Vedi File

@@ -4,6 +4,7 @@ import com.simple.common.ErrorCode;
import com.simple.domain.po.WxCouponChannel; import com.simple.domain.po.WxCouponChannel;
import com.simple.domain.vo.WxCouponCVo; import com.simple.domain.vo.WxCouponCVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@@ -28,10 +29,23 @@ public class WxCouponController extends BaseController {
@Autowired @Autowired
private WxCouponService wxCouponService; private WxCouponService wxCouponService;


@ApiOperation("根据id查询接口")
@ApiOperation("根据id(couponChannel)查询接口")
@GetMapping("/detail") @GetMapping("/detail")
public ResultData detail(@ModelAttribute WxCouponChannel wxCouponChannel) {
if(wxCouponChannel == null) wxCouponChannel = new WxCouponChannel();
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "couponChannelId", dataType = "String", paramType = "query", required = true)})
public ResultData detail(String id) {
if (StringUtils.isBlank(id)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id为空");
}
Long couponChannelId = 0L;
try {
couponChannelId = Long.valueOf(id);
} catch (NumberFormatException e) {
logger.error("id转换失败" + id);
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id转换失败" + id);
}
WxCouponChannel wxCouponChannel = new WxCouponChannel();
wxCouponChannel.setId(couponChannelId);
wxCouponChannel.setTenantId(getTenantId()); wxCouponChannel.setTenantId(getTenantId());
WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCouponChannel); WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCouponChannel);
if (wxCouponCVo == null) if (wxCouponCVo == null)


+ 7
- 0
mallinkCApi/src/main/java/com/simple/controller/WxOrderController.java Vedi File

@@ -113,6 +113,13 @@ public class WxOrderController extends BaseController {
} }
if (StringUtils.isBlank(couponIdStr)) { if (StringUtils.isBlank(couponIdStr)) {
couponId = wxCouponChannel.getCouponId(); couponId = wxCouponChannel.getCouponId();
} else {
try {
couponId = Long.valueOf(couponIdStr);
} catch (NumberFormatException e) {
logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage());
return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage());
}
} }
WxCUser user = getUser(); WxCUser user = getUser();




Caricamento…
Annulla
Salva