From b173d31976fc4731b7c247d4038de92134eba317 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 29 六月 2023 11:42:17 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity
---
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java | 212 ++++++++++++++++------------------------------------
1 files changed, 65 insertions(+), 147 deletions(-)
diff --git a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
index 2a261ae..857f152 100755
--- a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -4,7 +4,7 @@
import com.java110.core.factory.GenerateCodeFactory;
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;
@@ -12,17 +12,18 @@
import com.java110.dto.report.ReportFeeDetailDto;
import com.java110.dto.report.ReportFeeDto;
import com.java110.dto.report.ReportRoomDto;
-import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
+import com.java110.dto.reportFee.ReportFeeMonthStatisticsDto;
import com.java110.intf.community.IFloorInnerServiceSMO;
import com.java110.intf.community.IRoomInnerServiceSMO;
import com.java110.intf.community.IUnitInnerServiceSMO;
import com.java110.intf.report.IGeneratorFeeMonthStatisticsInnerServiceSMO;
import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
import com.java110.intf.user.IOwnerCarInnerServiceSMO;
-import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
+import com.java110.po.reportFee.ReportFeeMonthStatisticsPo;
import com.java110.report.dao.IReportCommunityServiceDao;
import com.java110.report.dao.IReportFeeMonthStatisticsServiceDao;
import com.java110.report.dao.IReportFeeServiceDao;
+import com.java110.utils.constant.FeeConfigConstant;
import com.java110.utils.util.*;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
@@ -166,6 +167,7 @@
ReportCarDto reportCarDto = new ReportCarDto();
reportCarDto.setCommunityId(reportFeeMonthStatisticsPo.getCommunityId());
+ reportCarDto.setLeaseTypes(new String[]{OwnerCarDto.LEASE_TYPE_MONTH,OwnerCarDto.LEASE_TYPE_INNER,OwnerCarDto.LEASE_TYPE_SALE,OwnerCarDto.LEASE_TYPE_NO_MONEY});
int count = reportCommunityServiceDaoImpl.getCarCount(reportCarDto);
@@ -335,92 +337,12 @@
Calendar calender = Calendar.getInstance();
calender.setTime(endTime);
- int year = calender.get(Calendar.YEAR);
- int month = calender.get(Calendar.MONTH);
ReportFeeMonthStatisticsPo tmpReportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
tmpReportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
tmpReportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getFormatTimeString(endTime, DateUtil.DATE_FORMATE_STRING_A));
tmpReportFeeMonthStatisticsPo.setOweAmount("0");
reportFeeMonthStatisticsServiceDaoImpl.updateReportFeeMonthStatisticsOwe(BeanConvertUtil.beanCovertMap(tmpReportFeeMonthStatisticsPo));
- }
-
- /**
- * 瑙e喅涓婄嚎鍓� 娆犺垂鏁版嵁
- *
- * @param tmpReportCarDto
- * @param tmpReportFeeDto
- */
- private void dealBeforeUploadCarFee(ReportFeeDto tmpReportFeeDto, ReportCarDto tmpReportCarDto) {
-
-
- Calendar preMonthDate = Calendar.getInstance();
- preMonthDate.set(Calendar.DAY_OF_MONTH, 1);
- preMonthDate.add(Calendar.DAY_OF_MONTH, -1);
-
- //褰撴湀涓�鏃�
- Calendar curMonthDate = Calendar.getInstance();
- curMonthDate.set(Calendar.DAY_OF_MONTH, 1);
- curMonthDate.set(Calendar.HOUR_OF_DAY, 0);
- curMonthDate.set(Calendar.MINUTE, 0);
- curMonthDate.set(Calendar.SECOND, 0);
- if (tmpReportFeeDto.getEndTime().getTime() > curMonthDate.getTime().getTime()) { //璇存槑娌℃湁娆犺垂
- return;
- }
-
- ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
- reportFeeMonthStatisticsDto.setCommunityId(tmpReportCarDto.getCommunityId());
- reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
- reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
- reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
- reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
- reportFeeMonthStatisticsDto.setFeeYear(preMonthDate.get(Calendar.YEAR) + "");
- reportFeeMonthStatisticsDto.setFeeMonth((preMonthDate.get(Calendar.MONTH) + 1) + "");
- List<ReportFeeMonthStatisticsDto> statistics = BeanConvertUtil.covertBeanList(
- reportFeeMonthStatisticsServiceDaoImpl.getReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto)),
- ReportFeeMonthStatisticsDto.class);
- //涓婁釜鏈堟湁鏁版嵁 涓嶅鐞�
- if (statistics != null && statistics.size() > 0) {
- return;
- }
-
- if (tmpReportFeeDto.getDeadlineTime().getTime() < curMonthDate.getTime().getTime()) {
- curMonthDate.setTime(tmpReportFeeDto.getDeadlineTime());
- }
-
- double receivableAmount = 0.0;
- if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) {
- receivableAmount = tmpReportFeeDto.getFeePrice();
- } else {
- double month = computeFeeSMOImpl.dayCompare(tmpReportFeeDto.getEndTime(), curMonthDate.getTime());
- BigDecimal curDegree = new BigDecimal(month);
- receivableAmount = curDegree.multiply(new BigDecimal(tmpReportFeeDto.getFeePrice())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
- }
-
-
- ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
- reportFeeMonthStatisticsPo.setDeadlineTime(DateUtil.getFormatTimeString(curMonthDate.getTime(), DateUtil.DATE_FORMATE_STRING_A));
-
- reportFeeMonthStatisticsPo.setOweAmount(receivableAmount + "");
- reportFeeMonthStatisticsPo.setReceivedAmount("0");
- reportFeeMonthStatisticsPo.setReceivableAmount(receivableAmount + "");
- reportFeeMonthStatisticsPo.setStatisticsId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_statisticsId));
- reportFeeMonthStatisticsPo.setCommunityId(tmpReportFeeDto.getCommunityId());
- reportFeeMonthStatisticsPo.setConfigId(tmpReportFeeDto.getConfigId());
- reportFeeMonthStatisticsPo.setFeeCreateTime(DateUtil.getFormatTimeString(tmpReportFeeDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A));
- reportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
- reportFeeMonthStatisticsPo.setFeeMonth((preMonthDate.get(Calendar.MONTH) + 1) + "");
- reportFeeMonthStatisticsPo.setFeeYear(preMonthDate.get(Calendar.YEAR) + "");
- reportFeeMonthStatisticsPo.setCurMaxTime(DateUtil.getFormatTimeString(DateUtil.getFirstDate(), DateUtil.DATE_FORMATE_STRING_A));
- reportFeeMonthStatisticsPo.setObjId(tmpReportCarDto.getCarId());
- reportFeeMonthStatisticsPo.setObjType(FeeDto.PAYER_OBJ_TYPE_CAR);
- reportFeeMonthStatisticsPo.setFeeName(tmpReportFeeDto.getFeeName());
- reportFeeMonthStatisticsPo.setObjName(tmpReportCarDto.getCarNum() + "(" + tmpReportCarDto.getAreaNum() + "鍋滆溅鍦�" + tmpReportCarDto.getNum() + "杞︿綅)");
- reportFeeMonthStatisticsPo.setObjNameNum(tmpReportCarDto.getAreaNum() + "-" + tmpReportCarDto.getNum() + "-" + tmpReportCarDto.getCarNum());
- reportFeeMonthStatisticsPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
- reportFeeMonthStatisticsServiceDaoImpl.saveReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
-
-
}
/**
@@ -465,8 +387,7 @@
reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId()); //杩欓噷涓嶈兘娉ㄩ噴锛屽洜涓轰竴涓垂鐢ㄥ娆″垱寤烘椂浼氬瓨鍦ㄨ鐩� 瀛樺湪bug闂
reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
- int year = DateUtil.getYear();
- int month = DateUtil.getMonth();
+
reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
List<ReportFeeMonthStatisticsDto> statistics = BeanConvertUtil.covertBeanList(
@@ -483,11 +404,6 @@
Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
tmpReportFeeDto.setDeadlineTime(targetEndDate);
double oweAmount = getOweAmount(tmpReportFeeDto, reportRoomDto, null); //娆犺垂
-
- //double receivableAmount = getReceivableAmount(tmpReportFeeDto, receivedAmount); //搴旀敹
- //瑙e喅涓婄嚎鏃� 涔嬪墠娆犺垂娌℃湁鍒峰叆瀵艰嚧璐圭敤閲戦瀵逛笉涓婇棶棰樺鐞�
- //dealBeforeUploadRoomFee(reportRoomDto, tmpReportFeeDto);
-
double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, reportRoomDto, null);
tmpReportFeeDto.setFeePrice(feePrice);
@@ -496,46 +412,34 @@
if (!ListUtil.isNull(statistics)) {
ReportFeeMonthStatisticsDto statistic = statistics.get(0);
reportFeeMonthStatisticsPo.setStatisticsId(statistic.getStatisticsId());
- //reportFeeMonthStatisticsPo.setReceivableAmount(receivableAmount + "");
- //reportFeeMonthStatisticsPo.setReceivedAmount("0");
+
reportFeeMonthStatisticsPo.setOweAmount(oweAmount + "");
reportFeeMonthStatisticsPo.setFeeId(tmpReportFeeDto.getFeeId());
reportFeeMonthStatisticsPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
reportFeeMonthStatisticsPo.setFeeName(StringUtil.isEmpty(tmpReportFeeDto.getImportFeeName()) ? tmpReportFeeDto.getFeeName() : tmpReportFeeDto.getImportFeeName());
// 缂磋垂浜嗗氨寰楀埛
- reportFeeMonthStatisticsPo.setHisOweAmount(getHisOweAmount(tmpReportFeeDto) + "");
+ reportFeeMonthStatisticsPo.setHisOweAmount(MoneyUtil.computePriceScale(getHisOweAmount(tmpReportFeeDto),
+ tmpReportFeeDto.getScale(),
+ Integer.parseInt(tmpReportFeeDto.getDecimalPlace())) + "");
//鏈夊彲鑳芥槸鏈堝唴鍒涘缓鐨勮垂鐢� 姣斿鐢佃垂姘磋垂
- reportFeeMonthStatisticsPo.setCurReceivableAmount(getCurFeeReceivableAmount(tmpReportFeeDto) + "");
- reportFeeMonthStatisticsPo.setCurReceivedAmount(getReceivedAmount(tmpReportFeeDto, 1) + "");
- reportFeeMonthStatisticsPo.setHisOweReceivedAmount(getReceivedAmount(tmpReportFeeDto, 2) + "");
- reportFeeMonthStatisticsPo.setPreReceivedAmount(getReceivedAmount(tmpReportFeeDto, 3) + "");
- /*if (!StringUtil.isEmpty(statistic.getObjType()) && statistic.getObjType().equals("3333")) { //鎴垮眿
- if (!StringUtil.isEmpty(statistic.getObjId())) {
- //鑾峰彇浠樿垂瀵硅薄ID
- String objId = statistic.getObjId();
- RoomDto roomDto = new RoomDto();
- roomDto.setRoomId(objId);
- List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
- if (roomDtos != null && roomDtos.size() == 1) {
- String roomNum = roomDtos.get(0).getRoomNum();
- UnitDto unitDto = new UnitDto();
- unitDto.setUnitId(roomDtos.get(0).getUnitId());
- List<UnitDto> unitDtos = unitInnerServiceSMOImpl.queryUnits(unitDto);
- if (unitDtos != null && unitDtos.size() == 1) {
- String unitNum = unitDtos.get(0).getUnitNum();
- FloorDto floorDto = new FloorDto();
- floorDto.setFloorId(unitDtos.get(0).getFloorId());
- List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto);
- if(floorDtos != null && floorDtos.size() == 1){
- String floorNum = floorDtos.get(0).getFloorNum();
- statistic.setObjNameNum(floorNum + "-" + unitNum + "-" + roomNum);
- }
- }
- }
- }
- }*/
+ reportFeeMonthStatisticsPo.setCurReceivableAmount(
+ MoneyUtil.computePriceScale(getCurFeeReceivableAmount(tmpReportFeeDto),
+ tmpReportFeeDto.getScale(),
+ Integer.parseInt(tmpReportFeeDto.getDecimalPlace())) + "");
+ reportFeeMonthStatisticsPo.setCurReceivedAmount(
+ MoneyUtil.computePriceScale(getReceivedAmount(tmpReportFeeDto, 1),
+ tmpReportFeeDto.getScale(),
+ Integer.parseInt(tmpReportFeeDto.getDecimalPlace())) + "");
+ reportFeeMonthStatisticsPo.setHisOweReceivedAmount(
+ MoneyUtil.computePriceScale(getReceivedAmount(tmpReportFeeDto, 2),
+ tmpReportFeeDto.getScale(),
+ Integer.parseInt(tmpReportFeeDto.getDecimalPlace())) + "");
+ reportFeeMonthStatisticsPo.setPreReceivedAmount(MoneyUtil.computePriceScale(getReceivedAmount(tmpReportFeeDto, 3),
+ tmpReportFeeDto.getScale(),
+ Integer.parseInt(tmpReportFeeDto.getDecimalPlace())) + "");
reportFeeMonthStatisticsServiceDaoImpl.updateReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
} else {
+
reportFeeMonthStatisticsPo.setOweAmount(oweAmount + "");
reportFeeMonthStatisticsPo.setReceivedAmount("0");
reportFeeMonthStatisticsPo.setReceivableAmount("0");
@@ -564,9 +468,16 @@
reportFeeMonthStatisticsPo.setHisOweReceivedAmount(getReceivedAmount(tmpReportFeeDto, 2) + "");
reportFeeMonthStatisticsPo.setPreReceivedAmount(getReceivedAmount(tmpReportFeeDto, 3) + "");
reportFeeMonthStatisticsPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
- reportFeeMonthStatisticsServiceDaoImpl.saveReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
- //澶勭悊姘寸數璐癸紝姘寸數璐规牴鎹紑濮嬫椂闂磋鍦ㄧ浉搴旀湀琛ュ厖鏁版嵁
- dealMeteWater(reportFeeMonthStatisticsPo, tmpReportFeeDto);
+ //濡傛灉鏄� 姘磋垂 鐢佃垂 鐓ゆ皵璐�
+ if (!FeeConfigDto.FEE_TYPE_CD_METER.equals(tmpReportFeeDto.getFeeTypeCd())
+ && !FeeConfigDto.FEE_TYPE_CD_WATER.equals(tmpReportFeeDto.getFeeTypeCd())
+ && !FeeConfigDto.FEE_TYPE_CD_GAS.equals(tmpReportFeeDto.getFeeTypeCd())
+ ) {
+ reportFeeMonthStatisticsServiceDaoImpl.saveReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
+ } else {
+ //澶勭悊姘寸數璐癸紝姘寸數璐规牴鎹紑濮嬫椂闂磋鍦ㄧ浉搴旀湀琛ュ厖鏁版嵁
+ dealMeteWater(reportFeeMonthStatisticsPo, tmpReportFeeDto);
+ }
}
@@ -598,14 +509,14 @@
//鏍规嵁璐圭敤寮�濮嬫椂闂� 璁$畻鏈堜唤
Date endTime = tmpReportFeeDto.getEndTime();
//鍘婚櫎 0 鍥犱负琛ㄩ噷鐨勬湀浠芥槸娌℃湁闆�
- String curMonth = Integer.parseInt(DateUtil.getFormatTimeString(endTime, "MM"))+"";
+ String curMonth = Integer.parseInt(DateUtil.getFormatTimeString(endTime, "MM")) + "";
String curYear = DateUtil.getFormatTimeString(endTime, "YYYY");
//鏌ヨ鏄惁瀛樺湪 鏁版嵁
ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
reportFeeMonthStatisticsDto.setCommunityId(tmpReportFeeDto.getCommunityId());
reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
- //reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
+ reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
reportFeeMonthStatisticsDto.setFeeYear(curYear);
reportFeeMonthStatisticsDto.setFeeMonth(curMonth);
@@ -669,15 +580,15 @@
if (allDays == 0) { // 闃叉闄ゆ暟涓�0
return 0;
}
- BigDecimal moneyPreDay = feePriceDec.divide(new BigDecimal(allDays), 2, BigDecimal.ROUND_HALF_EVEN);
+ BigDecimal moneyPreDay = feePriceDec.divide(new BigDecimal(allDays), FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN);
if (tmpReportFeeDto.getDeadlineTime().getTime() > nextDate.getTime()) {
int day = DateUtil.getCurrentMonthDay();
- return moneyPreDay.multiply(new BigDecimal(day)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+ return moneyPreDay.multiply(new BigDecimal(day)).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_UP).doubleValue();
}
// 缁撴潫鏃堕棿 鍦ㄥ綋鏈堝唴
double hisDays = computeFeeSMOImpl.daysBetween(tmpReportFeeDto.getEndTime(), curDate);
- BigDecimal hisDayDec = moneyPreDay.multiply(new BigDecimal(hisDays)).setScale(2, BigDecimal.ROUND_HALF_UP);
- return feePriceDec.subtract(hisDayDec).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+ BigDecimal hisDayDec = moneyPreDay.multiply(new BigDecimal(hisDays)).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_UP);
+ return feePriceDec.subtract(hisDayDec).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_UP).doubleValue();
}
month = computeFeeSMOImpl.dayCompare(curDate, tmpReportFeeDto.getDeadlineTime());
@@ -685,7 +596,7 @@
return 0;
}
if (month < 1) {
- return feePriceDec.multiply(new BigDecimal(month)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ return feePriceDec.multiply(new BigDecimal(month)).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
}
return tmpReportFeeDto.getFeePrice();
@@ -706,6 +617,9 @@
if (curDate.getTime() < tmpReportFeeDto.getEndTime().getTime()) {
return 0.0;
}
+ if(FeeDto.STATE_FINISH.equals(tmpReportFeeDto.getState())){
+ return 0.0;
+ }
if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) {
//璇存槑涓�娆℃�ц垂鐢ㄩ兘娆犱簡
@@ -718,11 +632,11 @@
return 0;
}
//杩欐槸姣忓ぉ鐨勯挶
- BigDecimal moneyPreDay = feePriceDec.divide(new BigDecimal(allDays), 2, BigDecimal.ROUND_HALF_EVEN);
+ BigDecimal moneyPreDay = feePriceDec.divide(new BigDecimal(allDays), FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN);
double hisDays = computeFeeSMOImpl.daysBetween(tmpReportFeeDto.getEndTime(), curDate);
- return moneyPreDay.multiply(new BigDecimal(hisDays)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+ return moneyPreDay.multiply(new BigDecimal(hisDays)).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_UP).doubleValue();
}
double month = 0.0;
@@ -732,7 +646,7 @@
month = computeFeeSMOImpl.dayCompare(tmpReportFeeDto.getEndTime(), curDate);
}
BigDecimal curDegree = new BigDecimal(month);
- return curDegree.multiply(feePriceDec).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ return curDegree.multiply(feePriceDec).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
}
@@ -785,7 +699,7 @@
} else {
double month = computeFeeSMOImpl.dayCompare(tmpReportFeeDto.getEndTime(), curMonthDate.getTime());
BigDecimal curDegree = new BigDecimal(month);
- receivableAmount = curDegree.multiply(new BigDecimal(tmpReportFeeDto.getFeePrice())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ receivableAmount = curDegree.multiply(new BigDecimal(tmpReportFeeDto.getFeePrice())).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
}
ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
reportFeeMonthStatisticsPo.setDeadlineTime(DateUtil.getFormatTimeString(curMonthDate.getTime(), DateUtil.DATE_FORMATE_STRING_A));
@@ -896,14 +810,18 @@
if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) {
return computeOnceFee(tmpReportFeeDto);
}
- OwnerCarDto ownerCarDto = new OwnerCarDto();
- ownerCarDto.setCommunityId(tmpReportFeeDto.getCommunityId());
- ownerCarDto.setCarId(tmpReportFeeDto.getCarId());
- List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
- if (ownerCarDtos == null || ownerCarDtos.size() < 1) {
+// OwnerCarDto ownerCarDto = new OwnerCarDto();
+// ownerCarDto.setCommunityId(tmpReportFeeDto.getCommunityId());
+// ownerCarDto.setCarId(tmpReportFeeDto.getCarId());
+// List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
+// if (ownerCarDtos == null || ownerCarDtos.size() < 1) {
+// return 0.0;
+// }
+ Date endTime = reportCarDto.getEndTime();
+
+ if(endTime == null){
return 0.0;
}
- Date endTime = ownerCarDtos.get(0).getEndTime();
Date maxEndDate = tmpReportFeeDto.getDeadlineTime();
if (FeeDto.FEE_FLAG_CYCLE.equals(tmpReportFeeDto.getFeeFlag())) {
@@ -923,7 +841,7 @@
//绠楀ぉ鏁�
double month = computeFeeSMOImpl.dayCompare(tmpReportFeeDto.getEndTime(), DateUtil.getNextMonthFirstDate());
BigDecimal curDegree = new BigDecimal(month);
- return curDegree.multiply(feePriceDec).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ return curDegree.multiply(feePriceDec).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
}
//3.0 璐圭敤鍒版湡鏃堕棿 涓嶅湪褰撴湀锛岃垂鐢ㄧ粨鏉熸椂闂村湪褰撴湀
if (!belongCurMonth(tmpReportFeeDto.getEndTime())
@@ -931,7 +849,7 @@
//绠楀ぉ鏁�
double month = computeFeeSMOImpl.dayCompare(DateUtil.getFirstDate(), maxEndDate);
BigDecimal curDegree = new BigDecimal(month);
- return curDegree.multiply(feePriceDec).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ return curDegree.multiply(feePriceDec).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
}
return 0.0;
}
@@ -951,7 +869,7 @@
}
BigDecimal feePriceDec = new BigDecimal(tmpReportFeeDto.getFeePrice());
- double money = feePriceDec.divide(new BigDecimal(month), 2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ double money = feePriceDec.divide(new BigDecimal(month), FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
return money;
}
@@ -993,7 +911,7 @@
//绠楀ぉ鏁�
double month = computeFeeSMOImpl.dayCompare(tmpReportFeeDto.getEndTime(), DateUtil.getNextMonthFirstDate());
BigDecimal curDegree = new BigDecimal(month);
- return curDegree.multiply(feePriceDec).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ return curDegree.multiply(feePriceDec).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
}
//3.0 璐圭敤鍒版湡鏃堕棿 涓嶅湪褰撴湀锛岃垂鐢ㄧ粨鏉熸椂闂村湪褰撴湀
if (!belongCurMonth(tmpReportFeeDto.getEndTime())
@@ -1001,7 +919,7 @@
//绠楀ぉ鏁�
double month = computeFeeSMOImpl.dayCompare(DateUtil.getFirstDate(), maxEndDate);
BigDecimal curDegree = new BigDecimal(month);
- return curDegree.multiply(feePriceDec).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ return curDegree.multiply(feePriceDec).setScale(FeeConfigConstant.FEE_SCALE, BigDecimal.ROUND_HALF_EVEN).doubleValue();
}
return 0.0;
}
--
Gitblit v1.8.0