diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExportController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExportController.java index 542845d..b742e40 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExportController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingExportController.java @@ -29,7 +29,7 @@ public class MeetingExportController { private final ExpertExportManage expertExportManage; - @GetMapping("/expertFee/{meetingId}") + @GetMapping("/expertFeeTable/{meetingId}") @ApiOperation("专家费用单导出") public void exportFeeForExpert(@PathVariable Long meetingId, HttpServletResponse response) { expertExportManage.exportFeeForExpert(meetingId, response); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/LaborFeeAuditTableDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/LaborFeeAuditTableDTO.java index 1b0966d..f4cb201 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/LaborFeeAuditTableDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/LaborFeeAuditTableDTO.java @@ -23,4 +23,6 @@ public class LaborFeeAuditTableDTO { private List experts; + private String meetingUsageTime; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertExportManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertExportManage.java index 954f6a0..02ae9c5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertExportManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertExportManage.java @@ -21,7 +21,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.sms.utils.DateUtil; import freemarker.template.TemplateException; -import lombok.AllArgsConstructor; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -31,8 +31,8 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; /** *

@@ -44,7 +44,7 @@ import java.util.concurrent.atomic.AtomicInteger; **/ @Slf4j @Component -@AllArgsConstructor +@RequiredArgsConstructor public class ExpertExportManage { private final IMeetingService meetingService; @@ -54,6 +54,20 @@ public class ExpertExportManage { private final IExpertUserFullInfoService expertUserInfoService; private final IProjectService projectService; + //================================================================================================================== + + static Function meetingUsageTime = (type) -> { + if (1 == type) { + return "半天"; + } + if (2 == type) { + return "一天"; + } + return StrUtil.EMPTY; + }; + + //================================================================================================================== + public void exportFeeForExpert(Long meetingId, HttpServletResponse response) { final String template = "专家费.ftl"; String fileName = UUID.randomUUID().toString(true) + ".doc"; @@ -137,6 +151,7 @@ public class ExpertExportManage { Meeting meeting = meetingService.getById(meetingId); LaborFeeAuditTableDTO data = new LaborFeeAuditTableDTO(); data.setMeetingTime(DateUtil.localDateTimeFormat(meeting.getStartTime(), "yyyy-MM-dd HH:mm")); + data.setMeetingUsageTime(meetingUsageTime.apply(meeting.getMeetingUsageTime())); List projectNames = new ArrayList<>(); if (meeting.getIsInnerProject()) { List inners = meetingInnerProjectService.listByMeetingId(meetingId); @@ -178,7 +193,7 @@ public class ExpertExportManage { Meeting meeting = meetingService.getById(meetingId); ExpertInviteTableDTO data = new ExpertInviteTableDTO(); data.setMeetingTime(DateUtil.localDateTimeFormat(meeting.getStartTime(), "yyyy-MM-dd HH:mm")); - data.setMeetingUsageTime(Objects.equals(1, meeting.getMeetingUsageTime()) ? "半天" : "一天"); + data.setMeetingUsageTime(meetingUsageTime.apply(meeting.getMeetingUsageTime())); data.setMeetingCreateBy(meeting.getCreator()); data.setMeetingAddress(meeting.getMeetingAddress()); if (meeting.getIsInnerProject()) { diff --git a/pmapi/src/main/resources/template/劳务费发放.ftl b/pmapi/src/main/resources/template/劳务费发放.ftl index 2191840..af6bcc0 100644 --- a/pmapi/src/main/resources/template/劳务费发放.ftl +++ b/pmapi/src/main/resources/template/劳务费发放.ftl @@ -599,7 +599,7 @@ - 半天 + ${meetingUsageTime}