Browse Source

[BUG][ID1001405][云端:version:.978.1416商铺物业和多经的租赁输入数过大会成负数需要限制]

release_toaliyun_real
gongbiao 7 years ago
parent
commit
79fa8b5208
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java

+ 6
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -194,10 +194,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
if (null == record.getDeposit()) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "押金不能为空");
}
if (record.getPrice().intValue() <= 0) {
if (record.getPrice().longValue() <= 0) {
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "物业费要大于0");
}
if (record.getDeposit().intValue() <= 0) {
if (record.getDeposit().longValue() <= 0) {
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "押金要大于0");
}

@@ -440,7 +440,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
double priceD = price;
for (int i = 1; i < size; i++) {
priceD = priceD + priceD * integers.get(i) / 10000.0;
priceArr[i] = new BigDecimal(priceD).setScale(0, RoundingMode.HALF_EVEN).intValue();
priceArr[i] = new BigDecimal(priceD).setScale(0, RoundingMode.HALF_EVEN).longValue();
}
int month = 12;
int divide = lease / month;
@@ -551,7 +551,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
instance.add(dayType, extralease);
instance.add(Calendar.DAY_OF_MONTH, -1);
wxBillProperty.setEndtime(instance.getTime());
needpay = price * extralease;
needpay = new BigDecimal(price).multiply(new BigDecimal(extralease)).longValue();
}

//自然月,开始日期、缴款日,结束日期
@@ -597,7 +597,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
}
DecimalFormat format = new DecimalFormat("0");
needpay = Integer.parseInt(format.format(needPayDouble)); //分做四舍五入
needpay = Long.parseLong(format.format(needPayDouble)); //分做四舍五入
}else if(i < paycount - 1){//中间周期
Date receiveDate = DateUtils.getFirstDayOfNextMonth(startdate,receivePeriod * i);
wxBillProperty.setReceiveDate(receiveDate);
@@ -671,7 +671,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
}
DecimalFormat format = new DecimalFormat("0");
needpay = Integer.parseInt(format.format(needPayDouble)); //分做四舍五入
needpay = Long.parseLong(format.format(needPayDouble)); //分做四舍五入
}
}



Loading…
Cancel
Save