Commit e84087ea by liulianglang

案件类别统计报表

parent c7fcb177
package org.springblade.founder.tjfx.controller; package org.springblade.founder.tjfx.controller;
import com.alibaba.excel.EasyExcel;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.Charsets;
import org.springblade.founder.tjfx.entity.DwTjParam; import org.springblade.founder.tjfx.entity.DwTjParam;
import org.springblade.founder.tjfx.entity.TbXwZbfzxyr;
import org.springblade.founder.tjfx.service.DwAjlbTjfxService; import org.springblade.founder.tjfx.service.DwAjlbTjfxService;
import org.springblade.founder.utils.EasyUIPage;
import org.springblade.founder.utils.R; import org.springblade.founder.utils.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map; import java.util.Map;
@RestController @RestController
...@@ -29,6 +35,18 @@ public class DwAjlbTjfxController { ...@@ -29,6 +35,18 @@ public class DwAjlbTjfxController {
return R.error(e.getMessage()); return R.error(e.getMessage());
} }
} }
// @PostMapping("/getAjlbTjByPid")
// @ApiOperation(value = "单位案件类别统计")
// public R getAjlbTjByPid(DwTjParam dwTjParam){
// try {
// Map<String, Object> rtMap = dwTjfxService.getDwTj(unitcode, kssj, jssj,ajzt,ajlbdm,xlajlbdm);
// return R.ok().data(rtMap);
// } catch (Exception e) {
// e.printStackTrace();
// return R.error(e.getMessage());
// }
// }
@PostMapping("/getXlAjlbTj") @PostMapping("/getXlAjlbTj")
@ApiOperation(value = "单位小类案件类别统计") @ApiOperation(value = "单位小类案件类别统计")
...@@ -46,6 +64,13 @@ public class DwAjlbTjfxController { ...@@ -46,6 +64,13 @@ public class DwAjlbTjfxController {
@ApiOperation(value = "单位小类案件类别统计透视") @ApiOperation(value = "单位小类案件类别统计透视")
public R getXlAjlbTjTs(DwTjParam dwTjParam){ public R getXlAjlbTjTs(DwTjParam dwTjParam){
try { try {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(dwTjParam.getPage());
easyUIPage.setPageParaOracle(dwTjParam.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
dwTjParam.setBegin(begin);
dwTjParam.setEnd(end);
Map<String, Object> rtMap = dwAjlbTjfxService.getXlAjlbTjTs(dwTjParam); Map<String, Object> rtMap = dwAjlbTjfxService.getXlAjlbTjTs(dwTjParam);
return R.ok().data(rtMap); return R.ok().data(rtMap);
} catch (Exception e) { } catch (Exception e) {
...@@ -54,6 +79,55 @@ public class DwAjlbTjfxController { ...@@ -54,6 +79,55 @@ public class DwAjlbTjfxController {
} }
} }
@PostMapping("/getDwXyrDaztTj")
@ApiOperation(value = "嫌疑人单位统计")
public R getDwXyrDaztTj(DwTjParam dwTjParam){
try {
Map<String, Object> rtMap = dwAjlbTjfxService.getDwXyrDaztTj(dwTjParam);
return R.ok().data(rtMap);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/getDwXyrDaztTjTs")
@ApiOperation(value = "嫌疑人单位透视")
public R getDwXyrDaztTjTs(DwTjParam dwTjParam){
try {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(dwTjParam.getPage());
easyUIPage.setPageParaOracle(dwTjParam.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
dwTjParam.setBegin(begin);
dwTjParam.setEnd(end);
Map<String, Object> rtMap = dwAjlbTjfxService.getDwXyrDaztTjTs(dwTjParam);
return R.ok().data(rtMap);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@RequestMapping("/exportDwXyrDaztTjTs")
@ResponseBody
public void exportDwXyrDaztTjTs(DwTjParam dwTjParam, HttpServletResponse response, HttpServletRequest request) throws IOException {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(1);
easyUIPage.setPageParaOracle(10000);
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
dwTjParam.setBegin(begin);
dwTjParam.setEnd(end);
Map<String, Object> rtMap = dwAjlbTjfxService.getDwXyrDaztTjTs(dwTjParam);
List<TbXwZbfzxyr> list =(List<TbXwZbfzxyr>)rtMap.get("rows");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("嫌疑人列表", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), TbXwZbfzxyr.class).sheet("嫌疑人列表").doWrite(list);
}
} }
package org.springblade.founder.tjfx.controller; package org.springblade.founder.tjfx.controller;
import com.alibaba.excel.EasyExcel;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.Charsets;
import org.springblade.founder.tjfx.entity.AjtjParam;
import org.springblade.founder.tjfx.entity.TbStAsj;
import org.springblade.founder.tjfx.entity.TbXwRybh;
import org.springblade.founder.tjfx.entity.TbXwZbfzxyr;
import org.springblade.founder.tjfx.service.DwTjfxService; import org.springblade.founder.tjfx.service.DwTjfxService;
import org.springblade.founder.utils.EasyUIPage; import org.springblade.founder.utils.EasyUIPage;
import org.springblade.founder.utils.R; import org.springblade.founder.utils.R;
import org.springblade.founder.utils.Utils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map; import java.util.Map;
@RestController @RestController
...@@ -57,6 +69,35 @@ public class DwTjfxController { ...@@ -57,6 +69,35 @@ public class DwTjfxController {
} }
} }
@RequestMapping("/exportgetDwTjTs")
@ResponseBody
public void exportgetDwTjTs(@RequestParam(value = "unitcode",defaultValue = "") String unitcode,
@RequestParam(value = "kssj",defaultValue = "") String kssj,
@RequestParam(value = "jssj",defaultValue = "") String jssj,
@RequestParam(value = "ajzt",defaultValue = "") String ajzt,
@RequestParam(value = "tjlb",defaultValue = "") String tjlb ,
@RequestParam(value = "ajlbdm",defaultValue = "") String ajlbdm ,
@RequestParam(value = "xlajlbdm",defaultValue = "") String xlajlbdm ,
@RequestParam(value = "qryType",defaultValue = "") String qryType ,
@RequestParam(value = "page", defaultValue = "0") int page,
@RequestParam(value = "limit", defaultValue = "0") int limit, HttpServletResponse response, HttpServletRequest request) throws IOException {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(1);
easyUIPage.setPageParaOracle(10000);
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
Map<String, Object> rtMap = dwTjfxService.getDwTjTs(unitcode, kssj, jssj,ajzt,tjlb,ajlbdm,xlajlbdm,qryType,begin,end);
List<TbStAsj> list =(List<TbStAsj>)rtMap.get("rows");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("案件列表", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), TbStAsj.class).sheet("案件列表").doWrite(list);
}
@PostMapping("/getSswpslflTs") @PostMapping("/getSswpslflTs")
@ApiOperation(value = "损失物品单位统计透视") @ApiOperation(value = "损失物品单位统计透视")
public R getSswpslflTs(@RequestParam(value = "unitcode",defaultValue = "") String unitcode, public R getSswpslflTs(@RequestParam(value = "unitcode",defaultValue = "") String unitcode,
...@@ -211,6 +252,35 @@ public class DwTjfxController { ...@@ -211,6 +252,35 @@ public class DwTjfxController {
} }
} }
@RequestMapping("/exportXyrHjorNlTjTs")
@ResponseBody
public void exportXyrHjorNlTjTs(@RequestParam(value = "unitcode",defaultValue = "") String unitcode,
@RequestParam(value = "kssj",defaultValue = "") String kssj,
@RequestParam(value = "jssj",defaultValue = "") String jssj,
@RequestParam(value = "ajzt",defaultValue = "") String ajzt,
@RequestParam(value = "tjlb",defaultValue = "") String tjlb ,
@RequestParam(value = "ajlbdm",defaultValue = "") String ajlbdm ,
@RequestParam(value = "xlajlbdm",defaultValue = "") String xlajlbdm ,
@RequestParam(value = "xzqhdm",defaultValue = "") String xzqhdm ,
@RequestParam(value = "qryType",defaultValue = "") String qryType ,
@RequestParam(value = "page", defaultValue = "0") int page,
@RequestParam(value = "limit", defaultValue = "0") int limit, HttpServletResponse response, HttpServletRequest request) throws IOException {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(1);
easyUIPage.setPageParaOracle(10000);
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
Map<String, Object> rtMap = dwTjfxService.getXyrHjorNlTjTs(unitcode, kssj, jssj,ajzt,tjlb,ajlbdm,xlajlbdm,xzqhdm,qryType,begin,end);
List<TbXwZbfzxyr> list =(List<TbXwZbfzxyr>)rtMap.get("rows");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("嫌疑人列表", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), TbXwZbfzxyr.class).sheet("嫌疑人列表").doWrite(list);
}
@PostMapping("/getShrHjorNlTjTs") @PostMapping("/getShrHjorNlTjTs")
@ApiOperation(value = "嫌疑人户籍or年龄单位统计透视") @ApiOperation(value = "嫌疑人户籍or年龄单位统计透视")
public R getShrHjorNlTjTs(@RequestParam(value = "unitcode",defaultValue = "") String unitcode, public R getShrHjorNlTjTs(@RequestParam(value = "unitcode",defaultValue = "") String unitcode,
...@@ -237,7 +307,33 @@ public class DwTjfxController { ...@@ -237,7 +307,33 @@ public class DwTjfxController {
return R.error(e.getMessage()); return R.error(e.getMessage());
} }
} }
@RequestMapping("/exportShrHjorNlTjTs")
@ResponseBody
public void exportShrHjorNlTjTs(@RequestParam(value = "unitcode",defaultValue = "") String unitcode,
@RequestParam(value = "kssj",defaultValue = "") String kssj,
@RequestParam(value = "jssj",defaultValue = "") String jssj,
@RequestParam(value = "ajzt",defaultValue = "") String ajzt,
@RequestParam(value = "tjlb",defaultValue = "") String tjlb ,
@RequestParam(value = "ajlbdm",defaultValue = "") String ajlbdm ,
@RequestParam(value = "xlajlbdm",defaultValue = "") String xlajlbdm ,
@RequestParam(value = "xzqhdm",defaultValue = "") String xzqhdm ,
@RequestParam(value = "qryType",defaultValue = "") String qryType ,
@RequestParam(value = "page", defaultValue = "0") int page,
@RequestParam(value = "limit", defaultValue = "0") int limit, HttpServletResponse response, HttpServletRequest request) throws IOException {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(1);
easyUIPage.setPageParaOracle(10000);
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
Map<String, Object> rtMap = dwTjfxService.getShrHjorNlTjTs(unitcode, kssj, jssj,ajzt,tjlb,ajlbdm,xlajlbdm,xzqhdm,qryType,begin,end);
List<TbXwRybh> list =(List<TbXwRybh>)rtMap.get("rows");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding(Charsets.UTF_8.name());
String fileName = URLEncoder.encode("受害人列表", Charsets.UTF_8.name());
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream(), TbXwRybh.class).sheet("受害人列表").doWrite(list);
}
......
...@@ -76,6 +76,7 @@ public class AjtjParam extends BaseModel { ...@@ -76,6 +76,7 @@ public class AjtjParam extends BaseModel {
private String ajlbsql; private String ajlbsql;
private String xyrlx;
@ApiModelProperty(value = "行政区划列表") @ApiModelProperty(value = "行政区划列表")
private List<String> xzqhList; private List<String> xzqhList;
......
...@@ -24,4 +24,6 @@ public class AjtjResult { ...@@ -24,4 +24,6 @@ public class AjtjResult {
private String num; private String num;
private String hb; private String hb;
private String tb; private String tb;
private String sjcode;
} }
package org.springblade.founder.tjfx.entity;
import lombok.Data;
@Data
public class DwDaztTj {
private String dwdm;
private String dwmc;
private int daztda;//案件总量
private int daztsw;//案件总量
private int daztzt;//案件总量
private String qryType;
}
...@@ -14,4 +14,6 @@ public class DwTjParam { ...@@ -14,4 +14,6 @@ public class DwTjParam {
private String qryType; private String qryType;
private int page; private int page;
private int limit; private int limit;
private int end;
private int begin;
} }
package org.springblade.founder.tjfx.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.tjfx.entity.DictitemXz;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface AjlbSysDictMapper {
List<DictitemXz> getAjlbByCode(String pid);
}
<?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="org.springblade.founder.tjfx.mapper.AjlbSysDictMapper">
<select id="getAjlbByCode" resultType="org.springblade.founder.tjfx.entity.DictitemXz">
select dict.name as name, dict.code as code,
(case when (select count(1) from sys_dictitem s where s.pid=dict.code and s.scbz='0')>0 then 'yxj' else 'mxj' end) lev
from sys_dictitem dict
where dict.scbz='0' and groupid='CODE_AJLB'
<if test="pid != null and pid != '' and pid == 'true'.toString() ">
and pid is null
</if>
<if test="pid != null and pid != '' and pid != 'true'.toString() ">
and pid =#{pid}
</if>
order by dict.code
</select>
</mapper>
package org.springblade.founder.tjfx.mapper; package org.springblade.founder.tjfx.mapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.tjfx.entity.AjtjResult; import org.springblade.founder.tjfx.entity.*;
import org.springblade.founder.tjfx.entity.DwTjParam;
import org.springblade.founder.tjfx.entity.TbStAsj;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
import java.util.Map;
@Component @Component
@Mapper @Mapper
...@@ -18,4 +17,10 @@ public interface DwAjlbTjfxMapper { ...@@ -18,4 +17,10 @@ public interface DwAjlbTjfxMapper {
List<TbStAsj> getXlAjlbTjTs(DwTjParam dwTjParam); List<TbStAsj> getXlAjlbTjTs(DwTjParam dwTjParam);
int getXlAjlbTjTsCount(DwTjParam dwTjParam); int getXlAjlbTjTsCount(DwTjParam dwTjParam);
DwDaztTj getDwXyrDaztTj(Map<String, Object> paramMap);
List<TbXwZbfzxyr> getDwXyrDaztTjTs(Map<String, Object> paramMap);
int getDwXyrDaztTjTsCount(Map<String, Object> paramMap);
} }
...@@ -3,24 +3,28 @@ ...@@ -3,24 +3,28 @@
<mapper namespace="org.springblade.founder.tjfx.mapper.DwAjlbTjfxMapper"> <mapper namespace="org.springblade.founder.tjfx.mapper.DwAjlbTjfxMapper">
<select id="getAjlbTj" resultType="org.springblade.founder.tjfx.entity.AjtjResult"> <select id="getAjlbTj" resultType="org.springblade.founder.tjfx.entity.AjtjResult">
select asj.ajlbdm code, select (case when asj.ajlbdm is null then '未知' else asj.ajlbdm end) code,
(SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJLB' AND code = asj.ajlbdm) as name, (SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJLB' AND code = asj.ajlbdm) as name,
count(1) as num count(1) as num
from TB_ST_ASJ asj from TB_ST_ASJ asj
where asj.xxsc_pdbz='0' where asj.xxsc_pdbz='0'
<include refid="asjQry-where"/> <include refid="asjQry-where"/>
group by asj.ajlbdm group by asj.ajlbdm
order by asj.ajlbdm
</select> </select>
<select id="getXlAjlbTj" resultType="org.springblade.founder.tjfx.entity.AjtjResult"> <select id="getXlAjlbTj" resultType="org.springblade.founder.tjfx.entity.AjtjResult">
select asj.zatz_jyqk code,
select (case when asj.zatz_jyqk is null then '未知' else asj.zatz_jyqk end) code,
(SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJXZ' AND code = asj.zatz_jyqk) as name, (SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJXZ' AND code = asj.zatz_jyqk) as name,
count(1) as num count(1) as num,'2' as lev,#{ajlbdm , jdbcType=VARCHAR} as sjcode
from TB_ST_ASJ asj from TB_ST_ASJ asj
where asj.xxsc_pdbz='0' where asj.xxsc_pdbz='0'
<include refid="asjQry-where"/> <include refid="asjQry-where"/>
group by asj.zatz_jyqk group by asj.zatz_jyqk
order by asj.zatz_jyqk
</select> </select>
<select id="getXlAjlbTjTs" resultType="org.springblade.founder.tjfx.entity.TbStAsj"> <select id="getXlAjlbTjTs" resultType="org.springblade.founder.tjfx.entity.TbStAsj">
...@@ -42,6 +46,90 @@ ...@@ -42,6 +46,90 @@
where asj.xxsc_pdbz='0' where asj.xxsc_pdbz='0'
<include refid="asjQry-where"/> <include refid="asjQry-where"/>
</select> </select>
<select id="getDwXyrDaztTj" resultType="org.springblade.founder.tjfx.entity.DwDaztTj">
select (select count(1)
from tb_xw_zbfzxyr xyr
left join tb_st_asj ASJ
on xyr.asjbh = ASJ.asjbh
where ASJ.xxsc_pdbz = '0'
and xyr.xxsc_pdbz = '0'
and xyr.ZHFZXYR_FZXYRDAZTDM = '1'
<include refid="asjQry-where"/>
) daztda,
(select count(1)
from tb_xw_zbfzxyr xyr
left join tb_st_asj ASJ
on xyr.asjbh = ASJ.asjbh
where ASJ.xxsc_pdbz = '0'
and xyr.xxsc_pdbz = '0'
and xyr.ZHFZXYR_FZXYRDAZTDM = '2'
<include refid="asjQry-where"/>
) daztzt,
(select count(1)
from tb_xw_zbfzxyr xyr
left join tb_st_asj ASJ
on xyr.asjbh = ASJ.asjbh
where ASJ.xxsc_pdbz = '0'
and xyr.xxsc_pdbz = '0'
and xyr.ZHFZXYR_FZXYRDAZTDM = '3'
<include refid="asjQry-where"/>
) daztsw
from dual
</select>
<select id="getDwXyrDaztTjTs" resultType="org.springblade.founder.tjfx.entity.TbXwZbfzxyr">
<include refid="pagination-head" />
SELECT
xyr.ZHFZXYR_XM zhfzxyrXm,xyr.ZHFZXYR_ASJXGRYBH rybh,
(select name from sys_dictitem d where d.groupid = 'CODE_XB' and
xyr.ZHFZXYR_XBDM=d.code) zhfzxyrXbdm,
xyr.ZHFZXYR_CYZJ_ZJHM zhfzxyrCyzjZjhm,
xyr.ZHFZXYR_HJDZ_DZMC hjdzDzmc,
(select name from sys_dictitem where groupid='CODE_XZQH' and code=xyr.ZHFZXYR_HJDZ_XZQHDM) as hjdzXzqhdm,
xyr.zhfzxyr_xzz_dzmc as xzdDzmc,
xyr.ASJBH,
(select name from sys_dictitem d where d.groupid = 'CODE_DAZT' and
xyr.ZHFZXYR_FZXYRDAZTDM=d.code) zhfzxyrFzxyrdaztdm,
to_char(xyr.ZHRQ,'yyyy-mm-dd') zhrqstr
from tb_xw_zbfzxyr xyr left join tb_st_asj ASJ on xyr.asjbh = ASJ.asjbh
where asj.xxsc_pdbz='0' and xyr.xxsc_pdbz='0'
<if test="tjlb != null and tjlb != '' and tjlb == 'daztda'.toString() ">
and xyr.ZHFZXYR_FZXYRDAZTDM = '1'
</if>
<if test="tjlb != null and tjlb != '' and tjlb == 'daztzt'.toString() ">
and xyr.ZHFZXYR_FZXYRDAZTDM = '2'
</if>
<if test="tjlb != null and tjlb != '' and tjlb == 'daztsw'.toString() ">
and xyr.ZHFZXYR_FZXYRDAZTDM = '3'
</if>
<include refid="asjQry-where"/>
order by xyr.ZHRQ desc nulls last
<include refid="pagination-tail" />
</select>
<select id="getDwXyrDaztTjTsCount" resultType="java.lang.Integer">
SELECT
count(1)
from tb_xw_zbfzxyr xyr left join tb_st_asj ASJ on xyr.asjbh = ASJ.asjbh
where asj.xxsc_pdbz='0' and xyr.xxsc_pdbz='0'
<if test="tjlb != null and tjlb != '' and tjlb == 'daztda'.toString() ">
and xyr.ZHFZXYR_FZXYRDAZTDM = '1'
</if>
<if test="tjlb != null and tjlb != '' and tjlb == 'daztzt'.toString() ">
and xyr.ZHFZXYR_FZXYRDAZTDM = '2'
</if>
<if test="tjlb != null and tjlb != '' and tjlb == 'daztsw'.toString() ">
and xyr.ZHFZXYR_FZXYRDAZTDM = '3'
</if>
<include refid="asjQry-where"/>
</select>
<sql id="asjQry-where"> <sql id="asjQry-where">
<if test="kssj != null and kssj != ''"> <if test="kssj != null and kssj != ''">
AND ASJ.LARQ <![CDATA[>=]]> to_date(#{kssj, jdbcType=VARCHAR},'yyyy-mm-dd') AND ASJ.LARQ <![CDATA[>=]]> to_date(#{kssj, jdbcType=VARCHAR},'yyyy-mm-dd')
...@@ -59,12 +147,20 @@ ...@@ -59,12 +147,20 @@
<if test="ajzt != null and ajzt != '' and ajzt == '3'.toString() "> <if test="ajzt != null and ajzt != '' and ajzt == '3'.toString() ">
and asj.ZCJDDM in ('0100','0200','0300','0301','0302','0400','0500') and asj.ZCJDDM in ('0100','0200','0300','0301','0302','0400','0500')
</if> </if>
<if test="ajlbdm != null and ajlbdm != '' "> <if test="ajlbdm != null and ajlbdm != '' and ajlbdm != '未知'.toString() ">
and ASJ.ajlbdm = #{ajlbdm} and ASJ.ajlbdm = #{ajlbdm}
</if> </if>
<if test="xlajlbdm != null and xlajlbdm != '' "> <if test="ajlbdm != null and ajlbdm != '' and ajlbdm == '未知'.toString() ">
and ASJ.ajlbdm is null
</if>
<if test="xlajlbdm != null and xlajlbdm != '' and xlajlbdm != '未知'.toString() ">
and ASJ.zatz_jyqk = #{xlajlbdm} and ASJ.zatz_jyqk = #{xlajlbdm}
</if> </if>
<if test="xlajlbdm != null and xlajlbdm != '' and xlajlbdm == '未知'.toString() ">
and ASJ.zatz_jyqk is null
</if>
<if test="qryType == 'bdw'"> <if test="qryType == 'bdw'">
and ASJ.LADW_GAJGJGDM = #{unitcode} and ASJ.LADW_GAJGJGDM = #{unitcode}
</if> </if>
......
package org.springblade.founder.tjfx.service;
import org.springblade.founder.tjfx.entity.DwTjParam;
import java.util.Map;
public interface AjlbSysDictService {
Map<String, Object> getAjlbTjByPid(DwTjParam dwTjParam);
}
...@@ -7,7 +7,14 @@ import java.util.Map; ...@@ -7,7 +7,14 @@ import java.util.Map;
public interface DwAjlbTjfxService { public interface DwAjlbTjfxService {
Map<String, Object> getAjlbTj(DwTjParam dwTjParam); Map<String, Object> getAjlbTj(DwTjParam dwTjParam);
Map<String, Object> getXlAjlbTj(DwTjParam dwTjParam); Map<String, Object> getXlAjlbTj(DwTjParam dwTjParam);
Map<String, Object> getXlAjlbTjTs(DwTjParam dwTjParam); Map<String, Object> getXlAjlbTjTs(DwTjParam dwTjParam);
Map<String, Object> getDwXyrDaztTj(DwTjParam dwTjParam);
Map<String, Object> getDwXyrDaztTjTs(DwTjParam dwTjParam);
} }
package org.springblade.founder.tjfx.service.impl;
import org.apache.commons.lang.StringUtils;
import org.springblade.core.secure.utils.SecureUtil;
import org.springblade.founder.tjfx.entity.DictitemXz;
import org.springblade.founder.tjfx.entity.DwTjParam;
import org.springblade.founder.tjfx.entity.DwXnpgTj;
import org.springblade.founder.tjfx.mapper.AjlbSysDictMapper;
import org.springblade.founder.tjfx.service.AjlbSysDictService;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
@Service
public class AjlbSysDictServiceImpl implements AjlbSysDictService {
@Autowired
private AjlbSysDictMapper ajlbSysDictMapper;
@Override
public Map<String, Object> getAjlbTjByPid(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>();
Map<String, Object> paramMap=new HashMap<>();
List<DwXnpgTj> dataList = new ArrayList<>();
List<DwXnpgTj> res = new ArrayList<>();
String unitcode=dwTjParam.getUnitcode();
String kssj=dwTjParam.getKssj();
String jssj=dwTjParam.getJssj();
String ajzt=dwTjParam.getAjzt();
String ajlbdm=dwTjParam.getAjlbdm();
String xlajlbdm=dwTjParam.getXlajlbdm();
String pid="true";
if (StringUtils.isEmpty(unitcode)) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
unitcode = xzxtUser.getUnitcode();//获取对应用户的单位
}
System.out.println(unitcode);
paramMap.put("unitcode", unitcode);
paramMap.put("kssj", kssj);
paramMap.put("jssj", jssj);
paramMap.put("ajzt", ajzt);
paramMap.put("ajlbdm", ajlbdm);
paramMap.put("xlajlbdm", xlajlbdm);
if(StringUtils.isEmpty(ajlbdm)){
pid="true";
}else {
pid=ajlbdm;
}
List<DictitemXz> unitList = ajlbSysDictMapper.getAjlbByCode(pid);
List<DictitemXz> unit1=new ArrayList<>();
List<DictitemXz> unit2=new ArrayList<>();
int ajts=0;//案件总量
int cjsswpajs=0;//采集损失物品案件量
int wcjsswpajs=0;//未采集损失物品案件量
int cssswpsl=0;//采集损失物品数量
int cjxyrajl=0;//采集嫌疑人案件量
int wcjxyrajl=0;//未采集嫌疑人案件量
int cjxyrsl=0;//采集嫌疑人数量
int cjshrajl=0;//采集受害人案件量
int wcjshrajl=0;//未采集受害人案件量
int cjshrsl=0;//采集受害人数量
Lock lock = new ReentrantLock();
// if(unitList!=null && unitList.size()>0){
// if(unitList.size()<2){
// unit1=unitList.subList(0,1);
// unit1.stream().parallel().forEach(item -> {
//
// String dwdm = item.getCode();
// String dwmc = item.getName();
// String dwtype="";
// paramMap.put("unitcode", dwdm);
// paramMap.put("qryType", "bdw");
// dwtype= "bdw";
//
// DwXnpgTj dwXnpgTj = dwTjfxMapper.getDwTjFx(paramMap);
//
// dwXnpgTj.setDwdm(dwdm);
// dwXnpgTj.setDwmc(dwmc);
// dwXnpgTj.setQryType(dwtype);
// lock.lock();
// try {
// dataList.add(dwXnpgTj);
// }finally {
// lock.unlock();
// }
//
// });
// }else {
// unit1=unitList.subList(0,1);
// unit2=unitList.subList(1,unitList.size());
// unit1.stream().parallel().forEach(item -> {
// Map<String, Object> paramet=new HashMap<>();
// String dwdm = item.getCode();
// String dwmc = item.getName();
// String dwtype="";
// paramet.putAll(paramMap);
// paramet.put("unitcode", dwdm);
// paramet.put("qryType", "bdw");
// dwtype= "bdw";
//
// DwXnpgTj dwXnpgTj = dwTjfxMapper.getDwTjFx(paramet);
//
// dwXnpgTj.setDwdm(dwdm);
// dwXnpgTj.setDwmc(dwmc);
// dwXnpgTj.setQryType(dwtype);
// lock.lock();
// try {
// dataList.add(dwXnpgTj);
// }finally {
// lock.unlock();
// }
//
// });
// unit2.stream().parallel().forEach(item -> {
//
//
// Map<String, Object> paramet=new HashMap<>();
// String dwdm = item.getCode();
// String dwmc = item.getName();
// String dwtype="";
// paramet.putAll(paramMap);
// paramet.put("unitcode", dwdm);
// paramet.put("qryType", "bxq");
// dwtype= "bxq";
//
// DwXnpgTj dwXnpgTj = dwTjfxMapper.getDwTjFx(paramet);
//
// dwXnpgTj.setDwdm(dwdm);
// dwXnpgTj.setDwmc(dwmc);
// dwXnpgTj.setQryType(dwtype);
// lock.lock();
// try {
// dataList.add(dwXnpgTj);
// }finally {
// lock.unlock();
// }
//
// });
//
//
// }
//
// }
res = dataList.stream().sorted(Comparator.comparing(DwXnpgTj::getDwdm))
.collect(Collectors.toList());
rtMap.put("rows",res);
return rtMap;
}
}
...@@ -3,25 +3,30 @@ package org.springblade.founder.tjfx.service.impl; ...@@ -3,25 +3,30 @@ package org.springblade.founder.tjfx.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springblade.founder.tjfx.entity.AjtjResult; import org.springblade.core.secure.utils.SecureUtil;
import org.springblade.founder.tjfx.entity.DwTjParam; import org.springblade.founder.tjfx.entity.*;
import org.springblade.founder.tjfx.entity.TbStAsj;
import org.springblade.founder.tjfx.mapper.DwAjlbTjfxMapper; import org.springblade.founder.tjfx.mapper.DwAjlbTjfxMapper;
import org.springblade.founder.tjfx.mapper.DwTjfxMapper; import org.springblade.founder.tjfx.mapper.DwTjfxMapper;
import org.springblade.founder.tjfx.service.DwAjlbTjfxService; import org.springblade.founder.tjfx.service.DwAjlbTjfxService;
import org.springblade.founder.utils.DwUtil;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap; import java.util.concurrent.locks.Lock;
import java.util.List; import java.util.concurrent.locks.ReentrantLock;
import java.util.Map; import java.util.stream.Collectors;
@Service @Service
@DS("xzxt") @DS("xzxt")
public class DwAjlbTjfxServiceImpl implements DwAjlbTjfxService { public class DwAjlbTjfxServiceImpl implements DwAjlbTjfxService {
@Resource @Resource
private DwAjlbTjfxMapper dwAjlbTjfxMapper; private DwAjlbTjfxMapper dwAjlbTjfxMapper;
@Autowired
private DwTjfxMapper dwTjfxMapper;
@Override @Override
public Map<String, Object> getAjlbTj(DwTjParam dwTjParam) { public Map<String, Object> getAjlbTj(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>(); Map<String, Object> rtMap = new HashMap<>();
...@@ -37,6 +42,11 @@ public class DwAjlbTjfxServiceImpl implements DwAjlbTjfxService { ...@@ -37,6 +42,11 @@ public class DwAjlbTjfxServiceImpl implements DwAjlbTjfxService {
return rtMap; return rtMap;
} }
@Override @Override
public Map<String, Object> getXlAjlbTj(DwTjParam dwTjParam) { public Map<String, Object> getXlAjlbTj(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>(); Map<String, Object> rtMap = new HashMap<>();
...@@ -70,4 +80,177 @@ public class DwAjlbTjfxServiceImpl implements DwAjlbTjfxService { ...@@ -70,4 +80,177 @@ public class DwAjlbTjfxServiceImpl implements DwAjlbTjfxService {
return rtMap; return rtMap;
} }
@Override
public Map<String, Object> getDwXyrDaztTj(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>();
Map<String, Object> paramMap=new HashMap<>();
List<DwDaztTj> dataList = new ArrayList<>();
List<DwDaztTj> res = new ArrayList<>();
String unitcode=dwTjParam.getUnitcode();
String kssj=dwTjParam.getKssj();
String jssj=dwTjParam.getJssj();
String ajzt=dwTjParam.getAjzt();
String ajlbdm=dwTjParam.getAjlbdm();
String xlajlbdm=dwTjParam.getXlajlbdm();
if (StringUtils.isEmpty(unitcode)) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
unitcode=xzxtUser.getUnitcode() ;//获取对应用户的单位
}
//获取本单位信息
DictitemXz bdwxx = dwTjfxMapper.getDwxxByDwdm(unitcode);
//设置单位查询参数
Map<String, Object> dwLevMap = DwUtil.getDwLevCode(unitcode, bdwxx.getLev());
paramMap.putAll(dwLevMap);
paramMap.put("unitcode", unitcode);
paramMap.put("kssj", kssj);
paramMap.put("jssj", jssj);
paramMap.put("ajzt", ajzt);
paramMap.put("ajlbdm", ajlbdm);
paramMap.put("xlajlbdm", xlajlbdm);
dwLevMap.put("includeBdw","true");
List<DictitemXz> unitList = dwTjfxMapper.getXqdwList(dwLevMap);
List<DictitemXz> unit1=new ArrayList<>();
List<DictitemXz> unit2=new ArrayList<>();
Lock lock = new ReentrantLock();
if(unitList!=null && unitList.size()>0){
if(unitList.size()<2){
unit1=unitList.subList(0,1);
unit1.stream().parallel().forEach(item -> {
String dwdm = item.getCode();
String dwmc = item.getName();
String dwtype="";
paramMap.put("unitcode", dwdm);
paramMap.put("qryType", "bdw");
dwtype= "bdw";
DwDaztTj dwXnpgTj = dwAjlbTjfxMapper.getDwXyrDaztTj(paramMap);
dwXnpgTj.setDwdm(dwdm);
dwXnpgTj.setDwmc(dwmc);
dwXnpgTj.setQryType(dwtype);
lock.lock();
try {
dataList.add(dwXnpgTj);
}finally {
lock.unlock();
}
});
}else {
unit1=unitList.subList(0,1);
unit2=unitList.subList(1,unitList.size());
unit1.stream().parallel().forEach(item -> {
Map<String, Object> paramet=new HashMap<>();
String dwdm = item.getCode();
String dwmc = item.getName();
String dwtype="";
paramet.putAll(paramMap);
paramet.put("unitcode", dwdm);
paramet.put("qryType", "bdw");
dwtype= "bdw";
DwDaztTj dwXnpgTj = dwAjlbTjfxMapper.getDwXyrDaztTj(paramMap);
dwXnpgTj.setDwdm(dwdm);
dwXnpgTj.setDwmc(dwmc);
dwXnpgTj.setQryType(dwtype);
lock.lock();
try {
dataList.add(dwXnpgTj);
}finally {
lock.unlock();
}
});
unit2.stream().parallel().forEach(item -> {
Map<String, Object> paramet=new HashMap<>();
String dwdm = item.getCode();
String dwmc = item.getName();
String dwtype="";
paramet.putAll(paramMap);
paramet.put("unitcode", dwdm);
paramet.put("qryType", "bxq");
dwtype= "bxq";
DwDaztTj dwXnpgTj = dwAjlbTjfxMapper.getDwXyrDaztTj(paramMap);
dwXnpgTj.setDwdm(dwdm);
dwXnpgTj.setDwmc(dwmc);
dwXnpgTj.setQryType(dwtype);
lock.lock();
try {
dataList.add(dwXnpgTj);
}finally {
lock.unlock();
}
});
}
}
res = dataList.stream().sorted(Comparator.comparing(DwDaztTj::getDwdm))
.collect(Collectors.toList());
rtMap.put("rows",res);
return rtMap;
}
@Override
public Map<String, Object> getDwXyrDaztTjTs(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>();
Map<String, Object> paramMap=new HashMap<>();
List<TbXwZbfzxyr> dataList = new ArrayList<>();
String unitcode=dwTjParam.getUnitcode();
String kssj=dwTjParam.getKssj();
String jssj=dwTjParam.getJssj();
String ajzt=dwTjParam.getAjzt();
String ajlbdm=dwTjParam.getAjlbdm();
String xlajlbdm=dwTjParam.getXlajlbdm();
String qryType=dwTjParam.getQryType();
String tjlb=dwTjParam.getTjlb();
if (StringUtils.isEmpty(unitcode)) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
unitcode = xzxtUser.getUnitcode();//获取对应用户的单位
}
paramMap.put("unitcode", unitcode);
paramMap.put("kssj", kssj);
paramMap.put("jssj", jssj);
paramMap.put("ajzt", ajzt);
paramMap.put("tjlb", tjlb);
paramMap.put("begin", dwTjParam.getBegin());
paramMap.put("end", dwTjParam.getEnd());
paramMap.put("ajlbdm", ajlbdm);
paramMap.put("xlajlbdm", xlajlbdm);
paramMap.put("qryType", qryType);
dataList=dwAjlbTjfxMapper.getDwXyrDaztTjTs(paramMap);
int count =dwAjlbTjfxMapper.getDwXyrDaztTjTsCount(paramMap);
rtMap.put("rows",dataList);
rtMap.put("total",count);
return rtMap;
}
} }
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