超标原因字段调整

This commit is contained in:
dengwc 2024-04-19 16:28:50 +08:00
parent ab6b7d6c1a
commit ca0b82a5a8
1 changed files with 13 additions and 0 deletions

View File

@ -1,13 +1,16 @@
package com.chint.interfaces.rest.bpm;
import com.chint.domain.aggregates.order.*;
import com.chint.domain.aggregates.user.User;
import com.chint.domain.exceptions.NotFoundException;
import com.chint.domain.repository.LegRepository;
import com.chint.infrastructure.constant.BPMConstant;
import com.chint.infrastructure.constant.CommonMessageConstant;
import com.chint.infrastructure.repository.jdbc.JdbcUserRepository;
import com.chint.infrastructure.util.DaysUtil;
import com.chint.interfaces.rest.bpm.dto.ANExceedStandardDto;
import com.chint.interfaces.rest.bpm.dto.ExceedStandardDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -30,6 +33,9 @@ public class BPMParamFactory {
@Autowired
private LegRepository legRepository;
@Autowired
private JdbcUserRepository userRepository;
public ExceedStandardDto creatAuditParamByCar(OrderDetail orderDetail) {
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
ExceedStandardDto exceedStandardDto = new ExceedStandardDto();
@ -102,6 +108,13 @@ public class BPMParamFactory {
.setOccupant(hotelOrderDetail.getBookingName())//入住人
.setDays(Integer.valueOf(hotelOrderDetail.getNightCount()))//入住天数
.setExcessAmountDay(divide);//超标金额(/)
if (StringUtils.isBlank(exceedStandardDto.getOccupant())) {
String employeeNo = orderDetail.getEmployeeNo();//用户id
User user = userRepository.findByEmployeeNo(employeeNo);
if (user != null) {
exceedStandardDto.setOccupant(user.getName());//入住人
}
}
return exceedStandardDto;
}