Merge remote-tracking branch 'origin/develop_master' into develop_master
This commit is contained in:
@@ -74,6 +74,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
//企业标准导出
|
//企业标准导出
|
||||||
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportSarBussionessStand");
|
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportSarBussionessStand");
|
||||||
|
|
||||||
|
//预警导出
|
||||||
|
addInterceptor.excludePathPatterns("/api/sys/EarlyWarning/exportWarning");
|
||||||
|
|
||||||
|
|
||||||
//OCR回调存储文件
|
//OCR回调存储文件
|
||||||
addInterceptor.excludePathPatterns("/api/ocr/OCRRestful/OcrHandleResult");
|
addInterceptor.excludePathPatterns("/api/ocr/OCRRestful/OcrHandleResult");
|
||||||
|
|
||||||
@@ -94,7 +98,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 添加自定义拦截器,并拦截对应 url
|
// // 添加自定义拦截器,并拦截对应 url
|
||||||
addInterceptor.addPathPatterns("/**");
|
// addInterceptor.addPathPatterns("/**");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -131,9 +131,11 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/exprotWarning")
|
@GetMapping("/exportWarning")
|
||||||
@ApiOperation("导出预警")
|
@ApiOperation("导出预警")
|
||||||
public void exportStandardsInfoExcel(WarningExcelVO excelVO, HttpServletResponse response) throws Exception {
|
public void exportStandardsInfoExcel(WarningExcelVO excelVO, HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||||
try {
|
try {
|
||||||
response.setContentType("application/vnd.ms-excel");
|
response.setContentType("application/vnd.ms-excel");
|
||||||
@@ -145,11 +147,12 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
|||||||
String fileName = URLEncoder.encode(excelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
String fileName = URLEncoder.encode(excelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
||||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||||
|
|
||||||
|
// List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||||
List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||||
|
|
||||||
|
|
||||||
// 这里需要设置不关闭流
|
// 这里需要设置不关闭流
|
||||||
EasyExcel.write(response.getOutputStream(), SarStandIssueControlProduct.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
EasyExcel.write(response.getOutputStream(), StandWarningEO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||||
.doWrite(exportExcel);
|
.doWrite(exportExcel);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e);
|
System.out.println(e);
|
||||||
|
|||||||
+4
-1
@@ -11,6 +11,9 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
|
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
|
||||||
|
|
||||||
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO,@Param("idList") List<String> ids);
|
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
|
||||||
|
|
||||||
|
|
||||||
|
List<StandWarningEO> exportWarning(@Param("idList") List<String> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ public class EarlyWarningEO extends BaseEntity {
|
|||||||
@TableField("STAND_ID")
|
@TableField("STAND_ID")
|
||||||
private String standId;
|
private String standId;
|
||||||
|
|
||||||
|
@ExcelIgnore
|
||||||
|
@ApiModelProperty("分解单条款id")
|
||||||
|
@TableField("ITEM_ID")
|
||||||
|
private String itemId;
|
||||||
|
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
@ApiModelProperty("标准类别")
|
@ApiModelProperty("标准类别")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ public class WarningDate {
|
|||||||
@TableField("law_id")
|
@TableField("law_id")
|
||||||
private String lawId;
|
private String lawId;
|
||||||
|
|
||||||
|
@TableField("itemId")
|
||||||
|
private String itemId;
|
||||||
|
|
||||||
@TableField("SSRQ")
|
@TableField("SSRQ")
|
||||||
private String SSRQ;
|
private String SSRQ;
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -112,7 +112,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
|||||||
@Override
|
@Override
|
||||||
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
|
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
|
||||||
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
||||||
return earlyWarningEODao.selectWarningPage(iPage,queryPage,null);
|
return earlyWarningEODao.selectWarningPage(iPage,queryPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,8 +121,10 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<StandWarningEO> getExportExcel(WarningExcelVO excelVO){
|
public List<StandWarningEO> getExportExcel(WarningExcelVO excelVO){
|
||||||
IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, excelVO.getIds());
|
List<StandWarningEO> standWarningEOList = earlyWarningEODao.exportWarning( excelVO.getIds());
|
||||||
return standWarningEOIPage.getRecords();
|
// IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, null);
|
||||||
|
|
||||||
|
return standWarningEOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+86
-9
@@ -38,16 +38,7 @@
|
|||||||
|
|
||||||
<sql id="stand_where">
|
<sql id="stand_where">
|
||||||
|
|
||||||
<if test="idList != null and idList.size() > 0">
|
|
||||||
|
|
||||||
warning.ID
|
|
||||||
IN
|
|
||||||
<foreach collection="idList" item="id" open="and (" close=")" separator=",">
|
|
||||||
<!-- 每个遍历需要生成的串 -->
|
|
||||||
#{id}
|
|
||||||
</foreach>
|
|
||||||
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="waringEO.standCode != null and waringEO.standCode != ''">
|
<if test="waringEO.standCode != null and waringEO.standCode != ''">
|
||||||
AND trim(replace(CONCAT(
|
AND trim(replace(CONCAT(
|
||||||
@@ -83,6 +74,92 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
<select id="exportWarning" resultType="com.adc.da.slrs.sarStandWarning.entity.StandWarningEO">
|
||||||
|
|
||||||
|
SELECT WARNING_RESULT.* FROM
|
||||||
|
(
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
<include refid="stand_column"/>
|
||||||
|
,
|
||||||
|
attr.CLLX AS
|
||||||
|
APPLY_TYPE ,
|
||||||
|
attr
|
||||||
|
.ZRGCS AS DUTY_ENGINEER ,
|
||||||
|
NULL AS ITEMS_ID ,
|
||||||
|
NULL AS ITEMS_NUM , NULL AS ITEMS_NAME ,
|
||||||
|
NULL AS POLICY_ID ,
|
||||||
|
NULL AS POLICY_NAME ,
|
||||||
|
MARK ,
|
||||||
|
POWER,
|
||||||
|
attr.XCXSSRQ AS XCXSSRQ ,
|
||||||
|
attr.ZCCSSRQ AS ZCCSSRQ
|
||||||
|
FROM sar_stand_warning AS warning
|
||||||
|
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
|
||||||
|
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
|
||||||
|
<where>
|
||||||
|
POWER = '1'
|
||||||
|
AND (MARK = 'stand')
|
||||||
|
<if test="idList != null and idList.size() > 0">
|
||||||
|
AND
|
||||||
|
warning.ID
|
||||||
|
IN
|
||||||
|
<foreach collection="idList" item="id" open="(" close=")" separator=",">
|
||||||
|
<!-- 每个遍历需要生成的串 -->
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
<include refid="stand_column"/> ,
|
||||||
|
items.APPLY_ARCTIC AS APPLY_TYPE ,
|
||||||
|
items.DUTY_ENGINEER AS DUTY_ENGINEER ,
|
||||||
|
items.ID AS ITEMS_ID ,
|
||||||
|
items.ITEMS_NUM ,
|
||||||
|
items.ITEMS_NAME ,
|
||||||
|
NULL AS POLICY_ID ,
|
||||||
|
NULL AS POLICY_NAME ,
|
||||||
|
MARK ,
|
||||||
|
POWER,
|
||||||
|
items.XCXSSRQ AS XCXSSRQ ,
|
||||||
|
items.ZCCSSRQ AS ZCCSSRQ
|
||||||
|
FROM
|
||||||
|
sar_stand_warning AS warning
|
||||||
|
LEFT JOIN sar_standards_info AS sarInfo ON sarInfo.id = warning.STAND_ID
|
||||||
|
LEFT JOIN sar_stand_items AS items ON items.STAND_ID = warning.STAND_ID
|
||||||
|
LEFT JOIN sar_stand_attr_info AS attr ON attr.STAND_ID = warning.STAND_ID
|
||||||
|
<where>
|
||||||
|
POWER = '1'
|
||||||
|
AND (MARK = 'item')
|
||||||
|
<if test="idList != null and idList.size() > 0">
|
||||||
|
AND
|
||||||
|
warning.ID
|
||||||
|
IN
|
||||||
|
<foreach collection="idList" item="id" open="(" close=")" separator=",">
|
||||||
|
<!-- 每个遍历需要生成的串 -->
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
)
|
||||||
|
WARNING_RESULT
|
||||||
|
LEFT JOIN
|
||||||
|
(
|
||||||
|
SELECT law_id,MIN(SSRQ) SSRQ_MIN FROM warning_date
|
||||||
|
GROUP BY warning_date.law_id
|
||||||
|
) warning_date
|
||||||
|
ON warning_date.law_id = WARNING_RESULT.STAND_ID
|
||||||
|
ORDER BY warning_date.SSRQ_MIN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectWarningPage" resultMap="resultMap">
|
<select id="selectWarningPage" resultMap="resultMap">
|
||||||
SELECT WARNING_RESULT.* FROM
|
SELECT WARNING_RESULT.* FROM
|
||||||
|
|||||||
+50
-23
@@ -51,15 +51,23 @@
|
|||||||
|
|
||||||
<select id="getWarningId" resultType="com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO">
|
<select id="getWarningId" resultType="com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO">
|
||||||
SELECT
|
SELECT
|
||||||
law_id as STAND_ID,
|
law_id AS standId,
|
||||||
'-1' AS itemsId,
|
item_id AS itemId,
|
||||||
'stand' AS mark,
|
CASE
|
||||||
'1' as power
|
WHEN item_id = '-1' THEN
|
||||||
|
'stand'
|
||||||
|
WHEN
|
||||||
|
item_id IS NULL THEN
|
||||||
|
'stand'
|
||||||
|
ELSE
|
||||||
|
'item'
|
||||||
|
END AS mark,
|
||||||
|
'1' as power
|
||||||
FROM
|
FROM
|
||||||
warning_date AS warning
|
warning_date AS warning
|
||||||
WHERE
|
WHERE
|
||||||
DATE_FORMAT(warning.SSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
DATE_FORMAT(warning.SSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
||||||
UNION
|
<!-- UNION
|
||||||
SELECT
|
SELECT
|
||||||
STAND_ID,
|
STAND_ID,
|
||||||
ID AS itemsId,
|
ID AS itemsId,
|
||||||
@@ -70,7 +78,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
DATE_FORMAT(item.XCXSSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
DATE_FORMAT(item.XCXSSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
||||||
OR
|
OR
|
||||||
DATE_FORMAT(item.ZCCSSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
DATE_FORMAT(item.ZCCSSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d') -->
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
@@ -79,25 +87,44 @@
|
|||||||
|
|
||||||
SELECT lawId,timeName,DATE_FORMAT(SSRQ,'%Y-%m-%d') as SSRQ FROM
|
SELECT lawId,timeName,DATE_FORMAT(SSRQ,'%Y-%m-%d') as SSRQ FROM
|
||||||
(
|
(
|
||||||
select attr.STAND_ID as lawId,'SSRQ' as timeName,
|
select attr.STAND_ID as lawId,'-1' as itemId,'SSRQ' as timeName,
|
||||||
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||||
from sar_stand_attr_info attr
|
from sar_stand_attr_info attr
|
||||||
join mysql.help_topic b
|
join mysql.help_topic b
|
||||||
on b.help_topic_id < (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
on b.help_topic_id > (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
select attr.STAND_ID as lawId,'XCXSSRQ' as timeName,
|
select attr.STAND_ID as lawId,'-1' as itemId,'XCXSSRQ' as timeName,
|
||||||
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||||
from sar_stand_attr_info attr
|
from sar_stand_attr_info attr
|
||||||
join mysql.help_topic b
|
join mysql.help_topic b
|
||||||
on b.help_topic_id < (length(attr.XCXSSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
on b.help_topic_id > (length(attr.XCXSSRQ) - length(replace(attr.XCXSSRQ,',',''))+1)
|
||||||
UNION ALL
|
|
||||||
select attr.STAND_ID as lawId,'ZCCSSRQ' as timeName,
|
|
||||||
substring_index(substring_index(attr.ZCCSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
|
||||||
from sar_stand_attr_info attr
|
UNION ALL
|
||||||
join mysql.help_topic b
|
select attr.STAND_ID as lawId,'-1' as itemId,'ZCCSSRQ' as timeName,
|
||||||
on b.help_topic_id < (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
|
substring_index(substring_index(attr.ZCCSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||||
|
from sar_stand_attr_info attr
|
||||||
|
join mysql.help_topic b
|
||||||
|
on b.help_topic_id > (length(attr.SSRQ) - length(replace(attr.ZCCSSRQ,',',''))+1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
UNION All
|
||||||
|
select item.STAND_ID as lawId,item.ID as itemId,'ZCCSSRQ' as timeName,
|
||||||
|
substring_index(substring_index(item.ZCCSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||||
|
from sar_stand_items item
|
||||||
|
join mysql.help_topic b
|
||||||
|
on b.help_topic_id > (length(item.ZCCSSRQ) - length(replace(item.ZCCSSRQ,',',''))+1)
|
||||||
|
|
||||||
|
UNION All
|
||||||
|
select item.STAND_ID as lawId,item.ID as itemId,'XCXSSRQ' as timeName,
|
||||||
|
substring_index(substring_index(item.XCXSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
|
||||||
|
from sar_stand_items item
|
||||||
|
join mysql.help_topic b
|
||||||
|
on b.help_topic_id > (length(item.XCXSSRQ) - length(replace(item.XCXSSRQ,',',''))+1)
|
||||||
|
|
||||||
) as T
|
) as T
|
||||||
WHERE
|
WHERE
|
||||||
|
|||||||
Reference in New Issue
Block a user