|
|
@@ -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; |
|
|
|
|
|
|
|
/** |
|
|
|
* <p> |
|
|
@@ -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<Integer, String> 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<String> projectNames = new ArrayList<>(); |
|
|
|
if (meeting.getIsInnerProject()) { |
|
|
|
List<MeetingInnerProject> 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()) { |
|
|
|