MyTetra Share
Делитесь знаниями!
com.groupstp.rtneo.core.bean.calculation.CalculationWorkerBean#getAreaNotInRentNew
Время создания: 16.10.2019 14:07
Раздел: INFO - JOB - CUBA
Запись: wwwlir/Tetra/master/base/15712060762d1wf0eo9d/text.html на raw.githubusercontent.com
private BigDecimal getAreaNotInRentNew(ContractPosition position, Date period) {
try{
Calendar cal = Calendar.
getInstance();
cal.setTime(period);

cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
Date from = cal.getTime();

cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
Date to = cal.getTime();

BigDecimal sum = dataManager.loadValue("select max(r.contragentRealEstate.calculationAmount) - sum(r.areaInRent) from rtneo$RealEstateRenter r where " +
"r.contragentRealEstate.id = :id " +
"and (r.renterRecord.validityFrom <= :from " +
"and r.renterRecord.validityTo >= :to)", BigDecimal.class)
.parameter(
"id", position.getContragentRealEstate().getId())
.parameter(
"from", from)
.parameter(
"to", to)
.one()
;
return
sum;
} catch (NullPointerException e) {
return BigDecimal.ZERO;
}
}
Так же в этом разделе:
 
MyTetra Share v.0.65
Яндекс индекс цитирования