|
|
|
@ -118,9 +118,18 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
// 时刻跨度
|
|
|
|
String[] dtzone = new String[2]; |
|
|
|
switch (rightDate) { |
|
|
|
case "year":dtzone[0]=last5years;dtzone[1]=nowtime;break; |
|
|
|
case "month":dtzone[0]=lastyear;dtzone[1]=nowtime;break; |
|
|
|
default:dtzone[0]=lastMonth;dtzone[1]=nowtime;break; |
|
|
|
case "year": |
|
|
|
dtzone[0] = last5years; |
|
|
|
dtzone[1] = nowtime; |
|
|
|
break; |
|
|
|
case "month": |
|
|
|
dtzone[0] = lastyear; |
|
|
|
dtzone[1] = nowtime; |
|
|
|
break; |
|
|
|
default: |
|
|
|
dtzone[0] = lastMonth; |
|
|
|
dtzone[1] = nowtime; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
//委托方排名
|
|
|
|
@ -170,7 +179,7 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
//统计图
|
|
|
|
List treeMapList = new ArrayList(); |
|
|
|
List labelList = new ArrayList(); //条形图标签名称
|
|
|
|
if("year".equals(leftDate)){ //年
|
|
|
|
|
|
|
|
// 重新初始化日历
|
|
|
|
Calendar ncal = Calendar.getInstance(); |
|
|
|
ncal.getTime(); |
|
|
|
@ -180,6 +189,9 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
List ftlist = new ArrayList(); |
|
|
|
//标的金额
|
|
|
|
List bdlist = new ArrayList(); |
|
|
|
|
|
|
|
if ("year".equals(leftDate)) { //年
|
|
|
|
|
|
|
|
// 数组索引从0 开始
|
|
|
|
for (int i = 4; i >= 0; i--) { |
|
|
|
int nyear = year - i; |
|
|
|
@ -193,6 +205,22 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
// 标的
|
|
|
|
bdlist.add(rest[1]); |
|
|
|
} |
|
|
|
|
|
|
|
}else if ("month".equals(leftDate)) {//按照月份
|
|
|
|
for (int i = 1; i <= 12; i++) { |
|
|
|
labelList.add(i + "月"); |
|
|
|
String startdt = year +"-"+i+ "-01 00:00:00"; |
|
|
|
String enddt = year +"-"+i+ "-31 23:59:59"; |
|
|
|
BigDecimal[] rest = getDateMomeny(startdt, enddt); |
|
|
|
// 订单金额
|
|
|
|
ftlist.add(rest[0]); |
|
|
|
// 标的
|
|
|
|
bdlist.add(rest[1]); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
//
|
|
|
|
} |
|
|
|
|
|
|
|
// 订单
|
|
|
|
Map tmp = new HashMap(); |
|
|
|
tmp.put("data", ftlist); |
|
|
|
@ -201,9 +229,8 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
// 标的
|
|
|
|
Map bdmap = new HashMap(); |
|
|
|
bdmap.put("data", bdlist); |
|
|
|
bdmap.put("label","标的金额"); |
|
|
|
bdmap.put("label", "标的价格金额"); |
|
|
|
treeMapList.add(bdmap); |
|
|
|
} |
|
|
|
|
|
|
|
result.put("treeMap", treeMapList); |
|
|
|
result.put("label", labelList); |
|
|
|
@ -212,22 +239,16 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询制定日期内的交易额 成交额 - 服务费 =订单额度 |
|
|
|
* |
|
|
|
* @param startdt |
|
|
|
* @param enddt |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private BigDecimal[] getDateMomeny(String startdt, String enddt) { |
|
|
|
//
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
|
|
|
try { |
|
|
|
String curyear = sdf.parse(startdt).toString(); |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal dealMoney = orderMapper.sumOderDtZone(startdt, enddt, "total_money");//成交额
|
|
|
|
BigDecimal platServiceFee = orderMapper.sumOderDtZone(startdt, enddt, "total_service_charge");//平台服务费
|
|
|
|
|
|
|
|
BigDecimal dm = (dealMoney == null) ? new BigDecimal(0.00) : dealMoney; |
|
|
|
log.info(curyear+"订单总额 :"+dm.toString()); |
|
|
|
BigDecimal pfee = platServiceFee == null ? new BigDecimal(0.00) : platServiceFee; |
|
|
|
|
|
|
|
BigDecimal oderMoney = null; |
|
|
|
@ -237,10 +258,5 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
|
|
|
|
BigDecimal[] dmarr = {dm, oderMoney}; |
|
|
|
return dmarr; |
|
|
|
}catch (Exception ex){ |
|
|
|
log.warn(ex); |
|
|
|
} |
|
|
|
BigDecimal[] dmarr = {new BigDecimal(0),new BigDecimal(0)}; |
|
|
|
return dmarr; |
|
|
|
} |
|
|
|
} |
|
|
|
|