Commit fb8a9fbf by liulianglang

统计报表

parent 9e3750ec
......@@ -2,7 +2,9 @@ package org.springblade.founder.tjfx.controller;
import io.swagger.annotations.ApiOperation;
import org.springblade.founder.tjfx.entity.DwTjParam;
import org.springblade.founder.tjfx.service.AjlbSysDictService;
import org.springblade.founder.tjfx.service.WcnrfzTjService;
import org.springblade.founder.utils.EasyUIPage;
import org.springblade.founder.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -16,7 +18,8 @@ import java.util.Map;
public class WcnrfzTjController {
@Autowired
private WcnrfzTjService wcnrfzTjService;
@Autowired
private AjlbSysDictService ajlbSysDictService;
@PostMapping("/getWcnrTj")
@ApiOperation(value = "未成年人单位统计")
public R getWcnrTj(DwTjParam dwTjParam){
......@@ -28,4 +31,54 @@ public class WcnrfzTjController {
return R.error(e.getMessage());
}
}
@PostMapping("/getWcnrAjlbTjByPid")
@ApiOperation(value = "未成年人单位案件类别统计")
public R getAjlbTjByPid(DwTjParam dwTjParam){
try {
Map<String, Object> rtMap = ajlbSysDictService.getWcnrAjlbTjByPid(dwTjParam);
return R.ok().data(rtMap);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/getWcnrAjlbTjByPidTs")
@ApiOperation(value = "未成年人单位案件类别统计透视")
public R getWcnrAjlbTjByPidTs(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 = ajlbSysDictService.getWcnrAjlbTjByPidTs(dwTjParam);
return R.ok().data(rtMap);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@PostMapping("/getWcnrRyTjByPidTs")
@ApiOperation(value = "未成年人单位案件类别统计透视")
public R getWcnrRyTjByPidTs(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 = ajlbSysDictService.getWcnrRyTjByPidTs(dwTjParam);
return R.ok().data(rtMap);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
}
......@@ -21,4 +21,6 @@ public class DictitemXz {
private String lev;
private String num;
private String rys;
}
package org.springblade.founder.tjfx.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.founder.tjfx.entity.DwWcnrTj;
import org.springblade.founder.tjfx.entity.*;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Component
@Mapper
@DS("xzxt")
public interface WcnrfzTjMapper {
DwWcnrTj getWcnrTj(Map<String, Object> paramMap);
List<AjtjResult> getAjlbTj(DwTjParam dwTjParam);
List<AjtjResult> getAjlbrysTj(DwTjParam dwTjParam);
List<TbStAsj> getAjlbTjTs(DwTjParam dwTjParam);
int getAjlbTjTsCount(DwTjParam dwTjParam);
List<TbXwZbfzxyr> getRyTjTs(DwTjParam dwTjParam);
int getRyTjTsCount(DwTjParam dwTjParam);
}
......@@ -147,6 +147,300 @@
from dual
</select>
<select id="getAjlbTj" resultType="org.springblade.founder.tjfx.entity.AjtjResult">
select asj.ajlbdm code,
(SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJLB' AND code = asj.ajlbdm) as name,
count(1) as num
from TB_ST_ASJ asj
where asj.xxsc_pdbz='0' and (
(select count(1) from tb_xw_zbfzxyr xyr where xyr.xxsc_pdbz='0'
and trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12)<![CDATA[<]]>18 and xyr.asjbh= asj.asjbh) >0 )
<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>
group by asj.ajlbdm
order by asj.ajlbdm
</select>
<select id="getAjlbrysTj" resultType="org.springblade.founder.tjfx.entity.AjtjResult">
select asj.ajlbdm code,
(SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJLB' AND code = asj.ajlbdm) as name,
count(1) as num
from tb_xw_zbfzxyr xyr left join TB_ST_ASJ asj
on
asj.ASJBH=xyr.ASJBH where trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12)<18
and asj.XXSC_PDBZ='0' and xyr.XXSC_PDBZ='0'
<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>
group by asj.ajlbdm
order by asj.ajlbdm
</select>
<select id="getAjlbTjTs" resultType="org.springblade.founder.tjfx.entity.TbStAsj">
<include refid="pagination-head" />
select
<include refid="aj-common-column"/>
from tb_st_asj asj
where asj.xxsc_pdbz='0'
and (
(select count(1) from tb_xw_zbfzxyr xyr where xyr.xxsc_pdbz='0'
and trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12)<![CDATA[<]]>18 and xyr.asjbh= asj.asjbh) >0 )
<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 asj.larq desc
<include refid="pagination-tail" />
</select>
<select id="getAjlbTjTsCount" resultType="java.lang.Integer">
select
count(1)
from tb_st_asj asj
where asj.xxsc_pdbz='0'
and (
(select count(1) from tb_xw_zbfzxyr xyr where xyr.xxsc_pdbz='0'
and trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12)<![CDATA[<]]>18 and xyr.asjbh= asj.asjbh) >0 )
<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>
</select>
<select id="getRyTjTs" 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'
and trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12)<![CDATA[<]]>18 and xyr.asjbh= asj.asjbh) >0 )
<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
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'
and trunc(months_between(asj.ASJFSSJ_ASJFSKSSJ,xyr.ZHFZXYR_CSRQ_RQGZXX) /12)<![CDATA[<]]>18 and xyr.asjbh= asj.asjbh) >0 )
<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>
</select>
<sql id="asjQry-where">
<if test="kssj != null and kssj != ''">
AND asj.ASJFSSJ_ASJFSKSSJ <![CDATA[>=]]> to_date(#{kssj, jdbcType=VARCHAR},'yyyy-mm-dd')
......@@ -187,4 +481,28 @@
or code_lev4 =#{unitcode} or code_lev5 =#{unitcode})
</if>
</sql>
<sql id="aj-common-column">
asj.asjbh as asjbh,
asj.ladw_Gajgmc AS ladwGajgmc,
asj.ZCZJ_ZXSJ01 AS zczjZxsj01,
asj.larq AS larq,
asj.asjfssj_Asjfskssj AS asjfssjAsjfskssj,
(SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJLB' AND code = asj.ajlbdm) as ajlbdm,
(SELECT name FROM sys_dictitem WHERE groupid = 'CODE_AJXZ' AND code = asj.zatz_jyqk) as zatzJyqk,
asj.ajmc AS ajmc,
asj.jyaq AS jyaq
</sql>
<!--分页查询开始-->
<sql id="pagination-head">
select * from (
select t.*,rownum rn from (
</sql>
<!--分页查询结束-->
<sql id="pagination-tail">
) t
WHERE ROWNUM <![CDATA[<=]]> #{end}
) WHERE RN > #{begin}
</sql>
</mapper>
......@@ -9,4 +9,12 @@ public interface AjlbSysDictService {
Map<String, Object> getAjlbTjByPidTs(DwTjParam dwTjParam);
Map<String, Object> getWcnrAjlbTjByPid(DwTjParam dwTjParam);
Map<String, Object> getWcnrAjlbTjByPidTs(DwTjParam dwTjParam);
Map<String, Object> getWcnrRyTjByPidTs(DwTjParam dwTjParam);
}
......@@ -7,4 +7,8 @@ import java.util.Map;
public interface WcnrfzTjService {
Map<String, Object> getWcnrTj(DwTjParam dwTjParam);
Map<String, Object> getAjlbTj(DwTjParam dwTjParam);
Map<String, Object> getAjlbrysTj(DwTjParam dwTjParam);
}
......@@ -5,8 +5,10 @@ import org.springblade.core.secure.utils.SecureUtil;
import org.springblade.founder.tjfx.entity.*;
import org.springblade.founder.tjfx.mapper.AjlbSysDictMapper;
import org.springblade.founder.tjfx.mapper.DwAjlbTjfxMapper;
import org.springblade.founder.tjfx.mapper.WcnrfzTjMapper;
import org.springblade.founder.tjfx.service.AjlbSysDictService;
import org.springblade.founder.tjfx.service.DwAjlbTjfxService;
import org.springblade.founder.tjfx.service.WcnrfzTjService;
import org.springblade.founder.utils.DwUtil;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -24,7 +26,12 @@ public class AjlbSysDictServiceImpl implements AjlbSysDictService {
@Autowired
private DwAjlbTjfxService dwAjlbTjfxService;
@Autowired
private WcnrfzTjService wcnrfzTjService;
@Autowired
private DwAjlbTjfxMapper dwAjlbTjfxMapper;
@Autowired
private WcnrfzTjMapper wcnrfzTjMapper;
@Override
public Map<String, Object> getAjlbTjByPid(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>();
......@@ -147,4 +154,193 @@ public class AjlbSysDictServiceImpl implements AjlbSysDictService {
}
@Override
public Map<String, Object> getWcnrAjlbTjByPidTs(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<TbStAsj> dalist = wcnrfzTjMapper.getAjlbTjTs(dwTjParam);
int count =wcnrfzTjMapper.getAjlbTjTsCount(dwTjParam);
rtMap.put("rows",dalist);
rtMap.put("total",count);
return rtMap;
}
@Override
public Map<String, Object> getWcnrRyTjByPidTs(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<TbXwZbfzxyr> dalist = wcnrfzTjMapper.getRyTjTs(dwTjParam);
int count =wcnrfzTjMapper.getRyTjTsCount(dwTjParam);
rtMap.put("rows",dalist);
rtMap.put("total",count);
return rtMap;
}
@Override
public Map<String, Object> getWcnrAjlbTjByPid(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);
dwTjParam.setUnitcode(unitcode);
if(StringUtils.isEmpty(ajlbdm)){
pid="true";
}else {
pid=ajlbdm;
}
List<DictitemXz> unitList = ajlbSysDictMapper.getAjlbByCode(pid);
Map<String, Object> results=wcnrfzTjService.getAjlbTj(dwTjParam);
Map<String, Object> rys=wcnrfzTjService.getAjlbrysTj(dwTjParam);
Map<String, String> resultMap=new HashMap<>();
Map<String, String> ryMap=new HashMap<>();
List<AjtjResult> dalist=(List<AjtjResult>)results.get("rows");
List<AjtjResult> rydatalist=(List<AjtjResult>)rys.get("rows");
if (dalist != null && dalist.size() > 0) {
// for (AjtjResult item : dalist) {
// map.put(String.valueOf(item.getMonthName()), item.getFaNum());
// }
resultMap=dalist.stream().collect(Collectors.toMap(AjtjResult::getCode, AjtjResult::getNum));
}
if (rydatalist != null && rydatalist.size() > 0) {
ryMap=rydatalist.stream().collect(Collectors.toMap(AjtjResult::getCode, AjtjResult::getNum));
}
for(DictitemXz xz:unitList){
if("yxj".equals(xz.getLev())){
int xjzs=0;
int ryxjzs=0;
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){
xjzs+=Integer.parseInt(resultMap.get(xxjs.getCode())!= null ?resultMap.get(xxjs.getCode()): "0");
ryxjzs+=Integer.parseInt(ryMap.get(xxjs.getCode())!= null ?ryMap.get(xxjs.getCode()): "0");
}
xjzs+=Integer.parseInt(resultMap.get(xjs.getCode())!= null ?resultMap.get(xjs.getCode()): "0");
ryxjzs+=Integer.parseInt(ryMap.get(xjs.getCode())!= null ?ryMap.get(xjs.getCode()): "0");
}else {
xjzs+=Integer.parseInt(resultMap.get(xjs.getCode())!= null ?resultMap.get(xjs.getCode()): "0");
ryxjzs+=Integer.parseInt(ryMap.get(xjs.getCode())!= null ?ryMap.get(xjs.getCode()): "0");
}
}
xjzs+=Integer.parseInt(resultMap.get(xz.getCode())!= null ?resultMap.get(xz.getCode()): "0");
ryxjzs+=Integer.parseInt(ryMap.get(xz.getCode())!= null ?ryMap.get(xz.getCode()): "0");
xz.setNum(String.valueOf(xjzs));
xz.setRys(String.valueOf(ryxjzs));
}else{
xz.setNum(resultMap.get(xz.getCode())!= null ?resultMap.get(xz.getCode()): "0");
xz.setRys(ryMap.get(xz.getCode())!= null ?ryMap.get(xz.getCode()): "0");
}
}
rtMap.put("rows",unitList);
return rtMap;
}
}
......@@ -3,10 +3,7 @@ package org.springblade.founder.tjfx.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
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.DwDaztTj;
import org.springblade.founder.tjfx.entity.DwTjParam;
import org.springblade.founder.tjfx.entity.DwWcnrTj;
import org.springblade.founder.tjfx.entity.*;
import org.springblade.founder.tjfx.mapper.DwTjfxMapper;
import org.springblade.founder.tjfx.mapper.WcnrfzTjMapper;
import org.springblade.founder.tjfx.service.WcnrfzTjService;
......@@ -160,5 +157,33 @@ public class WcnrfzTjServiceImpl implements WcnrfzTjService {
}
@Override
public Map<String, Object> getAjlbTj(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>();
if(StringUtils.isBlank(dwTjParam.getUnitcode())){
rtMap.put("rows",new ArrayList<>());
return rtMap;
}else {
dwTjParam.setQryType("bxq");
}
List<AjtjResult> dalist =wcnrfzTjMapper.getAjlbTj(dwTjParam);
rtMap.put("rows",dalist);
return rtMap;
}
@Override
public Map<String, Object> getAjlbrysTj(DwTjParam dwTjParam) {
Map<String, Object> rtMap = new HashMap<>();
if(StringUtils.isBlank(dwTjParam.getUnitcode())){
rtMap.put("rows",new ArrayList<>());
return rtMap;
}else {
dwTjParam.setQryType("bxq");
}
List<AjtjResult> dalist =wcnrfzTjMapper.getAjlbrysTj(dwTjParam);
rtMap.put("rows",dalist);
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