|
@@ -1,6 +1,7 @@
|
|
|
package com.minpay.common.service.impl;
|
|
package com.minpay.common.service.impl;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
+import java.util.Random;
|
|
|
|
|
|
|
|
import com.min.util.CommonUtil;
|
|
import com.min.util.CommonUtil;
|
|
|
import com.minpay.common.bean.User;
|
|
import com.minpay.common.bean.User;
|
|
@@ -16,6 +17,7 @@ import com.startup.minpay.frame.service.base.Service;
|
|
|
import com.startup.minpay.frame.session.MINSession;
|
|
import com.startup.minpay.frame.session.MINSession;
|
|
|
import com.startup.minpay.frame.target.MINComponent;
|
|
import com.startup.minpay.frame.target.MINComponent;
|
|
|
|
|
|
|
|
|
|
+import com.startup.minpay.util.Log;
|
|
|
import net.sf.json.JSONArray;
|
|
import net.sf.json.JSONArray;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -146,13 +148,34 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
proPrice = String.valueOf(proInf.getSallPrice());
|
|
proPrice = String.valueOf(proInf.getSallPrice());
|
|
|
}else if("01".equals(proType)){
|
|
}else if("01".equals(proType)){
|
|
|
//proNumsAndPayNum = CommonUtil.multiply(proNumsAndPayNum, payNumber);
|
|
//proNumsAndPayNum = CommonUtil.multiply(proNumsAndPayNum, payNumber);
|
|
|
- if(!CommonUtil.isEmpty(map.get("proPrice"))){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /*if(!commonutil.isempty(map.get("proprice"))){
|
|
|
//抽奖价格不为空的用抽奖价
|
|
//抽奖价格不为空的用抽奖价
|
|
|
- proPrice = String.valueOf(map.get("proPrice"));
|
|
|
|
|
|
|
+ proprice = string.valueof(map.get("proprice"));
|
|
|
}else{
|
|
}else{
|
|
|
//抽奖商品用游戏价
|
|
//抽奖商品用游戏价
|
|
|
- proPrice = String.valueOf(proInf.getGamePrice());
|
|
|
|
|
|
|
+ proprice = string.valueof(proinf.getgameprice());
|
|
|
|
|
+ }*/
|
|
|
|
|
+
|
|
|
|
|
+ String paymentType = equInf.getPaymentType();
|
|
|
|
|
+ String paymentAmt = equInf.getPayment();
|
|
|
|
|
+ if(CommonUtil.isEmpty(paymentType) || CommonUtil.isEmpty(paymentAmt) ){
|
|
|
|
|
+ throw new MINBusinessException("机器未设置游戏金额,请联系商户");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if("00".equals(paymentType)){//随机
|
|
|
|
|
+ Random aa = new Random();
|
|
|
|
|
+ int randomNum = aa.nextInt(100);
|
|
|
|
|
+ Log.info("=============详情编号:"+detailId+"随机数:"+randomNum);
|
|
|
|
|
+ if(randomNum > 50){
|
|
|
|
|
+ proPrice = CommonUtil.multiply(paymentAmt,"1.15");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ proPrice = CommonUtil.multiply(paymentAmt,"0.85");
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if("01".equals(paymentType)){ //固定
|
|
|
|
|
+ proPrice = paymentAmt;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
//查询商品详情
|
|
//查询商品详情
|
|
|
VmProductInf vmProductInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmProductInfMapper.class).selectByPrimaryKey(proInf.getProductId());
|
|
VmProductInf vmProductInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmProductInfMapper.class).selectByPrimaryKey(proInf.getProductId());
|
|
@@ -160,7 +183,6 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
throw new MINBusinessException("无此货");
|
|
throw new MINBusinessException("无此货");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 计算总金额
|
|
// 计算总金额
|
|
|
String amount = CommonUtil.multiply(proPrice, proNumsAndPayNum);
|
|
String amount = CommonUtil.multiply(proPrice, proNumsAndPayNum);
|
|
|
//初始化订单详情信息
|
|
//初始化订单详情信息
|
|
@@ -205,4 +227,6 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
return ordId;
|
|
return ordId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|