Bläddra i källkod

资产收益预估分页total

lmstack 3 år sedan
förälder
incheckning
998ef18c8f

+ 11 - 0
src/main/java/cn/fastfun/controller/api/ApiAssetProfitController.java

@@ -77,6 +77,7 @@ public class ApiAssetProfitController {
             ResponseDTO responseDTO = new ResponseDTO();
 
             Page<AppAssetConf> appAssetConfPage = appAssetConfService.appAssetConfPageQuery(param);
+            responseDTO.setTotal(appAssetConfPage.getTotal());
             if (appAssetConfPage.getTotal() > 0) {
                 appAssetConfPage.getRecords().forEach(p -> {
                     ResponseDTO.AllInfo allInfo = new ResponseDTO.AllInfo();
@@ -148,6 +149,8 @@ public class ApiAssetProfitController {
             ResponseDTO responseDTO = new ResponseDTO();
 
             Page<AppAssetConf> appAssetConfPage = appAssetConfService.appAssetConfPageQuery(param);
+            responseDTO.setTotal(appAssetConfPage.getTotal());
+
             if (appAssetConfPage.getTotal() > 0) {
                 appAssetConfPage.getRecords().forEach(p -> {
                     ResponseDTO.AllInfo allInfo = new ResponseDTO.AllInfo();
@@ -193,6 +196,8 @@ public class ApiAssetProfitController {
             ResponseDTO responseDTO = new ResponseDTO();
 
             Page<AppAssetConf> appAssetConfPage = appAssetConfService.appAssetConfPageQuery(param);
+            responseDTO.setTotal(appAssetConfPage.getTotal());
+
             if (appAssetConfPage.getTotal() > 0) {
                 appAssetConfPage.getRecords().forEach(p -> {
                     ResponseDTO.AllInfo allInfo = new ResponseDTO.AllInfo();
@@ -315,6 +320,8 @@ public class ApiAssetProfitController {
             ResponseDTO responseDTO = new ResponseDTO();
 
             Page<AppAssetConf> appAssetConfPage = appAssetConfService.appAssetConfPageQuery(param);
+            responseDTO.setTotal(appAssetConfPage.getTotal());
+
             if (appAssetConfPage.getTotal() > 0) {
                 appAssetConfPage.getRecords().forEach(p -> {
                     ResponseDTO.AllInfo allInfo = new ResponseDTO.AllInfo();
@@ -371,6 +378,8 @@ public class ApiAssetProfitController {
         else if (param.getTableOrder() != null && param.getTableOrder().equals(7)) {
             ResponseDTO responseDTO = new ResponseDTO();
             Page<AppAssetConf> appAssetConfPage = appAssetConfService.appAssetConfPageQuery(param);
+            responseDTO.setTotal(appAssetConfPage.getTotal());
+
             if (appAssetConfPage.getTotal() > 0) {
                 appAssetConfPage.getRecords().forEach(p -> {
                     ResponseDTO.AllInfo allInfo = new ResponseDTO.AllInfo();
@@ -414,6 +423,8 @@ public class ApiAssetProfitController {
         else if (param.getTableOrder() != null && param.getTableOrder().equals(8)) {
             ResponseDTO responseDTO = new ResponseDTO();
             Page<AppAssetConf> appAssetConfPage = appAssetConfService.appAssetConfPageQuery(param);
+            responseDTO.setTotal(appAssetConfPage.getTotal());
+
             if (appAssetConfPage.getTotal() > 0) {
                 appAssetConfPage.getRecords().forEach(p -> {
                     ResponseDTO.AllInfo allInfo = new ResponseDTO.AllInfo();

+ 6 - 0
src/main/java/cn/fastfun/controller/dto/asset/ResponseDTO.java

@@ -132,6 +132,9 @@ public class ResponseDTO {
     // 处置净收益
     private BigDecimal handleProfit = new BigDecimal(0);
 
+    // 毛利
+    private BigDecimal grossProfit = new BigDecimal(0);
+
     // 其他总支出
     private BigDecimal otherTotalCost = new BigDecimal(0);
 
@@ -141,6 +144,9 @@ public class ResponseDTO {
     // 净收入
     private BigDecimal netIncome = new BigDecimal(0);
 
+    // 分页total
+    private long total;
+
 
 
 }

+ 3 - 0
src/main/java/cn/fastfun/service/impl/AppAssetProfitServiceImpl.java

@@ -194,6 +194,7 @@ public class AppAssetProfitServiceImpl {
             List<RentAndDepositDto> rentAndDepositDtos = new ArrayList<>();
             if (rentInfo.get("data") != null && rentInfo.get("data") != "") {
                 JSONObject responseData = JSONObject.parseObject(rentInfo.get("data").toString());
+                responseDTO.setTotal((Integer)responseData.get("total"));
                 if (responseData.get("summary") != null && responseData.get("summary") != "") {
                     summaryCentAndDepositDto = JSONObject.parseObject(responseData.get("summary").toString(), SummaryCentAndDepositDto.class);
                 }
@@ -228,6 +229,7 @@ public class AppAssetProfitServiceImpl {
                 }
                 responseDTO.getAllInfoList().add(allInfo);
             }
+
             responseDTO.setOrderStartTime(summaryCentAndDepositDto.getOrderStartTime());
             responseDTO.setOrderEndTime(summaryCentAndDepositDto.getOrderEndTime());
             responseDTO.setRental(summaryCentAndDepositDto.getCurrentCent());
@@ -362,6 +364,7 @@ public class AppAssetProfitServiceImpl {
             List<MarketingInformationDto> rentAndDepositDtos = new ArrayList<>();
             if (rentInfo.get("data") != null && rentInfo.get("data") != "") {
                 JSONObject responseData = JSONObject.parseObject(rentInfo.get("data").toString());
+                responseDTO.setTotal((Integer)responseData.get("total"));
                 if (responseData.get("summary") != null && responseData.get("summary") != "") {
                     summaryCentAndDepositDto = JSONObject.parseObject(responseData.get("summary").toString(), SummaryCentAndDepositDto.class);
                 }