소스 검색

[统计][修改][调整收缴率百分比精度]

release_toaliyun_real
luozukai 7 년 전
부모
커밋
234140d5a3
1개의 변경된 파일25개의 추가작업 그리고 20개의 파일을 삭제
  1. +25
    -20
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java

+ 25
- 20
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java 파일 보기

@@ -2314,14 +2314,13 @@ public class WxChartServiceImpl implements WxChartDataService {
params.put("enddate", DateUtils.date2String(endDate,"yyyy-MM-dd") + " 23:59:59");
Map<String, Object> payinfo = wxBillRentMapper.queryPayInfoTotal(params);
if (payinfo != null) {
BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay");
BigDecimal pay = (BigDecimal) payinfo.get("pay");
Double receivepay = (Double) payinfo.get("receivepay");
Double pay = (Double) payinfo.get("pay");
if (receivepay.doubleValue() > 0) {
BigDecimal divide = pay.divide(receivepay, 8, BigDecimal.ROUND_HALF_UP);
double zjcjl = divide.multiply(new BigDecimal(100)).doubleValue();
Double divide = pay/receivepay*100;
datamap.put("rentysje", receivepay);
datamap.put("rentssje", pay);
datamap.put("rentzjsjl", (double) Math.round(zjcjl * 100) / 100);
datamap.put("rentzjsjl", formatDouble(divide));
} else {
datamap.put("rentysje", 0);
datamap.put("rentssje", 0);
@@ -2336,14 +2335,13 @@ public class WxChartServiceImpl implements WxChartDataService {
//物业费收缴率
payinfo = wxBillPropertyMapper.queryPayInfoTotal(params);
if (payinfo != null) {
BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay");
BigDecimal pay = (BigDecimal) payinfo.get("pay");
Double receivepay = (Double) payinfo.get("receivepay");
Double pay = (Double) payinfo.get("pay");
if (receivepay.doubleValue() > 0) {
BigDecimal divide = pay.divide(receivepay, 8, BigDecimal.ROUND_HALF_UP);
double zjcjl = divide.multiply(new BigDecimal(100)).doubleValue();
Double divide = pay/receivepay*100;
datamap.put("propertyysje", receivepay);
datamap.put("propertyssje", pay);
datamap.put("propertyzjsjl", (double) Math.round(zjcjl * 100) / 100);
datamap.put("propertyzjsjl", formatDouble(divide));
} else {
datamap.put("propertyysje", 0);
datamap.put("propertyssje", 0);
@@ -2358,14 +2356,13 @@ public class WxChartServiceImpl implements WxChartDataService {
//押金收缴率
payinfo = wxBillDepositMapper.queryPayInfoAllTotal(params);
if (payinfo != null) {
BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay");
BigDecimal pay = (BigDecimal) payinfo.get("pay");
Double receivepay = (Double) payinfo.get("receivepay");
Double pay = (Double) payinfo.get("pay");
if (receivepay.doubleValue() > 0) {
BigDecimal divide = pay.divide(receivepay, 8, BigDecimal.ROUND_HALF_UP);
double zjcjl = divide.multiply(new BigDecimal(100)).doubleValue();
Double divide = pay/receivepay* 100;
datamap.put("depositysje", receivepay);
datamap.put("depositssje", pay);
datamap.put("depositzjsjl", (double) Math.round(zjcjl * 100) / 100);
datamap.put("depositzjsjl", formatDouble(divide));
} else {
datamap.put("depositysje", 0);
datamap.put("depositssje", 0);
@@ -2380,14 +2377,13 @@ public class WxChartServiceImpl implements WxChartDataService {
//其他费用收缴率
payinfo = wxBillOtherMapper.queryPayInfoTotal(params);
if (payinfo != null) {
BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay");
BigDecimal pay = (BigDecimal) payinfo.get("pay");
Double receivepay = (Double) payinfo.get("receivepay");
Double pay = (Double) payinfo.get("pay");
if (receivepay.doubleValue() > 0) {
BigDecimal divide = pay.divide(receivepay, 8, BigDecimal.ROUND_HALF_UP);
double zjcjl = divide.multiply(new BigDecimal(100)).doubleValue();
Double divide = pay/receivepay*100;
datamap.put("otherysje", receivepay);
datamap.put("otherssje", pay);
datamap.put("otherzjsjl", (double) Math.round(zjcjl * 100) / 100);
datamap.put("otherzjsjl",formatDouble(divide));
} else {
datamap.put("otherysje", 0);
datamap.put("otherssje", 0);
@@ -2462,6 +2458,15 @@ public class WxChartServiceImpl implements WxChartDataService {
return new ResultData(datamap);
}

public static double formatDouble(Double d){
String s = d+"";
String lt = s.substring(s.indexOf("."),s.length());
if(lt.length() >3){
s = s.substring(0,s.indexOf(".")+3);
}
return Double.parseDouble(s);
}

/**
* 营销数据
* @param tenantId


불러오는 중...
취소
저장