|
|
@@ -39,7 +39,6 @@ public class ProfitStatisticsController {
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "分页", notes = "传入acc")
|
|
|
public R<IPage<AccProfitStatisticsExcel>> list(AccProfitStatisticsExcel accProfitStatisticsExcel, Query query) {
|
|
|
- accProfitStatisticsExcel.setBillType("收费");
|
|
|
IPage<AccProfitStatisticsExcel> pages = new Page<>();
|
|
|
if ("1".equals(accProfitStatisticsExcel.getWhetherStatistics())) {
|
|
|
pages = accService.accProfitStatisticsCode(Condition.getPage(query), accProfitStatisticsExcel);
|
|
|
@@ -47,27 +46,47 @@ public class ProfitStatisticsController {
|
|
|
pages = accService.accProfitStatistics(Condition.getPage(query), accProfitStatisticsExcel);
|
|
|
}
|
|
|
for (AccProfitStatisticsExcel accOne : pages.getRecords()) {
|
|
|
- AccProfitStatisticsExcel accProfitStatisticsExcel1 = new AccProfitStatisticsExcel();
|
|
|
- accProfitStatisticsExcel1.setBillType("付费");
|
|
|
- AccProfitStatisticsExcel accProfitStatisticsExcel_ = new AccProfitStatisticsExcel();
|
|
|
+
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsCollect = new AccProfitStatisticsExcel();
|
|
|
+ accProfitStatisticsCollect.setBillType("收费");
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsExcelCollect = new AccProfitStatisticsExcel();
|
|
|
+ if ("1".equals(accProfitStatisticsExcel.getWhetherStatistics())) {
|
|
|
+ accProfitStatisticsCollect.setSrcSysno(accOne.getSrcSysno());
|
|
|
+ accProfitStatisticsCollect.setWhetherStatistics("1");
|
|
|
+ accProfitStatisticsExcelCollect = accService.getAccProfitStatisticsCode(accProfitStatisticsCollect);
|
|
|
+ } else {
|
|
|
+ accProfitStatisticsCollect.setAccSysNo(accOne.getAccSysNo());
|
|
|
+ accProfitStatisticsCollect.setWhetherStatistics("0");
|
|
|
+ accProfitStatisticsExcelCollect = accService.getAccProfitStatistics(accProfitStatisticsCollect);
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(accProfitStatisticsExcelCollect)) {
|
|
|
+ accOne.setReceivableAmount(accProfitStatisticsExcelCollect.getReceivableAmount());
|
|
|
+ accOne.setReceivedAmount(accProfitStatisticsExcelCollect.getReceivedAmount());
|
|
|
+ } else {
|
|
|
+ accOne.setReceivableAmount(new BigDecimal("0.00"));
|
|
|
+ accOne.setReceivedAmount(new BigDecimal("0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsPay = new AccProfitStatisticsExcel();
|
|
|
+ accProfitStatisticsPay.setBillType("申请");
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsExcelPay = new AccProfitStatisticsExcel();
|
|
|
if ("1".equals(accProfitStatisticsExcel.getWhetherStatistics())) {
|
|
|
- accProfitStatisticsExcel1.setSrcSysno(accOne.getSrcSysno());
|
|
|
- accProfitStatisticsExcel1.setWhetherStatistics("1");
|
|
|
- accProfitStatisticsExcel_ = accService.getAccProfitStatisticsCode(accProfitStatisticsExcel1);
|
|
|
+ accProfitStatisticsPay.setSrcSysno(accOne.getSrcSysno());
|
|
|
+ accProfitStatisticsPay.setWhetherStatistics("1");
|
|
|
+ accProfitStatisticsExcelPay = accService.getAccProfitStatisticsCode(accProfitStatisticsPay);
|
|
|
} else {
|
|
|
- accProfitStatisticsExcel1.setAccSysNo(accOne.getAccSysNo());
|
|
|
- accProfitStatisticsExcel1.setWhetherStatistics("0");
|
|
|
- accProfitStatisticsExcel_ = accService.getAccProfitStatistics(accProfitStatisticsExcel1);
|
|
|
+ accProfitStatisticsPay.setAccSysNo(accOne.getAccSysNo());
|
|
|
+ accProfitStatisticsPay.setWhetherStatistics("0");
|
|
|
+ accProfitStatisticsExcelPay = accService.getAccProfitStatistics(accProfitStatisticsPay);
|
|
|
}
|
|
|
- if (ObjectUtils.isNotNull(accProfitStatisticsExcel_)) {
|
|
|
- accOne.setAnswerPayAmount(accProfitStatisticsExcel_.getAnswerPayAmount());
|
|
|
- accOne.setAlreadyPayAmount(accProfitStatisticsExcel_.getAlreadyPayAmount());
|
|
|
- accOne.setProfitAmount(accOne.getReceivableAmount().subtract(accProfitStatisticsExcel_.getAnswerPayAmount()));
|
|
|
+ if (ObjectUtils.isNotNull(accProfitStatisticsExcelPay)) {
|
|
|
+ accOne.setAnswerPayAmount(accProfitStatisticsExcelPay.getAnswerPayAmount());
|
|
|
+ accOne.setAlreadyPayAmount(accProfitStatisticsExcelPay.getAlreadyPayAmount());
|
|
|
} else {
|
|
|
accOne.setAnswerPayAmount(new BigDecimal("0.00"));
|
|
|
accOne.setAlreadyPayAmount(new BigDecimal("0.00"));
|
|
|
- accOne.setProfitAmount(accOne.getReceivableAmount().subtract(new BigDecimal("0.00")));
|
|
|
}
|
|
|
+ accOne.setProfitAmount(accOne.getReceivableAmount().subtract(accOne.getAnswerPayAmount()));
|
|
|
accOne.setDate(accProfitStatisticsExcel.getDate());
|
|
|
}
|
|
|
return R.data(pages);
|
|
|
@@ -80,7 +99,7 @@ public class ProfitStatisticsController {
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "分页", notes = "传入acc")
|
|
|
public void export(AccProfitStatisticsExcel accProfitStatisticsExcel, HttpServletResponse response) {
|
|
|
- accProfitStatisticsExcel.setBillType("收费");
|
|
|
+ accProfitStatisticsExcel.setBillType("申请");
|
|
|
List<AccProfitStatisticsExcel> accProfitStatisticsExcelList = new ArrayList<>();
|
|
|
if ("1".equals(accProfitStatisticsExcel.getWhetherStatistics())) {
|
|
|
accProfitStatisticsExcelList = accService.accProfitStatisticsListcode(accProfitStatisticsExcel);
|
|
|
@@ -88,27 +107,46 @@ public class ProfitStatisticsController {
|
|
|
accProfitStatisticsExcelList = accService.accProfitStatisticsList(accProfitStatisticsExcel);
|
|
|
}
|
|
|
for (AccProfitStatisticsExcel accOne : accProfitStatisticsExcelList) {
|
|
|
- AccProfitStatisticsExcel accProfitStatisticsExcel1 = new AccProfitStatisticsExcel();
|
|
|
- accProfitStatisticsExcel1.setBillType("付费");
|
|
|
- AccProfitStatisticsExcel accProfitStatisticsExcel_ = new AccProfitStatisticsExcel();
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsCollect = new AccProfitStatisticsExcel();
|
|
|
+ accProfitStatisticsCollect.setBillType("收费");
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsExcelCollect = new AccProfitStatisticsExcel();
|
|
|
+ if ("1".equals(accProfitStatisticsExcel.getWhetherStatistics())) {
|
|
|
+ accProfitStatisticsCollect.setSrcSysno(accOne.getSrcSysno());
|
|
|
+ accProfitStatisticsCollect.setWhetherStatistics("1");
|
|
|
+ accProfitStatisticsExcelCollect = accService.getAccProfitStatisticsCode(accProfitStatisticsCollect);
|
|
|
+ } else {
|
|
|
+ accProfitStatisticsCollect.setAccSysNo(accOne.getAccSysNo());
|
|
|
+ accProfitStatisticsCollect.setWhetherStatistics("0");
|
|
|
+ accProfitStatisticsExcelCollect = accService.getAccProfitStatistics(accProfitStatisticsCollect);
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(accProfitStatisticsExcelCollect)) {
|
|
|
+ accOne.setReceivableAmount(accProfitStatisticsExcelCollect.getReceivableAmount());
|
|
|
+ accOne.setReceivedAmount(accProfitStatisticsExcelCollect.getReceivedAmount());
|
|
|
+ } else {
|
|
|
+ accOne.setReceivableAmount(new BigDecimal("0.00"));
|
|
|
+ accOne.setReceivedAmount(new BigDecimal("0.00"));
|
|
|
+ }
|
|
|
+
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsPay = new AccProfitStatisticsExcel();
|
|
|
+ accProfitStatisticsPay.setBillType("申请");
|
|
|
+ AccProfitStatisticsExcel accProfitStatisticsExcelPay = new AccProfitStatisticsExcel();
|
|
|
if ("1".equals(accProfitStatisticsExcel.getWhetherStatistics())) {
|
|
|
- accProfitStatisticsExcel1.setSrcSysno(accOne.getSrcSysno());
|
|
|
- accProfitStatisticsExcel1.setWhetherStatistics("1");
|
|
|
- accProfitStatisticsExcel_ = accService.getAccProfitStatisticsCode(accProfitStatisticsExcel1);
|
|
|
+ accProfitStatisticsPay.setSrcSysno(accOne.getSrcSysno());
|
|
|
+ accProfitStatisticsPay.setWhetherStatistics("1");
|
|
|
+ accProfitStatisticsExcelPay = accService.getAccProfitStatisticsCode(accProfitStatisticsPay);
|
|
|
} else {
|
|
|
- accProfitStatisticsExcel1.setAccSysNo(accOne.getAccSysNo());
|
|
|
- accProfitStatisticsExcel1.setWhetherStatistics("0");
|
|
|
- accProfitStatisticsExcel_ = accService.getAccProfitStatistics(accProfitStatisticsExcel1);
|
|
|
+ accProfitStatisticsPay.setAccSysNo(accOne.getAccSysNo());
|
|
|
+ accProfitStatisticsPay.setWhetherStatistics("0");
|
|
|
+ accProfitStatisticsExcelPay = accService.getAccProfitStatistics(accProfitStatisticsPay);
|
|
|
}
|
|
|
- if (ObjectUtils.isNotNull(accProfitStatisticsExcel_)) {
|
|
|
- accOne.setAnswerPayAmount(accProfitStatisticsExcel_.getAnswerPayAmount());
|
|
|
- accOne.setAlreadyPayAmount(accProfitStatisticsExcel_.getAlreadyPayAmount());
|
|
|
- accOne.setProfitAmount(accOne.getReceivableAmount().subtract(accProfitStatisticsExcel_.getAnswerPayAmount()));
|
|
|
+ if (ObjectUtils.isNotNull(accProfitStatisticsExcelPay)) {
|
|
|
+ accOne.setAnswerPayAmount(accProfitStatisticsExcelPay.getAnswerPayAmount());
|
|
|
+ accOne.setAlreadyPayAmount(accProfitStatisticsExcelPay.getAlreadyPayAmount());
|
|
|
} else {
|
|
|
accOne.setAnswerPayAmount(new BigDecimal("0.00"));
|
|
|
accOne.setAlreadyPayAmount(new BigDecimal("0.00"));
|
|
|
- accOne.setProfitAmount(accOne.getReceivableAmount().subtract(new BigDecimal("0.00")));
|
|
|
}
|
|
|
+ accOne.setProfitAmount(accOne.getReceivableAmount().subtract(accOne.getAnswerPayAmount()));
|
|
|
accOne.setDate(accProfitStatisticsExcel.getDate());
|
|
|
}
|
|
|
ExcelUtil.export(response, "收付费利润统计", "收付费利润统计", accProfitStatisticsExcelList, AccProfitStatisticsExcel.class);
|