From ca0b82a5a8216b203fd3c8b6bb0ddf5ecb35af6e Mon Sep 17 00:00:00 2001 From: dengwc Date: Fri, 19 Apr 2024 16:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E6=A0=87=E5=8E=9F=E5=9B=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/interfaces/rest/bpm/BPMParamFactory.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; }