Browse Source

Merge remote-tracking branch 'origin/dev_zhili' into dev_zhili

master
sunyuchao 3 years ago
parent
commit
40c800a223
  1. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
  2. 42
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java
  3. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  4. 23
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  5. BIN
      epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java

@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@ -351,6 +352,22 @@ public class ProjectController {
return new Result<PageData>().ok(projectService.projectList(formDTO));
}
/**
* Desc: 项目管理导出
* @param response
* @param tokenDto
* @param formDTO
* @author zxc
* @date 2022/5/24 15:22
*/
@PostMapping("project-list-export")
public void projectListExport(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody ProjectManageListFormDTO formDTO) throws IOException {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setIsPage(false);
projectService.projectListExport(response,formDTO);
}
/**
* Desc: 满意度评价列表
* @param formDTO

42
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectListExportExcel.java

@ -0,0 +1,42 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/5/24 15:24
* @DESC
*/
@Data
public class ProjectListExportExcel extends ExcelVerifyInfo implements Serializable {
@Excel(name = "所属网格",needMerge = true)
private String gridName = "";
@Excel(name = "项目标题",needMerge = true)
private String title = "";
@Excel(name = "转项目时间",needMerge = true)
private String shiftProjectTime;
@Excel(name = "项目方案",needMerge = true)
private String projectScheme = "";
@Excel(name = "内部备注",needMerge = true)
private String internalRemark = "";
@Excel(name = "滞留工作日",needMerge = true)
private String detentionDays = "";
// @ExcelCollection(name = "当前处理部门")
// private List<String> departmentNameList;
}

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java

@ -9,6 +9,8 @@ import com.epmet.dto.result.*;
import com.epmet.entity.ProjectEntity;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@ -384,4 +386,13 @@ public interface ProjectService extends BaseService<ProjectEntity> {
*/
PageData satisfactionEvaluationList(SatisfactionEvaluationListFormDTO formDTO);
/**
* Desc: 项目管理导出
* @param response
* @param formDTO
* @author zxc
* @date 2022/5/24 15:22
*/
void projectListExport(HttpServletResponse response,ProjectManageListFormDTO formDTO) throws IOException;
}

23
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -48,6 +49,7 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.excel.ProjectListExportExcel;
import com.epmet.feign.*;
import com.epmet.redis.ProjectRedis;
import com.epmet.resi.group.constant.TopicConstant;
@ -80,6 +82,8 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -3208,7 +3212,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
formDTO.setAgencyId(staffInfo.getAgencyId());
PageData<ProjectManageListResultDTO> result = new PageData<>(new ArrayList<>(),NumConstant.ZERO);
PageInfo<ProjectManageListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getProjectManageList(formDTO));
PageInfo<ProjectManageListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getProjectManageList(formDTO));
List<ProjectManageListResultDTO> projectManageList = pageInfo.getList();
if (CollectionUtils.isNotEmpty(projectManageList)){
// 获取滞留天数
@ -3312,6 +3316,23 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
/**
* Desc: 项目管理导出
* @param response
* @param formDTO
* @author zxc
* @date 2022/5/24 15:22
*/
@Override
public void projectListExport(HttpServletResponse response, ProjectManageListFormDTO formDTO) throws IOException {
List<ProjectManageListResultDTO> list = this.projectList(formDTO).getList();
List<ProjectListExportExcel> projectListExportExcels = ConvertUtils.sourceToTarget(list, ProjectListExportExcel.class);
TemplateExportParams templatePath = new TemplateExportParams("excel/project_list_export.xlsx");
Map<String,Object> map = new HashMap<>();
map.put("maplist",projectListExportExcels);
ExcelPoiUtils.exportExcel(templatePath ,map,"项目管理导出表",response);
}
/**
* @Description 区间项目分类数量处理
* 查询的是时间段内的分类项目数查询的时间 是传入一个日期拼上时间在进行比较大小
* @param categories

BIN
epmet-module/gov-project/gov-project-server/src/main/resources/excel/project_list_export.xlsx

Binary file not shown.
Loading…
Cancel
Save