| @@ -234,11 +234,19 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| WxOrder orderParams = new WxOrder(); | WxOrder orderParams = new WxOrder(); | ||||
| orderParams.setOrderGroupId(order.getOrderGroupId()); | orderParams.setOrderGroupId(order.getOrderGroupId()); | ||||
| orderParams.setCUserId(user.getId()); | orderParams.setCUserId(user.getId()); | ||||
| //orderParams.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()); | |||||
| int count = wxOrderMapper.selectCount(new QueryWrapper(orderParams)); | |||||
| if (count > 0) { | |||||
| logger.error("重复的拼团>>>" + order); | |||||
| throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_ATTEND); | |||||
| List<WxOrder> olist = wxOrderMapper.findList(orderParams); | |||||
| if (olist == null || olist.size() <=0 ) { | |||||
| throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"未查询到参团订单[user:"+user.getId()+",groupId:"+order.getOrderGroupId()+"]"); | |||||
| } | |||||
| if (olist.size() != 1) { | |||||
| throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"参团订单多条[user:"+user.getId()+",groupId:"+order.getOrderGroupId()+"]"); | |||||
| } | |||||
| WxOrder orderq = olist.get(0); | |||||
| if (null == orderq) { | |||||
| throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FAILD.getCode(),"未查询到参团订单[user:"+user.getId()+",groupId:"+order.getOrderGroupId()+"]"); | |||||
| } | |||||
| if (orderq.getOrderStatus()==EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()) { | |||||
| throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_ATTEND.getCode(),"不能重复参团订单[user:"+user.getId()+",groupId:"+order.getOrderGroupId()+"]"); | |||||
| } | } | ||||
| } | } | ||||