|
@@ -1,1258 +0,0 @@
|
|
|
-package com.qunzhixinxi.hnqz.report.service.impl;
|
|
|
-
|
|
|
-import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
|
|
|
-import com.qunzhixinxi.hnqz.report.config.UpmsConfig;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmDaDrugEnt;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmReport;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmScorePackage;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmScorePackageSettleNote;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmTask;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskContent;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskContentConfig;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskType;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.entity.XlsTask;
|
|
|
-import com.qunzhixinxi.hnqz.admin.api.constant.enums.ReportEnum;
|
|
|
-import com.qunzhixinxi.hnqz.report.mapper.WmScorePackageSettleNoteMapper;
|
|
|
-import com.qunzhixinxi.hnqz.report.mapper.WmTaskMapper;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.ReportExportService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.SysDeptService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.SysFileService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.SysUserService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmDaDrugEntService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmReportService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmScorePackageService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmScorePackageStatusService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmTaskContentConfigService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmTaskContentService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmTaskService;
|
|
|
-import com.qunzhixinxi.hnqz.report.service.WmTaskTypeService;
|
|
|
-import com.qunzhixinxi.hnqz.report.util.ExportReport;
|
|
|
-import com.qunzhixinxi.hnqz.report.util.Html2ImageByJsWrapper;
|
|
|
-import com.qunzhixinxi.hnqz.common.core.util.R;
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.commons.io.IOUtils;
|
|
|
-import org.springframework.context.annotation.Primary;
|
|
|
-import org.springframework.mock.web.MockMultipartFile;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileInputStream;
|
|
|
-import java.io.IOException;
|
|
|
-import java.lang.reflect.Field;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.sql.Timestamp;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- * <p>
|
|
|
- * 报告管理 服务实现类
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @author hnqz
|
|
|
- * @since 2018-01-20
|
|
|
- */
|
|
|
-@Slf4j
|
|
|
-@Service("ReportExportForJinpaiServiceImpl")
|
|
|
-@AllArgsConstructor
|
|
|
-public class ReportExportForJinpaiServiceImpl implements ReportExportService {
|
|
|
-
|
|
|
- private final WmTaskService wmTaskService;
|
|
|
- private final WmScorePackageService wmScorePackageService;
|
|
|
- private final UpmsConfig upmsConfig;
|
|
|
- private final SysFileService sysFileService;
|
|
|
- private final WmDaDrugEntService wmDaDrugEntService;
|
|
|
- private final WmTaskTypeService wmTaskTypeService;
|
|
|
- private final SysUserService sysUserService;
|
|
|
- private final SysDeptService sysDeptService;
|
|
|
- private final WmTaskContentService wmTaskContentService;
|
|
|
- private final WmTaskContentConfigService wmTaskContentConfigService;
|
|
|
- private final WmTaskMapper wmTaskMapper;
|
|
|
- private final WmReportService wmReportService;
|
|
|
- private final WmScorePackageStatusService wmScorePackageStatusService;
|
|
|
- private final WmScorePackageSettleNoteMapper wmScorePackageSettleNoteMapper;
|
|
|
- private final ReportExportService reportExportService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 结算报告--导出汇总报告--学术推广服务报告
|
|
|
- *
|
|
|
- * @param wmReport
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- @Override
|
|
|
- public R newExportNb(WmReport wmReport, Integer deptId, String username) throws IOException {
|
|
|
-
|
|
|
-
|
|
|
- wmReport = wmReportService.getById(wmReport.getId());
|
|
|
- List<WmTask> taskList = new ArrayList<>();//该报告关联的所有未提交的任务
|
|
|
- //更新任务表审批意见
|
|
|
- WmScorePackage scorePackage = wmScorePackageService.getById(wmReport.getScoreId());
|
|
|
- WmTask wmTask = new WmTask();
|
|
|
- wmTask.setDelFlag("0");
|
|
|
- wmTask.setEnableFlag("0");
|
|
|
- wmTask.setRealFlag("0");
|
|
|
-
|
|
|
- SysDept sysDept = sysDeptService.getById(scorePackage.getSendPackageDeptId());
|
|
|
-
|
|
|
-
|
|
|
- if ("0".equals(scorePackage.getTypeid())) {//药企
|
|
|
- wmTask.setReportDrugId(wmReport.getId());
|
|
|
- wmTask.setReportDrugApprovalOpinion(ReportEnum.APPROVAL_OPINION_YES.getType());//审核通过的状态
|
|
|
- taskList = wmTaskService.list(Wrappers.query(wmTask));
|
|
|
- } else if ("1".equals(scorePackage.getTypeid())) {//一级代理商类型
|
|
|
- wmTask.setReportOneId(wmReport.getId());
|
|
|
- if (sysDept.getLevel() == 2) {
|
|
|
- wmTask.setReportDrugApprovalOpinion(ReportEnum.APPROVAL_OPINION_YES.getType());//审核通过的状态
|
|
|
- } else {
|
|
|
- wmTask.setReportOneApprovalOpinion(ReportEnum.APPROVAL_OPINION_YES.getType());//审核通过的状态
|
|
|
- }
|
|
|
-
|
|
|
- taskList = wmTaskService.list(Wrappers.query(wmTask));
|
|
|
- } else if ("2".equals(scorePackage.getTypeid())) {//二级代理商类型
|
|
|
- wmTask.setReportSecondId(wmReport.getId());
|
|
|
- wmTask.setReportSecondApprovalOpinion(ReportEnum.APPROVAL_OPINION_YES.getType());//审核通过的状态
|
|
|
- taskList = wmTaskService.list(Wrappers.query(wmTask));
|
|
|
- }
|
|
|
- if (null == taskList || taskList.size() <= 0) {
|
|
|
- return R.failed("ERROR_未查询到该报告关联的审批通过的任务");
|
|
|
- }
|
|
|
- String ids = taskList.stream().map(WmTask::getId).collect(Collectors.joining(","));
|
|
|
- wmTask.setScorePackageId(wmReport.getScoreId().toString());
|
|
|
- wmTask.setId(ids);
|
|
|
-
|
|
|
- return exportNb(wmTask, wmReport, deptId, username);//报告汇总
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 结算报告--导出汇总报告--学术推广服务报告
|
|
|
- *
|
|
|
- * @param wmTask
|
|
|
- * @param wmReport
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- private R exportNb(WmTask wmTask, WmReport wmReport, Integer deptId, String username) throws IOException {
|
|
|
-
|
|
|
- WmTask wmTaskparam = wmTask;
|
|
|
- String packageId = wmTask.getScorePackageId(); // 获取积分包ID
|
|
|
- if (null == packageId) {
|
|
|
- return R.failed("积分包ID不能为空");
|
|
|
- }
|
|
|
-
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
- list.add(packageId);
|
|
|
-
|
|
|
- wmTask.setExtIds(list);
|
|
|
-
|
|
|
- Map<String, Object> excelMap = new HashMap<>();
|
|
|
-
|
|
|
- WmScorePackage wmScorePackage = wmScorePackageService.getById(packageId);
|
|
|
- if (null == wmScorePackage) {
|
|
|
- return R.failed("获取积分包失败");
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("totalscorePackageScore", wmScorePackage.getScore());
|
|
|
- if (wmScorePackage.getPackageType1().equals("2") || wmScorePackage.getPackageType1().equals("3")) {
|
|
|
- excelMap.put("totalscorePackageTaskNum", wmScorePackage.getTaskNum() * wmScorePackage.getUserNum());//积分包值任务个数
|
|
|
- }
|
|
|
-
|
|
|
- List<WmScorePackageSettleNote> settleNoteList = wmScorePackageSettleNoteMapper.selectList(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
|
|
|
- .eq(WmScorePackageSettleNote::getPackageId, packageId));
|
|
|
- if (CollUtil.isNotEmpty(settleNoteList)) {
|
|
|
- BigDecimal totalActualAmount = settleNoteList.stream()
|
|
|
- .map(WmScorePackageSettleNote::getActualAmount)
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- // 个体经营者生产经营所得(税后),即实际支付金额
|
|
|
- excelMap.put("actualAmount", totalActualAmount);
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> wmTaskList = wmTaskService.getTaskListByIds(wmTask);
|
|
|
-
|
|
|
-
|
|
|
- List<XlsTask> xlsTaskList = new ArrayList<>();//mxTable
|
|
|
- Integer totalMoney = 0;
|
|
|
-// wmTask.setScorePackageId(null);
|
|
|
-// wmTask.setScorePackageDrugId(null);
|
|
|
-
|
|
|
- //当前登陆人的机构
|
|
|
- SysDept sysDept = sysDeptService.getById(deptId);
|
|
|
-
|
|
|
- Map<String, Object> userMap = new HashMap<>();
|
|
|
-
|
|
|
- //委托公司(结算企业)
|
|
|
- SysDept drugEnt = sysDeptService.getById(wmReport.getDrugEntId());
|
|
|
- //WmDaDrugEnt wmDaDrugEnt = wmDaDrugEntService.getById(SecurityUtils.getUser().getDrugEntId());
|
|
|
-
|
|
|
- //报告公司(申请结算企业)
|
|
|
- SysDept applydrugEnt = sysDeptService.getById(wmReport.getApplyDrugEntId());
|
|
|
- //WmDaAgent wmDaAgent = wmDaAgentService.getById(wmScorePackage.getLevel1Id());
|
|
|
-
|
|
|
- for (Map<String, Object> wmT : wmTaskList) {
|
|
|
- totalMoney += Integer.parseInt(wmT.get("score") + "");
|
|
|
- XlsTask xlsTask = new XlsTask();
|
|
|
- xlsTask.setTaskNum(1);
|
|
|
- xlsTask.setCreateTime(wmT.get("create_time") + "");
|
|
|
-
|
|
|
- xlsTask.setDeptName(sysDept.getName());
|
|
|
-
|
|
|
- //level=2是药企
|
|
|
- if (sysDept.getLevel() == 2) {
|
|
|
- xlsTask.setAgentDeptName(applydrugEnt.getName());
|
|
|
- }
|
|
|
-
|
|
|
- xlsTask.setDrugEntName(drugEnt.getName());
|
|
|
-
|
|
|
-
|
|
|
- xlsTask.setScore(Integer.parseInt(wmT.get("score") + ""));
|
|
|
-
|
|
|
- xlsTask.setUsername(wmT.get("realname") + "");
|
|
|
- xlsTask.setTaskType(wmT.get("base_id") + "");
|
|
|
-
|
|
|
- xlsTaskList.add(xlsTask);
|
|
|
-
|
|
|
- String buildKey = wmT.get("realname") + "_" + drugEnt.getName() + "_" + sysDept.getName();
|
|
|
- //人员表格
|
|
|
- if (userMap.containsKey(buildKey)) {
|
|
|
- try {
|
|
|
- userMap.put(buildKey, Integer.parseInt(wmT.get("score") + "") + Integer.parseInt(userMap.get(buildKey) + ""));
|
|
|
- userMap.put(buildKey + "_total", Integer.parseInt(wmT.get("score_count") + "") + Integer.parseInt(userMap
|
|
|
- .get(buildKey + "_total") + ""));
|
|
|
-
|
|
|
- } catch (Exception ex) {
|
|
|
- }
|
|
|
- } else {
|
|
|
- userMap.put(buildKey, Integer.parseInt(wmT.get("score") + ""));
|
|
|
- userMap.put(buildKey + "_total", Integer.parseInt(wmT.get("score_count") + ""));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-// List<String> list1 = new ArrayList<>();
|
|
|
-// list1.add(packageId);
|
|
|
-
|
|
|
- //学术推广服务任务明细表格
|
|
|
- List<WmTask> wmTaskDetialList = wmTaskService.getTaskListByIdsReturnWmtaskInfo(wmTask);
|
|
|
- List<Map<String, Object>> wmTaskDetialMap = new ArrayList<>();
|
|
|
-
|
|
|
- if (wmTaskDetialList.size() > 0) {
|
|
|
-
|
|
|
-
|
|
|
- for (WmTask wmTask1 : wmTaskDetialList) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- WmTaskType wmTaskTypeTemp1 = wmTaskTypeService.getById(wmTask1.getTaskTypeId());
|
|
|
- map.put("taskType", wmTaskTypeTemp1.getTaskTypeName());
|
|
|
- DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- String strDate2 = dtf2.format(wmTask1.getCreateTime());
|
|
|
- map.put("taskTime", strDate2);
|
|
|
- // map.put("taskUser", sysUserService.getById(wmTask1.getTaskUserId()).getRealname());
|
|
|
- map.put("taskUser", sysUserService.getByIdIgnore(wmTask1.getTaskUserId()).getRealname());
|
|
|
- map.put("taskTypeId", wmTask1.getTaskTypeId());
|
|
|
- map.put("score", wmTask1.getScore());
|
|
|
- map.put("taskNum", 1);
|
|
|
-
|
|
|
- wmTaskDetialMap.add(map);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("rwmxTable", wmTaskDetialMap);//学术推广服务任务明细表格
|
|
|
-
|
|
|
- if (totalMoney > wmScorePackage.getScore()) {
|
|
|
- totalMoney = wmScorePackage.getScore();
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("ryTable", userMap);//人员表格
|
|
|
- excelMap.put("tMoney", totalMoney);
|
|
|
-
|
|
|
- if (xlsTaskList.size() > 0) {
|
|
|
- excelMap.put("wt_ent", xlsTaskList.get(0).getDrugEntName());//委托公司
|
|
|
- excelMap.put("drugEnt", xlsTaskList.get(0).getDrugEntName());//服务药企
|
|
|
- excelMap.put("mxTable", xlsTaskList);
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, String>> ztTableList = new ArrayList<>();
|
|
|
- Map<String, String> ztMap = new HashMap<>();
|
|
|
- List<Map<String, Object>> wmTaskCount = wmTaskService.getTaskListByIdsCount(wmTask);
|
|
|
- if (wmTaskCount.size() > 0) {
|
|
|
- Integer total = 0;
|
|
|
- Integer sum = 0;
|
|
|
- for (Map<String, Object> map :
|
|
|
- wmTaskCount) {
|
|
|
- if (null != map.get("taskCount")) {
|
|
|
- total += Integer.parseInt(map.get("taskCount") + "");
|
|
|
- }
|
|
|
-
|
|
|
- if (null != map.get("taskSum")) {
|
|
|
- sum += Integer.parseInt(map.get("taskSum") + "");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- Map<String, Object> totalMap = new HashMap<>();
|
|
|
- totalMap.put("taskTypeName", "合计");
|
|
|
- totalMap.put("taskCount", total);
|
|
|
- totalMap.put("taskSum", sum);
|
|
|
- wmTaskCount.add(totalMap);
|
|
|
-
|
|
|
- excelMap.put("totalSubmitScore", sum);
|
|
|
- excelMap.put("totalSubmitTaskNum", total);
|
|
|
-
|
|
|
- excelMap.put("ztTable", wmTaskCount);//学术推广服务整体概况表格
|
|
|
- }
|
|
|
-
|
|
|
- // 任务小类及对应的任务个数和积分值
|
|
|
- List<WmTask> taskList = wmTaskMapper.selectBatchIds(Arrays.asList(wmTask.getId().split(",")));
|
|
|
-
|
|
|
- // 查询taskType
|
|
|
- List<WmTaskType> taskTypeList = wmTaskTypeService.list(Wrappers.<WmTaskType>lambdaQuery()
|
|
|
- .eq(WmTaskType::getTaskTypeLevel, "1")
|
|
|
- .eq(WmTaskType::getDelFlag, "0")
|
|
|
-// .eq(WmTaskType::getEnableFlag, "0")
|
|
|
- );
|
|
|
- // taskType通过id分组(key为parentId,value为taskTypeId的set)
|
|
|
- Map<String, String> taskTypeIdMap = taskTypeList.stream()
|
|
|
- .collect(Collectors.toMap(WmTaskType::getId, WmTaskType::getTaskTypeName));
|
|
|
-
|
|
|
- // task通过taskTypeId分组
|
|
|
- Map<String, List<WmTask>> taskTypeMap = taskList.stream()
|
|
|
- .collect(Collectors.groupingBy(WmTask::getTaskTypeId, Collectors.toList()));
|
|
|
-
|
|
|
- // 封装brief table1数据(统计每个小类任务的积分、任务数)
|
|
|
- List<Map<String, Object>> briefTable1List = new ArrayList<>();
|
|
|
- taskTypeMap.forEach((taskTypeId, wmTasks) -> {
|
|
|
- Map<String, Object> briefTable1Params = new HashMap<>();
|
|
|
- briefTable1Params.put("taskTypeName", taskTypeIdMap.get(taskTypeId));
|
|
|
- briefTable1Params.put("taskCount", wmTasks.size());
|
|
|
- briefTable1Params.put("taskSum", wmTasks.stream().map(WmTask::getScore).reduce(0, Integer::sum));
|
|
|
- briefTable1List.add(briefTable1Params);
|
|
|
- });
|
|
|
- Map<String, Object> briefTable1TotalParams = new HashMap<>();
|
|
|
- briefTable1TotalParams.put("taskTypeName", "合计");
|
|
|
- briefTable1TotalParams.put("taskCount", taskList.size());
|
|
|
- briefTable1TotalParams.put("taskSum", taskList.stream().map(WmTask::getScore).reduce(0, Integer::sum));
|
|
|
- briefTable1List.add(briefTable1TotalParams);
|
|
|
- excelMap.put("briefTable", briefTable1List);
|
|
|
-
|
|
|
- //WmTaskRule wmTaskRule = wmTaskRuleService.getById(wmScorePackage.getTaskRuleId());
|
|
|
- String entDate = wmScorePackage.getBelongDate() + "-31";
|
|
|
- try {
|
|
|
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- format.parse(entDate);
|
|
|
- } catch (Exception ex) {
|
|
|
- entDate = wmScorePackage.getBelongDate() + "-30";
|
|
|
- }
|
|
|
- //excelMap.put("service_date", wmTaskRule.getRuleMonth() + "-01 至 " + entDate);
|
|
|
-
|
|
|
- List<Map<String, Object>> wmTaskZd = wmTaskService.getTaskListByIdsZd(wmTask);
|
|
|
- String minDateStr = null;
|
|
|
- String maxDateStr = null;
|
|
|
- // 服务周期取 积分包领取审核通过时间~管理员审核积分包时最后审核通过的时间
|
|
|
- Map<String, String> serviceTimeRangeMap = wmScorePackageStatusService.getServiceTimeRange(wmScorePackage);
|
|
|
- if (null != wmTaskZd) {
|
|
|
- if (wmTaskZd.size() > 0) {
|
|
|
- Map<String, Object> stringMap = wmTaskZd.get(0);
|
|
|
- if (null == stringMap) {
|
|
|
- return R.failed("未找到审核通过的任务");
|
|
|
- }
|
|
|
- excelMap.put("service_date", serviceTimeRangeMap.get("service_start_date") + "至" + serviceTimeRangeMap.get("service_end_date"));
|
|
|
-// excelMap.put("service_date", stringMap.get("mindate") + "至" + stringMap.get("maxdate"));
|
|
|
-
|
|
|
- try {
|
|
|
- minDateStr = serviceTimeRangeMap.get("service_start_date").substring(5, 7);
|
|
|
- maxDateStr = serviceTimeRangeMap.get("service_end_date").substring(5, 7);
|
|
|
-
|
|
|
- } catch (Exception ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (null != applydrugEnt) {
|
|
|
- excelMap.put("report_ent", applydrugEnt.getName());
|
|
|
- } else {
|
|
|
- excelMap.put("report_ent", "");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- String ruleDate = wmScorePackage.getBelongDate();
|
|
|
-
|
|
|
- excelMap.put("rule_year", ruleDate.substring(0, 4));
|
|
|
-
|
|
|
- String monthStr = ruleDate.substring(5, 7);
|
|
|
- if (null != minDateStr && null != maxDateStr) {
|
|
|
- if (minDateStr.equals(maxDateStr)) {
|
|
|
- monthStr = minDateStr;
|
|
|
- } else {
|
|
|
- // 跨年情况判断
|
|
|
- if (!ruleDate.substring(0, 4).equals(serviceTimeRangeMap.get("service_end_date").substring(0, 4))) {
|
|
|
- monthStr = String.format("%s月至%s年%s",
|
|
|
- minDateStr, serviceTimeRangeMap.get("service_end_date").substring(0, 4), maxDateStr);
|
|
|
- } else {
|
|
|
- monthStr = minDateStr + "月至" + maxDateStr;
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (null != minDateStr) {
|
|
|
- monthStr = minDateStr;
|
|
|
- } else if (null != maxDateStr) {
|
|
|
- monthStr = maxDateStr;
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("rule_month", monthStr);
|
|
|
-
|
|
|
- //报告日期
|
|
|
- Map<String, Timestamp> maxMaxTime = wmTaskService.getMaxCreateTime(wmTask);
|
|
|
- System.out.println(maxMaxTime);
|
|
|
- LocalDateTime MaxTime = maxMaxTime.get("MaxTime").toLocalDateTime();
|
|
|
- excelMap.put("year", MaxTime.getYear() + "");
|
|
|
- Integer month = MaxTime.getMonthValue();
|
|
|
- if (month < 10) {
|
|
|
- excelMap.put("month", "0" + MaxTime.getMonthValue() + "");
|
|
|
- } else {
|
|
|
- excelMap.put("month", MaxTime.getMonthValue() + "");
|
|
|
- }
|
|
|
- Integer day = MaxTime.getDayOfMonth();
|
|
|
- if (day < 10) {
|
|
|
- excelMap.put("day", "0" + MaxTime.getDayOfMonth() + "");
|
|
|
- } else {
|
|
|
- excelMap.put("day", MaxTime.getDayOfMonth() + "");
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("tMoney", totalMoney);
|
|
|
- excelMap.put("scoreId", wmScorePackage.getScorePackageName());
|
|
|
-
|
|
|
- List<Map<String, Object>> infoList = exportZbInfo(wmTaskparam);
|
|
|
- if (null != infoList && infoList.size() > 0) {
|
|
|
- excelMap.put("infoList", infoList);
|
|
|
- } else {
|
|
|
- return R.failed("未查询到审核通过的任务");
|
|
|
- }
|
|
|
- //区分全职兼职学术推广员模版
|
|
|
- excelMap.put("userType", wmScorePackage.getTypeid());
|
|
|
-
|
|
|
- File f = null;
|
|
|
- if (wmScorePackage.getPackageType1().equals("1")) {//定额
|
|
|
- f = ExportReport.main_bulidTemplate1_jinpai(excelMap, 1, upmsConfig.getBasePath());
|
|
|
- } else {//定量
|
|
|
- f = ExportReport.main_bulidTemplate2(excelMap, 1, upmsConfig.getBasePath());
|
|
|
- }
|
|
|
-
|
|
|
- FileInputStream input = new FileInputStream(f);
|
|
|
-
|
|
|
- MultipartFile multipartFile = new MockMultipartFile("学术推广服务报告(" + packageId + ")", "学术推广服务报告(" + packageId + ").doc", "text/plain", IOUtils
|
|
|
- .toByteArray(input));
|
|
|
- return sysFileService.uploadFileAllUrlRealName(multipartFile, username);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
- public R newExportNba(WmScorePackage wmScorePackage, Integer deptId, String username) throws IOException {
|
|
|
-
|
|
|
- wmScorePackage = wmScorePackageService.getById(wmScorePackage.getId());
|
|
|
-
|
|
|
- HashSet<String> idSet = new HashSet<>();
|
|
|
- idSet.add(wmScorePackage.getId());
|
|
|
- int size = idSet.size();
|
|
|
- do {
|
|
|
- Set<String> collect = wmScorePackageService.list(Wrappers.<WmScorePackage>lambdaQuery().in(WmScorePackage::getRelationScoreId, idSet))
|
|
|
- .stream()
|
|
|
- .map(WmScorePackage::getId)
|
|
|
- .collect(Collectors.toSet());
|
|
|
- idSet.addAll(collect);
|
|
|
- size += collect.size();
|
|
|
- } while (size != idSet.size());
|
|
|
-
|
|
|
- List<WmTask> taskList = wmTaskMapper.selectList(Wrappers.<WmTask>lambdaQuery().in(WmTask::getScorePackageId, idSet)
|
|
|
- .eq(WmTask::getTaskStatus, 3)
|
|
|
- .and(item -> item.in(WmTask::getReportDrugApprovalStatus, Arrays.asList(5,6)).eq(WmTask::getReportDrugApprovalOpinion, 1)
|
|
|
- .or(item2 -> item2.in(WmTask::getReportOneApprovalStatus, Arrays.asList(5,6)).eq(WmTask::getReportOneApprovalOpinion,1))));
|
|
|
-
|
|
|
- //更新任务表审批意见
|
|
|
- WmTask wmTask = new WmTask();
|
|
|
- wmTask.setDelFlag("0");
|
|
|
- wmTask.setEnableFlag("0");
|
|
|
-
|
|
|
- if (null == taskList || taskList.size() <= 0) {
|
|
|
- return R.failed("ERROR_未查询到该报告关联的审批通过的任务");
|
|
|
- }
|
|
|
- String ids = taskList.stream().map(WmTask::getId).collect(Collectors.joining(","));
|
|
|
- wmTask.setScorePackageId(wmScorePackage.getId());
|
|
|
- wmTask.setId(ids);
|
|
|
-
|
|
|
-
|
|
|
- return exportNba(wmTask, wmScorePackage, deptId, username);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public R newExportNbaHistory(WmScorePackage wmScorePackage, Integer deptId, String username) throws IOException {
|
|
|
- wmScorePackage=wmScorePackageService.getById(wmScorePackage.getId());
|
|
|
- if(wmScorePackage==null){
|
|
|
- return R.failed("未查询到积分包信息");
|
|
|
- }
|
|
|
- LambdaQueryWrapper<WmTask> queryWrapper=new LambdaQueryWrapper();
|
|
|
- queryWrapper.eq(WmTask::getScorePackageDrugId, wmScorePackage.getId());
|
|
|
- queryWrapper.eq(WmTask::getTaskStatus,"3");
|
|
|
- queryWrapper.eq(WmTask::getDelFlag,"0");
|
|
|
- queryWrapper.eq(WmTask::getEnableFlag,"0");
|
|
|
- queryWrapper.eq(WmTask::getRealFlag,"0");
|
|
|
- List<WmTask> taskList=wmTaskService.list(queryWrapper);
|
|
|
- //List<WmTask> taskList = wmTaskMapper.selectListByWmTask(wmScorePackage);
|
|
|
- //更新任务表审批意见
|
|
|
- WmTask wmTask=new WmTask();
|
|
|
- wmTask.setDelFlag("0");
|
|
|
- wmTask.setEnableFlag("0");
|
|
|
-
|
|
|
- if(null==taskList||taskList.size()<=0){
|
|
|
- return R.failed("ERROR_未查询到该报告关联的审批通过的任务");
|
|
|
- }
|
|
|
- String ids = taskList.stream().map(WmTask::getId).collect(Collectors.joining("," ));
|
|
|
- wmTask.setScorePackageId(wmScorePackage.getId());
|
|
|
- //wmTask.setId(ids);
|
|
|
- wmTask.setId("(select id from wm_task where del_flag=0 and real_flag=0 and enable_flag=0 and task_status=3 and score_package_drug_id="+wmScorePackage.getId()+")");
|
|
|
-
|
|
|
- return exportNba(wmTask,wmScorePackage,deptId,username);//报告汇总
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 结算报告--导出汇总报告--学术推广服务报告
|
|
|
- *
|
|
|
- * @param wmTask
|
|
|
- * @param wmScorePackage
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- private R exportNba(WmTask wmTask, WmScorePackage wmScorePackage, Integer deptId, String username) throws IOException {
|
|
|
-
|
|
|
- WmTask wmTaskparam = wmTask;
|
|
|
- String packageId = wmTask.getScorePackageId(); // 获取积分包ID
|
|
|
- if (null == packageId) {
|
|
|
- return R.failed("积分包ID不能为空");
|
|
|
- }
|
|
|
-
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
- list.add(packageId);
|
|
|
-
|
|
|
- wmTask.setExtIds(list);
|
|
|
-
|
|
|
- Map<String, Object> excelMap = new HashMap<>();
|
|
|
-
|
|
|
- wmScorePackage = wmScorePackageService.getById(packageId);
|
|
|
- if (null == wmScorePackage) {
|
|
|
- return R.failed("获取积分包失败");
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("totalscorePackageScore", wmScorePackage.getScore());
|
|
|
- if (wmScorePackage.getPackageType1().equals("2") || wmScorePackage.getPackageType1().equals("3")) {
|
|
|
- excelMap.put("totalscorePackageTaskNum", wmScorePackage.getTaskNum() * wmScorePackage.getUserNum());//积分包值任务个数
|
|
|
- }
|
|
|
-
|
|
|
- List<WmScorePackageSettleNote> settleNoteList = wmScorePackageSettleNoteMapper.selectList(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
|
|
|
- .eq(WmScorePackageSettleNote::getPackageId, packageId));
|
|
|
- if (CollUtil.isNotEmpty(settleNoteList)) {
|
|
|
- BigDecimal totalActualAmount = settleNoteList.stream()
|
|
|
- .map(WmScorePackageSettleNote::getActualAmount)
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- // 个体经营者生产经营所得(税后),即实际支付金额
|
|
|
- excelMap.put("actualAmount", totalActualAmount);
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> wmTaskList = wmTaskService.getTaskListByIdsOld(wmTask);
|
|
|
-
|
|
|
-
|
|
|
- List<XlsTask> xlsTaskList = new ArrayList<>();//mxTable
|
|
|
- Integer totalMoney = 0;
|
|
|
-// wmTask.setScorePackageId(null);
|
|
|
-// wmTask.setScorePackageDrugId(null);
|
|
|
-
|
|
|
- //当前登陆人的机构
|
|
|
- SysDept sysDept = sysDeptService.getById(deptId);
|
|
|
-
|
|
|
- Map<String, Object> userMap = new HashMap<>();
|
|
|
-
|
|
|
- //委托公司(结算企业)
|
|
|
- SysDept drugEnt = sysDeptService.getById(wmScorePackage.getSendPackageDeptId());
|
|
|
- //WmDaDrugEnt wmDaDrugEnt = wmDaDrugEntService.getById(SecurityUtils.getUser().getDrugEntId());
|
|
|
-
|
|
|
- //报告公司(申请结算企业)
|
|
|
- SysDept applydrugEnt = sysDeptService.getById(wmScorePackage.getDeptId());
|
|
|
- //WmDaAgent wmDaAgent = wmDaAgentService.getById(wmScorePackage.getLevel1Id());
|
|
|
-
|
|
|
- for (Map<String, Object> wmT : wmTaskList) {
|
|
|
- totalMoney += Integer.parseInt(wmT.get("score") + "");
|
|
|
- XlsTask xlsTask = new XlsTask();
|
|
|
- xlsTask.setTaskNum(1);
|
|
|
- xlsTask.setCreateTime(wmT.get("create_time") + "");
|
|
|
-
|
|
|
- xlsTask.setDeptName(sysDept.getName());
|
|
|
-
|
|
|
- //level=2是药企
|
|
|
- if (sysDept.getLevel() == 2) {
|
|
|
- xlsTask.setAgentDeptName(applydrugEnt.getName());
|
|
|
- }
|
|
|
-
|
|
|
- xlsTask.setDrugEntName(drugEnt.getName());
|
|
|
-
|
|
|
-
|
|
|
- xlsTask.setScore(Integer.parseInt(wmT.get("score") + ""));
|
|
|
-
|
|
|
- xlsTask.setUsername(wmT.get("realname") + "");
|
|
|
- xlsTask.setTaskType(wmT.get("base_id") + "");
|
|
|
-
|
|
|
- xlsTaskList.add(xlsTask);
|
|
|
-
|
|
|
- String buildKey = wmT.get("realname") + "_" + drugEnt.getName() + "_" + sysDept.getName();
|
|
|
- //人员表格
|
|
|
- if (userMap.containsKey(buildKey)) {
|
|
|
- try {
|
|
|
- userMap.put(buildKey, Integer.parseInt(wmT.get("score") + "") + Integer.parseInt(userMap.get(buildKey) + ""));
|
|
|
- userMap.put(buildKey + "_total", Integer.parseInt(wmT.get("score_count") + "") + Integer.parseInt(userMap
|
|
|
- .get(buildKey + "_total") + ""));
|
|
|
-
|
|
|
- } catch (Exception ex) {
|
|
|
- }
|
|
|
- } else {
|
|
|
- userMap.put(buildKey, Integer.parseInt(wmT.get("score") + ""));
|
|
|
- userMap.put(buildKey + "_total", Integer.parseInt(wmT.get("score_count") + ""));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-// List<String> list1 = new ArrayList<>();
|
|
|
-// list1.add(packageId);
|
|
|
-
|
|
|
- //学术推广服务任务明细表格
|
|
|
- List<WmTask> wmTaskDetialList = wmTaskService.getTaskListByIdsReturnWmtaskInfo(wmTask);
|
|
|
- List<Map<String, Object>> wmTaskDetialMap = new ArrayList<>();
|
|
|
-
|
|
|
- if (wmTaskDetialList.size() > 0) {
|
|
|
- for (WmTask wmTask1 :
|
|
|
- wmTaskDetialList) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- WmTaskType wmTaskTypeTemp1 = wmTaskTypeService.getById(wmTask1.getTaskTypeId());
|
|
|
- map.put("taskType", wmTaskTypeTemp1.getTaskTypeName());
|
|
|
- DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- String strDate2 = dtf2.format(wmTask1.getCreateTime());
|
|
|
- map.put("taskTime", strDate2);
|
|
|
-// map.put("taskUser", sysUserService.getById(wmTask1.getTaskUserId()).getRealname());
|
|
|
- map.put("taskUser", sysUserService.getByIdIgnore(wmTask1.getTaskUserId()).getRealname());
|
|
|
- map.put("taskTypeId", wmTask1.getTaskTypeId());
|
|
|
- map.put("score", wmTask1.getScore());
|
|
|
- map.put("taskNum", 1);
|
|
|
-
|
|
|
- wmTaskDetialMap.add(map);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("rwmxTable", wmTaskDetialMap);//学术推广服务任务明细表格
|
|
|
-
|
|
|
- if (totalMoney > wmScorePackage.getScore()) {
|
|
|
- totalMoney = wmScorePackage.getScore();
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("ryTable", userMap);//人员表格
|
|
|
- excelMap.put("tMoney", totalMoney);
|
|
|
-
|
|
|
- if (xlsTaskList.size() > 0) {
|
|
|
- excelMap.put("wt_ent", xlsTaskList.get(0).getDrugEntName());//委托公司
|
|
|
- excelMap.put("drugEnt", xlsTaskList.get(0).getDrugEntName());//服务药企
|
|
|
- excelMap.put("mxTable", xlsTaskList);
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, String>> ztTableList = new ArrayList<>();
|
|
|
- Map<String, String> ztMap = new HashMap<>();
|
|
|
- List<Map<String, Object>> wmTaskCount = wmTaskService.getTaskListByIdsCount(wmTask);
|
|
|
- if (wmTaskCount.size() > 0) {
|
|
|
- Integer total = 0;
|
|
|
- Integer sum = 0;
|
|
|
- for (Map<String, Object> map :
|
|
|
- wmTaskCount) {
|
|
|
- if (null != map.get("taskCount")) {
|
|
|
- total += Integer.parseInt(map.get("taskCount") + "");
|
|
|
- }
|
|
|
-
|
|
|
- if (null != map.get("taskSum")) {
|
|
|
- sum += Integer.parseInt(map.get("taskSum") + "");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- Map<String, Object> totalMap = new HashMap<>();
|
|
|
- totalMap.put("taskTypeName", "合计");
|
|
|
- totalMap.put("taskCount", total);
|
|
|
- totalMap.put("taskSum", sum);
|
|
|
- wmTaskCount.add(totalMap);
|
|
|
-
|
|
|
- excelMap.put("totalSubmitScore", sum);
|
|
|
- excelMap.put("totalSubmitTaskNum", total);
|
|
|
-
|
|
|
- excelMap.put("ztTable", wmTaskCount);//学术推广服务整体概况表格
|
|
|
- }
|
|
|
-
|
|
|
- // 任务小类及对应的任务个数和积分值
|
|
|
- List<WmTask> taskList = wmTaskMapper.selectBatchIds(Arrays.asList(wmTask.getId().split(",")));
|
|
|
-
|
|
|
- // 查询taskType
|
|
|
- List<WmTaskType> taskTypeList = wmTaskTypeService.list(Wrappers.<WmTaskType>lambdaQuery()
|
|
|
- .eq(WmTaskType::getTaskTypeLevel, "1")
|
|
|
- .eq(WmTaskType::getDelFlag, "0")
|
|
|
-// .eq(WmTaskType::getEnableFlag, "0")
|
|
|
- );
|
|
|
- // taskType通过id分组(key为parentId,value为taskTypeId的set)
|
|
|
- Map<String, String> taskTypeIdMap = taskTypeList.stream()
|
|
|
- .collect(Collectors.toMap(WmTaskType::getId, WmTaskType::getTaskTypeName));
|
|
|
-
|
|
|
- // task通过taskTypeId分组
|
|
|
- Map<String, List<WmTask>> taskTypeMap = taskList.stream()
|
|
|
- .collect(Collectors.groupingBy(WmTask::getTaskTypeId, Collectors.toList()));
|
|
|
-
|
|
|
- // 封装brief table1数据(统计每个小类任务的积分、任务数)
|
|
|
- List<Map<String, Object>> briefTable1List = new ArrayList<>();
|
|
|
- taskTypeMap.forEach((taskTypeId, wmTasks) -> {
|
|
|
- Map<String, Object> briefTable1Params = new HashMap<>();
|
|
|
- briefTable1Params.put("taskTypeName", taskTypeIdMap.get(taskTypeId));
|
|
|
- briefTable1Params.put("taskCount", wmTasks.size());
|
|
|
- briefTable1Params.put("taskSum", wmTasks.stream().map(WmTask::getScore).reduce(0, Integer::sum));
|
|
|
- briefTable1List.add(briefTable1Params);
|
|
|
- });
|
|
|
- Map<String, Object> briefTable1TotalParams = new HashMap<>();
|
|
|
- briefTable1TotalParams.put("taskTypeName", "合计");
|
|
|
- briefTable1TotalParams.put("taskCount", taskList.size());
|
|
|
- briefTable1TotalParams.put("taskSum", taskList.stream().map(WmTask::getScore).reduce(0, Integer::sum));
|
|
|
- briefTable1List.add(briefTable1TotalParams);
|
|
|
- excelMap.put("briefTable", briefTable1List);
|
|
|
-
|
|
|
- //WmTaskRule wmTaskRule = wmTaskRuleService.getById(wmScorePackage.getTaskRuleId());
|
|
|
- String entDate = wmScorePackage.getBelongDate() + "-31";
|
|
|
- try {
|
|
|
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- format.parse(entDate);
|
|
|
- } catch (Exception ex) {
|
|
|
- entDate = wmScorePackage.getBelongDate() + "-30";
|
|
|
- }
|
|
|
- //excelMap.put("service_date", wmTaskRule.getRuleMonth() + "-01 至 " + entDate);
|
|
|
-
|
|
|
- List<Map<String, Object>> wmTaskZd = wmTaskService.getTaskListByIdsZd(wmTask);
|
|
|
- String minDateStr = null;
|
|
|
- String maxDateStr = null;
|
|
|
- // 服务周期取 积分包领取审核通过时间~管理员审核积分包时最后审核通过的时间
|
|
|
- Map<String, String> serviceTimeRangeMap = wmScorePackageStatusService.getServiceTimeRange(wmScorePackage);
|
|
|
- if (null != wmTaskZd) {
|
|
|
- if (wmTaskZd.size() > 0) {
|
|
|
- Map<String, Object> stringMap = wmTaskZd.get(0);
|
|
|
- if (null == stringMap) {
|
|
|
- return R.failed("未找到审核通过的任务");
|
|
|
- }
|
|
|
- excelMap.put("service_date", serviceTimeRangeMap.get("service_start_date") + "至" + serviceTimeRangeMap.get("service_end_date"));
|
|
|
-// excelMap.put("service_date", stringMap.get("mindate") + "至" + stringMap.get("maxdate"));
|
|
|
-
|
|
|
- try {
|
|
|
- minDateStr = serviceTimeRangeMap.get("service_start_date").substring(5, 7);
|
|
|
- maxDateStr = serviceTimeRangeMap.get("service_end_date").substring(5, 7);
|
|
|
-
|
|
|
- } catch (Exception ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (null != applydrugEnt) {
|
|
|
- excelMap.put("report_ent", applydrugEnt.getName());
|
|
|
- } else {
|
|
|
- excelMap.put("report_ent", "");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- String ruleDate = wmScorePackage.getBelongDate();
|
|
|
-
|
|
|
- excelMap.put("rule_year", ruleDate.substring(0, 4));
|
|
|
-
|
|
|
- String monthStr = ruleDate.substring(5, 7);
|
|
|
- if (null != minDateStr && null != maxDateStr) {
|
|
|
- if (minDateStr.equals(maxDateStr)) {
|
|
|
- monthStr = minDateStr;
|
|
|
- } else {
|
|
|
- // 跨年情况判断
|
|
|
- if (!ruleDate.substring(0, 4).equals(serviceTimeRangeMap.get("service_end_date").substring(0, 4))) {
|
|
|
- monthStr = String.format("%s月至%s年%s",
|
|
|
- minDateStr, serviceTimeRangeMap.get("service_end_date").substring(0, 4), maxDateStr);
|
|
|
- } else {
|
|
|
- monthStr = minDateStr + "月至" + maxDateStr;
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (null != minDateStr) {
|
|
|
- monthStr = minDateStr;
|
|
|
- } else if (null != maxDateStr) {
|
|
|
- monthStr = maxDateStr;
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("rule_month", monthStr);
|
|
|
-
|
|
|
- //报告日期
|
|
|
- Map<String, Timestamp> maxMaxTime = wmTaskService.getMaxCreateTime(wmTask);
|
|
|
- System.out.println(maxMaxTime);
|
|
|
- LocalDateTime MaxTime = maxMaxTime.get("MaxTime").toLocalDateTime();
|
|
|
- excelMap.put("year", MaxTime.getYear() + "");
|
|
|
- Integer month = MaxTime.getMonthValue();
|
|
|
- if (month < 10) {
|
|
|
- excelMap.put("month", "0" + MaxTime.getMonthValue() + "");
|
|
|
- } else {
|
|
|
- excelMap.put("month", MaxTime.getMonthValue() + "");
|
|
|
- }
|
|
|
- Integer day = MaxTime.getDayOfMonth();
|
|
|
- if (day < 10) {
|
|
|
- excelMap.put("day", "0" + MaxTime.getDayOfMonth() + "");
|
|
|
- } else {
|
|
|
- excelMap.put("day", MaxTime.getDayOfMonth() + "");
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("tMoney", totalMoney);
|
|
|
- excelMap.put("scoreId", wmScorePackage.getScorePackageName());
|
|
|
-
|
|
|
- List<Map<String, Object>> infoList = exportZbInfo(wmTaskparam);
|
|
|
- if (null != infoList && infoList.size() > 0) {
|
|
|
- excelMap.put("infoList", infoList);
|
|
|
- } else {
|
|
|
- return R.failed("未查询到审核通过的任务");
|
|
|
- }
|
|
|
- //区分全职兼职学术推广员模版
|
|
|
- excelMap.put("userType", wmScorePackage.getTypeid());
|
|
|
-
|
|
|
- File f = null;
|
|
|
- if (wmScorePackage.getPackageType1().equals("1")) {//定额
|
|
|
- f = ExportReport.main_bulidTemplate1_jinpai(excelMap, 1, upmsConfig.getBasePath());
|
|
|
- } else {//定量
|
|
|
- f = ExportReport.main_bulidTemplate2(excelMap, 1, upmsConfig.getBasePath());
|
|
|
- }
|
|
|
-
|
|
|
- FileInputStream input = new FileInputStream(f);
|
|
|
-
|
|
|
- MultipartFile multipartFile = new MockMultipartFile("学术推广服务报告(" + packageId + ")", "学术推广服务报告(" + packageId + ").doc", "text/plain", IOUtils
|
|
|
- .toByteArray(input));
|
|
|
- return sysFileService.uploadFileAllUrlRealName(multipartFile, username);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 个人承接按积分制
|
|
|
- * @param wmTask
|
|
|
- * @param username
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- @Override
|
|
|
- public R newExportZb(WmTask wmTask, String username) throws IOException {
|
|
|
- String packageId = wmTask.getScorePackageDrugId();
|
|
|
- if (null == packageId) {
|
|
|
- return R.failed("积分包ID不能为空");
|
|
|
- }
|
|
|
- LambdaQueryWrapper<WmTask> queryWrapper = new LambdaQueryWrapper();
|
|
|
- queryWrapper.in(WmTask::getScorePackageId, Arrays.asList(packageId.split(",")));
|
|
|
- queryWrapper.eq(WmTask::getTaskStatus, "3");
|
|
|
- queryWrapper.eq(WmTask::getDelFlag, "0");
|
|
|
- queryWrapper.eq(WmTask::getEnableFlag, "0");
|
|
|
- queryWrapper.eq(WmTask::getRealFlag, "0");
|
|
|
- List<WmTask> taskList = wmTaskService.list(queryWrapper);
|
|
|
- if (taskList.isEmpty()) {
|
|
|
- return R.failed("未查询到审核通过的任务");
|
|
|
- }
|
|
|
- String ids = taskList.stream().map(WmTask::getId).collect(Collectors.joining(","));
|
|
|
- wmTask.setScorePackageId(packageId);
|
|
|
- wmTask.setId(ids);
|
|
|
- return exportZb(wmTask, username);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 个人报告导出--众包代表业绩报告
|
|
|
- *
|
|
|
- * @param wmTask
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- private R exportZb(WmTask wmTask, String username) throws IOException {
|
|
|
-
|
|
|
- WmTask wmTaskparam = wmTask;
|
|
|
- String packageId = wmTask.getScorePackageId(); // 获取积分包ID
|
|
|
- if (null == packageId) {
|
|
|
- packageId = wmTask.getScorePackageDrugId();
|
|
|
- }
|
|
|
-
|
|
|
- if (null == packageId) {
|
|
|
- return R.failed("积分包ID不能为空");
|
|
|
- }
|
|
|
-
|
|
|
- WmScorePackage wmScorePackage1 = wmScorePackageService.getById(packageId);
|
|
|
-
|
|
|
- Map<String, Object> excelMap = exportZbCommon(wmTask);
|
|
|
- if (null == excelMap) {
|
|
|
- return R.failed("未查询到审核通过的任务");
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> infoList = exportZbInfo(wmTaskparam);
|
|
|
- if (null != infoList && infoList.size() > 0) {
|
|
|
- excelMap.put("infoList", infoList);
|
|
|
- }
|
|
|
- //区分全职兼职学术推广员模版
|
|
|
- excelMap.put("userType", wmScorePackage1.getTypeid());
|
|
|
-// excelMap.put("scoreId", wmScorePackage1.getScorePackageName());
|
|
|
- List<String> extIds = wmTask.getExtIds();
|
|
|
- List<WmScorePackage> wmScorePackages = wmScorePackageService.listByIds(extIds);
|
|
|
- String scoreIds = wmScorePackages.stream().map(WmScorePackage::getScorePackageName).collect(Collectors.joining(","));
|
|
|
- excelMap.put("scoreId", StrUtil.isBlank(scoreIds) ? wmScorePackage1.getScorePackageName() : scoreIds);
|
|
|
-
|
|
|
- List<WmScorePackageSettleNote> settleNoteList = wmScorePackageSettleNoteMapper.selectList(Wrappers.<WmScorePackageSettleNote>lambdaQuery()
|
|
|
- .eq(WmScorePackageSettleNote::getPackageId, packageId));
|
|
|
- if (CollUtil.isNotEmpty(settleNoteList)) {
|
|
|
- BigDecimal totalActualAmount = settleNoteList.stream()
|
|
|
- .map(WmScorePackageSettleNote::getActualAmount)
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- // 个体经营者生产经营所得(税后),即实际支付金额
|
|
|
- excelMap.put("actualAmount", totalActualAmount);
|
|
|
- }
|
|
|
-
|
|
|
- File f = null;
|
|
|
- if (wmScorePackage1.getPackageType1().equals("1")) {//定额
|
|
|
- f = ExportReport.main_bulidTemplate1_jinpai(excelMap, 2, upmsConfig.getBasePath());
|
|
|
- } else {//定量
|
|
|
- f = ExportReport.main_bulidTemplate2(excelMap, 2, upmsConfig.getBasePath());
|
|
|
- }
|
|
|
-
|
|
|
- FileInputStream input = new FileInputStream(f);
|
|
|
-
|
|
|
- String fileNamePrefix = "";
|
|
|
- if (StrUtil.equals(wmScorePackage1.getTypeid(), "3")) {
|
|
|
- fileNamePrefix = "全职学术信息沟通专员业绩报告";
|
|
|
- } else if (StrUtil.equals(wmScorePackage1.getTypeid(), "5")) {
|
|
|
- fileNamePrefix = "招商经理业绩报告";
|
|
|
- } else if (StrUtil.equals(wmScorePackage1.getTypeid(), "4")) {
|
|
|
- fileNamePrefix = "兼职学术信息沟通专员业绩报告";
|
|
|
- }
|
|
|
-
|
|
|
- MultipartFile multipartFile = new MockMultipartFile(fileNamePrefix + "(" + packageId + ")", "兼职学术推广员业绩报告(" + packageId + ").doc", "text/plain", IOUtils
|
|
|
- .toByteArray(input));
|
|
|
- return sysFileService.uploadFileAllUrlRealName(multipartFile, username);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- /*合并导出--汇总
|
|
|
- */
|
|
|
- public Map<String, Object> exportZbCommon(WmTask wmTask) {
|
|
|
- String packageId = wmTask.getScorePackageId(); // 获取积分包ID
|
|
|
- if (null == packageId) {
|
|
|
- packageId = wmTask.getScorePackageDrugId();
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, Object> excelMap = new HashMap<>();
|
|
|
- WmScorePackage wmScorePackage1 = wmScorePackageService.getById(packageId);
|
|
|
- WmDaDrugEnt wmDaDrugEnt = wmDaDrugEntService.getById(wmScorePackage1.getDrugEntId());
|
|
|
- if (wmDaDrugEnt == null) {
|
|
|
- wmDaDrugEnt = new WmDaDrugEnt();
|
|
|
- wmDaDrugEnt.setEntname("无");
|
|
|
- }
|
|
|
-
|
|
|
- List<String> strs = new ArrayList<>();
|
|
|
- if (packageId.contains(",")) {
|
|
|
- strs.addAll(Arrays.asList(packageId.split(",")));
|
|
|
- } else {
|
|
|
- strs.add(packageId);
|
|
|
- }
|
|
|
- wmTask.setExtIds(strs);
|
|
|
-
|
|
|
-
|
|
|
- List<Map<String, Object>> wmTaskList = wmTaskService.getTaskListByIdsOld(wmTask);
|
|
|
- if (wmScorePackage1.getPackageType2().equals("2")) {
|
|
|
- wmTaskList = wmTaskService.getTaskListByIdsJs(wmTask);
|
|
|
- }
|
|
|
- if (wmTaskList.size() > 0) {
|
|
|
- List<XlsTask> xlsTaskList = new ArrayList<>();
|
|
|
- Map<String, Object> userMap = new HashMap<>();
|
|
|
- for (Map<String, Object> wmt : wmTaskList) {
|
|
|
- XlsTask xlsTask = new XlsTask();
|
|
|
- xlsTask.setTaskNum(Integer.valueOf(wmt.get("score_count") + ""));
|
|
|
- xlsTask.setTaskType(wmt.get("base_id") + "");
|
|
|
- xlsTask.setUsername(wmt.get("realname") + "");
|
|
|
- xlsTask.setScore(Integer.parseInt((wmt.get("score") == null ? "0" : wmt.get("score")) + ""));
|
|
|
- xlsTask.setDrugEntName(wmDaDrugEnt.getEntname());
|
|
|
- xlsTask.setDeptName(wmt.get("dept_name") + "");
|
|
|
- xlsTask.setCreateTime(wmt.get("create_time") + "");
|
|
|
- xlsTaskList.add(xlsTask);
|
|
|
-
|
|
|
- String buildKey = wmt.get("realname") + "_" + wmDaDrugEnt.getEntname() + "_" + wmt.get("dept_name") + "";
|
|
|
- if (userMap.containsKey(buildKey)) {
|
|
|
- try {
|
|
|
- userMap.put(buildKey, Integer.parseInt(wmt.get("score") == null ? "0" : wmt.get("score") + "") + Integer
|
|
|
- .parseInt(userMap.get(buildKey) == null ? "0" : userMap.get(buildKey) + ""));
|
|
|
- userMap.put(buildKey + "_total", Integer.parseInt(wmt.get("score_count") + "") + Integer.parseInt(userMap
|
|
|
- .get(buildKey + "_total") + ""));
|
|
|
-
|
|
|
- } catch (Exception ex) {
|
|
|
- }
|
|
|
- } else {
|
|
|
- userMap.put(buildKey, wmt.get("score"));
|
|
|
- userMap.put(buildKey + "_total", Integer.parseInt(wmt.get("score_count") + ""));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- List<WmTask> wmTaskDetialList = wmTaskService.getTaskListByIdsReturnWmtaskInfo(wmTask);
|
|
|
- List<Map<String, Object>> wmTaskDetialMap = new ArrayList<>();
|
|
|
-
|
|
|
- List<String> listPackageIds = new ArrayList<>();
|
|
|
-
|
|
|
- if (wmTaskDetialList.size() > 0) {
|
|
|
- for (WmTask wmTask1 :
|
|
|
- wmTaskDetialList) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- WmTaskType wmTaskTypeTemp1 = wmTaskTypeService.getById(wmTask1.getTaskTypeId());
|
|
|
- map.put("taskType", wmTaskTypeTemp1.getTaskTypeName());
|
|
|
- DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- String strDate2 = dtf2.format(wmTask1.getCreateTime());
|
|
|
- map.put("taskTime", strDate2);
|
|
|
- if (wmScorePackage1.getPackageType2().equals("2")) {
|
|
|
- map.put("taskUser", sysUserService.getByIdIgnore(wmTask1.getTaskUserId()).getRealname());
|
|
|
- } else {
|
|
|
- map.put("taskUser", sysUserService.getByIdIgnore(wmTask1.getTaskUserId()).getRealname());
|
|
|
- }
|
|
|
-
|
|
|
- map.put("taskTypeId", wmTask1.getTaskTypeId());
|
|
|
- map.put("score", wmTask1.getScore());
|
|
|
- map.put("taskNum", 1);
|
|
|
- wmTaskDetialMap.add(map);
|
|
|
-
|
|
|
- if (listPackageIds.size() == 0) {
|
|
|
- listPackageIds.add(wmTask1.getScorePackageId());
|
|
|
- } else {
|
|
|
- boolean isInscore = true;
|
|
|
- for (String str : listPackageIds) {
|
|
|
- if (str.equals(wmTask1.getScorePackageId())) {
|
|
|
- isInscore = false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (isInscore) {
|
|
|
- listPackageIds.add(wmTask1.getScorePackageId());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (listPackageIds.size() > 0) {
|
|
|
- List<WmScorePackage> wmScorePackageList = wmScorePackageService.listByIds(listPackageIds);
|
|
|
- Integer totalScorePackage = 0;
|
|
|
- BigDecimal settleAmount = new BigDecimal("0");
|
|
|
- if (wmScorePackageList.size() > 0) {
|
|
|
- for (WmScorePackage wmScorePackage : wmScorePackageList) {
|
|
|
- totalScorePackage += wmScorePackage.getScore();
|
|
|
- if (wmScorePackage.getSettleStatus() != null && wmScorePackage.getSettleStatus() == 1) {
|
|
|
- settleAmount = settleAmount.add(wmScorePackage.getSettleAmount());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- excelMap.put("settleAmount", "0".equals(settleAmount.toString()) ? " " : settleAmount);
|
|
|
- excelMap.put("totalscorePackageScore", totalScorePackage);
|
|
|
- if (wmScorePackage1.getPackageType1().equals("2") || wmScorePackage1.getPackageType1().equals("3")) {
|
|
|
- if (!wmScorePackage1.getPackageType2().equals("2")) {
|
|
|
- excelMap.put("totalscorePackageTaskNum", wmScorePackage1.getTaskNum() * wmScorePackage1.getUserNum());//积分包值任务个数
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- List<WmTask> tasks = wmTaskService.list(Wrappers.<WmTask>lambdaQuery()
|
|
|
- .in(WmTask::getScorePackageId, listPackageIds));
|
|
|
-
|
|
|
- if (CollUtil.isNotEmpty(tasks)) {
|
|
|
- int sum = tasks.stream()
|
|
|
-// .filter(t -> "3".equals( t.getTaskStatus()) && WmTask.TaskSettleStatusEnum.SETTLED.getCode().equals(t.getTaskSettleStatus()))
|
|
|
- .filter(t -> "3".equals( t.getTaskStatus()))
|
|
|
- .mapToInt(WmTask::getScore).sum();
|
|
|
- excelMap.put("submitAmount", sum);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("rwmxTable", wmTaskDetialMap);
|
|
|
- excelMap.put("mxTable", xlsTaskList);
|
|
|
- excelMap.put("ryTable", userMap);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, Timestamp> maxMaxTime = wmTaskService.getMaxCreateTime(wmTask);
|
|
|
- System.out.println(maxMaxTime);
|
|
|
- LocalDateTime MaxTime = maxMaxTime.get("MaxTime").toLocalDateTime();
|
|
|
- excelMap.put("year", MaxTime.getYear() + "");
|
|
|
- Integer month = MaxTime.getMonthValue();
|
|
|
- if (month < 10) {
|
|
|
- excelMap.put("month", "0" + MaxTime.getMonthValue() + "");
|
|
|
- } else {
|
|
|
- excelMap.put("month", MaxTime.getMonthValue() + "");
|
|
|
- }
|
|
|
- Integer day = MaxTime.getDayOfMonth();
|
|
|
- if (day < 10) {
|
|
|
- excelMap.put("day", "0" + MaxTime.getDayOfMonth() + "");
|
|
|
- } else {
|
|
|
- excelMap.put("day", MaxTime.getDayOfMonth() + "");
|
|
|
- }
|
|
|
-
|
|
|
- List<Map<String, Object>> wmTaskCount = wmTaskService.getTaskListByIdsCount(wmTask);
|
|
|
- if (wmTaskCount.size() > 0) {
|
|
|
- Integer total = 0;
|
|
|
- Integer sum = 0;
|
|
|
- for (Map<String, Object> map :
|
|
|
- wmTaskCount) {
|
|
|
- if (null != map.get("taskCount")) {
|
|
|
- total += Integer.parseInt(map.get("taskCount") + "");
|
|
|
- }
|
|
|
-
|
|
|
- if (null != map.get("taskSum")) {
|
|
|
- sum += Integer.parseInt(map.get("taskSum") + "");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- Map<String, Object> totalMap = new HashMap<>();
|
|
|
- totalMap.put("taskTypeName", "合计");
|
|
|
- totalMap.put("taskCount", total);
|
|
|
- totalMap.put("taskSum", sum);
|
|
|
- wmTaskCount.add(totalMap);
|
|
|
-
|
|
|
- excelMap.put("totalSubmitScore", sum);
|
|
|
- excelMap.put("totalSubmitTaskNum", total);
|
|
|
- excelMap.put("ztTable", wmTaskCount);
|
|
|
- }
|
|
|
-
|
|
|
- // 任务小类及对应的任务个数和积分值
|
|
|
- List<WmTask> taskList = wmTaskMapper.selectBatchIds(Arrays.asList(wmTask.getId().split(",")));
|
|
|
-
|
|
|
- // 查询taskType
|
|
|
- List<WmTaskType> taskTypeList = wmTaskTypeService.list(Wrappers.<WmTaskType>lambdaQuery()
|
|
|
- .eq(WmTaskType::getTaskTypeLevel, "1")
|
|
|
- .eq(WmTaskType::getDelFlag, "0")
|
|
|
-// .eq(WmTaskType::getEnableFlag, "0")
|
|
|
- );
|
|
|
- // taskType通过id分组(key为parentId,value为taskTypeId的set)
|
|
|
- Map<String, String> taskTypeIdMap = taskTypeList.stream()
|
|
|
- .collect(Collectors.toMap(WmTaskType::getId, WmTaskType::getTaskTypeName));
|
|
|
-
|
|
|
- // task通过taskTypeId分组
|
|
|
- Map<String, List<WmTask>> taskTypeMap = taskList.stream()
|
|
|
- .collect(Collectors.groupingBy(WmTask::getTaskTypeId, Collectors.toList()));
|
|
|
-
|
|
|
- // 封装brief table1数据(统计每个小类任务的积分、任务数)
|
|
|
- List<Map<String, Object>> briefTable1List = new ArrayList<>();
|
|
|
- taskTypeMap.forEach((taskTypeId, wmTasks) -> {
|
|
|
- Map<String, Object> briefTable1Params = new HashMap<>();
|
|
|
- briefTable1Params.put("taskTypeName", taskTypeIdMap.get(taskTypeId));
|
|
|
- briefTable1Params.put("taskCount", wmTasks.size());
|
|
|
- briefTable1Params.put("taskSum", wmTasks.stream().map(WmTask::getScore).reduce(0, Integer::sum));
|
|
|
- briefTable1List.add(briefTable1Params);
|
|
|
- });
|
|
|
- Map<String, Object> briefTable1TotalParams = new HashMap<>();
|
|
|
- briefTable1TotalParams.put("taskTypeName", "合计");
|
|
|
- briefTable1TotalParams.put("taskCount", taskList.size());
|
|
|
- briefTable1TotalParams.put("taskSum", taskList.stream().map(WmTask::getScore).reduce(0, Integer::sum));
|
|
|
- briefTable1List.add(briefTable1TotalParams);
|
|
|
- excelMap.put("briefTable", briefTable1List);
|
|
|
-
|
|
|
- SysDept paramDept = new SysDept();
|
|
|
- paramDept.setDeptId(Integer.valueOf(wmScorePackage1.getSendPackageDeptId()));
|
|
|
- SysDept wmDaAgent = sysDeptService.selectDeptById(paramDept);
|
|
|
- excelMap.put("wt_ent", wmDaAgent.getName());
|
|
|
-
|
|
|
- excelMap.put("drugEnt", "");
|
|
|
-
|
|
|
-
|
|
|
- List<Map<String, Object>> wmTaskZd = wmTaskService.getTaskListByIdsZd(wmTask);
|
|
|
- if (wmScorePackage1.getPackageType2().equals("2")) {
|
|
|
- wmTaskZd = wmTaskService.getTaskListByIdsZdJs(wmTask);
|
|
|
- }
|
|
|
- String minDateStr = null;
|
|
|
- String maxDateStr = null;
|
|
|
- if (null != wmTaskZd) {
|
|
|
- if (wmTaskZd.size() > 0) {
|
|
|
- Map<String, Object> stringMap = wmTaskZd.get(0);
|
|
|
- if (null == stringMap) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- // 服务周期取 积分包领取审核通过时间~管理员审核积分包时最后审核通过的时间
|
|
|
- Map<String, String> serviceTimeRangeMap = wmScorePackageStatusService.getServiceTimeRange(wmScorePackage1);
|
|
|
- excelMap.put("service_date", serviceTimeRangeMap.get("service_start_date") + "至" + serviceTimeRangeMap.get("service_end_date"));
|
|
|
-// excelMap.put("service_date", stringMap.get("mindate") + "至" + stringMap.get("maxdate"));
|
|
|
- try {
|
|
|
- minDateStr = serviceTimeRangeMap.get("service_start_date").substring(5, 7);
|
|
|
- maxDateStr = serviceTimeRangeMap.get("service_end_date").substring(5, 7);
|
|
|
-
|
|
|
- } catch (Exception ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- excelMap.put("tMoney", stringMap.get("sumscore") + "");
|
|
|
- excelMap.put("report_users", stringMap.get("realname") + "");
|
|
|
-
|
|
|
-
|
|
|
- String ruleDate = wmScorePackage1.getBelongDate();
|
|
|
-
|
|
|
- excelMap.put("rule_year", ruleDate.substring(0, 4));
|
|
|
-
|
|
|
- String monthStr = ruleDate.substring(5, 7);
|
|
|
- if (null != minDateStr && null != maxDateStr) {
|
|
|
- if (minDateStr.equals(maxDateStr)) {
|
|
|
- monthStr = minDateStr;
|
|
|
- } else {
|
|
|
- // 跨年情况判断
|
|
|
- if (!ruleDate.substring(0, 4).equals(serviceTimeRangeMap.get("service_end_date").substring(0, 4))) {
|
|
|
- monthStr = String.format("%s月至%s年%s",
|
|
|
- minDateStr, serviceTimeRangeMap.get("service_end_date").substring(0, 4), maxDateStr);
|
|
|
- } else {
|
|
|
- monthStr = minDateStr + "月至" + maxDateStr;
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (null != minDateStr) {
|
|
|
- monthStr = minDateStr;
|
|
|
- } else if (null != maxDateStr) {
|
|
|
- monthStr = maxDateStr;
|
|
|
- }
|
|
|
-
|
|
|
- excelMap.put("rule_month", monthStr);
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- return excelMap;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 个人报告导出--报告详情
|
|
|
- *
|
|
|
- * @param wmTask
|
|
|
- * @return
|
|
|
- * @throws IOException
|
|
|
- */
|
|
|
- public List<Map<String, Object>> exportZbInfo(WmTask wmTask) throws IOException {
|
|
|
- return reportExportService.exportZbInfo(wmTask);
|
|
|
- }
|
|
|
-
|
|
|
- public String getFieldValueByFieldName(String fieldName, Object object) {
|
|
|
- try {
|
|
|
- Field field = object.getClass().getDeclaredField(fieldName);
|
|
|
- //对private的属性的访问
|
|
|
- field.setAccessible(true);
|
|
|
- return field.get(object) + "";
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|