瀏覽代碼

优化代码

java110 3 年之前
父節點
當前提交
26dfd1a3ac

+ 10 - 8
service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java

@@ -6,7 +6,7 @@ import com.alibaba.fastjson.parser.Feature;
 import com.java110.api.smo.DefaultAbstractComponentSMO;
 import com.java110.api.smo.assetExport.IExportFeeManualCollectionSMO;
 import com.java110.core.context.IPageData;
-import com.java110.dto.fee.FeeConfigDto;
+import com.java110.core.log.LoggerFactory;
 import com.java110.dto.fee.FeeDto;
 import com.java110.entity.component.ComponentValidateResult;
 import com.java110.utils.util.Assert;
@@ -18,7 +18,6 @@ import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
@@ -359,7 +358,7 @@ public class ExportFeeManualCollectionSMOImpl extends DefaultAbstractComponentSM
             squarePrice = feeObj.getString("squarePrice");
 
             //动态费用单价就去动态单价
-            if(feeObj.containsKey("computingFormula") && "9009".equals(feeObj.getString("computingFormula"))){
+            if (feeObj.containsKey("computingFormula") && "9009".equals(feeObj.getString("computingFormula"))) {
                 squarePrice = feeObj.getString("mwPrice");
             }
 
@@ -370,14 +369,17 @@ public class ExportFeeManualCollectionSMOImpl extends DefaultAbstractComponentSM
             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")) {
-                double totalDegrees = feeObj.getDouble("curDegrees") - feeObj.getDouble("preDegrees");
-                BigDecimal degreesDec = new BigDecimal(totalDegrees).setScale(2,BigDecimal.ROUND_HALF_UP);
-
-                cell3.setCellValue(startTime + "至" + endTime + " " + feeObj.getString("preDegrees") + "至" + feeObj.getString("curDegrees")+" 总:"+degreesDec.doubleValue());
+                cell3.setCellValue(startTime + "至" + endTime + " " + feeObj.getString("preDegrees") + "至" + feeObj.getString("curDegrees"));
             } else {
                 cell3.setCellValue(startTime + "至" + endTime);
             }