wuxw
2024-04-05 09095d67f2e2acf45dcd55155da491e44206db4e
service-api/src/main/java/com/java110/api/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
@@ -6,8 +6,9 @@
import com.java110.api.smo.DefaultAbstractComponentSMO;
import com.java110.api.smo.assetExport.IExportFeeManualCollectionSMO;
import com.java110.core.context.IPageData;
import com.java110.core.log.LoggerFactory;
import com.java110.dto.fee.FeeDto;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.dto.system.ComponentValidateResult;
import com.java110.utils.util.Assert;
import com.java110.utils.util.Base64Convert;
import com.java110.utils.util.DateUtil;
@@ -17,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;
@@ -340,6 +340,7 @@
        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);
@@ -347,22 +348,34 @@
            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"))) {
                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")) {
@@ -372,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");
@@ -381,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);