报表页面获取业务类型日志总量功能提交
This commit is contained in:
@@ -43,7 +43,7 @@ public class NtcPzReportController extends BaseController{
|
||||
@ResponseBody
|
||||
public Map<String, Object> ajaxGetLogTotal(Model model,long endTime,int action,Integer functionId,Integer compileId){
|
||||
Map<String, Object> data=new HashMap<String, Object>();
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat sdf=new SimpleDateFormat(Constants.SEARCH_DATEFORMAT);
|
||||
int interval=Constants.LOG_TIME_RANGE;
|
||||
Date endDate=new Date(endTime);
|
||||
Date startDate=new Date(endTime-interval);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.nis.web.controller.report;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.ParseException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -9,34 +13,71 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.log.SearchReport;
|
||||
import com.nis.domain.report.NtcServiceReport;
|
||||
import com.nis.domain.report.ReportResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/report")
|
||||
public class NtcServiceReportController extends BaseController {
|
||||
@RequestMapping("/ntcLabelReport")
|
||||
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
initReportCondition(model, bean);
|
||||
@RequestMapping("/ajaxNtcServiceReport")
|
||||
@ResponseBody
|
||||
public Map<String, Long> report(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Map<String, Long> data=new HashMap<>();
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(bean.getFunctionId());
|
||||
if(bean.getAction()!=null){
|
||||
for(FunctionServiceDict service:serviceList){
|
||||
if(service.getAction().intValue()==bean.getAction().intValue()){
|
||||
bean.setSearchService(service.getServiceId().toString());
|
||||
}
|
||||
}
|
||||
}else{
|
||||
StringBuffer serviceId=new StringBuffer();
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
if(i==0){
|
||||
serviceId.append(serviceList.get(i).getServiceId().toString());
|
||||
}else{
|
||||
serviceId.append(","+serviceList.get(i).getServiceId().toString());
|
||||
}
|
||||
}
|
||||
bean.setSearchService(serviceId.toString());
|
||||
}
|
||||
bean.setSearchBusinessType("1");
|
||||
bean.setPageSize(-1);
|
||||
try {
|
||||
this.setReportSearchTime(bean);
|
||||
} catch (ParseException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
ReportResult<NtcServiceReport> result=new ReportResult<>();
|
||||
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_SERVICE_REPORT+"?");
|
||||
try {
|
||||
result=result.getReport(url.toString(), bean);
|
||||
} catch (MaatConvertException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
// try {
|
||||
// result=result.getReport(url.toString(), bean);
|
||||
// Page<NtcServiceReport> page=result.getData();
|
||||
// List<NtcServiceReport> data=page.getList();
|
||||
// for(NtcServiceReport report:data){
|
||||
// if(datas.containsKey(report.getService().toString())){
|
||||
// data.put(report.getService().toString(), datas.get(report.getService().toString())+report.getSum().longValue());
|
||||
// }else{
|
||||
// data.put(report.getService().toString(),report.getSum().longValue());
|
||||
// }
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
if(bean.getAction()!=null){
|
||||
data.put(bean.getAction().toString(), 66666666l);
|
||||
}
|
||||
Page<NtcServiceReport> page=result.getData();
|
||||
model.addAttribute("page", page);
|
||||
return "/report/list";
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user