Commit 6ef1a389 by liulianglang

导出

parent 850340ca
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.entity.WcnrEntity;
import org.springblade.founder.tjfx.service.AjlbSysDictService; import org.springblade.founder.tjfx.service.AjlbSysDictService;
import org.springblade.founder.tjfx.service.WcnrfzTjService; import org.springblade.founder.tjfx.service.WcnrfzTjService;
import org.springblade.founder.utils.EasyUIPage; import org.springblade.founder.utils.EasyUIPage;
...@@ -9,8 +13,14 @@ import org.springblade.founder.utils.R; ...@@ -9,8 +13,14 @@ 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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; 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
...@@ -80,5 +90,26 @@ public class WcnrfzTjController { ...@@ -80,5 +90,26 @@ public class WcnrfzTjController {
return R.error(e.getMessage()); return R.error(e.getMessage());
} }
} }
@RequestMapping("/ExportWcnrRyTjByPidTs")
@ResponseBody
public void ExportWcnrRyTjByPidTs(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 = ajlbSysDictService.ExportWcnrRyTjByPidTs(dwTjParam);
List<WcnrEntity> list =(List<WcnrEntity>)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.entity;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
@ExcelIgnoreUnannotated
public class WcnrEntity {
@ExcelProperty(value = {"姓名"},index = 0)
private String zhfzxyrXm = null;
@ExcelProperty(value = {"证件号码"},index = 1)
private String zhfzxyrCyzjZjhm = null;
@ExcelProperty(value = {"性别"},index = 2)
private String zhfzxyrXbdm = null;
@ExcelProperty(value = {"户籍地"},index = 3)
private String hjdzXzqhdm = null;
@ExcelProperty(value = {"犯罪年龄"},index = 4)
private String fznl;
}
...@@ -21,6 +21,7 @@ public interface WcnrfzTjMapper { ...@@ -21,6 +21,7 @@ public interface WcnrfzTjMapper {
int getAjlbTjTsCount(DwTjParam dwTjParam); int getAjlbTjTsCount(DwTjParam dwTjParam);
List<TbXwZbfzxyr> getRyTjTs(DwTjParam dwTjParam); List<TbXwZbfzxyr> getRyTjTs(DwTjParam dwTjParam);
List<WcnrEntity> ExportRyTjTs(DwTjParam dwTjParam);
int getRyTjTsCount(DwTjParam dwTjParam); int getRyTjTsCount(DwTjParam dwTjParam);
} }
...@@ -382,6 +382,65 @@ ...@@ -382,6 +382,65 @@
</select> </select>
<select id="ExportRyTjTs" resultType="org.springblade.founder.tjfx.entity.WcnrEntity">
<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,
trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12) fznl
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 trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12)<![CDATA[<]]>18
<if test="kssj != null and kssj != ''">
AND ASJ.ASJFSSJ_ASJFSKSSJ <![CDATA[>=]]> to_date(#{kssj, jdbcType=VARCHAR},'yyyy-mm-dd')
</if>
<if test="jssj != null and jssj != ''">
AND ASJ.ASJFSSJ_ASJFSKSSJ <![CDATA[<]]> to_date(#{jssj, jdbcType=VARCHAR},'yyyy-mm-dd ') +1
</if>
<if test="ajzt != null and ajzt != '' and ajzt == '1'.toString() ">
and ASJ.ZCJDDM = '0400'
</if>
<if test="ajzt != null and ajzt != '' and ajzt == '2'.toString() ">
and asj.ZCJDDM in ('0600','0700','0800')
</if>
<if test="ajzt != null and ajzt != '' and ajzt == '3'.toString() ">
and asj.ZCJDDM in ('0100','0200','0300','0301','0302','0400','0500')
</if>
<if test="qryType == 'bdw'">
and ASJ.LADW_GAJGJGDM = #{unitcode}
</if>
<if test="qryType == 'bxq'">
and ASJ.LADW_GAJGJGDM in (select code from sys_dictitem_xz where code_lev1 =#{unitcode} or
code_lev2 =#{unitcode} or code_lev3 =#{unitcode}
or code_lev4 =#{unitcode} or code_lev5 =#{unitcode})
</if>
<if test="lbs != null and lbs.size() > 0">
and
asj.ajlbdm in
<foreach collection="lbs" item="dw" separator="," open="(" close=")">
#{dw,jdbcType=VARCHAR}
</foreach>
</if>
order by xyr.ZHRQ desc nulls last
<include refid="pagination-tail" />
</select>
<select id="getRyTjTsCount" resultType="java.lang.Integer"> <select id="getRyTjTsCount" resultType="java.lang.Integer">
......
...@@ -17,4 +17,7 @@ public interface AjlbSysDictService { ...@@ -17,4 +17,7 @@ public interface AjlbSysDictService {
Map<String, Object> getWcnrRyTjByPidTs(DwTjParam dwTjParam); Map<String, Object> getWcnrRyTjByPidTs(DwTjParam dwTjParam);
Map<String, Object> ExportWcnrRyTjByPidTs(DwTjParam dwTjParam);
} }
...@@ -260,6 +260,58 @@ public class AjlbSysDictServiceImpl implements AjlbSysDictService { ...@@ -260,6 +260,58 @@ public class AjlbSysDictServiceImpl implements AjlbSysDictService {
} }
@Override
public Map<String, Object> ExportWcnrRyTjByPidTs(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>();
String unitcode=dwTjParam.getUnitcode();
if (StringUtils.isEmpty(unitcode)) {
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
unitcode = xzxtUser.getUnitcode();//获取对应用户的单位
}
System.out.println(unitcode);
dwTjParam.setUnitcode(unitcode);
// dwTjParam.setQryType("bxq");
List<String> lbs=new ArrayList<>();
List<DictitemXz> unitList = ajlbSysDictMapper.getAjlbByCode(dwTjParam.getAjlbdm());
lbs.add(dwTjParam.getAjlbdm());
for(DictitemXz xz:unitList){
if("yxj".equals(xz.getLev())){
List<DictitemXz> xjajlbs = ajlbSysDictMapper.getAjlbByCode(xz.getCode());
for(DictitemXz xjs:xjajlbs){
if("yxj".equals(xjs.getLev())){
List<DictitemXz> xxjajlbs = ajlbSysDictMapper.getAjlbByCode(xjs.getCode());
for(DictitemXz xxjs:xxjajlbs){
lbs.add(xxjs.getCode());
}
lbs.add(xjs.getCode());
}else {
lbs.add(xjs.getCode());
}
}
lbs.add(xz.getCode());
}else{
lbs.add(xz.getCode());
}
}
dwTjParam.setLbs(lbs);
List<WcnrEntity> dalist = wcnrfzTjMapper.ExportRyTjTs(dwTjParam);
rtMap.put("rows",dalist);
return rtMap;
}
@Override @Override
public Map<String, Object> getWcnrAjlbTjByPid(DwTjParam dwTjParam) { public Map<String, Object> getWcnrAjlbTjByPid(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>(); Map<String, Object> rtMap = new HashMap<>();
......
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