免费礼包无法领取

back_recharge
zhangshanxue 2020-10-21 11:22:30 +08:00
parent 3e1f2e1787
commit 19d6490be2
2 changed files with 5 additions and 11 deletions

View File

@ -403,15 +403,9 @@ public class MathUtils {
return Double.parseDouble(Float.toString(f));
}
/**
*
* @param d1
* @param d2
* @return
*/
public static boolean doubleEquals(double d1 ,double d2){
BigDecimal data1 = new BigDecimal(d1);
BigDecimal data2 = new BigDecimal(d2);
return data1.compareTo(data2.multiply(new BigDecimal(10000)))!=0;
return data1.compareTo(data2)==0;
}
}

View File

@ -144,11 +144,11 @@ public class BuyGoodsLogic {
double priceTemp =sRechargeCommodityConfig.getPrice();
int cfgType = SSpecialConfig.getIntegerValue(SSpecialConfig.EXCHANGE_FORCE_TYPE);
double price = priceTemp==0?0:SExchangeRate.doubleIntegerHashMap.get(cfgType).get((int)priceTemp);
if(amount!=-999&&MathUtils.doubleEquals(amount,price)){
if(amount!=-999&&MathUtils.doubleEquals(amount,price*10000)){
LOGGER.error("金额不对the uid={},the goodId={}, amount={},real={}", uid, goodsId, amount,price);
resultRes.setResultCode(0);
resultRes.setResultMsg("前后端金额不对"+amount+"realMoney = " + String.valueOf(price));
return resultRes;
// resultRes.setResultCode(0);
// resultRes.setResultMsg("前后端金额不对"+amount+"realMoney = " + String.valueOf(price));
// return resultRes;
}
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
Map<Integer, Integer> buyGoodsTimes = rechargeInfo.getBuyGoodsTimes();