Commit 54e6f576 authored by hekaiwen's avatar hekaiwen

新增 检验检测结果列表导出接口

parent e8ff69b4
...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; ...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto; import com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto;
import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult; import com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult;
import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel; import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcInspectionApplicationVo;
import com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcInspectionResultVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -23,4 +25,6 @@ public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionRes ...@@ -23,4 +25,6 @@ public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionRes
Page<JyjcInspectionResultModel> selectForPage(@Param("page") Page<JyjcInspectionResultModel> page, @Param("jyjcInspectionResultModel") JyjcInspectionResultModel jyjcInspectionResultModel,@Param("identity") String identity); Page<JyjcInspectionResultModel> selectForPage(@Param("page") Page<JyjcInspectionResultModel> page, @Param("jyjcInspectionResultModel") JyjcInspectionResultModel jyjcInspectionResultModel,@Param("identity") String identity);
List<InspectionTimelinesDto> queryInspectionTimelinessTopXX(@Param("top") String top, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<InspectionTimelinesDto> queryInspectionTimelinessTopXX(@Param("top") String top, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
List<JyjcInspectionResultVo> queryExportInIds(@Param("ids") List<String> ids);
} }
package com.yeejoin.amos.boot.module.jyjc.api.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class JyjcInspectionResultVo {
@ExcelProperty(value = "报检单编号", index = 0)
String applicationNo;
@ExcelProperty(value = "报检日期", index = 1)
String applicationDate;
@ExcelProperty(value = "检验类型", index = 2)
String inspectionTypeName;
@ExcelProperty(value = "报检单位", index = 3)
String applicationUnitName;
@ExcelProperty(value = "检验检测机构", index = 4)
String inspectionUnitName;
@ExcelProperty(value = "设备种类", index = 5)
String equListName;
@ExcelProperty(value = "监管码", index = 6)
String supervisoryCode;
@ExcelProperty(value = "设备代码", index = 7)
String equCode;
@ExcelProperty(value = "使用登记证编号", index = 8)
String useOrgCode;
@ExcelProperty(value = "单位内部编号", index = 9)
String useInnerCode;
@ExcelProperty(value = "设备地址", index = 10)
String equUseAddress;
@ExcelProperty(value = "检验结果", index = 11)
String resultStatus;
public String getResultStatus() {
return resultStatus;
}
public void setResultStatus(String resultStatus) {
this.resultStatus = resultStatus;
}
}
\ No newline at end of file
...@@ -59,8 +59,7 @@ ...@@ -59,8 +59,7 @@
ORDER BY application_date DESC ORDER BY application_date DESC
</select> </select>
<select id="selectForPage" <sql id="page-list">
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel">
SELECT SELECT
res.sequence_nbr, res.sequence_nbr,
res.inspection_unit_code, res.inspection_unit_code,
...@@ -103,9 +102,14 @@ ...@@ -103,9 +102,14 @@
concat(ibjui.province_name, ibjui.city_name,ibjui.county_name, ibjui.street_name,ibjui.ADDRESS ) as equUseAddress concat(ibjui.province_name, ibjui.city_name,ibjui.county_name, ibjui.street_name,ibjui.ADDRESS ) as equUseAddress
FROM FROM
tz_jyjc_inspection_result res tz_jyjc_inspection_result res
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjui.record = res.equip_unicode LEFT JOIN idx_biz_jg_use_info ibjui ON ibjui.record = res.equip_unicode
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.record = ibjri.record LEFT JOIN idx_biz_jg_register_info ibjri ON ibjui.record = ibjri.record
LEFT JOIN idx_biz_jg_other_info ot ON ot.record = ibjri.record LEFT JOIN idx_biz_jg_other_info ot ON ot.record = ibjri.record
</sql>
<select id="selectForPage"
resultType="com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel">
<include refid="page-list"/>
<where> <where>
<if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null"> <if test="jyjcInspectionResultModel.applicationNo != '' and jyjcInspectionResultModel.applicationNo != null">
and res.application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%') and res.application_no like concat('%',#{jyjcInspectionResultModel.applicationNo},'%')
...@@ -178,4 +182,17 @@ ...@@ -178,4 +182,17 @@
WHERE WHERE
a1.inspection_unit_code = b1.use_unit_code a1.inspection_unit_code = b1.use_unit_code
</select> </select>
<select id="queryExportInIds" resultType="com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcInspectionResultVo">
<include refid="page-list"/>
<where>
<if test='ids != null'>
and res.sequence_nbr in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
order by res.application_no desc
</select>
</mapper> </mapper>
...@@ -9,6 +9,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieModel; ...@@ -9,6 +9,7 @@ import com.yeejoin.amos.feign.systemctl.model.DictionarieModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -16,6 +17,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -16,6 +17,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -195,4 +198,12 @@ public class JyjcInspectionResultController extends BaseController { ...@@ -195,4 +198,12 @@ public class JyjcInspectionResultController extends BaseController {
public ResponseModel<List<DictionarieModel>> inspectTypeListByPerson(){ public ResponseModel<List<DictionarieModel>> inspectTypeListByPerson(){
return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.inspectTypeListByPerson(getSelectedOrgInfo())); return ResponseHelper.buildResponse(jyjcInspectionResultServiceImpl.inspectTypeListByPerson(getSelectedOrgInfo()));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/export")
@ApiOperation(httpMethod = "GET", value = "检验检测结果列表数据导出", notes = "检验检测结果列表数据导出")
public void Export(HttpServletResponse response, String ids) {
Assert.hasText(ids,"未选择导出数据");
jyjcInspectionResultServiceImpl.Export(response, Arrays.asList(ids.split(",")));
}
} }
...@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil; import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -28,6 +29,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel; ...@@ -28,6 +29,7 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttachmentService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcInspectionResultVo;
import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionDetectionSaveToDbEvent; import com.yeejoin.amos.boot.module.jyjc.biz.event.InspectionDetectionSaveToDbEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.UseInfoSaveToDbEvent; import com.yeejoin.amos.boot.module.jyjc.biz.event.UseInfoSaveToDbEvent;
import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.BizEmqPublisher; import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.BizEmqPublisher;
...@@ -52,6 +54,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -52,6 +54,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity; import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -531,4 +534,21 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -531,4 +534,21 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
updateWrapper.set(JyjcInspectionResult::getPlanCreateDate, new Date()); updateWrapper.set(JyjcInspectionResult::getPlanCreateDate, new Date());
this.update(updateWrapper); this.update(updateWrapper);
} }
/**
* 检验检测结果列表数据导出
* @param response
* @param ids
*/
public void Export(HttpServletResponse response, List<String> ids) {
List<JyjcInspectionResultVo> exportData = this.baseMapper.queryExportInIds(ids);
for (JyjcInspectionResultVo vo : exportData) {
if (vo.getResultStatus().equals("1")) {
vo.setResultStatus("未出");
} else if (vo.getResultStatus().equals("2")) {
vo.setResultStatus("已出");
}
}
ExcelUtil.createTemplate(response, "检验检测结果列表数据", "检验检测结果列表", exportData, JyjcInspectionResultVo.class, null, false);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment