费用推送接口修改
This commit is contained in:
parent
45774cad12
commit
92c7c0c9ae
|
|
@ -30,7 +30,7 @@ public class InformMonthly {
|
||||||
* - 星期(?):表示星期,由于每月第一天的星期不固定,因此使用?表示。
|
* - 星期(?):表示星期,由于每月第一天的星期不固定,因此使用?表示。
|
||||||
* - 年份(空):不指定年份,表示每年都执行。
|
* - 年份(空):不指定年份,表示每年都执行。
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 1 * * ?")
|
//@Scheduled(cron = "0 0 1 * * ?")
|
||||||
public void taskCycle() {
|
public void taskCycle() {
|
||||||
System.out.println("使用SpringMVC框架配置定时任务");
|
System.out.println("使用SpringMVC框架配置定时任务");
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -1303,14 +1303,22 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
||||||
// 计算租赁天数
|
// 计算租赁天数
|
||||||
long leaseDays = calculateDaysBetween(calcStartTime, calcEndTime);
|
long leaseDays = calculateDaysBetween(calcStartTime, calcEndTime);
|
||||||
|
|
||||||
|
|
||||||
// 计算租赁费用
|
// 计算租赁费用
|
||||||
BigDecimal leaseCost = BigDecimal.ZERO;
|
BigDecimal leaseCost = BigDecimal.ZERO;
|
||||||
if (result.getComsumable() != null && result.getComsumable() == 1) {
|
if (result.getComsumable() != null && result.getComsumable() == 1) {
|
||||||
|
Date startTime =result.getStartTime();
|
||||||
|
long startDays = calculateDaysBetween(startTime, calcEndTime);
|
||||||
|
|
||||||
if (result.getNum() == null) {
|
if (result.getNum() == null) {
|
||||||
result.setNum(BigDecimal.ZERO);
|
result.setNum(BigDecimal.ZERO);
|
||||||
}
|
}
|
||||||
// 消耗性物资直接计算购置价
|
|
||||||
result.setConsumeCost(result.getNum().multiply(Optional.ofNullable(result.getBuyPrice()).orElse(BigDecimal.ZERO)));
|
if(startDays >0) {
|
||||||
|
// 消耗性物资直接计算购置价
|
||||||
|
result.setConsumeCost(result.getNum().multiply(Optional.ofNullable(result.getBuyPrice()).orElse(BigDecimal.ZERO)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (result.getNum() != null && result.getLeasePrice() != null && leaseDays >= 1) {
|
if (result.getNum() != null && result.getLeasePrice() != null && leaseDays >= 1) {
|
||||||
// 非消耗性物资按照租赁单价计算租赁费用
|
// 非消耗性物资按照租赁单价计算租赁费用
|
||||||
|
|
@ -1456,7 +1464,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
|
||||||
|
|
||||||
Calendar endCal = Calendar.getInstance();
|
Calendar endCal = Calendar.getInstance();
|
||||||
endCal.setTime(endDate);
|
endCal.setTime(endDate);
|
||||||
// 将结束时间设为当天00:00:00.000
|
// 将结束时间设为当天00:00:00.000
|
||||||
endCal.set(Calendar.HOUR_OF_DAY, 0);
|
endCal.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
endCal.set(Calendar.MINUTE, 0);
|
endCal.set(Calendar.MINUTE, 0);
|
||||||
endCal.set(Calendar.SECOND, 0);
|
endCal.set(Calendar.SECOND, 0);
|
||||||
|
|
|
||||||
|
|
@ -434,8 +434,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{item.leasePrice},
|
#{item.leasePrice},
|
||||||
#{item.leaseCost},
|
#{item.leaseCost},
|
||||||
#{item.taskId},
|
#{item.taskId},
|
||||||
null,
|
#{item.buyPrice},
|
||||||
0.00,
|
#{item.consumeCost},
|
||||||
#{item.equipmentType}
|
#{item.equipmentType}
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue