Ecology-Dev/JSSBMJ/interface/custom/querySecretCerrierReport.jsp

254 lines
9.1 KiB
Plaintext
Raw Permalink Normal View History

2025-09-01 21:16:20 +08:00
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
User user = HrmUserVarify.getUser(request, response);
if(user==null) {
response.sendRedirect("/login/Login.jsp");
return;
}
Map<String,String> signMap = new HashMap<String,String>();
signMap.put("涉密文件资料","smwjzl");
signMap.put("国家统一考试试卷","gjtykssj");
signMap.put("涉密防伪票据证书","smfwpjzs");
signMap.put("涉密光电磁介质","smgdcjz");
signMap.put("涉密档案数字化加工","smdaszhjg");
Map<String,Integer> countMap = new HashMap<String,Integer>();
countMap.put("smwjzl",0);
countMap.put("gjtykssj",0);
countMap.put("smfwpjzs",0);
countMap.put("smgdcjz",0);
countMap.put("smdaszhjg",0);
String startDate = request.getParameter("startDate");
String endDate = request.getParameter("endDate");
String zzlx = "1";
RecordSet rs = new RecordSet();
List<Map<String,Object>> cityList = new ArrayList<Map<String,Object>>();
String sql =" select selectvalue,selectname \n" +
" from workflow_selectitem \n" +
" where fieldid in(\n" +
" select id from workflow_billfield \n" +
" where billid in( select id from workflow_bill where tablename='uf_dwjbxx' ) and fieldname='szcs' \n" +
" and detailtable is null\n" +
" ) ";
rs.executeQuery(sql);
while (rs.next()){
String selectvalue = rs.getString("selectvalue");
String selectname = rs.getString("selectname");
Map<String,Object> cityMap = new HashMap<String,Object>();
cityMap.put("key","City"+selectvalue);
cityMap.put("title",selectname);
cityList.add(cityMap);
}
String selectnames = "";
Iterator<Map.Entry<String,String>> iterator = signMap.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry<String,String> entry = iterator.next();
String key = entry.getKey();
selectnames += StringUtils.isBlank(selectnames) ? "'" + key + "'" : ",'" + key + "'";
}
List<Map<String,String>> typeList = new ArrayList<Map<String,String>>();
sql = " select selectvalue,selectname \n" +
" from workflow_selectitem\n" +
" where fieldid in(\n" +
" select id from workflow_billfield \n" +
" where billid in( select id from workflow_bill where tablename='uf_bmzzzsxx' ) and fieldname='ywzl' \n" +
" and detailtable is null\n" +
" ) \n" +
" AND selectname in("+selectnames+")" ;
rs.executeQuery(sql);
while (rs.next()){
String selectvalue = Util.null2String(rs.getString("selectvalue"));
String selectname = Util.null2String(rs.getString("selectname"));
Map<String,String> typeMap = new HashMap<String,String>();
typeMap.put("selectname",selectname);
typeMap.put("selectvalue",selectvalue);
String selectType = signMap.get(selectname);
typeMap.put("selecttype",selectType);
typeList.add(typeMap);
}
String where = "";
if(StringUtils.isNotBlank(startDate)){
where += " and k.fzrq >= '"+startDate+"' ";
}
if(StringUtils.isNotBlank(endDate)){
where += " and k.fzrq <= '"+endDate+"' ";
}
int yjjg_total = 0;
int ejjg_total = 0 ;
for(int i=0;i<cityList.size();i++){
Map<String,Object> cityMap = cityList.get(i);
String yjjg = "0";
String ejjg = "0";
String cityKey = Util.null2String(cityMap.get("key")).replace("City","");
sql = "select zzdj,count(1) as cou\n" +
"from uf_dwjbxx t\n" +
"inner join uf_bmzzzsxx k on k.dwmc = t.id\n" +
"where k.zszt=0\n" +
"and k.zzlx = " + zzlx +
"and t.szcs=" + cityKey + where +
"group by zzdj ";
rs.executeQuery(sql);
while (rs.next()){
String zzdj = Util.null2String(rs.getString("zzdj"));
String cou = Util.null2String(rs.getString("cou"));
if("1".equals(zzdj)){
yjjg = cou;
}else if("2".equals(zzdj)){
ejjg = cou;
}
}
if(StringUtils.isNotBlank(yjjg)){
yjjg_total += Util.getIntValue(yjjg,0);
}
if(StringUtils.isNotBlank(ejjg)){
ejjg_total += Util.getIntValue(ejjg,0);
}
cityMap.put("yjjg",yjjg);
cityMap.put("ejjg",ejjg);
for(int k=0;k<typeList.size();k++){
Map<String,String> typeMap = typeList.get(k);
String selectvalue = typeMap.get("selectvalue");
String selecttype = typeMap.get("selecttype");
int count = 0;
if(StringUtils.isNotBlank(selectvalue)){
sql = " select k.id \n" +
" from uf_dwjbxx t\n" +
" inner join uf_bmzzzsxx k on k.dwmc = t.id\n" +
" where k.zszt=0 \n" +
" and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" +
" and k.zzlx = " + zzlx +
" and t.szcs="+cityKey + where ;
rs.executeQuery(sql);
while (rs.next()){
count++;
}
int total = countMap.get(selecttype);
total += count;
countMap.put(selecttype,total);
}
cityMap.put(selecttype,count);
}
}
for(int i=0;i<cityList.size();i++){
Map<String,Object> cityMap = cityList.get(i);
String cityKey = Util.null2String(cityMap.get("key")).replace("City","");
List<Map<String,Object>> districtList = new ArrayList<Map<String,Object>>();
if(StringUtils.isNotBlank(cityKey)){
int cityKey_ = Util.getIntValue(cityKey)+1;
sql = "select id,qm,yb from uf_qjsj where sss="+cityKey_;
rs.executeQuery(sql);
while (rs.next()){
String id = Util.null2String(rs.getString("id"));
String qm = Util.null2String(rs.getString("qm"));
Map<String,Object> districtMap = new HashMap<String,Object>();
districtMap.put("key","District"+id);
districtMap.put("title",qm);
districtList.add(districtMap);
}
}
for(int k=0;k<districtList.size();k++){
Map<String,Object> districtMap = districtList.get(k);
String districtKey = Util.null2String(districtMap.get("key")).replace("District","");
String dist_yjjg = "0";
String dist_ejjg = "0";
sql = "select zzdj,count(1) as cou\n" +
"from uf_dwjbxx t\n" +
"inner join uf_bmzzzsxx k on k.dwmc = t.id\n" +
"where k.zszt=0\n" +
"and k.zzlx = " + zzlx +
"and t.szqx= " + districtKey + where +
"group by zzdj ";
rs.executeQuery(sql);
while (rs.next()){
String zzdj = Util.null2String(rs.getString("zzdj"));
String cou = Util.null2String(rs.getString("cou"));
if("1".equals(zzdj)){
dist_yjjg = cou;
}else if("2".equals(zzdj)){
dist_ejjg = cou;
}
}
districtMap.put("yjjg",dist_yjjg);
districtMap.put("ejjg",dist_ejjg);
for(int n=0;n<typeList.size();n++){
Map<String,String> typeMap = typeList.get(n);
String selectvalue = typeMap.get("selectvalue");
String selecttype = typeMap.get("selecttype");
int count = 0;
if(StringUtils.isNotBlank(selectvalue)){
sql = " select k.id \n" +
" from uf_dwjbxx t\n" +
" inner join uf_bmzzzsxx k on k.dwmc = t.id\n" +
" where k.zszt=0 \n" +
" and instr(','||ywzl||',',',"+selectvalue+",')>0 \n" +
" and k.zzlx = " + zzlx +
" and t.szqx= " + districtKey + where ;
rs.executeQuery(sql);
while (rs.next()){
count++;
}
}
districtMap.put(selecttype,count);
}
}
cityMap.put("subList",districtList);
}
Map<String,Object> totalMap = new HashMap<String,Object>();
totalMap.put("key","total");
totalMap.put("title","合计");
totalMap.put("yjjg",yjjg_total);
totalMap.put("ejjg",ejjg_total);
cityList.add(totalMap);
JSONObject dataJson = new JSONObject();
dataJson.put("data",cityList);
%>
<%=dataJson.toJSONString() %>