From 45149c4de50d945a27cbc7324ec0699f5b15df14 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 27 二月 2024 13:57:47 +0800
Subject: [PATCH] 取消空格问题

---
 service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java |   42 +++++++++++++++++++++++++++++++-----------
 1 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java b/service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
index 0371f49..a6fa67b 100644
--- a/service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
+++ b/service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
@@ -4,12 +4,11 @@
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.parser.Feature;
 import com.java110.api.smo.DefaultAbstractComponentSMO;
-import com.java110.core.component.BaseComponentSMO;
-import com.java110.core.context.IPageData;
-import com.java110.core.factory.Java110ThreadPoolFactory;
-import com.java110.entity.component.ComponentValidateResult;
 import com.java110.api.smo.assetExport.IExportFeeManualCollectionSMO;
-import com.java110.utils.constant.ServiceConstant;
+import com.java110.core.context.IPageData;
+import com.java110.core.log.LoggerFactory;
+import com.java110.dto.fee.FeeDto;
+import com.java110.dto.system.ComponentValidateResult;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.Base64Convert;
 import com.java110.utils.util.DateUtil;
@@ -19,7 +18,6 @@
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
@@ -32,8 +30,8 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -342,20 +340,42 @@
         BigDecimal totalPrice = new BigDecimal(0);
         String startTime = "";
         String endTime = "";
+        String squarePrice = "";
         for (int feeIndex = 0; feeIndex < fees.size(); feeIndex++) {
             JSONObject feeObj = fees.getJSONObject(feeIndex);
             row = sheet.createRow(line + feeIndex + 3);
             startTime = feeObj.getString("endTime").length() > 10 ? feeObj.getString("endTime").substring(0, 10) : feeObj.getString("endTime");
             endTime = feeObj.getString("deadlineTime").length() > 10 ? feeObj.getString("deadlineTime").substring(0, 10) : feeObj.getString("deadlineTime");
+            //濡傛灉璐圭敤鏄懆鏈熸�ц垂鐢� 鍒� 缁撴潫鏃堕棿鍑忎竴澶�
+            try {
+                if (feeObj.containsKey("feeFlag") && (FeeDto.FEE_FLAG_CYCLE.equals(feeObj.getString("feeFlag")) || FeeDto.FEE_FLAG_CYCLE_ONCE.equals(feeObj.getString("feeFlag")))) {
+                    endTime = DateUtil.getFormatTimeString(DateUtil.stepDay(DateUtil.getDateFromString(endTime, DateUtil.DATE_FORMATE_STRING_B), -1),
+                            DateUtil.DATE_FORMATE_STRING_B);
+                }
+            } catch (ParseException e) {
+                logger.error("澶勭悊缁撴潫鏃堕棿澶辫触", e);
+            }
+            squarePrice = feeObj.getString("squarePrice");
+
+            //鍔ㄦ�佽垂鐢ㄥ崟浠峰氨鍘诲姩鎬佸崟浠�
+            if (feeObj.containsKey("computingFormula") && "9009".equals(feeObj.getString("computingFormula"))) {
+                squarePrice = feeObj.getString("mwPrice");
+            }
 
             cell0 = row.createCell(0);
             cell0.setCellValue(feeObj.getString("feeName"));
             cell0.setCellStyle(cellStyle);
             cell1 = row.createCell(1);
-            cell1.setCellValue(feeObj.getString("squarePrice"));
+            cell1.setCellValue(squarePrice);
             cell1.setCellStyle(cellStyle);
             cell2 = row.createCell(2);
-            cell2.setCellValue(room.getString("builtUpArea"));
+            if (feeObj.containsKey("curDegrees")) {
+                double totalDegrees = feeObj.getDouble("curDegrees") - feeObj.getDouble("preDegrees");
+                BigDecimal degreesDec = new BigDecimal(totalDegrees).setScale(2, BigDecimal.ROUND_HALF_UP);
+                cell2.setCellValue(degreesDec.doubleValue());
+            } else {
+                cell2.setCellValue(room.getString("builtUpArea"));
+            }
             cell2.setCellStyle(cellStyle);
             cell3 = row.createCell(3);
             if (feeObj.containsKey("curDegrees")) {
@@ -365,7 +385,7 @@
             }
             cell3.setCellStyle(cellStyle);
             cell4 = row.createCell(4);
-            cell4.setCellValue(feeObj.getString("feePrice"));
+            cell4.setCellValue(feeObj.getString("feeTotalPrice"));
             cell4.setCellStyle(cellStyle);
             cell5 = row.createCell(5);
             cell5.setCellValue("0");
@@ -374,7 +394,7 @@
             cell6.setCellValue("");
             cell6.setCellStyle(cellStyle);
             row.setHeight((short) (defaultRowHeight));
-            totalPrice = totalPrice.add(new BigDecimal(feeObj.getString("feePrice")));
+            totalPrice = totalPrice.add(new BigDecimal(feeObj.getString("feeTotalPrice")));
         }
 
         row = sheet.createRow(line + fees.size() + 3);

--
Gitblit v1.8.0