| @@ -2,7 +2,7 @@ package com.simple.controller; | |||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.dto.WxUserCoupon; | |||||
| import com.simple.domain.dto.WxUserCouponDto; | |||||
| import com.simple.service.WxUserCouponService; | import com.simple.service.WxUserCouponService; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -25,7 +25,7 @@ public class WxUserCouponController { | |||||
| @ApiOperation("查询用户卡券接口") | @ApiOperation("查询用户卡券接口") | ||||
| @PostMapping("findByStatus") | @PostMapping("findByStatus") | ||||
| public ResultData findByStatus(@RequestBody WxUserCoupon wxUserCoupon) { | |||||
| public ResultData findByStatus(@RequestBody WxUserCouponDto wxUserCoupon) { | |||||
| //根据用户id,用户卡券状态查找 | //根据用户id,用户卡券状态查找 | ||||
| if(wxUserCoupon==null||wxUserCoupon.getcUserId()==null||wxUserCoupon.getCouponStatus()==null){ | if(wxUserCoupon==null||wxUserCoupon.getcUserId()==null||wxUserCoupon.getCouponStatus()==null){ | ||||
| return new ResultData(Result.ERROR,"查询失败"); | return new ResultData(Result.ERROR,"查询失败"); | ||||
| @@ -7,7 +7,7 @@ import java.util.Date; | |||||
| * Created by syf on 2018/8/10. | * Created by syf on 2018/8/10. | ||||
| * 用户卡券 | * 用户卡券 | ||||
| */ | */ | ||||
| public class WxUserCoupon implements Serializable { | |||||
| public class WxUserCouponDto implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| private Integer couponStatus; | private Integer couponStatus; | ||||
| @@ -17,7 +17,7 @@ public class WxUserCoupon implements Serializable { | |||||
| private String couponTitle; | private String couponTitle; | ||||
| private Date validDate; | private Date validDate; | ||||
| public WxUserCoupon(){ | |||||
| public WxUserCouponDto(){ | |||||
| } | } | ||||
| public Integer getCouponStatus() { | public Integer getCouponStatus() { | ||||
| @@ -2,7 +2,7 @@ package com.simple.service; | |||||
| import com.simple.domain.dto.WxUserCoupon; | |||||
| import com.simple.domain.dto.WxUserCouponDto; | |||||
| import java.util.List; | import java.util.List; | ||||
| @@ -10,6 +10,6 @@ import java.util.List; | |||||
| * Created by syf on 2018/8/10. | * Created by syf on 2018/8/10. | ||||
| */ | */ | ||||
| public interface WxUserCouponService { | public interface WxUserCouponService { | ||||
| List<WxUserCoupon> findList(Long userId, int status); | |||||
| List<WxUserCouponDto> findList(Long userId, int status); | |||||
| } | } | ||||
| @@ -1,5 +1,5 @@ | |||||
| package com.simple.service.impl; | package com.simple.service.impl; | ||||
| import com.simple.domain.dto.WxUserCoupon; | |||||
| import com.simple.domain.dto.WxUserCouponDto; | |||||
| import com.simple.domain.po.WxCoupon; | import com.simple.domain.po.WxCoupon; | ||||
| import com.simple.domain.po.WxOrder; | import com.simple.domain.po.WxOrder; | ||||
| import com.simple.mapper.WxCouponMapper; | import com.simple.mapper.WxCouponMapper; | ||||
| @@ -31,9 +31,9 @@ public class WxUserCouponServiceImpl implements WxUserCouponService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public List<WxUserCoupon> findList(Long userId, int status) { | |||||
| public List<WxUserCouponDto> findList(Long userId, int status) { | |||||
| //TODO 待测试优化 | //TODO 待测试优化 | ||||
| List<WxUserCoupon> wxUserCoupons = new ArrayList<>(); | |||||
| List<WxUserCouponDto> wxUserCoupons = new ArrayList<>(); | |||||
| //查询订单表 | //查询订单表 | ||||
| WxOrder wxOrder = new WxOrder(); | WxOrder wxOrder = new WxOrder(); | ||||
| wxOrder.setCUserId(userId); | wxOrder.setCUserId(userId); | ||||
| @@ -52,8 +52,8 @@ public class WxUserCouponServiceImpl implements WxUserCouponService { | |||||
| } | } | ||||
| return wxUserCoupons; | return wxUserCoupons; | ||||
| } | } | ||||
| public WxUserCoupon getWxUserCoupon(WxOrder wxOrder,String title){ | |||||
| WxUserCoupon wxUserCoupon = new WxUserCoupon(); | |||||
| public WxUserCouponDto getWxUserCoupon(WxOrder wxOrder, String title){ | |||||
| WxUserCouponDto wxUserCoupon = new WxUserCouponDto(); | |||||
| wxUserCoupon.setOrderId(wxOrder.getId()); | wxUserCoupon.setOrderId(wxOrder.getId()); | ||||
| wxUserCoupon.setcUserId(wxOrder.getCUserId()); | wxUserCoupon.setcUserId(wxOrder.getCUserId()); | ||||
| wxUserCoupon.setCouponId(wxOrder.getCouponId()); | wxUserCoupon.setCouponId(wxOrder.getCouponId()); | ||||