'修复已知问题'

dev-discount
199901012 4 years ago
parent d50d518157
commit d541bea107
  1. 27
      hai-cweb/src/main/java/com/cweb/controller/HighCouponController.java
  2. 7
      hai-service/src/main/java/com/hai/service/HighUserCouponService.java
  3. 12
      hai-service/src/main/java/com/hai/service/impl/HighUserCouponServiceImpl.java

@ -172,6 +172,33 @@ public class HighCouponController {
} }
} }
@RequestMapping(value = "/getUserNewCouponDetail", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户最新的卡卷详细")
public ResponseData getUserNewCouponDetail(@RequestParam(name = "couponId", required = true) Long couponId,
HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
// 查询最新一张可用的卡券
HighUserCoupon newCoupon = highUserCouponService.getUserNewCoupon(userInfoModel.getHighUser().getId(), couponId);
if (newCoupon != null) {
Map<String, Object> map = new HashMap<>();
map.put("highUserCoupon", newCoupon);
map.put("couponInfo", highCouponService.getCouponById(newCoupon.getCouponId()));
map.put("couponCodeInfo", highCouponCodeService.getCouponCodeById(newCoupon.getCouponCodeId()));
return ResponseMsgUtil.success(map);
}
return ResponseMsgUtil.success(null);
} catch (Exception e) {
log.error("HighCouponController --> getUserNewCouponDetail() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/againReceiveCoupon", method = RequestMethod.GET) @RequestMapping(value = "/againReceiveCoupon", method = RequestMethod.GET)
@ResponseBody @ResponseBody

@ -49,6 +49,13 @@ public interface HighUserCouponService {
**/ **/
HighUserCoupon getDetailById(Long userCouponId); HighUserCoupon getDetailById(Long userCouponId);
/**
* @Author 胡锐
* @Description 查询最新一张可用的卡券
* @Date 2021/4/20 21:01
**/
HighUserCoupon getUserNewCoupon(Long userId,Long couponId);
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 查询用户列表 * @Description 查询用户列表

@ -76,6 +76,18 @@ public class HighUserCouponServiceImpl implements HighUserCouponService {
return highUserCouponMapper.selectByPrimaryKey(userCouponId); return highUserCouponMapper.selectByPrimaryKey(userCouponId);
} }
@Override
public HighUserCoupon getUserNewCoupon(Long userId, Long couponId) {
HighUserCouponExample example = new HighUserCouponExample();
example.createCriteria().andUserIdEqualTo(userId).andCouponIdEqualTo(couponId).andStatusEqualTo(1);
example.setOrderByClause("create_time desc");
List<HighUserCoupon> couponList = highUserCouponMapper.selectByExample(example);
if (couponList != null && couponList.size() > 0) {
return couponList.get(0);
}
return null;
}
@Override @Override
public List<HighUserCoupon> getUserCouponList(Map<String, Object> map) { public List<HighUserCoupon> getUserCouponList(Map<String, Object> map) {
HighUserCouponExample example = new HighUserCouponExample(); HighUserCouponExample example = new HighUserCouponExample();

Loading…
Cancel
Save