fix 项目列表导出
This commit is contained in:
parent
4d75d91766
commit
6b11047fc7
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.chushang.inspection.project.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class ProjectExportVO implements java.io.Serializable{
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "项目名称", index = 0)
|
||||||
|
private String projectName;
|
||||||
|
@ExcelProperty(value = "所属部门", index = 1)
|
||||||
|
private String deptName;
|
||||||
|
@ExcelProperty(value = "项目负责人", index = 2)
|
||||||
|
private String projectConcat;
|
||||||
|
@ExcelProperty(value = "项目负责人电话", index = 3)
|
||||||
|
private String projectPhone;
|
||||||
|
@ExcelProperty(value = "项目状态", index = 4)
|
||||||
|
private String projectEffect;
|
||||||
|
@ExcelProperty(value = "创建时间", index = 5)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@ import com.chushang.inspection.project.query.ProjectQuery;
|
||||||
import com.chushang.inspection.project.service.WrkProjectContractService;
|
import com.chushang.inspection.project.service.WrkProjectContractService;
|
||||||
import com.chushang.inspection.project.service.WrkProjectPaymentService;
|
import com.chushang.inspection.project.service.WrkProjectPaymentService;
|
||||||
import com.chushang.inspection.project.service.WrkProjectService;
|
import com.chushang.inspection.project.service.WrkProjectService;
|
||||||
|
import com.chushang.inspection.work.query.WrkInfoQuery;
|
||||||
import com.chushang.security.annotation.RequiresPermissions;
|
import com.chushang.security.annotation.RequiresPermissions;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
@ -25,6 +26,7 @@ import org.aspectj.weaver.loadtime.Aj;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -58,7 +60,7 @@ public class WrkProjectController {
|
||||||
* 获取项目列表
|
* 获取项目列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@RequiresPermissions("inspection:project:list")
|
// @RequiresPermissions("inspection:project:list")
|
||||||
public AjaxResult list(WrkProject project)
|
public AjaxResult list(WrkProject project)
|
||||||
{
|
{
|
||||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||||
|
|
@ -189,12 +191,21 @@ public class WrkProjectController {
|
||||||
* 项目数据导出
|
* 项目数据导出
|
||||||
* @param projectQuery 查询条件
|
* @param projectQuery 查询条件
|
||||||
*/
|
*/
|
||||||
|
// @SysLog(value = "项目数据", businessType = BusinessType.EXPORT)
|
||||||
|
// @GetMapping(value = "/project/data/export")
|
||||||
|
//// @RequiresPermissions("inspection:project:export")
|
||||||
|
// public AjaxResult projectDataExport(ProjectQuery projectQuery)
|
||||||
|
// {
|
||||||
|
// return AjaxResult.success("项目数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]");
|
||||||
|
// }
|
||||||
|
|
||||||
@SysLog(value = "项目数据", businessType = BusinessType.EXPORT)
|
@SysLog(value = "项目数据", businessType = BusinessType.EXPORT)
|
||||||
@GetMapping(value = "/project/data/export")
|
@GetMapping("/project/data/export")
|
||||||
@RequiresPermissions("inspection:project:export")
|
// @RequiresPermissions("inspection:project:export")
|
||||||
public AjaxResult projectDataExport(ProjectQuery projectQuery)
|
public void projectDataExport(HttpServletResponse response, ProjectQuery query) {
|
||||||
{
|
// 派单领取列表, 就是 已经派出的工单以及领取的工单,
|
||||||
return AjaxResult.success("项目数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]");
|
projectService.exportDispatchPage(response,query);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,18 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.chushang.inspection.project.po.WrkProject;
|
import com.chushang.inspection.project.po.WrkProject;
|
||||||
import com.chushang.inspection.project.po.WrkProjectContract;
|
import com.chushang.inspection.project.po.WrkProjectContract;
|
||||||
|
import com.chushang.inspection.project.query.ProjectQuery;
|
||||||
|
import com.chushang.inspection.project.vo.ProjectExportVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @auther: zhao
|
* @auther: zhao
|
||||||
* @date: 2024/6/15 10:51
|
* @date: 2024/6/15 10:51
|
||||||
*/
|
*/
|
||||||
public interface WrkProjectMapper extends BaseMapper<WrkProject> {
|
public interface WrkProjectMapper extends BaseMapper<WrkProject> {
|
||||||
|
|
||||||
|
List<ProjectExportVO> exportDispatchPage(@Param("query") ProjectQuery query);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,16 @@ import com.chushang.inspection.project.po.WrkProjectContract;
|
||||||
import com.chushang.inspection.project.query.ProjectQuery;
|
import com.chushang.inspection.project.query.ProjectQuery;
|
||||||
import com.chushang.inspection.project.vo.CountVO;
|
import com.chushang.inspection.project.vo.CountVO;
|
||||||
import com.chushang.inspection.project.vo.EmployeeVO;
|
import com.chushang.inspection.project.vo.EmployeeVO;
|
||||||
|
import com.chushang.inspection.project.vo.ProjectExportVO;
|
||||||
import com.chushang.inspection.project.vo.ProjectVO;
|
import com.chushang.inspection.project.vo.ProjectVO;
|
||||||
import com.chushang.inspection.terminal.service.StoreService;
|
import com.chushang.inspection.terminal.service.StoreService;
|
||||||
import com.chushang.inspection.terminal.service.TerminalService;
|
import com.chushang.inspection.terminal.service.TerminalService;
|
||||||
import com.chushang.inspection.terminal.vo.FiveStoreVO;
|
import com.chushang.inspection.terminal.vo.FiveStoreVO;
|
||||||
import com.chushang.inspection.work.po.WrkInfo;
|
import com.chushang.inspection.work.po.WrkInfo;
|
||||||
|
import com.chushang.inspection.work.query.WrkInfoQuery;
|
||||||
import com.chushang.inspection.work.service.WrkInfoService;
|
import com.chushang.inspection.work.service.WrkInfoService;
|
||||||
import com.chushang.inspection.work.vo.WrkInfoDetailsVO;
|
import com.chushang.inspection.work.vo.WrkInfoDetailsVO;
|
||||||
|
import com.chushang.inspection.work.vo.WrkInfoExportVO;
|
||||||
import com.chushang.oss.entity.dto.UploadBytesDTO;
|
import com.chushang.oss.entity.dto.UploadBytesDTO;
|
||||||
import com.chushang.oss.entity.vo.FileSourceVo;
|
import com.chushang.oss.entity.vo.FileSourceVo;
|
||||||
import com.chushang.oss.feign.RemoteOssService;
|
import com.chushang.oss.feign.RemoteOssService;
|
||||||
|
|
@ -47,6 +50,7 @@ import com.chushang.inspection.project.mapper.WrkProjectMapper;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
@ -433,4 +437,9 @@ public class WrkProjectService extends ServiceImpl<WrkProjectMapper, WrkProject>
|
||||||
.build(), SecurityConstants.INNER).getData();
|
.build(), SecurityConstants.INNER).getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void exportDispatchPage(HttpServletResponse response, ProjectQuery query) {
|
||||||
|
WrapperUtils.buildSql(query);
|
||||||
|
List<ProjectExportVO> records = baseMapper.exportDispatchPage(query);
|
||||||
|
ExcelUtils.exportList(response, ProjectExportVO.class, records, "导出");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.chushang.inspection.project.mapper.WrkProjectMapper">
|
||||||
|
|
||||||
|
<select id="exportDispatchPage" resultType="com.chushang.inspection.project.vo.ProjectExportVO">
|
||||||
|
select project_name,dept_name,project_concat,project_phone,create_time from wrk_project
|
||||||
|
</select>
|
||||||
|
<!-- project_name,dept_name-->
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue