|
|
@@ -45,7 +45,8 @@ public class TradingDataServiceImpl implements TradingDataService {
|
|
|
// 获取累计发票金额
|
|
|
Double apBillSum = getApBillSum(enUU);
|
|
|
// 获取历史退货率
|
|
|
- Double historyReturn = NumFormat.getPercent(returnSum / getOrderSum(enUU));
|
|
|
+ Double orderSum = getOrderSum(enUU);
|
|
|
+ Double historyReturn = NumFormat.getPercent(orderSum == 0.0 ? 0.0 : returnSum / orderSum);
|
|
|
map.put("timeSum", timeSum);
|
|
|
map.put("acceptSum", acceptSum);
|
|
|
map.put("returnSum", returnSum);
|
|
|
@@ -70,13 +71,13 @@ public class TradingDataServiceImpl implements TradingDataService {
|
|
|
if (StringUtils.isEmpty(acceptSum) || acceptSum == 0.0) {
|
|
|
custTrading.setAcceptPercent(0.00);
|
|
|
} else {
|
|
|
- custTrading.setAcceptPercent(NumFormat.getPercent((acceptSum - returnSum) / sum));
|
|
|
+ custTrading.setAcceptPercent(NumFormat.getPercent(sum == 0.0 ? 0.0 : (acceptSum - returnSum) / sum));
|
|
|
}
|
|
|
Integer acceptNum = getAcceptNum(enUU, custTrading.getCustUU());
|
|
|
Integer realNum = acceptNum - getReturnNum(enUU, custTrading.getCustUU());
|
|
|
custTrading.setRealNum(realNum);
|
|
|
if (0 != acceptNum) {
|
|
|
- custTrading.setNumPercent(NumFormat.getPercent((double) realNum / sumNum));
|
|
|
+ custTrading.setNumPercent(NumFormat.getPercent(sumNum == 0 ? 0 : (double) realNum / sumNum));
|
|
|
}
|
|
|
custTrading.setTimeSum(NumFormat.getOne(getTimeSum(enUU, custTrading.getCustUU())));
|
|
|
}
|
|
|
@@ -90,93 +91,93 @@ public class TradingDataServiceImpl implements TradingDataService {
|
|
|
ModelMap map = new ModelMap();
|
|
|
List<RecentOfYear> years = new ArrayList<>();
|
|
|
// 有交易额客户数量
|
|
|
- RecentOfYear ofYear1 = new RecentOfYear("有交易额客户数量");
|
|
|
- ofYear1.setTwoYear((double) getAcceptCust(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear1.setOneYear((double) getAcceptCust(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear1.setThisYear((double) getAcceptCust(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear1.setOneYearNum(NumFormat.getIncrease(ofYear1.getTwoYear(), ofYear1.getOneYear()));
|
|
|
- ofYear1.setThisYearNum(NumFormat.getIncrease(ofYear1.getOneYear(), ofYear1.getThisYear()));
|
|
|
- years.add(ofYear1);
|
|
|
+ RecentOfYear havingTradingQty = new RecentOfYear("有交易额客户数量");
|
|
|
+ havingTradingQty.setTwoYear((double) getAcceptCust(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ havingTradingQty.setOneYear((double) getAcceptCust(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ havingTradingQty.setThisYear((double) getAcceptCust(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ havingTradingQty.setOneYearNum(NumFormat.getIncrease(havingTradingQty.getTwoYear(), havingTradingQty.getOneYear()));
|
|
|
+ havingTradingQty.setThisYearNum(NumFormat.getIncrease(havingTradingQty.getOneYear(), havingTradingQty.getThisYear()));
|
|
|
+ years.add(havingTradingQty);
|
|
|
// 验收金额
|
|
|
- RecentOfYear ofYear2 = new RecentOfYear("验收金额");
|
|
|
- ofYear2.setTwoYear(getAcceptSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear2.setOneYear(getAcceptSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear2.setThisYear(getAcceptSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear2.setOneYearNum(NumFormat.getIncrease(ofYear2.getTwoYear(), ofYear2.getOneYear()));
|
|
|
- ofYear2.setThisYearNum(NumFormat.getIncrease(ofYear2.getOneYear(), ofYear2.getThisYear()));
|
|
|
- years.add(ofYear2);
|
|
|
+ RecentOfYear acceptAmount = new RecentOfYear("验收金额");
|
|
|
+ acceptAmount.setTwoYear(getAcceptSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ acceptAmount.setOneYear(getAcceptSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ acceptAmount.setThisYear(getAcceptSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ acceptAmount.setOneYearNum(NumFormat.getIncrease(acceptAmount.getTwoYear(), acceptAmount.getOneYear()));
|
|
|
+ acceptAmount.setThisYearNum(NumFormat.getIncrease(acceptAmount.getOneYear(), acceptAmount.getThisYear()));
|
|
|
+ years.add(acceptAmount);
|
|
|
// 验收笔数
|
|
|
- RecentOfYear ofYear3 = new RecentOfYear("验收笔数");
|
|
|
- ofYear3.setTwoYear((double) getAcceptNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear3.setOneYear((double) getAcceptNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear3.setThisYear((double) getAcceptNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear3.setOneYearNum(NumFormat.getIncrease(ofYear3.getTwoYear(), ofYear3.getOneYear()));
|
|
|
- ofYear3.setThisYearNum(NumFormat.getIncrease(ofYear3.getOneYear(), ofYear3.getThisYear()));
|
|
|
- years.add(ofYear3);
|
|
|
+ RecentOfYear acceptNum = new RecentOfYear("验收笔数");
|
|
|
+ acceptNum.setTwoYear((double) getAcceptNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ acceptNum.setOneYear((double) getAcceptNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ acceptNum.setThisYear((double) getAcceptNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ acceptNum.setOneYearNum(NumFormat.getIncrease(acceptNum.getTwoYear(), acceptNum.getOneYear()));
|
|
|
+ acceptNum.setThisYearNum(NumFormat.getIncrease(acceptNum.getOneYear(), acceptNum.getThisYear()));
|
|
|
+ years.add(acceptNum);
|
|
|
// 验退金额
|
|
|
- RecentOfYear ofYear4 = new RecentOfYear("验退金额");
|
|
|
- ofYear4.setTwoYear(getReturnSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear4.setOneYear(getReturnSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear4.setThisYear(getReturnSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear4.setOneYearNum(NumFormat.getIncrease(ofYear4.getTwoYear(), ofYear4.getOneYear()));
|
|
|
- ofYear4.setThisYearNum(NumFormat.getIncrease(ofYear4.getOneYear(), ofYear4.getThisYear()));
|
|
|
- years.add(ofYear4);
|
|
|
+ RecentOfYear returnAmount = new RecentOfYear("验退金额");
|
|
|
+ returnAmount.setTwoYear(getReturnSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ returnAmount.setOneYear(getReturnSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ returnAmount.setThisYear(getReturnSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ returnAmount.setOneYearNum(NumFormat.getIncrease(returnAmount.getTwoYear(), returnAmount.getOneYear()));
|
|
|
+ returnAmount.setThisYearNum(NumFormat.getIncrease(returnAmount.getOneYear(), returnAmount.getThisYear()));
|
|
|
+ years.add(returnAmount);
|
|
|
// 验退笔数
|
|
|
- RecentOfYear ofYear5 = new RecentOfYear("验退笔数");
|
|
|
- ofYear5.setTwoYear((double) getReturnNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear5.setOneYear((double) getReturnNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear5.setThisYear((double) getReturnNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear5.setOneYearNum(NumFormat.getIncrease(ofYear5.getTwoYear(), ofYear5.getOneYear()));
|
|
|
- ofYear5.setThisYearNum(NumFormat.getIncrease(ofYear5.getOneYear(), ofYear5.getThisYear()));
|
|
|
- years.add(ofYear5);
|
|
|
+ RecentOfYear returnNum = new RecentOfYear("验退笔数");
|
|
|
+ returnNum.setTwoYear((double) getReturnNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ returnNum.setOneYear((double) getReturnNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ returnNum.setThisYear((double) getReturnNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ returnNum.setOneYearNum(NumFormat.getIncrease(returnNum.getTwoYear(), returnNum.getOneYear()));
|
|
|
+ returnNum.setThisYearNum(NumFormat.getIncrease(returnNum.getOneYear(), returnNum.getThisYear()));
|
|
|
+ years.add(returnNum);
|
|
|
// 实收金额
|
|
|
- RecentOfYear ofYear6 = new RecentOfYear("实收金额");
|
|
|
- ofYear6.setTwoYear(ofYear2.getTwoYear() - ofYear4.getTwoYear());
|
|
|
- ofYear6.setOneYear(ofYear2.getOneYear() - ofYear4.getOneYear());
|
|
|
- ofYear6.setThisYear(ofYear2.getThisYear() - ofYear4.getThisYear());
|
|
|
- ofYear6.setOneYearNum(NumFormat.getIncrease(ofYear6.getTwoYear(), ofYear6.getOneYear()));
|
|
|
- ofYear6.setThisYearNum(NumFormat.getIncrease(ofYear6.getOneYear(), ofYear6.getThisYear()));
|
|
|
- years.add(ofYear6);
|
|
|
+ RecentOfYear realAmount = new RecentOfYear("实收金额");
|
|
|
+ realAmount.setTwoYear(acceptAmount.getTwoYear() - returnAmount.getTwoYear());
|
|
|
+ realAmount.setOneYear(acceptAmount.getOneYear() - returnAmount.getOneYear());
|
|
|
+ realAmount.setThisYear(acceptAmount.getThisYear() - returnAmount.getThisYear());
|
|
|
+ realAmount.setOneYearNum(NumFormat.getIncrease(realAmount.getTwoYear(), realAmount.getOneYear()));
|
|
|
+ realAmount.setThisYearNum(NumFormat.getIncrease(realAmount.getOneYear(), realAmount.getThisYear()));
|
|
|
+ years.add(realAmount);
|
|
|
// 实收笔数
|
|
|
- RecentOfYear ofYear7 = new RecentOfYear("实收笔数");
|
|
|
- ofYear7.setTwoYear(ofYear3.getTwoYear() - ofYear5.getTwoYear());
|
|
|
- ofYear7.setOneYear(ofYear3.getOneYear() - ofYear5.getOneYear());
|
|
|
- ofYear7.setThisYear(ofYear3.getThisYear() - ofYear5.getThisYear());
|
|
|
- ofYear7.setOneYearNum(NumFormat.getIncrease(ofYear7.getTwoYear(), ofYear7.getOneYear()));
|
|
|
- ofYear7.setThisYearNum(NumFormat.getIncrease(ofYear7.getOneYear(), ofYear7.getThisYear()));
|
|
|
- years.add(ofYear7);
|
|
|
+ RecentOfYear realNum = new RecentOfYear("实收笔数");
|
|
|
+ realNum.setTwoYear(acceptNum.getTwoYear() - returnNum.getTwoYear());
|
|
|
+ realNum.setOneYear(acceptNum.getOneYear() - returnNum.getOneYear());
|
|
|
+ realNum.setThisYear(acceptNum.getThisYear() - returnNum.getThisYear());
|
|
|
+ realNum.setOneYearNum(NumFormat.getIncrease(realNum.getTwoYear(), realNum.getOneYear()));
|
|
|
+ realNum.setThisYearNum(NumFormat.getIncrease(realNum.getOneYear(), realNum.getThisYear()));
|
|
|
+ years.add(realNum);
|
|
|
// 对账金额
|
|
|
- RecentOfYear ofYear8 = new RecentOfYear("对账金额");
|
|
|
- ofYear8.setTwoYear(getApCheckSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear8.setOneYear(getApCheckSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear8.setThisYear(getApCheckSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear8.setOneYearNum(NumFormat.getIncrease(ofYear8.getTwoYear(), ofYear8.getOneYear()));
|
|
|
- ofYear8.setThisYearNum(NumFormat.getIncrease(ofYear8.getOneYear(), ofYear8.getThisYear()));
|
|
|
- years.add(ofYear8);
|
|
|
+ RecentOfYear apcheckAmount = new RecentOfYear("对账金额");
|
|
|
+ apcheckAmount.setTwoYear(getApCheckSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ apcheckAmount.setOneYear(getApCheckSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ apcheckAmount.setThisYear(getApCheckSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ apcheckAmount.setOneYearNum(NumFormat.getIncrease(apcheckAmount.getTwoYear(), apcheckAmount.getOneYear()));
|
|
|
+ apcheckAmount.setThisYearNum(NumFormat.getIncrease(apcheckAmount.getOneYear(), apcheckAmount.getThisYear()));
|
|
|
+ years.add(apcheckAmount);
|
|
|
// 对账笔数
|
|
|
- RecentOfYear ofYear9 = new RecentOfYear("对账笔数");
|
|
|
- ofYear9.setTwoYear(getApCheckNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear9.setOneYear(getApCheckNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear9.setThisYear(getApCheckNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear9.setOneYearNum(NumFormat.getIncrease(ofYear9.getTwoYear(), ofYear9.getOneYear()));
|
|
|
- ofYear9.setThisYearNum(NumFormat.getIncrease(ofYear9.getOneYear(), ofYear9.getThisYear()));
|
|
|
- years.add(ofYear9);
|
|
|
+ RecentOfYear apcheckNum = new RecentOfYear("对账笔数");
|
|
|
+ apcheckNum.setTwoYear(getApCheckNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ apcheckNum.setOneYear(getApCheckNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ apcheckNum.setThisYear(getApCheckNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ apcheckNum.setOneYearNum(NumFormat.getIncrease(apcheckNum.getTwoYear(), apcheckNum.getOneYear()));
|
|
|
+ apcheckNum.setThisYearNum(NumFormat.getIncrease(apcheckNum.getOneYear(), apcheckNum.getThisYear()));
|
|
|
+ years.add(apcheckNum);
|
|
|
// 开票金额
|
|
|
- RecentOfYear ofYear10 = new RecentOfYear("开票金额");
|
|
|
- ofYear10.setTwoYear(getApBillSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear10.setOneYear(getApBillSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear10.setThisYear(getApBillSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear10.setOneYearNum(NumFormat.getIncrease(ofYear10.getTwoYear(), ofYear10.getOneYear()));
|
|
|
- ofYear10.setThisYearNum(NumFormat.getIncrease(ofYear10.getOneYear(), ofYear10.getThisYear()));
|
|
|
- years.add(ofYear10);
|
|
|
+ RecentOfYear apbillAmount = new RecentOfYear("开票金额");
|
|
|
+ apbillAmount.setTwoYear(getApBillSumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ apbillAmount.setOneYear(getApBillSumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ apbillAmount.setThisYear(getApBillSumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ apbillAmount.setOneYearNum(NumFormat.getIncrease(apbillAmount.getTwoYear(), apbillAmount.getOneYear()));
|
|
|
+ apbillAmount.setThisYearNum(NumFormat.getIncrease(apbillAmount.getOneYear(), apbillAmount.getThisYear()));
|
|
|
+ years.add(apbillAmount);
|
|
|
// 开票笔数
|
|
|
- RecentOfYear ofYear11 = new RecentOfYear("开票笔数");
|
|
|
- ofYear11.setTwoYear(getApBillNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
- ofYear11.setOneYear(getApBillNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
- ofYear11.setThisYear(getApBillNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
- ofYear11.setOneYearNum(NumFormat.getIncrease(ofYear11.getTwoYear(), ofYear11.getOneYear()));
|
|
|
- ofYear11.setThisYearNum(NumFormat.getIncrease(ofYear11.getOneYear(), ofYear11.getThisYear()));
|
|
|
- years.add(ofYear11);
|
|
|
+ RecentOfYear apbillNum = new RecentOfYear("开票笔数");
|
|
|
+ apbillNum.setTwoYear(getApBillNumTime(enUU, NumFormat.getTwoYear(), NumFormat.getOneYear()));
|
|
|
+ apbillNum.setOneYear(getApBillNumTime(enUU, NumFormat.getOneYear(), NumFormat.getThisYear()));
|
|
|
+ apbillNum.setThisYear(getApBillNumTime(enUU, NumFormat.getThisYear(), NumFormat.getNow()));
|
|
|
+ apbillNum.setOneYearNum(NumFormat.getIncrease(apbillNum.getTwoYear(), apbillNum.getOneYear()));
|
|
|
+ apbillNum.setThisYearNum(NumFormat.getIncrease(apbillNum.getOneYear(), apbillNum.getThisYear()));
|
|
|
+ years.add(apbillNum);
|
|
|
map.put("data", years);
|
|
|
return map;
|
|
|
}
|
|
|
@@ -191,145 +192,119 @@ public class TradingDataServiceImpl implements TradingDataService {
|
|
|
Date now = NumFormat.getNowM();
|
|
|
List<RecentOfMonth> months = new ArrayList<>();
|
|
|
// 有交易额客户数量
|
|
|
- RecentOfMonth ofMonth1 = new RecentOfMonth("有交易额客户数量");
|
|
|
- ofMonth1.setFourMonth((double) getAcceptCust(enUU, four, three));
|
|
|
- ofMonth1.setThreeMonth((double) getAcceptCust(enUU, three, two));
|
|
|
- ofMonth1.setTwoMonth((double) getAcceptCust(enUU, two, one));
|
|
|
- ofMonth1.setOneMonth((double) getAcceptCust(enUU, one, now));
|
|
|
- ofMonth1.setThreeMonthNum(NumFormat.getIncrease(ofMonth1.getFourMonth(), ofMonth1.getThreeMonth()));
|
|
|
- ofMonth1.setTwoMonthNum(NumFormat.getIncrease(ofMonth1.getThreeMonth(), ofMonth1.getTwoMonth()));
|
|
|
- ofMonth1.setOneMonthNum(NumFormat.getIncrease(ofMonth1.getTwoMonth(), ofMonth1.getOneMonth()));
|
|
|
- months.add(ofMonth1);
|
|
|
+ RecentOfMonth havingTradingQty = new RecentOfMonth("有交易额客户数量");
|
|
|
+ havingTradingQty.setFourMonth((double) getAcceptCust(enUU, four, three));
|
|
|
+ havingTradingQty.setThreeMonth((double) getAcceptCust(enUU, three, two));
|
|
|
+ havingTradingQty.setTwoMonth((double) getAcceptCust(enUU, two, one));
|
|
|
+ havingTradingQty.setOneMonth((double) getAcceptCust(enUU, one, now));
|
|
|
+ havingTradingQty.setThreeMonthNum(NumFormat.getIncrease(havingTradingQty.getFourMonth(), havingTradingQty.getThreeMonth()));
|
|
|
+ havingTradingQty.setTwoMonthNum(NumFormat.getIncrease(havingTradingQty.getThreeMonth(), havingTradingQty.getTwoMonth()));
|
|
|
+ havingTradingQty.setOneMonthNum(NumFormat.getIncrease(havingTradingQty.getTwoMonth(), havingTradingQty.getOneMonth()));
|
|
|
+ months.add(havingTradingQty);
|
|
|
// 验收金额
|
|
|
- RecentOfMonth ofMonth2 = new RecentOfMonth("验收金额");
|
|
|
- ofMonth2.setFourMonth(getAcceptSumTime(enUU, four, three));
|
|
|
- ofMonth2.setThreeMonth(getAcceptSumTime(enUU, three, two));
|
|
|
- ofMonth2.setTwoMonth(getAcceptSumTime(enUU, two, one));
|
|
|
- ofMonth2.setOneMonth(getAcceptSumTime(enUU, one, now));
|
|
|
- ofMonth2.setThreeMonthNum(NumFormat.getIncrease(ofMonth2.getFourMonth(), ofMonth2.getThreeMonth()));
|
|
|
- ofMonth2.setTwoMonthNum(NumFormat.getIncrease(ofMonth2.getThreeMonth(), ofMonth2.getTwoMonth()));
|
|
|
- ofMonth2.setOneMonthNum(NumFormat.getIncrease(ofMonth2.getTwoMonth(), ofMonth2.getOneMonth()));
|
|
|
- months.add(ofMonth2);
|
|
|
+ RecentOfMonth aceptAmount = new RecentOfMonth("验收金额");
|
|
|
+ aceptAmount.setFourMonth(getAcceptSumTime(enUU, four, three));
|
|
|
+ aceptAmount.setThreeMonth(getAcceptSumTime(enUU, three, two));
|
|
|
+ aceptAmount.setTwoMonth(getAcceptSumTime(enUU, two, one));
|
|
|
+ aceptAmount.setOneMonth(getAcceptSumTime(enUU, one, now));
|
|
|
+ aceptAmount.setThreeMonthNum(NumFormat.getIncrease(aceptAmount.getFourMonth(), aceptAmount.getThreeMonth()));
|
|
|
+ aceptAmount.setTwoMonthNum(NumFormat.getIncrease(aceptAmount.getThreeMonth(), aceptAmount.getTwoMonth()));
|
|
|
+ aceptAmount.setOneMonthNum(NumFormat.getIncrease(aceptAmount.getTwoMonth(), aceptAmount.getOneMonth()));
|
|
|
+ months.add(aceptAmount);
|
|
|
// 验收笔数
|
|
|
- RecentOfMonth ofMonth3 = new RecentOfMonth("验收笔数");
|
|
|
- ofMonth3.setFourMonth((double) getAcceptNumTime(enUU, four, three));
|
|
|
- ofMonth3.setThreeMonth((double) getAcceptNumTime(enUU, three, two));
|
|
|
- ofMonth3.setTwoMonth((double) getAcceptNumTime(enUU, two, one));
|
|
|
- ofMonth3.setOneMonth((double) getAcceptNumTime(enUU, one, now));
|
|
|
- ofMonth3.setThreeMonthNum(NumFormat.getIncrease(ofMonth3.getFourMonth(), ofMonth3.getThreeMonth()));
|
|
|
- ofMonth3.setTwoMonthNum(NumFormat.getIncrease(ofMonth3.getThreeMonth(), ofMonth3.getTwoMonth()));
|
|
|
- ofMonth3.setOneMonthNum(NumFormat.getIncrease(ofMonth3.getTwoMonth(), ofMonth3.getOneMonth()));
|
|
|
- months.add(ofMonth3);
|
|
|
+ RecentOfMonth aceptNum = new RecentOfMonth("验收笔数");
|
|
|
+ aceptNum.setFourMonth((double) getAcceptNumTime(enUU, four, three));
|
|
|
+ aceptNum.setThreeMonth((double) getAcceptNumTime(enUU, three, two));
|
|
|
+ aceptNum.setTwoMonth((double) getAcceptNumTime(enUU, two, one));
|
|
|
+ aceptNum.setOneMonth((double) getAcceptNumTime(enUU, one, now));
|
|
|
+ aceptNum.setThreeMonthNum(NumFormat.getIncrease(aceptNum.getFourMonth(), aceptNum.getThreeMonth()));
|
|
|
+ aceptNum.setTwoMonthNum(NumFormat.getIncrease(aceptNum.getThreeMonth(), aceptNum.getTwoMonth()));
|
|
|
+ aceptNum.setOneMonthNum(NumFormat.getIncrease(aceptNum.getTwoMonth(), aceptNum.getOneMonth()));
|
|
|
+ months.add(aceptNum);
|
|
|
// 验退金额
|
|
|
- RecentOfMonth ofMonth4 = new RecentOfMonth("验退金额");
|
|
|
- ofMonth4.setFourMonth(getReturnSumTime(enUU, four, three));
|
|
|
- ofMonth4.setThreeMonth(getReturnSumTime(enUU, three, two));
|
|
|
- ofMonth4.setTwoMonth(getReturnSumTime(enUU, two, one));
|
|
|
- ofMonth4.setOneMonth(getReturnSumTime(enUU, one, now));
|
|
|
- ofMonth4.setThreeMonthNum(NumFormat.getIncrease(ofMonth4.getFourMonth(), ofMonth4.getThreeMonth()));
|
|
|
- ofMonth4.setTwoMonthNum(NumFormat.getIncrease(ofMonth4.getThreeMonth(), ofMonth4.getTwoMonth()));
|
|
|
- ofMonth4.setOneMonthNum(NumFormat.getIncrease(ofMonth4.getTwoMonth(), ofMonth4.getOneMonth()));
|
|
|
- months.add(ofMonth4);
|
|
|
+ RecentOfMonth returnAmount = new RecentOfMonth("验退金额");
|
|
|
+ returnAmount.setFourMonth(getReturnSumTime(enUU, four, three));
|
|
|
+ returnAmount.setThreeMonth(getReturnSumTime(enUU, three, two));
|
|
|
+ returnAmount.setTwoMonth(getReturnSumTime(enUU, two, one));
|
|
|
+ returnAmount.setOneMonth(getReturnSumTime(enUU, one, now));
|
|
|
+ returnAmount.setThreeMonthNum(NumFormat.getIncrease(returnAmount.getFourMonth(), returnAmount.getThreeMonth()));
|
|
|
+ returnAmount.setTwoMonthNum(NumFormat.getIncrease(returnAmount.getThreeMonth(), returnAmount.getTwoMonth()));
|
|
|
+ returnAmount.setOneMonthNum(NumFormat.getIncrease(returnAmount.getTwoMonth(), returnAmount.getOneMonth()));
|
|
|
+ months.add(returnAmount);
|
|
|
// 验退笔数
|
|
|
- RecentOfMonth ofMonth5 = new RecentOfMonth("验退笔数");
|
|
|
- ofMonth5.setFourMonth((double) getReturnNumTime(enUU, four, three));
|
|
|
- ofMonth5.setThreeMonth((double) getReturnNumTime(enUU, three, two));
|
|
|
- ofMonth5.setTwoMonth((double) getReturnNumTime(enUU, two, one));
|
|
|
- ofMonth5.setOneMonth((double) getReturnNumTime(enUU, one, now));
|
|
|
- ofMonth5.setThreeMonthNum(NumFormat.getIncrease(ofMonth5.getFourMonth(), ofMonth5.getThreeMonth()));
|
|
|
- ofMonth5.setTwoMonthNum(NumFormat.getIncrease(ofMonth5.getThreeMonth(), ofMonth5.getTwoMonth()));
|
|
|
- ofMonth5.setOneMonthNum(NumFormat.getIncrease(ofMonth5.getTwoMonth(), ofMonth5.getOneMonth()));
|
|
|
- months.add(ofMonth5);
|
|
|
+ RecentOfMonth returnNum = new RecentOfMonth("验退笔数");
|
|
|
+ returnNum.setFourMonth((double) getReturnNumTime(enUU, four, three));
|
|
|
+ returnNum.setThreeMonth((double) getReturnNumTime(enUU, three, two));
|
|
|
+ returnNum.setTwoMonth((double) getReturnNumTime(enUU, two, one));
|
|
|
+ returnNum.setOneMonth((double) getReturnNumTime(enUU, one, now));
|
|
|
+ returnNum.setThreeMonthNum(NumFormat.getIncrease(returnNum.getFourMonth(), returnNum.getThreeMonth()));
|
|
|
+ returnNum.setTwoMonthNum(NumFormat.getIncrease(returnNum.getThreeMonth(), returnNum.getTwoMonth()));
|
|
|
+ returnNum.setOneMonthNum(NumFormat.getIncrease(returnNum.getTwoMonth(), returnNum.getOneMonth()));
|
|
|
+ months.add(returnNum);
|
|
|
// 实收金额
|
|
|
- RecentOfMonth ofMonth6 = new RecentOfMonth("实收金额");
|
|
|
- ofMonth6.setFourMonth(ofMonth2.getFourMonth() - ofMonth4.getFourMonth());
|
|
|
- ofMonth6.setThreeMonth(ofMonth2.getThreeMonth() - ofMonth4.getThreeMonth());
|
|
|
- ofMonth6.setTwoMonth(ofMonth2.getTwoMonth() - ofMonth4.getTwoMonth());
|
|
|
- ofMonth6.setOneMonth(ofMonth2.getOneMonth() - ofMonth4.getOneMonth());
|
|
|
- ofMonth6.setThreeMonthNum(NumFormat.getIncrease(ofMonth6.getFourMonth(), ofMonth6.getThreeMonth()));
|
|
|
- ofMonth6.setTwoMonthNum(NumFormat.getIncrease(ofMonth6.getThreeMonth(), ofMonth6.getTwoMonth()));
|
|
|
- ofMonth6.setOneMonthNum(NumFormat.getIncrease(ofMonth6.getTwoMonth(), ofMonth6.getOneMonth()));
|
|
|
- months.add(ofMonth6);
|
|
|
+ RecentOfMonth realAmount = new RecentOfMonth("实收金额");
|
|
|
+ realAmount.setFourMonth(aceptAmount.getFourMonth() - returnAmount.getFourMonth());
|
|
|
+ realAmount.setThreeMonth(aceptAmount.getThreeMonth() - returnAmount.getThreeMonth());
|
|
|
+ realAmount.setTwoMonth(aceptAmount.getTwoMonth() - returnAmount.getTwoMonth());
|
|
|
+ realAmount.setOneMonth(aceptAmount.getOneMonth() - returnAmount.getOneMonth());
|
|
|
+ realAmount.setThreeMonthNum(NumFormat.getIncrease(realAmount.getFourMonth(), realAmount.getThreeMonth()));
|
|
|
+ realAmount.setTwoMonthNum(NumFormat.getIncrease(realAmount.getThreeMonth(), realAmount.getTwoMonth()));
|
|
|
+ realAmount.setOneMonthNum(NumFormat.getIncrease(realAmount.getTwoMonth(), realAmount.getOneMonth()));
|
|
|
+ months.add(realAmount);
|
|
|
// 实收笔数
|
|
|
- RecentOfMonth ofMonth7 = new RecentOfMonth("实收笔数");
|
|
|
- ofMonth7.setFourMonth(ofMonth3.getFourMonth() - ofMonth5.getFourMonth());
|
|
|
- ofMonth7.setThreeMonth(ofMonth3.getThreeMonth() - ofMonth5.getThreeMonth());
|
|
|
- ofMonth7.setTwoMonth(ofMonth3.getTwoMonth() - ofMonth5.getTwoMonth());
|
|
|
- ofMonth7.setOneMonth(ofMonth3.getOneMonth() - ofMonth5.getOneMonth());
|
|
|
- ofMonth7.setThreeMonthNum(NumFormat.getIncrease(ofMonth7.getFourMonth(), ofMonth7.getThreeMonth()));
|
|
|
- ofMonth7.setTwoMonthNum(NumFormat.getIncrease(ofMonth7.getThreeMonth(), ofMonth7.getTwoMonth()));
|
|
|
- ofMonth7.setOneMonthNum(NumFormat.getIncrease(ofMonth7.getTwoMonth(), ofMonth7.getOneMonth()));
|
|
|
- months.add(ofMonth7);
|
|
|
+ RecentOfMonth realNum = new RecentOfMonth("实收笔数");
|
|
|
+ realNum.setFourMonth(aceptNum.getFourMonth() - returnNum.getFourMonth());
|
|
|
+ realNum.setThreeMonth(aceptNum.getThreeMonth() - returnNum.getThreeMonth());
|
|
|
+ realNum.setTwoMonth(aceptNum.getTwoMonth() - returnNum.getTwoMonth());
|
|
|
+ realNum.setOneMonth(aceptNum.getOneMonth() - returnNum.getOneMonth());
|
|
|
+ realNum.setThreeMonthNum(NumFormat.getIncrease(realNum.getFourMonth(), realNum.getThreeMonth()));
|
|
|
+ realNum.setTwoMonthNum(NumFormat.getIncrease(realNum.getThreeMonth(), realNum.getTwoMonth()));
|
|
|
+ realNum.setOneMonthNum(NumFormat.getIncrease(realNum.getTwoMonth(), realNum.getOneMonth()));
|
|
|
+ months.add(realNum);
|
|
|
// 对账金额
|
|
|
- RecentOfMonth ofMonth8 = new RecentOfMonth("对账金额");
|
|
|
- ofMonth8.setFourMonth(getApCheckSumTime(enUU, four, three));
|
|
|
- ofMonth8.setThreeMonth(getApCheckSumTime(enUU, three, two));
|
|
|
- ofMonth8.setTwoMonth(getApCheckSumTime(enUU, two, one));
|
|
|
- ofMonth8.setOneMonth(getApCheckSumTime(enUU, one, now));
|
|
|
- ofMonth8.setThreeMonthNum(NumFormat.getIncrease(ofMonth8.getFourMonth(), ofMonth8.getThreeMonth()));
|
|
|
- ofMonth8.setTwoMonthNum(NumFormat.getIncrease(ofMonth8.getThreeMonth(), ofMonth8.getTwoMonth()));
|
|
|
- ofMonth8.setOneMonthNum(NumFormat.getIncrease(ofMonth8.getTwoMonth(), ofMonth8.getOneMonth()));
|
|
|
- months.add(ofMonth8);
|
|
|
+ RecentOfMonth apcheckAmount = new RecentOfMonth("对账金额");
|
|
|
+ apcheckAmount.setFourMonth(getApCheckSumTime(enUU, four, three));
|
|
|
+ apcheckAmount.setThreeMonth(getApCheckSumTime(enUU, three, two));
|
|
|
+ apcheckAmount.setTwoMonth(getApCheckSumTime(enUU, two, one));
|
|
|
+ apcheckAmount.setOneMonth(getApCheckSumTime(enUU, one, now));
|
|
|
+ apcheckAmount.setThreeMonthNum(NumFormat.getIncrease(apcheckAmount.getFourMonth(), apcheckAmount.getThreeMonth()));
|
|
|
+ apcheckAmount.setTwoMonthNum(NumFormat.getIncrease(apcheckAmount.getThreeMonth(), apcheckAmount.getTwoMonth()));
|
|
|
+ apcheckAmount.setOneMonthNum(NumFormat.getIncrease(apcheckAmount.getTwoMonth(), apcheckAmount.getOneMonth()));
|
|
|
+ months.add(apcheckAmount);
|
|
|
// 对账笔数
|
|
|
- RecentOfMonth ofMonth9 = new RecentOfMonth("对账笔数");
|
|
|
- ofMonth9.setFourMonth(getApCheckNumTime(enUU, four, three));
|
|
|
- ofMonth9.setThreeMonth(getApCheckNumTime(enUU, three, two));
|
|
|
- ofMonth9.setTwoMonth(getApCheckNumTime(enUU, two, one));
|
|
|
- ofMonth9.setOneMonth(getApCheckNumTime(enUU, one, now));
|
|
|
- ofMonth9.setThreeMonthNum(NumFormat.getIncrease(ofMonth9.getFourMonth(), ofMonth9.getThreeMonth()));
|
|
|
- ofMonth9.setTwoMonthNum(NumFormat.getIncrease(ofMonth9.getThreeMonth(), ofMonth9.getTwoMonth()));
|
|
|
- ofMonth9.setOneMonthNum(NumFormat.getIncrease(ofMonth9.getTwoMonth(), ofMonth9.getOneMonth()));
|
|
|
- months.add(ofMonth9);
|
|
|
+ RecentOfMonth apcheckNum = new RecentOfMonth("对账笔数");
|
|
|
+ apcheckNum.setFourMonth(getApCheckNumTime(enUU, four, three));
|
|
|
+ apcheckNum.setThreeMonth(getApCheckNumTime(enUU, three, two));
|
|
|
+ apcheckNum.setTwoMonth(getApCheckNumTime(enUU, two, one));
|
|
|
+ apcheckNum.setOneMonth(getApCheckNumTime(enUU, one, now));
|
|
|
+ apcheckNum.setThreeMonthNum(NumFormat.getIncrease(apcheckNum.getFourMonth(), apcheckNum.getThreeMonth()));
|
|
|
+ apcheckNum.setTwoMonthNum(NumFormat.getIncrease(apcheckNum.getThreeMonth(), apcheckNum.getTwoMonth()));
|
|
|
+ apcheckNum.setOneMonthNum(NumFormat.getIncrease(apcheckNum.getTwoMonth(), apcheckNum.getOneMonth()));
|
|
|
+ months.add(apcheckNum);
|
|
|
// 开票金额
|
|
|
- RecentOfMonth ofMonth10 = new RecentOfMonth("开票金额");
|
|
|
- ofMonth10.setFourMonth(getApBillSumTime(enUU, four, three));
|
|
|
- ofMonth10.setThreeMonth(getApBillSumTime(enUU, three, two));
|
|
|
- ofMonth10.setTwoMonth(getApBillSumTime(enUU, two, one));
|
|
|
- ofMonth10.setOneMonth(getApBillSumTime(enUU, one, now));
|
|
|
- ofMonth10.setThreeMonthNum(NumFormat.getIncrease(ofMonth10.getFourMonth(), ofMonth10.getThreeMonth()));
|
|
|
- ofMonth10.setTwoMonthNum(NumFormat.getIncrease(ofMonth10.getThreeMonth(), ofMonth10.getTwoMonth()));
|
|
|
- ofMonth10.setOneMonthNum(NumFormat.getIncrease(ofMonth10.getTwoMonth(), ofMonth10.getOneMonth()));
|
|
|
- months.add(ofMonth10);
|
|
|
+ RecentOfMonth apbillAmount = new RecentOfMonth("开票金额");
|
|
|
+ apbillAmount.setFourMonth(getApBillSumTime(enUU, four, three));
|
|
|
+ apbillAmount.setThreeMonth(getApBillSumTime(enUU, three, two));
|
|
|
+ apbillAmount.setTwoMonth(getApBillSumTime(enUU, two, one));
|
|
|
+ apbillAmount.setOneMonth(getApBillSumTime(enUU, one, now));
|
|
|
+ apbillAmount.setThreeMonthNum(NumFormat.getIncrease(apbillAmount.getFourMonth(), apbillAmount.getThreeMonth()));
|
|
|
+ apbillAmount.setTwoMonthNum(NumFormat.getIncrease(apbillAmount.getThreeMonth(), apbillAmount.getTwoMonth()));
|
|
|
+ apbillAmount.setOneMonthNum(NumFormat.getIncrease(apbillAmount.getTwoMonth(), apbillAmount.getOneMonth()));
|
|
|
+ months.add(apbillAmount);
|
|
|
// 开票笔数
|
|
|
- RecentOfMonth ofMonth11 = new RecentOfMonth("开票笔数");
|
|
|
- ofMonth11.setFourMonth(getApBillNumTime(enUU, four, three));
|
|
|
- ofMonth11.setThreeMonth(getApBillNumTime(enUU, three, two));
|
|
|
- ofMonth11.setTwoMonth(getApBillNumTime(enUU, two, one));
|
|
|
- ofMonth11.setOneMonth(getApBillNumTime(enUU, one, now));
|
|
|
- ofMonth11.setThreeMonthNum(NumFormat.getIncrease(ofMonth11.getFourMonth(), ofMonth11.getThreeMonth()));
|
|
|
- ofMonth11.setTwoMonthNum(NumFormat.getIncrease(ofMonth11.getThreeMonth(), ofMonth11.getTwoMonth()));
|
|
|
- ofMonth11.setOneMonthNum(NumFormat.getIncrease(ofMonth11.getTwoMonth(), ofMonth11.getOneMonth()));
|
|
|
- months.add(ofMonth11);
|
|
|
+ RecentOfMonth apbillNum = new RecentOfMonth("开票笔数");
|
|
|
+ apbillNum.setFourMonth(getApBillNumTime(enUU, four, three));
|
|
|
+ apbillNum.setThreeMonth(getApBillNumTime(enUU, three, two));
|
|
|
+ apbillNum.setTwoMonth(getApBillNumTime(enUU, two, one));
|
|
|
+ apbillNum.setOneMonth(getApBillNumTime(enUU, one, now));
|
|
|
+ apbillNum.setThreeMonthNum(NumFormat.getIncrease(apbillNum.getFourMonth(), apbillNum.getThreeMonth()));
|
|
|
+ apbillNum.setTwoMonthNum(NumFormat.getIncrease(apbillNum.getThreeMonth(), apbillNum.getTwoMonth()));
|
|
|
+ apbillNum.setOneMonthNum(NumFormat.getIncrease(apbillNum.getTwoMonth(), apbillNum.getOneMonth()));
|
|
|
+ months.add(apbillNum);
|
|
|
map.put("data", months);
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 交易时间
|
|
|
- * @param enUU 卖方uu
|
|
|
- * @param custUU 客户uu
|
|
|
- * @return 交易时间
|
|
|
- */
|
|
|
- private Double getTimeSum(Long enUU, Long custUU) {
|
|
|
- StringBuffer last = new StringBuffer("SELECT ifnull((SELECT pu_date from purc$orders "
|
|
|
- + "WHERE pu_venduu = " + enUU + " and pu_date is not null ");
|
|
|
- if (!StringUtils.isEmpty(custUU)) {
|
|
|
- last.append("and pu_enuu = " + custUU + "");
|
|
|
- }
|
|
|
- last.append(" ORDER BY pu_date desc limit 1),now()) pu_date");
|
|
|
- StringBuffer first = new StringBuffer("SELECT ifnull((SELECT pu_date from purc$orders "
|
|
|
- + "WHERE pu_venduu = " + enUU + " and pu_date is not null ");
|
|
|
- if (!StringUtils.isEmpty(custUU)) {
|
|
|
- first.append("and pu_enuu = " + custUU + "");
|
|
|
- }
|
|
|
- first.append(" ORDER BY pu_date asc limit 1),now()) pu_date");
|
|
|
- Date lastTime = commonDao.queryForObject(last.toString(), Date.class);
|
|
|
- Date firstTime = commonDao.queryForObject(first.toString(), Date.class);
|
|
|
- StringBuffer result = new StringBuffer("SELECT TIMESTAMPDIFF(MONTH,'" + firstTime + "','" + lastTime + "')");
|
|
|
- Double resultTime = commonDao.queryForObject(result.toString(), Double.class) / TimeStauts.TYEAR.value();
|
|
|
- return NumFormat.getOne(resultTime);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 验收金额
|
|
|
* @param enUU 卖方uu
|
|
|
@@ -587,4 +562,31 @@ public class TradingDataServiceImpl implements TradingDataService {
|
|
|
Double result = commonDao.queryForObject(sql.toString(), Double.class);
|
|
|
return NumFormat.getTwo(result);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 交易时间
|
|
|
+ * @param enUU 卖方uu
|
|
|
+ * @param custUU 客户uu
|
|
|
+ * @return 交易时间
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Double getTimeSum(Long enUU, Long custUU) {
|
|
|
+ StringBuffer last = new StringBuffer("SELECT ifnull((SELECT pu_date from purc$orders "
|
|
|
+ + "WHERE pu_venduu = " + enUU + " and pu_date is not null ");
|
|
|
+ if (!StringUtils.isEmpty(custUU)) {
|
|
|
+ last.append("and pu_enuu = " + custUU + "");
|
|
|
+ }
|
|
|
+ last.append(" ORDER BY pu_date desc limit 1),now()) pu_date");
|
|
|
+ StringBuffer first = new StringBuffer("SELECT ifnull((SELECT pu_date from purc$orders "
|
|
|
+ + "WHERE pu_venduu = " + enUU + " and pu_date is not null ");
|
|
|
+ if (!StringUtils.isEmpty(custUU)) {
|
|
|
+ first.append("and pu_enuu = " + custUU + "");
|
|
|
+ }
|
|
|
+ first.append(" ORDER BY pu_date asc limit 1),now()) pu_date");
|
|
|
+ Date lastTime = commonDao.queryForObject(last.toString(), Date.class);
|
|
|
+ Date firstTime = commonDao.queryForObject(first.toString(), Date.class);
|
|
|
+ StringBuffer result = new StringBuffer("SELECT TIMESTAMPDIFF(MONTH,'" + firstTime + "','" + lastTime + "')");
|
|
|
+ Double resultTime = commonDao.queryForObject(result.toString(), Double.class) / TimeStauts.TYEAR.value();
|
|
|
+ return NumFormat.getOne(resultTime);
|
|
|
+ }
|
|
|
}
|