From 074caee550216dfd4bb676677ae33cbd837c5710 Mon Sep 17 00:00:00 2001
From: chengf <cgf12138@163.com>
Date: 星期三, 27 八月 2025 18:17:21 +0800
Subject: [PATCH] 暂存0827
---
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java | 309 ++++++++++++++++++++++++++++-----------------------
1 files changed, 171 insertions(+), 138 deletions(-)
diff --git a/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java b/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
index d2740e0..755e2ed 100755
--- a/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
+++ b/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
@@ -1,9 +1,11 @@
package com.java110.fee.bmo.impl;
import com.alibaba.fastjson.JSONArray;
+import com.java110.core.factory.CommunitySettingFactory;
import com.java110.core.factory.Java110ThreadPoolFactory;
+import com.java110.core.log.LoggerFactory;
import com.java110.core.smo.IComputeFeeSMO;
-import com.java110.dto.RoomDto;
+import com.java110.dto.room.RoomDto;
import com.java110.dto.fee.FeeConfigDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.owner.OwnerCarDto;
@@ -19,18 +21,21 @@
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.DateUtil;
-import com.java110.utils.util.StringUtil;
+import com.java110.utils.util.*;
import com.java110.vo.ResultVo;
+import com.java110.vo.api.fee.ApiFeeDataVo;
+import com.java110.vo.api.fee.ApiFeeVo;
+import com.java110.vo.api.feeConfig.ApiFeeConfigDataVo;
import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
import java.util.*;
@Service
@@ -70,25 +75,58 @@
//閿�
public static final String RECEIVED_AMOUNT_SWITCH = "RECEIVED_AMOUNT_SWITCH";
+ //绂佺敤鐢佃剳绔彁浜ゆ敹璐规寜閽�
+ public static final String OFFLINE_PAY_FEE_SWITCH = "OFFLINE_PAY_FEE_SWITCH";
+
@Override
public ResponseEntity<String> query(FeeDto feeDto) {
//鏌ヨ璐圭敤淇℃伅arrearsEndTime
- feeDto.setArrearsEndTime(DateUtil.getCurrentDate());
+ // todo 杩欓噷鑰冭檻棰勪粯鏈熺殑璐圭敤 鎵�浠ユ煡璇㈠叏閲忓啀鐢ㄨ垂鐢�
feeDto.setState(FeeDto.STATE_DOING);
List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
- if (feeDtos == null || feeDtos.size() < 1) {
+ if (ListUtil.isNull(feeDtos)) {
feeDtos = new ArrayList<>();
return ResultVo.createResponseEntity(feeDtos);
}
+ String val = CommunitySettingFactory.getValue(feeDtos.get(0).getCommunityId(), TOTAL_FEE_PRICE);
+ if (StringUtil.isEmpty(val)) {
+ val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
+ }
List<FeeDto> tmpFeeDtos = new ArrayList<>();
for (FeeDto tmpFeeDto : feeDtos) {
- computeFeeSMOImpl.computeEveryOweFee(tmpFeeDto);//璁$畻娆犺垂閲戦
- //濡傛灉閲戦涓�0 灏辨帓闄�
- //if (tmpFeeDto.getFeePrice() > 0 && tmpFeeDto.getEndTime().getTime() <= DateUtil.getCurrentDate().getTime()) {
- if (tmpFeeDto.getFeePrice() > 0) {
- tmpFeeDtos.add(tmpFeeDto);
+ try {
+ if (!StringUtil.isEmpty(tmpFeeDto.getAdditionalAmount())) {
+ tmpFeeDto.setAdditionalAmount(Double.parseDouble(tmpFeeDto.getAdditionalAmount()) + "");
+ }
+ if (!StringUtil.isEmpty(tmpFeeDto.getSquarePrice())) {
+ tmpFeeDto.setSquarePrice(Double.parseDouble(tmpFeeDto.getSquarePrice()) + "");
+ }
+
+ //todo 鏈夌洰鏍囩粨鏉熸椂闂�,骞朵笖涓嶆槸涓�娆℃�ц垂鐢�
+ if (!StringUtil.isEmpty(feeDto.getTargetEndTime())
+ && !FeeDto.FEE_FLAG_ONCE.equals(tmpFeeDto.getFeeFlag())
+ ) {
+ computeFeeSMOImpl.computeEveryOweFeeByTargetEndTime(tmpFeeDto, feeDto.getTargetEndTime());//璁$畻娆犺垂閲戦
+ } else {
+ computeFeeSMOImpl.computeEveryOweFee(tmpFeeDto);//璁$畻娆犺垂閲戦
+ }
+ //濡傛灉閲戦涓�0 灏辨帓闄�
+ tmpFeeDto.setFeeTotalPrice(
+ MoneyUtil.computePriceScale(
+ tmpFeeDto.getFeeTotalPrice(),
+ tmpFeeDto.getScale(),
+ Integer.parseInt(tmpFeeDto.getDecimalPlace())
+ )
+ );
+
+ tmpFeeDto.setVal(val);
+ if (tmpFeeDto.getFeeTotalPrice() != 0) {
+ tmpFeeDtos.add(tmpFeeDto);
+ }
+ } catch (Exception e) {
+ logger.error("鍙兘璐圭敤璧勬枡鏈夐棶棰樺鑷寸畻璐瑰け璐�", e);
}
}
@@ -117,17 +155,35 @@
List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
- if (feeDtos == null || feeDtos.size() < 1) {
+ if (ListUtil.isNull(feeDtos)) {
return ResultVo.success();
}
String cycel = null;
+ String custEndTime = null;
+ String customStartTime = "";
+ String customEndTime = "";
if (!StringUtil.isEmpty(feeDto.getCycle())) {
cycel = feeDto.getCycle();
}
+ if (!StringUtil.isEmpty(feeDto.getCustEndTime())) {
+ custEndTime = feeDto.getCustEndTime();
+ }
+ customStartTime = feeDto.getCustomStartTime();
+ customEndTime = feeDto.getCustomEndTime();
feeDto = feeDtos.get(0);
+ //todo 鑰冭檻璐﹀崟妯″紡
+ if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag()) && StringUtil.isNumber(feeDto.getMonthCycle())) {
+ cycel = feeDto.getMonthCycle();
+ }
if (!StringUtil.isEmpty(cycel)) {
feeDto.setCycle(cycel);
}
+ if (!StringUtil.isEmpty(custEndTime)) {
+ feeDto.setCustEndTime(custEndTime);
+ }
+
+ feeDto.setCustomStartTime(customStartTime);
+ feeDto.setCustomEndTime(customEndTime);
if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) { //鎴垮眿鐩稿叧
RoomDto roomDto = new RoomDto();
@@ -138,7 +194,7 @@
throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "鏈煡鍒版埧灞嬩俊鎭紝鏌ヨ澶氭潯鏁版嵁");
}
roomDto = roomDtos.get(0);
- feeDto.setPayerObjName(roomDto.getFloorNum() + "鏍�" + roomDto.getUnitNum() + "鍗曞厓" + roomDto.getRoomNum() + "瀹�");
+ feeDto.setPayerObjName(roomDto.getFloorNum() + "-" + roomDto.getUnitNum() + "-" + roomDto.getRoomNum());
feeDto.setBuiltUpArea(roomDto.getBuiltUpArea());
} else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//杞︿綅鐩稿叧
@@ -152,7 +208,7 @@
parkingSpaceDto.setCommunityId(feeDto.getCommunityId());
parkingSpaceDto.setPsId(ownerCarDtos.get(0).getPsId());
List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto);
- if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) { //鏁版嵁鏈夐棶棰�
+ if (ListUtil.isNull(parkingSpaceDtos)) { //鏁版嵁鏈夐棶棰�
throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "鏈煡鍒板仠杞︿綅淇℃伅锛屾煡璇㈠鏉℃暟鎹�");
}
ownerCarDto = ownerCarDtos.get(0);
@@ -160,19 +216,108 @@
feeDto.setPayerObjName(ownerCarDto.getCarNum() + "(" + parkingSpaceDto.getAreaNum() + "鍋滆溅鍦�" + parkingSpaceDto.getNum() + "杞︿綅)");
feeDto.setBuiltUpArea(parkingSpaceDto.getArea());
}
+
Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
- feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
+
+ feeDto.setFeeTotalPrice(
+ MoneyUtil.computePriceScale(
+ Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()),
+ feeDto.getScale(),
+ Integer.parseInt(feeDto.getDecimalPlace())
+ )
+ );
+ if (!StringUtil.isEmpty(custEndTime)) {
+ Date date = DateUtil.getDateFromStringB(custEndTime);
+ computeFeeSMOImpl.dealRentRateCustEndTime(feeDto, date);
+ } else {
+ computeFeeSMOImpl.dealRentRateCycle(feeDto, NumberUtil.getDouble(feeDto.getCycle()));
+ }
+
+
//搴旀敹娆惧彇鍊�
- String val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
+ //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
+ String val = CommunitySettingFactory.getValue(feeDto.getCommunityId(), TOTAL_FEE_PRICE);
+ if (StringUtil.isEmpty(val)) {
+ val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
+ }
feeDto.setVal(val);
- String received_amount_switch = MappingCache.getValue(DOMAIN_COMMON, RECEIVED_AMOUNT_SWITCH);
+ //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
+ String received_amount_switch = CommunitySettingFactory.getValue(feeDto.getCommunityId(), RECEIVED_AMOUNT_SWITCH);
+ if (StringUtil.isEmpty(received_amount_switch)) {
+ received_amount_switch = MappingCache.getValue(DOMAIN_COMMON, RECEIVED_AMOUNT_SWITCH);
+ }
+ //鍏抽棴 绾夸笅鏀堕摱鍔熻兘
if (StringUtil.isEmpty(received_amount_switch)) {
feeDto.setReceivedAmountSwitch("1");//榛樿鍚敤瀹炴敹娆捐緭鍏ユ
} else {
feeDto.setReceivedAmountSwitch(received_amount_switch);
}
- return ResultVo.createResponseEntity(feeDto);
+ //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
+ String offlinePayFeeSwitch = CommunitySettingFactory.getValue(feeDto.getCommunityId(), OFFLINE_PAY_FEE_SWITCH);
+ if (StringUtil.isEmpty(offlinePayFeeSwitch)) {
+ offlinePayFeeSwitch = MappingCache.getValue(DOMAIN_COMMON, OFFLINE_PAY_FEE_SWITCH);
+ }
+ feeDto.setOfflinePayFeeSwitch(offlinePayFeeSwitch);
+ //鍘绘帀澶氫綑0
+ feeDto.setSquarePrice(Double.parseDouble(feeDto.getSquarePrice()) + "");
+ feeDto.setAdditionalAmount(Double.parseDouble(feeDto.getAdditionalAmount()) + "");
+ ApiFeeDataVo apiFeeDataVo = BeanConvertUtil.covertBeanList(feeDtos, ApiFeeDataVo.class).get(0);
+ apiFeeDataVo.setStartTime(apiFeeDataVo.getStartTime() == null ? null : apiFeeDataVo.getStartTime().split(" ")[0]);
+ apiFeeDataVo.setEndTime(apiFeeDataVo.getEndTime() == null ? null : apiFeeDataVo.getEndTime().split(" ")[0]);
+ apiFeeDataVo.setMaxEndTime(apiFeeDataVo.getMaxEndTime() == null ? null : apiFeeDataVo.getMaxEndTime().split(" ")[0]);
+ apiFeeDataVo.setDeadlineTime(apiFeeDataVo.getDeadlineTime() == null ? null : apiFeeDataVo.getDeadlineTime().split(" ")[0]);
+ if (cycel != null && !"105".equals(cycel)) { // 淇瀛楃涓叉瘮杈冩柟寮�
+ Date date = feeDto.getEndTime();
+ if (date != null) { // 澧炲姞绌哄�兼鏌�
+ LocalDateTime localDateTime;
+
+ // 澶勭悊 java.sql.Date 涓嶆敮鎸� toInstant() 鐨勯棶棰�
+ if (date instanceof java.sql.Date) {
+ // 瀵逛簬 sql.Date锛屽厛杞崲涓� LocalDate 鍐嶈浆涓� LocalDateTime
+ LocalDate localDate = ((java.sql.Date) date).toLocalDate();
+ localDateTime = localDate.atStartOfDay();
+ } else {
+ // 瀵逛簬 util.Date锛屾甯歌浆鎹�
+ localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
+ }
+
+ try {
+ // 澧炲姞x涓湀
+ int monthsToAdd = Integer.parseInt(cycel);
+ LocalDateTime newLocalDateTime = localDateTime.plusMonths(monthsToAdd).minusDays(1);
+
+ // 杞崲鍥濪ate
+ Date newDate = Date.from(newLocalDateTime.atZone(ZoneId.systemDefault()).toInstant());
+ apiFeeDataVo.setPayStartDate(feeDto.getEndTime());
+ apiFeeDataVo.setPayEndDate(newDate);
+ } catch (NumberFormatException e) {
+ // 澶勭悊cycel鏃犳硶杞崲涓烘暣鏁扮殑寮傚父
+ // 鍙互鏍规嵁瀹為檯闇�姹傝褰曟棩蹇楁垨鎶涘嚭鑷畾涔夊紓甯�
+ e.printStackTrace();
+ }
+ }
+ }else{
+ apiFeeDataVo.setPayStartDate(DateUtil.getDateFromStringB(feeDto.getCustomStartTime()));
+ // 鑾峰彇鍘熷鏃ユ湡
+ Date originalDate = DateUtil.getDateFromStringB(feeDto.getCustomEndTime());
+ if (originalDate != null) {
+ // 鍒涘缓Calendar瀹炰緥骞惰缃棩鏈�
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTime(originalDate);
+
+ // 鍑忎竴澶�
+ calendar.add(Calendar.DAY_OF_MONTH, -1);
+
+ // 鑾峰彇澶勭悊鍚庣殑鏃ユ湡
+ Date dateMinusOneDay = calendar.getTime();
+ apiFeeDataVo.setPayEndDate(dateMinusOneDay);
+ }
+ }
+ //璁$畻MaxEndTime鍜宲ayStartDate涔嬮棿鐨勬湀鏁�
+ int monthCount = DateUtil.calculateMonths(DateUtil.getFormatTimeStringB(apiFeeDataVo.getPayStartDate()), apiFeeDataVo.getMaxEndTime());
+ apiFeeDataVo.setMonthCount(monthCount);
+ return ResultVo.createResponseEntity(apiFeeDataVo);
}
@Override
@@ -393,7 +538,7 @@
private void dealFeePs(ParkingSpaceDto tmpParkingSpaceDto, FeeDto feeDto) {
// 杞暟 * 鍛ㄦ湡 * 30 + 寮�濮嬫椂闂� = 鐩爣 鍒版湡鏃堕棿
- Map<String, Object> targetEndDateAndOweMonth = getTargetEndDateAndOweMonth(feeDto);
+ Map<String, Object> targetEndDateAndOweMonth = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto);
Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
if (!tmpParkingSpaceDto.getPsId().equals(feeDto.getPayerObjId())) {
@@ -415,6 +560,8 @@
} else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
feePrice = 0.0;
} else if ("1101".equals(computingFormula)) { // 绉熼噾
+ feePrice = 0.0;
+ } else if ("1102".equals(computingFormula)) { // 绉熼噾
feePrice = 0.0;
} else if ("4004".equals(computingFormula)) {
feePrice = Double.parseDouble(feeDto.getAmount());
@@ -509,7 +656,7 @@
}
private void dealFeeRoom(RoomDto tmpRoomDto, FeeDto feeDto) {
- Map<String, Object> targetEndDateAndOweMonth = getTargetEndDateAndOweMonth(feeDto);
+ Map<String, Object> targetEndDateAndOweMonth = computeFeeSMOImpl.getTargetEndDateAndOweMonth(feeDto);
Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
if (!tmpRoomDto.getRoomId().equals(feeDto.getPayerObjId())) {
@@ -533,6 +680,9 @@
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
} else if ("1101".equals(computingFormula)) { // 绉熼噾
+ BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpRoomDto.getRoomRent()));
+ feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ } else if ("1102".equals(computingFormula)) { // 绉熼噾
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpRoomDto.getRoomRent()));
feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
} else if ("4004".equals(computingFormula)) {
@@ -584,123 +734,6 @@
}
-
- /**
- * 璁$畻2涓棩鏈熶箣闂寸浉宸殑 浠ュ勾銆佹湀銆佹棩涓哄崟浣嶏紝鍚勮嚜璁$畻缁撴灉鏄灏�
- * 姣斿锛�2011-02-02 鍒� 2017-03-02
- * 浠ュ勾涓哄崟浣嶇浉宸负锛�6骞�
- * 浠ユ湀涓哄崟浣嶇浉宸负锛�73涓湀
- * 浠ユ棩涓哄崟浣嶇浉宸负锛�2220澶�
- *
- * @param fromDate
- * @param toDate
- * @return
- */
- public static double dayCompare(Date fromDate, Date toDate) {
- Calendar from = Calendar.getInstance();
- from.setTime(fromDate);
- Calendar to = Calendar.getInstance();
- to.setTime(toDate);
-
- long t1 = from.getTimeInMillis();
- long t2 = to.getTimeInMillis();
- double days = (t2 - t1) * 1.00 / (24 * 60 * 60 * 1000);
-
- BigDecimal tmpDays = new BigDecimal(days);
- BigDecimal monthDay = new BigDecimal(30);
-
- return tmpDays.divide(monthDay, 2, RoundingMode.HALF_UP).doubleValue();
- }
-
- private Map getTargetEndDateAndOweMonth(FeeDto feeDto) {
- Date targetEndDate = null;
- double oweMonth = 0.0;
-
- Map<String, Object> targetEndDateAndOweMonth = new HashMap<>();
-
- if (FeeDto.STATE_FINISH.equals(feeDto.getState())) {
- targetEndDate = feeDto.getEndTime();
- targetEndDateAndOweMonth.put("oweMonth", oweMonth);
- targetEndDateAndOweMonth.put("targetEndDate", targetEndDate);
- return targetEndDateAndOweMonth;
- }
- if (FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())) {
- if (feeDto.getDeadlineTime() != null) {
- targetEndDate = feeDto.getDeadlineTime();
- } else if (!StringUtil.isEmpty(feeDto.getCurDegrees())) {
- targetEndDate = feeDto.getCurReadingTime();
- } else if (feeDto.getImportFeeEndTime() == null) {
- targetEndDate = feeDto.getConfigEndTime();
- } else {
- targetEndDate = feeDto.getImportFeeEndTime();
- }
- //鍒ゆ柇褰撳墠璐圭敤鏄笉鏄鍏ヨ垂鐢�
- oweMonth = 1.0;
-
- } else {
- //褰撳墠鏃堕棿
- Date billEndTime = DateUtil.getCurrentDate();
- //寮�濮嬫椂闂�
- Date startDate = feeDto.getStartTime();
- //鍒版湡鏃堕棿
- Date endDate = feeDto.getEndTime();
- if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {
- OwnerCarDto ownerCarDto = new OwnerCarDto();
- ownerCarDto.setCommunityId(feeDto.getCommunityId());
- ownerCarDto.setCarId(feeDto.getPayerObjId());
- List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
-
- if (ownerCarDtos == null || ownerCarDtos.size() != 1) {
- targetEndDateAndOweMonth.put("oweMonth", 0);
- targetEndDateAndOweMonth.put("targetEndDate", "");
- return targetEndDateAndOweMonth;
- }
-
- targetEndDate = ownerCarDtos.get(0).getEndTime();
- //璇存槑娌℃湁娆犺垂
- if (endDate.getTime() >= targetEndDate.getTime()) {
- // 鐩爣鍒版湡鏃堕棿 - 鍒版湡鏃堕棿 = 娆犺垂鏈堜唤
- oweMonth = 0;
- targetEndDateAndOweMonth.put("oweMonth", oweMonth);
- targetEndDateAndOweMonth.put("targetEndDate", targetEndDate);
- return targetEndDateAndOweMonth;
- }
- }
-
- //缂磋垂鍛ㄦ湡
- long paymentCycle = Long.parseLong(feeDto.getPaymentCycle());
- // 褰撳墠鏃堕棿 - 寮�濮嬫椂闂� = 鏈堜唤
- double mulMonth = 0.0;
- mulMonth = dayCompare(startDate, billEndTime);
-
- // 鏈堜唤/ 鍛ㄦ湡 = 杞暟锛堝悜涓婂彇鏁达級
- double round = 0.0;
- if ("1200".equals(feeDto.getPaymentCd())) { // 棰勪粯璐�
- round = Math.floor(mulMonth / paymentCycle) + 1;
- } else { //鍚庝粯璐�
- round = Math.floor(mulMonth / paymentCycle);
- }
- // 杞暟 * 鍛ㄦ湡 * 30 + 寮�濮嬫椂闂� = 鐩爣 鍒版湡鏃堕棿
- targetEndDate = getTargetEndTime(round * paymentCycle, startDate);
- //璐圭敤 蹇粨鏉熶簡
- if (feeDto.getConfigEndTime().getTime() < targetEndDate.getTime()) {
- targetEndDate = feeDto.getConfigEndTime();
- }
- //璇存槑娌℃湁娆犺垂
- if (endDate.getTime() < targetEndDate.getTime()) {
- // 鐩爣鍒版湡鏃堕棿 - 鍒版湡鏃堕棿 = 娆犺垂鏈堜唤
- oweMonth = dayCompare(endDate, targetEndDate);
- }
-
- if (feeDto.getEndTime().getTime() > targetEndDate.getTime()) {
- targetEndDate = feeDto.getEndTime();
- }
- }
-
- targetEndDateAndOweMonth.put("oweMonth", oweMonth);
- targetEndDateAndOweMonth.put("targetEndDate", targetEndDate);
- return targetEndDateAndOweMonth;
- }
private Date getTargetEndTime(double v, Date startDate) {
Calendar endDate = Calendar.getInstance();
--
Gitblit v1.8.0