feat: 企标稽查-导出延期数据
This commit is contained in:
+7
@@ -121,4 +121,11 @@ public class EnterpriseStandardInspectController extends JeroController<Enterpri
|
||||
public void exportData(HttpServletResponse response, ESQueryCommonDTO esQueryCommonDTO) {
|
||||
esInspectService.export(response, esQueryCommonDTO, "企标稽查", "企标稽查");
|
||||
}
|
||||
|
||||
@AutoLog(value = "企标稽查-导出延期数据")
|
||||
@ApiOperation(value="企标稽查-导出延期数据", notes="企标稽查-导出延期数据")
|
||||
@GetMapping("/exportDataWithDelay")
|
||||
public void exportDataWithDelay(HttpServletResponse response, ESQueryCommonDTO esQueryCommonDTO) {
|
||||
esInspectService.exportDataWithDelay(response, esQueryCommonDTO, "企标稽查-延期数据", "企标稽查-延期数据");
|
||||
}
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.jero.modules.laws.enterprise.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/9/10 18:14
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EnterpriseStandardInspectDelayVo extends EnterpriseStandardInspectVo {
|
||||
|
||||
/** 计划稽查日期 */
|
||||
@Excel(name = "申请延期日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "申请延期日期")
|
||||
private Date requestDelayDate;
|
||||
|
||||
/** 延期说明 */
|
||||
@Excel(name = "延期说明", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "延期说明")
|
||||
private String delayDescription;
|
||||
}
|
||||
+13
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -20,55 +21,67 @@ public class EnterpriseStandardInspectVo {
|
||||
private String id;
|
||||
|
||||
/** 稽查依据标准号 */
|
||||
@Excel(name = "稽查依据标准号", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "稽查依据标准号")
|
||||
private String inspectNo;
|
||||
|
||||
/** 计划稽查对象 */
|
||||
@Excel(name = "计划稽查对象", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "计划稽查对象")
|
||||
private String planInspectObject;
|
||||
|
||||
/** 稽查依据标准名称 */
|
||||
@Excel(name = "稽查依据标准名称", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "稽查依据标准名称")
|
||||
private String inspectName;
|
||||
|
||||
/** 主责标准化工作组 */
|
||||
@Excel(name = "主责标准化工作组", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "主责标准化工作组")
|
||||
private String standardizationWorkGroup;
|
||||
|
||||
/** 所属部门 */
|
||||
@Excel(name = "所属部门", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String belongDept;
|
||||
|
||||
/** 计划稽查日期 */
|
||||
@Excel(name = "计划稽查日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划稽查日期")
|
||||
private Date planInspectDate;
|
||||
|
||||
/** 稽查负责人 */
|
||||
@Excel(name = "稽查负责人", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "稽查负责人")
|
||||
private String inspectUser;
|
||||
|
||||
/** 标准化组对接人 */
|
||||
@Excel(name = "标准化组对接人", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "标准化组对接人")
|
||||
private String standardizationDockingUser;
|
||||
|
||||
/** 实际稽查完成日期 */
|
||||
@Excel(name = "实际稽查完成日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "实际稽查完成日期")
|
||||
private Date completeDate;
|
||||
|
||||
/** 实际稽查人 */
|
||||
@Excel(name = "实际稽查人", width = 15, orderNum = "1")
|
||||
@ApiModelProperty(value = "实际稽查人")
|
||||
private String actualInspectUser;
|
||||
|
||||
/** 稽查状态 */
|
||||
@Excel(name = "稽查状态", width = 15, orderNum = "1", dicCode = "inspect_status")
|
||||
@Dict(dicCode = "inspect_status")
|
||||
@ApiModelProperty(value = "稽查状态")
|
||||
private String inspectStatus;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建日期", width = 15, orderNum = "1", format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
|
||||
+9
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspect;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.laws.enterprise.entity.dto.ESQueryCommonDTO;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardInspectDelayVo;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardInspectVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -22,6 +23,14 @@ public interface EnterpriseStandardInspectMapper extends BaseMapper<EnterpriseSt
|
||||
* @return
|
||||
*/
|
||||
IPage<EnterpriseStandardInspectVo> page(IPage<EnterpriseStandardInspectVo> page, @Param("param") ESQueryCommonDTO esInspect);
|
||||
|
||||
/**
|
||||
* 稽查列表-带延期数据
|
||||
* @param page
|
||||
* @param esQueryCommonDTO
|
||||
* @return
|
||||
*/
|
||||
IPage<EnterpriseStandardInspectDelayVo> pageWithDelay(IPage<EnterpriseStandardInspectDelayVo> page, @Param("param") ESQueryCommonDTO esQueryCommonDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+75
@@ -92,4 +92,79 @@
|
||||
</if>
|
||||
ORDER BY i.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="pageWithDelay"
|
||||
resultType="com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardInspectDelayVo">
|
||||
SELECT DISTINCT
|
||||
i.id,
|
||||
s.standard_number AS inspectNo,
|
||||
s.standard_name AS inspectName,
|
||||
io.planInspectObject AS planInspectObject,
|
||||
w.`name` AS standardizationWorkGroup,
|
||||
d.depart_name AS belongDept,
|
||||
i.plan_inspect_date AS planInspectDate,
|
||||
u1.username AS inspectUser,
|
||||
u2.username AS standardizationDockingUser,
|
||||
i.complete_date AS completeDate,
|
||||
u3.username AS actualInspectUser,
|
||||
i.inspect_status AS inspectStatus,
|
||||
i.create_time AS createTime,
|
||||
id.request_delay_date AS requestDelayDate,
|
||||
id.delay_description AS delayDescription
|
||||
FROM
|
||||
laws_enterprise_standard_inspect_delay AS id
|
||||
INNER JOIN (
|
||||
SELECT inspect_id, MAX(create_time) AS latest_time
|
||||
FROM laws_enterprise_standard_inspect_delay
|
||||
GROUP BY inspect_id
|
||||
) AS latest_id ON id.inspect_id = latest_id.inspect_id AND id.create_time = latest_id.latest_time
|
||||
LEFT JOIN laws_enterprise_standard_inspect AS i ON i.id = id.inspect_id
|
||||
LEFT JOIN laws_working_group AS w ON w.id = i.standardization_work_group
|
||||
LEFT JOIN laws_enterprise_standard AS s ON s.standard_number = i.inspect_no
|
||||
LEFT JOIN sys_depart AS d ON d.id = i.belong_dept
|
||||
LEFT JOIN sys_user AS u1 ON u1.id = i.inspect_user
|
||||
LEFT JOIN sys_user AS u2 ON u2.id = i.standardization_docking_user
|
||||
LEFT JOIN sys_user AS u3 ON u3.id = i.actual_inspect_user
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
io.inspect_id AS id,
|
||||
GROUP_CONCAT((d.depart_name) SEPARATOR ',') AS planInspectObject
|
||||
FROM
|
||||
laws_enterprise_standard_inspect_object AS io
|
||||
LEFT JOIN sys_depart AS d ON d.id = io.plan_inspect_object
|
||||
GROUP BY io.inspect_id
|
||||
) AS io ON io.id = i.id
|
||||
WHERE 1 = 1
|
||||
<!--企标编号判断-->
|
||||
<if test="param.standardNo != null and param.standardNo != ''">
|
||||
AND s.standard_number LIKE CONCAT('%',#{param.standardNo},'%')
|
||||
</if>
|
||||
<!--企标名称判断-->
|
||||
<if test="param.standardName != null and param.standardName != ''">
|
||||
AND s.standard_name LIKE CONCAT('%',#{param.standardName},'%')
|
||||
</if>
|
||||
<!--状态判断-->
|
||||
<if test="param.inspectStatus != null and param.inspectStatus != ''">
|
||||
AND i.inspect_status = #{param.inspectStatus}
|
||||
</if>
|
||||
<!--所属部门判断-->
|
||||
<if test="param.inspectDept != null and param.inspectDept != ''">
|
||||
AND i.belong_dept = #{param.inspectDept}
|
||||
</if>
|
||||
<!--计划稽查日期判断-->
|
||||
<if test="param.inspectStartDate != null and param.inspectEndDate != null">
|
||||
AND i.plan_inspect_date BETWEEN #{param.inspectStartDate} AND #{param.inspectEndDate}
|
||||
</if>
|
||||
<!--创建日期判断-->
|
||||
<if test="param.inspectCreateStartDate != null and param.inspectCreateEndDate != null">
|
||||
AND i.create_time BETWEEN #{param.inspectCreateStartDate} AND #{param.inspectCreateEndDate}
|
||||
</if>
|
||||
<if test="param.idList != null and param.idList.size() > 0">
|
||||
AND d.id IN
|
||||
<foreach item="item" index="index" collection="param.idList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY i.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+9
@@ -32,4 +32,13 @@ public interface EnterpriseStandardInspectService extends IService<EnterpriseSta
|
||||
* @param sheetName
|
||||
*/
|
||||
void export(HttpServletResponse response, ESQueryCommonDTO esQueryCommonDTO, String fileName, String sheetName);
|
||||
|
||||
/**
|
||||
* 企标稽查-导出
|
||||
* @param response
|
||||
* @param esQueryCommonDTO
|
||||
* @param fileName
|
||||
* @param sheetName
|
||||
*/
|
||||
void exportDataWithDelay(HttpServletResponse response, ESQueryCommonDTO esQueryCommonDTO, String fileName, String sheetName);
|
||||
}
|
||||
|
||||
+26
@@ -9,6 +9,7 @@ import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspect;
|
||||
import com.jero.modules.laws.enterprise.entity.dto.ESQueryCommonDTO;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardDeclareVo;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardInspectDelayVo;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardInspectVo;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardRecheckPlanVo;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectService;
|
||||
@@ -69,6 +70,31 @@ public class EnterpriseStandardInspectServiceImpl extends ServiceImpl<Enterprise
|
||||
throw new JeroBootException("导出excel异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportDataWithDelay(HttpServletResponse response, ESQueryCommonDTO esQueryCommonDTO, String fileName, String sheetName) {
|
||||
try {
|
||||
// 获取数据
|
||||
IPage<EnterpriseStandardInspectDelayVo> page = new Page<>(1, Integer.MAX_VALUE);
|
||||
IPage<EnterpriseStandardInspectDelayVo> enterpriseStandardInspectDelayVoIPage = esInspectMapper.pageWithDelay(page, esQueryCommonDTO);
|
||||
List<EnterpriseStandardInspectDelayVo> records = enterpriseStandardInspectDelayVoIPage.getRecords();
|
||||
|
||||
// 设置导出参数
|
||||
ExportParams exportParams = new ExportParams(null, sheetName); // 可以为标题添加更多的配置
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, EnterpriseStandardInspectDelayVo.class, records);
|
||||
|
||||
// 设置响应头和内容类型
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName + ".xls");
|
||||
|
||||
// 写出到响应流
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
log.error("导出excel异常", e);
|
||||
throw new JeroBootException("导出excel异常", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user