|
@@ -7,7 +7,13 @@ import com.github.abel533.echarts.code.Trigger;
|
|
|
import com.github.abel533.echarts.feature.MagicType;
|
|
|
import com.github.abel533.echarts.json.GsonOption;
|
|
|
import com.github.abel533.echarts.series.Bar;
|
|
|
+import com.jeeplus.common.json.AjaxJson;
|
|
|
+import com.jeeplus.common.utils.DateUtils;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
+import com.jeeplus.common.utils.excel.ExportExcel;
|
|
|
+import com.jeeplus.modules.sg.audit.information.entity.Information;
|
|
|
+import com.jeeplus.modules.sg.audit.information.entity.OutInformation;
|
|
|
+import com.jeeplus.modules.sg.audit.material.entity.Material;
|
|
|
import com.jeeplus.modules.sg.audit.report.entity.SgReport;
|
|
|
import com.jeeplus.modules.sg.audit.report.service.ReportService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -68,6 +74,25 @@ public class ReportController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 二级单位项目报表
|
|
|
+ */
|
|
|
+ @RequestMapping("/secondlist")
|
|
|
+ public String list2(SgReport sgReport, Model model) {
|
|
|
+ String status = sgReport.getStatus();
|
|
|
+ model.addAttribute("sgReport", sgReport);
|
|
|
+ List<SgReport> list = reportService.findSecondData(sgReport);
|
|
|
+// List<SgReport> list1 = reportService.findList(sgReport);
|
|
|
+ model.addAttribute("list",list);
|
|
|
+// model.addAttribute("list1",list1);
|
|
|
+ if(StringUtils.isNotBlank(status)) {
|
|
|
+ model.addAttribute("dataURL", "/sg/report/secondoption?status=" + status);
|
|
|
+ }else {
|
|
|
+ model.addAttribute("dataURL", "/sg/report/secondoption");
|
|
|
+ }
|
|
|
+ return "modules/sg/audit/report/reportList2";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -212,4 +237,97 @@ public class ReportController {
|
|
|
return option;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping("secondoption")
|
|
|
+ public GsonOption getOption2(HttpServletRequest request){
|
|
|
+ String status = request.getParameter("status");
|
|
|
+ SgReport sgReport = new SgReport();
|
|
|
+ sgReport.setStatus(status);
|
|
|
+ List<SgReport> list = reportService.findSecondList(sgReport);
|
|
|
+ String[] str = new String[list.size()];
|
|
|
+ int[] level1 = new int[list.size()];
|
|
|
+ int[] level2 = new int[list.size()];
|
|
|
+ int[] level3 = new int[list.size()];
|
|
|
+ int[] level4 = new int[list.size()];
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
+ str[i] = list.get(i).getName();
|
|
|
+ level1[i] = list.get(i).getLevel1();
|
|
|
+ level2[i] = list.get(i).getLevel2();
|
|
|
+ level3[i] = list.get(i).getLevel3();
|
|
|
+ level4[i] = list.get(i).getLevel4();
|
|
|
+ }
|
|
|
+ GsonOption option = new GsonOption();
|
|
|
+// option.title("ECharts2 vs ECharts1", "Chrome下测试数据");
|
|
|
+ option.tooltip(Trigger.axis);
|
|
|
+ option.legend(
|
|
|
+ "1-7天", "8-14天", "15-21天",
|
|
|
+ "21天以上");
|
|
|
+ option.toolbox().show(true)
|
|
|
+ .feature(
|
|
|
+ Tool.mark, Tool.dataView,
|
|
|
+ new MagicType(Magic.line, Magic.bar),
|
|
|
+ Tool.restore, Tool.saveAsImage);
|
|
|
+ option.calculable(true);
|
|
|
+ option.grid().y(70).y2(30).x2(60).bottom(120);
|
|
|
+ CategoryAxis categoryAxis = new CategoryAxis();
|
|
|
+ for(int j=0;j<str.length;j++){
|
|
|
+ categoryAxis.data(str[j]);
|
|
|
+ }
|
|
|
+ option.xAxis(
|
|
|
+ categoryAxis.axisLabel(new AxisLabel().rotate(40).interval(0))
|
|
|
+// new CategoryAxis()
|
|
|
+// .axisLine(new AxisLine().show(false))
|
|
|
+// .axisTick(new AxisTick().show(false))
|
|
|
+// .axisLabel(new AxisLabel().show(false))
|
|
|
+// .splitArea(new SplitArea().show(false))
|
|
|
+// .axisLine(new AxisLine().show(false))
|
|
|
+// .data("Line", "Bar")
|
|
|
+ );
|
|
|
+ option.yAxis(new ValueAxis().axisLabel(new AxisLabel().formatter("{value} 个")));
|
|
|
+ Bar b1 = new Bar("1-7天");
|
|
|
+ b1.itemStyle().normal().color("rgba(193,35,43,0.5)").label().show(true);
|
|
|
+ Bar b2 = new Bar("8-14天");
|
|
|
+ b2.itemStyle().normal().color("rgba(181,195,52,1)").label().show(true).textStyle().color("#27727B");
|
|
|
+ Bar b3 = new Bar("15-21天");
|
|
|
+ b3.itemStyle().normal().color("rgba(252,206,16,1)").label().show(true).textStyle().color("#E87C25");
|
|
|
+ Bar b4 = new Bar("21天以上");
|
|
|
+ b4.itemStyle().normal().color("rgba(193,35,43,1)").label().show(true);
|
|
|
+ for (int k=0;k<list.size();k++){
|
|
|
+ b1.data(level1[k] );
|
|
|
+ b2.data(level2[k] );
|
|
|
+ b3.data(level3[k] );
|
|
|
+ b4.data(level4[k] );
|
|
|
+ }
|
|
|
+ option.series(b1, b2, b3, b4);
|
|
|
+ return option;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出项目清单
|
|
|
+ * */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping(value = "exportInformation")
|
|
|
+ public AjaxJson exportInformation(SgReport sgReport,HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ AjaxJson j = new AjaxJson();
|
|
|
+ try {
|
|
|
+ String condition = request.getParameter("condition");
|
|
|
+ condition = new String(condition.getBytes("iso8859-1"), "utf-8");
|
|
|
+ String status = request.getParameter("status");
|
|
|
+ String type = request.getParameter("type");
|
|
|
+ sgReport.setStatus(status);
|
|
|
+ sgReport.setType(type);
|
|
|
+ sgReport.setCondition(condition);
|
|
|
+ String fileName = "导出项目信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
+ List<Information> informationList = reportService.findInformationList(sgReport);
|
|
|
+ new ExportExcel("导出项目信息", OutInformation.class).setDataList(informationList).write(response, fileName).dispose();
|
|
|
+ j.setSuccess(true);
|
|
|
+ j.setMsg("导出成功!");
|
|
|
+ return j;
|
|
|
+ } catch (Exception e) {
|
|
|
+ j.setSuccess(false);
|
|
|
+ j.setMsg("导出物料清单!失败信息:" + e.getMessage());
|
|
|
+ }
|
|
|
+ return j;
|
|
|
+ }
|
|
|
}
|