实时报表

1、action中drop和whitelist判断处理
2、修复functionId后台没有获取到
This commit is contained in:
leijun
2018-08-30 17:25:37 +08:00
parent 374087ca85
commit a28087e5ad
9 changed files with 82 additions and 27 deletions

View File

@@ -60,7 +60,6 @@ public class NtcDestIpReportController extends BaseController {
}else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){ }else if(bean.getReportType()==Constants.REPORT_TYPE_MONTH){
bean.setSearchBusinessType("4"); bean.setSearchBusinessType("4");
} }
// 调用服务接口... // 调用服务接口...
bean.setPageSize(-1); bean.setPageSize(-1);
@@ -70,6 +69,7 @@ public class NtcDestIpReportController extends BaseController {
} catch (ParseException e1) { } catch (ParseException e1) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
} }
List<String> titles=this.getDateTitiles(bean); List<String> titles=this.getDateTitiles(bean);
model.addAttribute("titles", titles); model.addAttribute("titles", titles);
@@ -91,7 +91,11 @@ public class NtcDestIpReportController extends BaseController {
trimStr=report.getDestCountry().trim()+Constants.REPORT_TRIM_CONNECTOR+ trimStr=report.getDestCountry().trim()+Constants.REPORT_TRIM_CONNECTOR+
report.getReportTime().substring(0,7); report.getReportTime().substring(0,7);
} }
if(trimData.containsKey(trimStr)){
trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue());
}else{
trimData.put(trimStr, report.getSum().longValue()); trimData.put(trimStr, report.getSum().longValue());
}
} }
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
@@ -115,7 +119,8 @@ public class NtcDestIpReportController extends BaseController {
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
// HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 // HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// List<Long> line= new ArrayList<Long>(); // List<Long> line= new ArrayList<Long>();

View File

@@ -32,9 +32,7 @@ import net.sf.json.JsonConfig;
public class NtcEntranceReportController extends BaseController { public class NtcEntranceReportController extends BaseController {
@RequestMapping("/ajaxNtcIspReport") @RequestMapping("/ajaxNtcIspReport")
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) { public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId()); List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
if(bean.getAction()!=null){ if(bean.getAction()!=null){
for(FunctionServiceDict service:serviceList){ for(FunctionServiceDict service:serviceList){
if(service.getAction().intValue()==bean.getAction().intValue()){ if(service.getAction().intValue()==bean.getAction().intValue()){
@@ -91,8 +89,12 @@ public class NtcEntranceReportController extends BaseController {
trimStr=report.getEntranceId().intValue()+Constants.REPORT_TRIM_CONNECTOR+ trimStr=report.getEntranceId().intValue()+Constants.REPORT_TRIM_CONNECTOR+
report.getReportTime().substring(0,7); report.getReportTime().substring(0,7);
} }
if(trimData.containsKey(trimStr)){
trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue());
}else{
trimData.put(trimStr, report.getSum().longValue()); trimData.put(trimStr, report.getSum().longValue());
} }
}
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(Entry<String, Long> counrty:trimData.entrySet()){ for(Entry<String, Long> counrty:trimData.entrySet()){
String[] keyArr=counrty.getKey().split(Constants.REPORT_TRIM_CONNECTOR); String[] keyArr=counrty.getKey().split(Constants.REPORT_TRIM_CONNECTOR);
@@ -114,7 +116,8 @@ public class NtcEntranceReportController extends BaseController {
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
// HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 // HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// List<Long> line= new ArrayList<Long>(); // List<Long> line= new ArrayList<Long>();

View File

@@ -21,6 +21,7 @@ import com.nis.domain.report.NtcLwhhReport;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DictUtils; import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
@@ -89,8 +90,12 @@ public class NtcLwhhReportController extends BaseController {
trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+ trimStr=report.getLwhh().intValue()+Constants.REPORT_TRIM_CONNECTOR+
report.getReportTime().substring(0,7); report.getReportTime().substring(0,7);
} }
if(trimData.containsKey(trimStr)){
trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue());
}else{
trimData.put(trimStr, report.getSum().longValue()); trimData.put(trimStr, report.getSum().longValue());
} }
}
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(RequestInfo requestInfo:requestInfos){ for(RequestInfo requestInfo:requestInfos){
List<Long> line= new ArrayList<Long>(); List<Long> line= new ArrayList<Long>();
@@ -111,7 +116,8 @@ public class NtcLwhhReportController extends BaseController {
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
// HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 // HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// for(RequestInfo requestInfo:requestInfos){ // for(RequestInfo requestInfo:requestInfos){

View File

@@ -122,7 +122,8 @@ public class NtcPzReportController extends BaseController{
model.addAttribute("datas", getList(json)); model.addAttribute("datas", getList(json));
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
return "/report/pz"; return "/report/pz";
} }

View File

@@ -67,13 +67,16 @@ public class NtcServiceReportController extends BaseController {
} }
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT); StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT);
try { try {
//bean.setSearchReportEndTime("2018-08-27 00:00:00");
String json=ConfigServiceUtil.getReport(url.toString(), bean); String json=ConfigServiceUtil.getReport(url.toString(), bean);
List<NtcServiceReport> data=getList(json); List<NtcServiceReport> data=getList(json);
Map<Integer, Long> dataMap=new HashMap<>(); Map<Integer, Long> dataMap=new HashMap<>();
for(NtcServiceReport report:data){ for(NtcServiceReport report:data){
if(dataMap.containsKey(report.getService())){
dataMap.put(report.getService(), dataMap.get(report.getService())+report.getSum().longValue());
}else{
dataMap.put(report.getService(),report.getSum().longValue()); dataMap.put(report.getService(),report.getSum().longValue());
} }
}
for(Entry<Integer, Long> e:dataMap.entrySet()) { for(Entry<Integer, Long> e:dataMap.entrySet()) {
Map<String, Object> _data=new HashMap<>(); Map<String, Object> _data=new HashMap<>();
_data.put("service", e.getKey()); _data.put("service", e.getKey());
@@ -82,7 +85,8 @@ public class NtcServiceReportController extends BaseController {
} }
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
// if(bean.getAction()!=null){ // if(bean.getAction()!=null){
// data.put(bean.getAction().toString(), 66666666l); // data.put(bean.getAction().toString(), 66666666l);

View File

@@ -127,8 +127,12 @@ public class NtcSrcipDomesticReportController extends BaseController {
report.getSrcCity().trim()+Constants.REPORT_TRIM_CONNECTOR+ report.getSrcCity().trim()+Constants.REPORT_TRIM_CONNECTOR+
report.getReportTime().substring(0,7); report.getReportTime().substring(0,7);
} }
if(trimData.containsKey(trimStr)){
trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue());
}else{
trimData.put(trimStr, report.getSum().longValue()); trimData.put(trimStr, report.getSum().longValue());
} }
}
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(String key:trimData.keySet()){ for(String key:trimData.keySet()){
List<Long> line= new ArrayList<Long>(); List<Long> line= new ArrayList<Long>();
@@ -152,7 +156,8 @@ public class NtcSrcipDomesticReportController extends BaseController {
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
// HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 // HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// long total=0; // long total=0;

View File

@@ -90,8 +90,12 @@ public class NtcTagReportController extends BaseController {
trimStr=report.getTag().intValue()+Constants.REPORT_TRIM_CONNECTOR+ trimStr=report.getTag().intValue()+Constants.REPORT_TRIM_CONNECTOR+
report.getReportTime().substring(0,7); report.getReportTime().substring(0,7);
} }
if(trimData.containsKey(trimStr)){
trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue());
}else{
trimData.put(trimStr, report.getSum().longValue()); trimData.put(trimStr, report.getSum().longValue());
} }
}
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(ServiceDictInfo label:labels){ for(ServiceDictInfo label:labels){
List<Long> line= new ArrayList<Long>(); List<Long> line= new ArrayList<Long>();
@@ -112,7 +116,8 @@ public class NtcTagReportController extends BaseController {
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
// HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 // HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// for(ServiceDictInfo label:labels){ // for(ServiceDictInfo label:labels){

View File

@@ -95,8 +95,12 @@ public class NtcXzReportController extends BaseController {
trimStr=report.getAttrType().intValue()+Constants.REPORT_TRIM_CONNECTOR+ trimStr=report.getAttrType().intValue()+Constants.REPORT_TRIM_CONNECTOR+
report.getReportTime().substring(0,7); report.getReportTime().substring(0,7);
} }
if(trimData.containsKey(trimStr)){
trimData.put(trimStr, trimData.get(trimStr)+report.getSum().longValue());
}else{
trimData.put(trimStr, report.getSum().longValue()); trimData.put(trimStr, report.getSum().longValue());
} }
}
HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
for(ServiceDictInfo xz:xzs){ for(ServiceDictInfo xz:xzs){
List<Long> line= new ArrayList<Long>(); List<Long> line= new ArrayList<Long>();
@@ -117,7 +121,8 @@ public class NtcXzReportController extends BaseController {
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
} catch (Exception e) { } catch (Exception e) {
// TODO: handle exception // TODO: handle exception
e.printStackTrace(); logger.error("查询失败", e);
addMessageLog(model, null);
} }
// HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合 // HashMap<String,List<Long>> showData=new LinkedHashMap<>();//构造数据展示集合
// for(ServiceDictInfo xz:xzs){ // for(ServiceDictInfo xz:xzs){

View File

@@ -159,7 +159,8 @@ var ajaxReport=function(url,target){
data:{ data:{
"action":$('[name="action"]').val(), "action":$('[name="action"]').val(),
"reportType":$('[name="reportType"]').val(), "reportType":$('[name="reportType"]').val(),
"reportTime":$('[name="reportTime"]').val() "reportTime":$('[name="reportTime"]').val(),
"functionId":$('[name="functionId"]').val()
}, },
dataType:"html", dataType:"html",
success:function(data){ success:function(data){
@@ -215,6 +216,8 @@ function customColumnClick(){
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action"> <c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action">
<c:forEach items="${serviceList}" var="service" varStatus="status"> <c:forEach items="${serviceList}" var="service" varStatus="status">
<c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}"> <c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}">
<c:if test="${service.serviceId ne 5}">
<c:if test="${(service.action ne 128) && (service.action ne 32)}" >
<div data-service="${service.serviceId}" class="service btn <div data-service="${service.serviceId}" class="service btn
<c:if test="${status.index%2==0}">btn-primary</c:if> <c:if test="${status.index%2==0}">btn-primary</c:if>
<c:if test="${status.index%2!=0}">btn-default</c:if>"> <c:if test="${status.index%2!=0}">btn-default</c:if>">
@@ -223,6 +226,17 @@ function customColumnClick(){
<span>0</span> <span>0</span>
</div> </div>
</c:if> </c:if>
</c:if>
<c:if test="${service.serviceId eq 5}">
<div data-service="${service.serviceId}" class="service btn
<c:if test="${status.index%2==0}">btn-primary</c:if>
<c:if test="${status.index%2!=0}">btn-default</c:if>">
<spring:message code="${action.itemValue}"/>
<spring:message code="log_total"/>
<span>0</span>
</div>
</c:if>
</c:if>
</c:forEach> </c:forEach>
</c:forEach> </c:forEach>
</div> </div>
@@ -253,8 +267,15 @@ function customColumnClick(){
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" > <c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="action" >
<c:forEach items="${serviceList}" var="service" > <c:forEach items="${serviceList}" var="service" >
<c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}"> <c:if test="${service.functionId eq bean.functionId and action.itemCode eq service.action}">
<c:if test="${service.serviceId ne 5}">
<c:if test="${(service.action ne 128) && (service.action ne 32)}" >
<form:option value="${action.itemCode}" ><spring:message code="${action.itemValue}"/></form:option> <form:option value="${action.itemCode}" ><spring:message code="${action.itemValue}"/></form:option>
</c:if> </c:if>
</c:if>
<c:if test="${service.serviceId eq 5}">
<form:option value="${action.itemCode}" ><spring:message code="${action.itemValue}"/></form:option>
</c:if>
</c:if>
</c:forEach> </c:forEach>
</c:forEach> </c:forEach>
</form:select> </form:select>