|
@@ -187,15 +187,20 @@ public class OrderHandler {
|
|
|
//cDto.setPage(new PageBean());
|
|
|
//cDto.getPage().setPageSize(12);
|
|
|
//cDto.getPage().setPageNumber(pageNO);
|
|
|
- List<CouponItemDto> list = couponItemService.getCouponItemDtoList(cDto);
|
|
|
- for(CouponItemDto couponItemDto : list){
|
|
|
+ List<CouponItemDto> couponItemDtoList = couponItemService.getCouponItemDtoList(cDto);
|
|
|
+ List<CouponItemDto> list = new ArrayList<>();
|
|
|
+ for(CouponItemDto couponItemDto : couponItemDtoList){
|
|
|
+ boolean flag = true;
|
|
|
if(couponItemDto.getCouponIsNewPeople() == 1 && member.getUserIdentity() != 1){ //当券为新人券,用户为非会员时,需要有牙刷,结算才可以使用该券
|
|
|
- if(!disable){ //没有牙刷
|
|
|
- couponItemDto.setCouponIsUse(2);
|
|
|
- couponItemDto.setCouponNoUseReason("需要购买牙刷才能使用");
|
|
|
+ if(!disable){ //订单中没有牙刷
|
|
|
+ flag = false;
|
|
|
}
|
|
|
}
|
|
|
+ if(flag){
|
|
|
+ list.add(couponItemDto);
|
|
|
+ }
|
|
|
}
|
|
|
+ /*插入优惠券*/
|
|
|
dto.setCouponItems(list);
|
|
|
|
|
|
dto.setCartId(cartIds);// 购物车ID
|
|
@@ -493,24 +498,29 @@ public class OrderHandler {
|
|
|
public ResultMsg getOrderIntegral(@RequestParam(value = "orderId") String orderId) {
|
|
|
ResultMsg msg = new ResultMsg();
|
|
|
msg.setResultCode(ResultInfo.ERRORCODE);
|
|
|
-
|
|
|
//Integer orderStatus = cartService.selectOrderStatusByOrderId(orderId);
|
|
|
-
|
|
|
+ if(orderId == null || "".equals(orderId)){
|
|
|
+ msg.setResultCode(ResultInfo.ERRORCODE);
|
|
|
+ msg.setMessage(NameUtils.getConfig("未查询到订单信息!"));
|
|
|
+ msg.setStatus(false);
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
StayIntegral stayIntegral = new StayIntegral();
|
|
|
stayIntegral.setOrderId(orderId);
|
|
|
List<StayIntegral> listStayIntegral = useIntegralService.listStayIntegral(stayIntegral);
|
|
|
-
|
|
|
if (listStayIntegral != null && listStayIntegral.size() > 0) {
|
|
|
msg.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
msg.setMessage(NameUtils.getConfig("SUCCESSINFO"));
|
|
|
msg.setData(listStayIntegral.get(0).getStayNumber());
|
|
|
msg.setStatus(true);
|
|
|
return msg;
|
|
|
+ }else{
|
|
|
+ msg.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
+ msg.setMessage(NameUtils.getConfig("SUCCESSINFO"));
|
|
|
+ msg.setData(0);
|
|
|
+ msg.setStatus(true);
|
|
|
+ return msg;
|
|
|
}
|
|
|
- msg.setResultCode(ResultInfo.ERRORCODE);
|
|
|
- msg.setMessage(NameUtils.getConfig("ERRORINFO"));
|
|
|
- msg.setStatus(false);
|
|
|
- return msg;
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/paySuccess")
|