瀏覽代碼

调整查询是否中奖

xubh 5 年之前
父節點
當前提交
48f87e857d
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      src/main/java/com/minpay/shouhuo/orderaction/OrderAction.java

+ 12 - 0
src/main/java/com/minpay/shouhuo/orderaction/OrderAction.java

@@ -13,6 +13,7 @@ import com.minpay.common.util.CommonUtil;
 import com.minpay.common.util.RegexUtil;
 import com.minpay.db.table.mapper.VmOrderDetailsMapper;
 import com.minpay.db.table.mapper.VmOrderDrawDetailMapper;
+import com.minpay.db.table.mapper.VmOrderInfMapper;
 import com.minpay.db.table.mapper.VmProductInfMapper;
 import com.minpay.db.table.model.*;
 import com.minpay.db.table.own.mapper.OrderMapper;
@@ -210,6 +211,17 @@ public class OrderAction implements IMINAction{
 		MINActionResult res = new MINActionResult();
 		//获取操作员信息
 		User user = session.getUser();
+
+		VmOrderInf vmOrderInf = Service.lookup(IMINDataBaseService.class)
+										.getMybatisMapper(VmOrderInfMapper.class)
+										.selectByPrimaryKey(orderId);
+		if(vmOrderInf == null){
+			throw new MINBusinessException("无此订单");
+		}
+		if(!"00".equals(vmOrderInf.getState())){
+			throw new MINBusinessException("订单没有支付成功!");
+		}
+
 		//新中奖详情
 		VmOrderDetailsExample detailExample = new VmOrderDetailsExample();
 		detailExample.createCriteria().andOrderIdEqualTo(orderId).andChannelEqualTo(user.getChannel());