瀏覽代碼

矛盾纠纷临时提交--第一次迁移--截止

wanghao 1 月之前
父節點
當前提交
5003a8d37c

+ 2 - 0
src/main/java/org/ssssssss/example/datacheck/common/ExcelExportUtil.java

@@ -72,6 +72,8 @@ public class ExcelExportUtil {
         }
 
         // 设置响应头
+//        response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+
         response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
         fileName = URLEncoder.encode(fileName+DateUtils.dateTimeNow(),"UTF-8");
         response.setHeader("Content-Disposition", "attachment; filename=" + fileName + ".xlsx");

+ 125 - 16
src/main/java/org/ssssssss/example/datacheck/controller/DataExportController.java

@@ -9,6 +9,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.io.InputStreamResource;
+import org.springframework.http.ResponseEntity;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.*;
 import org.ssssssss.example.datacheck.bean.JsonResult;
@@ -16,6 +18,7 @@ import org.ssssssss.example.datacheck.service.DataCheckService;
 import org.ssssssss.example.datacheck.service.DataExportService;
 import org.ssssssss.example.mdjf.common.Constant;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
@@ -34,29 +37,43 @@ public class DataExportController extends BaseController {
 
 
 	@RequestMapping(value = "/mdjftotal", method = RequestMethod.GET)
-	public void mdjftotal(HttpServletResponse response,@RequestParam(value = "startTime",required = false) String startTime, @RequestParam(value = "endTime",required = false) String endTime) throws IOException {
-		dataExportService.mdjftotal(startTime,endTime,response);
+	public ResponseEntity<InputStreamResource> mdjftotal(HttpServletResponse response, @RequestParam(value = "startTime",required = false) String startTime, @RequestParam(value = "endTime",required = false) String endTime) throws IOException {
+		return dataExportService.mdjftotal(startTime,endTime,response);
 	}
 
 	@RequestMapping(value = "/zdrtotal", method = RequestMethod.GET)
-	public void zdrtotal(HttpServletResponse response,@RequestParam(value = "startTime",required = false) String startTime, @RequestParam(value = "endTime",required = false) String endTime) throws IOException {
+	public void zdrtotal(HttpServletResponse response,
+						 @RequestParam(value = "startTime",required = false) String startTime,
+						 @RequestParam(value = "endTime",required = false) String endTime) throws IOException {
 		dataExportService.zdrtotal(startTime,endTime,response);
 	}
 
 
-	@RequestMapping(value = "/yjzxList", method = RequestMethod.POST)
-	public void yjzxList(HttpServletResponse response,@RequestBody String jsonString) throws IOException {
-		JSONObject obj = JSONObject.parseObject(jsonString);
-		String idno = obj.getString("idno");
-		String jsdwmc = obj.getString("jsdwmc");
-		String name = obj.getString("name");
-		String rwlx = obj.getString("rwlx");
-		String rwmc = obj.getString("rwmc");
-		String sqdwmc = obj.getString("sqdwmc");
-		String yjsjEnd = obj.getString("yjsjEnd");
-		String yjsjStart = obj.getString("yjsjStart");
-		String yjzt = obj.getString("yjzt");
-		String zrmj = obj.getString("zrmj");
+	@RequestMapping(value = "/yjzxList", method = RequestMethod.GET)
+	public void yjzxList(HttpServletResponse response,
+						 @RequestParam(value = "idno",required = false) String idno,
+						 @RequestParam(value = "jsdwmc",required = false) String jsdwmc,
+						 @RequestParam(value = "name",required = false) String name,
+						 @RequestParam(value = "rwlx",required = false) String rwlx,
+						 @RequestParam(value = "rwmc",required = false) String rwmc,
+						 @RequestParam(value = "sqdwmc",required = false) String sqdwmc,
+						 @RequestParam(value = "yjsjEnd",required = false) String yjsjEnd,
+						 @RequestParam(value = "yjsjStart",required = false) String yjsjStart,
+						 @RequestParam(value = "yjzt",required = false) String yjzt,
+						 @RequestParam(value = "zrmj",required = false) String zrmj
+
+						 ) throws IOException {
+//		JSONObject obj = JSONObject.parseObject(jsonString);
+//		String idno = obj.getString("idno");
+//		String jsdwmc = obj.getString("jsdwmc");
+//		String name = obj.getString("name");
+//		String rwlx = obj.getString("rwlx");
+//		String rwmc = obj.getString("rwmc");
+//		String sqdwmc = obj.getString("sqdwmc");
+//		String yjsjEnd = obj.getString("yjsjEnd");
+//		String yjsjStart = obj.getString("yjsjStart");
+//		String yjzt = obj.getString("yjzt");
+//		String zrmj = obj.getString("zrmj");
 
 
 
@@ -65,6 +82,98 @@ public class DataExportController extends BaseController {
 
 
 
+	@RequestMapping(value = "/mdjfList", method = RequestMethod.GET)
+	public void mdjfList(HttpServletResponse response,
+						 @RequestParam(value = "bjlx",required = false) String bjlx,
+						 @RequestParam(value = "bldw",required = false) String bldw,
+						 @RequestParam(value = "blzrr",required = false) String blzrr,
+						 @RequestParam(value = "dataSource",required = false) String dataSource,
+						 @RequestParam(value = "eventAddress",required = false) String eventAddress,
+						 @RequestParam(value = "eventDataEnd",required = false) String eventDataEnd,
+						 @RequestParam(value = "eventDataStart",required = false) String eventDataStart,
+						 @RequestParam(value = "eventId",required = false) String eventId,
+						 @RequestParam(value = "eventName",required = false) String eventName,
+						 @RequestParam(value = "eventType",required = false) String eventType,
+						 @RequestParam(value = "idno",required = false) String idno,
+						 @RequestParam(value = "isZdgz",required = false) String isZdgz,
+						 @RequestParam(value = "partyType",required = false) String partyType,
+						 @RequestParam(value = "sjrs",required = false) String sjrs,
+						 @RequestParam(value = "slsjEnd",required = false) String slsjEnd,
+						 @RequestParam(value = "slsjStart",required = false) String slsjStart
+						 ) throws IOException {
+//		JSONObject obj = JSONObject.parseObject(jsonString);
+//		String bjlx = obj.getString("bjlx");
+//		String bldw = obj.getString("bldw");
+//		String blzrr = obj.getString("blzrr");
+//		String dataSource = obj.getString("dataSource");
+//		String eventAddress = obj.getString("eventAddress");
+//		String eventDataEnd = obj.getString("eventDataEnd");
+//		String eventDataStart = obj.getString("eventDataStart");
+//		String eventId = obj.getString("eventId");
+//		String eventName = obj.getString("eventName");
+//		String eventType = obj.getString("eventType");
+//		String idno = obj.getString("idno");
+//		String isZdgz = obj.getString("isZdgz");
+//		String partyType = obj.getString("partyType");
+//		String sjrs = obj.getString("sjrs");
+//		String slsjEnd = obj.getString("slsjEnd");
+//		String slsjStart = obj.getString("slsjStart");
+
+
+		dataExportService.mdjfList(response,bjlx,bldw,blzrr,dataSource,eventAddress,eventDataEnd,eventDataStart,eventId,eventName,eventType,idno,isZdgz,partyType,sjrs,slsjEnd,slsjStart);
+	}
+
+
+
+	@RequestMapping(value = "/zdrList", method = RequestMethod.GET)
+	public void zdrList(HttpServletRequest request, HttpServletResponse response,
+						@RequestBody(required = false) String requestBody,
+						@RequestParam(value = "edfx",required = false) String edfx,
+						@RequestParam(value = "gksjStart",required = false) String gksjStart,
+						@RequestParam(value = "gksjEnd",required = false) String gksjEnd,
+						@RequestParam(value = "gkztStr",required = false) String gkzt,
+						@RequestParam(value = "rybq",required = false) String rybq,
+						@RequestParam(value = "rylb",required = false) String rylb,
+						@RequestParam(value = "ryzt",required = false) String ryzt,
+						@RequestParam(value = "sdfx",required = false) String sdfx,
+						@RequestParam(value = "tsyj",required = false) String tsyj,
+						@RequestParam(value = "fengxian",required = false) String fengxian,
+						@RequestParam(value = "zrbm",required = false) String zrbm,
+						@RequestParam(value = "zrdw",required = false) String zrdw,
+						@RequestParam(value = "zrr",required = false) String zrr
+
+						) throws IOException {
+
+
+//		// 获取所有参数名
+//		System.err.println(JSONObject.toJSONString(request.getParameterMap()));
+//		System.err.println(11111);
+//
+//		System.err.println(JSONObject.toJSONString(requestBody));
+
+
+
+//		JSONObject obj = JSONObject.parseObject(jsonString);
+//		String edfx = obj.getString("edfx");
+//		String gksjStart = obj.getString("gksjStart");
+//		String gksjEnd = obj.getString("gksjEnd");
+//		String gkztStr = obj.getString("gkztStr");
+//		String rybq = obj.getString("rybq");
+//		String rylb = obj.getString("rylb");
+//		String ryzt = obj.getString("ryzt");
+//		String sdfx = obj.getString("sdfx");
+//		String tsyj = obj.getString("tsyj");
+//		String fengxian = obj.getString("fengxian");
+//		String zrbm = obj.getString("zrbm");
+//		String zrdw = obj.getString("zrdw");
+//		String zrr = obj.getString("zrr");
+
+		dataExportService.zdrList(response,edfx,gksjStart,gksjEnd,gkzt,rybq,rylb,ryzt,sdfx,tsyj,fengxian,zrbm,zrdw,zrr);
+	}
+
+
+
+
 }
 
 

+ 4 - 0
src/main/java/org/ssssssss/example/datacheck/dao/DataExportMapper.java

@@ -19,4 +19,8 @@ public interface DataExportMapper {
       List<Map<String, Object>> zdrtotal(String startTime, String endTime);
 
       List<Map<String, Object>> yjzxList(String idno, String jsdwmc, String name, String rwlx, String rwmc, String sqdwmc, String yjsjEnd, String yjsjStart, String yjzt, String zrmj);
+
+      List<Map<String, Object>> mdjfList(String bjlx, String bldw, String blzrr, String dataSource, String eventAddress, String eventDataEnd, String eventDataStart, String eventId, String eventName, String eventType, String idno, String isZdgz, String partyType, String sjrs, String slsjEnd, String slsjStart);
+
+      List<Map<String, Object>> zdrList(String edfx, String gksjStart, String gksjEnd, String gkzt, String rybq, String rylb, String ryzt, String sdfx, String tsyj, String fengxian, String zrbm, String zrdw, String zrr);
 }

+ 17 - 2
src/main/java/org/ssssssss/example/datacheck/service/DataExportService.java

@@ -6,6 +6,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.io.InputStreamResource;
+import org.springframework.http.ResponseEntity;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 import org.ssssssss.example.datacheck.bean.CheckErrorTypeEnum;
@@ -14,6 +16,7 @@ import org.ssssssss.example.datacheck.bean.JsonResult;
 import org.ssssssss.example.datacheck.common.CustomDateSource;
 import org.ssssssss.example.datacheck.common.DateUtils;
 import org.ssssssss.example.datacheck.common.ExcelExportUtil;
+import org.ssssssss.example.datacheck.common.ExcelExportUtilBlob;
 import org.ssssssss.example.datacheck.dao.DataExportMapper;
 import org.ssssssss.example.datacheck.dao.MDJFDao;
 import org.ssssssss.example.mdjf.common.CommonUtil;
@@ -39,9 +42,10 @@ public class DataExportService {
   @Autowired
   private DataExportMapper dataExportMapper;
 
-  public void mdjftotal(String startTime, String endTime, HttpServletResponse response) throws IOException {
+  public ResponseEntity<InputStreamResource> mdjftotal(String startTime, String endTime, HttpServletResponse response) throws IOException {
     List<Map<String,Object>> result = dataExportMapper.mdjftotal(startTime,endTime);
-    ExcelExportUtil.exportToExcel(response,result,"矛盾纠纷统计报表导出","导出结果");
+    return ExcelExportUtilBlob.exportToExcel(response,result,"矛盾纠纷统计报表导出","导出结果");
+//    ExcelExportUtil.exportToExcel(response,result,"矛盾纠纷统计报表导出","导出结果");
   }
 
   public void zdrtotal(String startTime, String endTime, HttpServletResponse response) throws IOException {
@@ -53,4 +57,15 @@ public class DataExportService {
     List<Map<String,Object>> result = dataExportMapper.yjzxList(idno,jsdwmc,name,rwlx,rwmc,sqdwmc,yjsjEnd,yjsjStart,yjzt,zrmj);
     ExcelExportUtil.exportToExcel(response,result,"预警信息导出","导出结果");
   }
+
+  public void mdjfList(HttpServletResponse response, String bjlx, String bldw, String blzrr, String dataSource, String eventAddress, String eventDataEnd, String eventDataStart, String eventId, String eventName, String eventType, String idno, String isZdgz, String partyType, String sjrs, String slsjEnd, String slsjStart) throws IOException {
+    List<Map<String,Object>> result = dataExportMapper.mdjfList(bjlx,bldw,blzrr,dataSource,eventAddress,eventDataEnd,eventDataStart,eventId,eventName,eventType,idno,isZdgz,partyType,sjrs,slsjEnd,slsjStart);
+    ExcelExportUtil.exportToExcel(response,result,"矛盾纠纷列表导出","导出结果");
+  }
+
+  public void zdrList(HttpServletResponse response, String edfx, String gksjStart, String gksjEnd, String gkzt, String rybq, String rylb, String ryzt, String sdfx, String tsyj, String fengxian, String zrbm, String zrdw, String zrr) throws IOException {
+    List<Map<String,Object>> result = dataExportMapper.zdrList(edfx,gksjStart,gksjEnd,gkzt,rybq,rylb,ryzt,sdfx,tsyj,fengxian,zrbm,zrdw,zrr);
+    ExcelExportUtil.exportToExcel(response,result,"重点人列表导出","导出结果");
+
+  }
 }

+ 2 - 2
src/main/resources/application.yml

@@ -81,7 +81,7 @@ mybatis-plus:
     map-underscore-to-camel-case: false
   # 忽略字段大小写的差异,不对字段名称进行转换
     # 日志输出SQL
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     # 设置全局的 SQL 执行超时时间(单位:秒)
     default-statement-timeout: 300
     # 执行插入、更新、删除操作时,是否忽略插入时的字段为空值
@@ -206,7 +206,7 @@ magic-api:
 logging:
   level:
     root: info  # 设置根日志级别为 INFO
-    com.baomidou.mybatisplus: debug
+#    com.baomidou.mybatisplus: debug
 
 
 

+ 115 - 3
src/main/resources/mapper/DataExportMapper.xml

@@ -86,16 +86,16 @@
         where 1 =1
 
         <if test="startTime != null and startTime != ''">
-            <![CDATA[ and CREATE_TIME >#{startTime} ]]>
+            <![CDATA[ and CREATE_TIME >= #{startTime} ]]>
         </if>
 
         <if test="endTime != null and endTime != ''">
-            <![CDATA[ and CREATE_TIME >=#{endTime} ]]>
+            <![CDATA[ and CREATE_TIME <=#{endTime} ]]>
         </if>
     </select>
 
     <select id="yjzxList" resultType="java.util.Map">
-        SELECT YJRY_XM,YJRY_SFZH,TO_CHAR(YJXXSM),RWMC,RWLX,RWLXMC,RWDXMC,YJZT,YJZTMC,YJSJ,JSBMMC,SQR_DWMC,YWLY,ZRMJXM from T_BKRW_YJXX WHERE 1=1
+        SELECT YJRY_XM,YJRY_SFZH,DBMS_LOB.SUBSTR(YJXXSM, 4000, 1) 预警信息,RWMC,RWLX,RWLXMC,RWDXMC,YJZT,YJZTMC,YJSJ,JSBMMC,SQR_DWMC,YWLY,ZRMJXM from T_BKRW_YJXX WHERE 1=1
         <if test="idno != null and idno != ''">
             and YJRY_SFZH = #{idno}
         </if>
@@ -139,5 +139,117 @@
         ORDER BY YJSJ desc
 
     </select>
+    <select id="mdjfList" resultType="java.util.Map">
+        SELECT ID,RKSJ_ZYK,EVENT_ID,EVENT_NAME,EVENT_CATEGORY,EVENT_DESCRIPTION,PARTY_NAME,PARTY_TYPE,PARTY_ID_NUMBER,EVENT_DATE,'未知' as WANZHENGDU,RESOLUTION_STATUS,RESOLUTION_SUCCESS FROM TB_MDJFKHJXX WHERE 1=1
+
+
+        <if test="bjlx != null and bjlx != ''">
+            and RESOLUTION_METHOD = #{bjlx}
+        </if>
+        <if test="bldw != null and bldw != ''">
+            and INVOLVED_UNIT like '%'||#{bldw}||'%'
+        </if>
+        <if test="blzrr != null and blzrr != ''">
+            and RESOLUTION_RES_PER_NAME = #{blzrr}
+        </if>
+        <if test="dataSource != null and dataSource != ''">
+            and SJLY like '%'||#{dataSource}||'%'
+        </if>
+        <if test="eventAddress != null and eventAddress != ''">
+            and EVENT_ADDRESS like '%'||#{eventAddress}||'%'
+        </if>
+        <if test="eventDataStart != null and eventDataStart != ''">
+            <![CDATA[  and EVENT_DATE >= TO_DATE(#{eventDataStart},'YYYY-MM-DD HH24:MI:SS')  ]]>
+        </if>
+        <if test="eventDataEnd != null and eventDataEnd != ''">
+          <![CDATA[  and EVENT_DATE <= TO_DATE(#{eventDataEnd},'YYYY-MM-DD HH24:MI:SS') ]]>
+        </if>
+
+        <if test="eventId != null and eventId != ''">
+            and EVENT_ID = #{eventId}
+        </if>
+        <if test="eventName != null and eventName != ''">
+            and EVENT_NAME like '%'||#{eventName}||'%'
+        </if>
+        <if test="eventType != null and eventType != ''">
+            and EVENT_CATEGORY = #{eventType}
+        </if>
+        <if test="idno != null and idno != ''">
+            and PARTY_ID_NUMBER = #{idno}
+        </if>
+
+        <if test="isZdgz == 1">
+            and PARTY_ID_NUMBER = '1'
+        </if>
+        <if test="isZdgz == 2">
+            and PARTY_ID_NUMBER != '1'
+        </if>
+
+        <if test="partyType != null and partyType != ''">
+            and PARTY_TYPE = #{partyType}
+        </if>
+
+        <if test="sjrs != null and sjrs != ''">
+           <![CDATA[ and NUMBER_OF_PEOPLE_INVOLVED >= #{sjrs}  ]]>
+        </if>
+
+
+        <if test="slsjStart != null and slsjStart != ''">
+           <![CDATA[ and RESOLUTION_DATE >= TO_DATE(#{slsjStart},'YYYY-MM-DD HH24:MI:SS') ]]>
+        </if>
+        <if test="slsjEnd != null and slsjEnd != ''">
+           <![CDATA[ and RESOLUTION_DATE <= TO_DATE(#{slsjEnd},'YYYY-MM-DD HH24:MI:SS') ]]>
+        </if>
+
+        ORDER BY RKSJ_ZYK desc
+
+    </select>
+
+    <select id="zdrList" resultType="java.util.Map">
+        select SFZH,NAME,TEL,RISK,MAIN_UNIT||MAIN_DEPT UNITINFO,MAIN_POLICE,CONTROL_TYPE,PERSON_LABEL,PERSON_CLASS,PERSON_STATUS,CREATE_TIME
+        from T_ZDR_JBXX where 1=1
+
+        <if test="edfx != null and edfx != 0 and  edfx != '0' and edfx != ''">
+            and IS_LINE2 =  #{edfx}
+        </if>
+        <if test="sdfx != null and sdfx != 0 and  sdfx != '0' and sdfx != ''">
+            and IS_LINE3 =  #{sdfx}
+        </if>
+        <if test="gksjStart != null and gksjStart != ''">
+            <![CDATA[  and CONTROL_TIME >= #{gksjStart}  ]]>
+        </if>
+        <if test="gksjEnd != null and gksjEnd != ''">
+           <![CDATA[  and CONTROL_TIME <= #{gksjEnd}  ]]>
+        </if>
+        <if test="gkzt != null and gkzt != ''">
+            and CONTROL_TYPE in (${gkzt})
+        </if>
+        <if test="rybq != null and rybq != 0 and  rybq != '0' and rybq != ''">
+            and ',' ||PERSON_LABEL|| ','  like '%,'||#{rybq}||',%'
+        </if>
+        <if test="rylb != null and rylb != 0 and  rylb != '0' and rylb != ''">
+            and ',' ||PERSON_CLASS|| ','  like '%,'||#{rylb}||',%'
+        </if>
+        <if test="ryzt != null and ryzt != 0 and  ryzt != '0' and ryzt != ''">
+            and PERSON_STATUS =  #{ryzt}
+        </if>
+        <if test="tsyj != null and tsyj != 0 and  tsyj != '0' and tsyj != ''">
+            and IS_PUSH =  #{tsyj}
+        </if>
+
+        <if test="zrdw != null and zrdw != ''">
+            and MAIN_UNIT||MAIN_DEPT like '%'||#{zrdw}||'%'
+        </if>
+        <if test="zrr != null and zrr != ''">
+            and MAIN_POLICE =  #{zrr}
+        </if>
+
+        <if test="fengxian != null and fengxian != 0 and  fengxian != '0' and fengxian != ''">
+          <![CDATA[   and RISK >=  #{fengxian}  ]]>
+        </if>
+
+        ORDER BY CREATE_TIME desc
+
+    </select>
 
 </mapper>