diff --git a/src/main/java/com/chint/interfaces/rest/bpm/BPMParamFactory.java b/src/main/java/com/chint/interfaces/rest/bpm/BPMParamFactory.java index 4123363b..6a5ae496 100644 --- a/src/main/java/com/chint/interfaces/rest/bpm/BPMParamFactory.java +++ b/src/main/java/com/chint/interfaces/rest/bpm/BPMParamFactory.java @@ -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; }