|
@@ -1,16 +1,16 @@
|
|
|
package com.zkqy.web.controller.homepagestatistics;
|
|
|
|
|
|
+import com.zkqy.business.domain.DetailsOfTheRefuelingPlan;
|
|
|
import com.zkqy.business.entity.DragForm;
|
|
|
import com.zkqy.business.entity.DragTable;
|
|
|
import com.zkqy.business.entity.DragTableGroup;
|
|
|
import com.zkqy.business.entity.vo.CommonTableOperationVO;
|
|
|
-import com.zkqy.business.service.impl.DragFormServiceImpl;
|
|
|
-import com.zkqy.business.service.impl.DragTableGroupServiceImpl;
|
|
|
-import com.zkqy.business.service.impl.DragTableServiceImpl;
|
|
|
-import com.zkqy.business.service.impl.MysqlTableOperationServiceImpl;
|
|
|
+import com.zkqy.business.service.impl.*;
|
|
|
import com.zkqy.common.constant.DataSourceType;
|
|
|
import com.zkqy.common.core.domain.AjaxResult;
|
|
|
import com.zkqy.common.utils.SecurityUtils;
|
|
|
+import com.zkqy.execution.produce.dispersed.entity.BpmExecuteProcess;
|
|
|
+import com.zkqy.execution.produce.dispersed.service.impl.BpmExecuteProcessServiceImpl;
|
|
|
import com.zkqy.execution.produce.dispersed.service.impl.BpmProcessServiceImpl;
|
|
|
import com.zkqy.system.domain.SysLogininfor;
|
|
|
import com.zkqy.system.service.ISysOperLogService;
|
|
@@ -26,12 +26,15 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+/**
|
|
|
+ * 化纤数据统计
|
|
|
+ */
|
|
|
@RestController
|
|
|
@RequestMapping("/statistics/info")
|
|
|
public class StatisticsController {
|
|
|
|
|
|
- @Autowired
|
|
|
- BpmProcessServiceImpl bpmProcessService;
|
|
|
+ @Autowired
|
|
|
+ BpmExecuteProcessServiceImpl bpmExecuteProcessService;
|
|
|
|
|
|
@Autowired
|
|
|
private ISysOperLogService operLogService;
|
|
@@ -40,29 +43,49 @@ public class StatisticsController {
|
|
|
private SysLogininforServiceImpl logininforService;
|
|
|
|
|
|
@Autowired
|
|
|
- DragTableServiceImpl dragTableService;
|
|
|
+ DetailsOfTheRefuelingPlanServiceImpl detailsOfTheRefuelingPlanService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ DetailsOfTheRefuelingPlanSpinningServiceImpl detailsOfTheRefuelingPlanSpinningService;
|
|
|
|
|
|
@Autowired
|
|
|
- DragFormServiceImpl dragFormService;
|
|
|
+ MaterialInventoryServiceImpl materialInventoryService;
|
|
|
|
|
|
@Autowired
|
|
|
- MysqlTableOperationServiceImpl mysqlTableOperationService;
|
|
|
+ InboundRecordsServiceImpl inboundRecordsService;
|
|
|
|
|
|
@Autowired
|
|
|
- DragTableGroupServiceImpl dragTableGroupService;
|
|
|
+ OutboundRecordsServiceImpl outboundRecordsService;
|
|
|
|
|
|
/**
|
|
|
- * 流程信息统计
|
|
|
+ * 任务数量统计 √
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getProcessInformation")
|
|
|
public AjaxResult getProcessInformation(){
|
|
|
- List<Map> bpmProcesses = bpmProcessService.selectBpmProcessStatistics();
|
|
|
- return AjaxResult.success(bpmProcesses);
|
|
|
+ if(SecurityUtils.getUsername().equals("huaxian")){
|
|
|
+ //查询加弹计划
|
|
|
+ int i1 = detailsOfTheRefuelingPlanService.selectDetailsOfTheRefuelingPlanListCount();
|
|
|
+ int i2 = detailsOfTheRefuelingPlanSpinningService.selectDetailsOfTheRefuelingPlanSpinningListCount();
|
|
|
+ HashMap<String, String> map1 = new HashMap<>();
|
|
|
+ map1.put("name", "计划任务");
|
|
|
+ map1.put("value",String.valueOf((i1+i2)));
|
|
|
+ int i = bpmExecuteProcessService.selectBpmExecuteProcessListCount();
|
|
|
+ HashMap<String, String> map2 = new HashMap<>();
|
|
|
+ map2.put("审批任务",String.valueOf(i));
|
|
|
+ map2.put("name", "审批任务");
|
|
|
+ map2.put("value",String.valueOf(i));
|
|
|
+ List<Map> listMap=new ArrayList<>();
|
|
|
+ listMap.add(map1);
|
|
|
+ listMap.add(map2);
|
|
|
+ return AjaxResult.success(listMap);
|
|
|
+ //纺丝+翻框+络筒
|
|
|
+ }
|
|
|
+ return AjaxResult.success(0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 操作日志信息统计
|
|
|
+ * 操作日志信息统计 (这个没办法做成共同的,因为,操作记录在主表当中)
|
|
|
* Operation information statistics
|
|
|
*/
|
|
|
@GetMapping("/getOperationInformationStatistics")
|
|
@@ -73,87 +96,110 @@ public class StatisticsController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 操作日志信息统计
|
|
|
+ * 生产任务、 完成任务数量
|
|
|
* Operation information statistics
|
|
|
*/
|
|
|
- @GetMapping("/getLoginInformationStatistics")
|
|
|
- public AjaxResult getLoginInformationStatistics(){
|
|
|
- SysLogininfor sysLogininfor=new SysLogininfor();
|
|
|
- sysLogininfor.setTenantId( SecurityUtils.getLoginUser().getTenantId());
|
|
|
- sysLogininfor.setWhichApplication("1");
|
|
|
- List<Map> loginInformationStatistics = logininforService.getLoginInformationStatistics(sysLogininfor);
|
|
|
-
|
|
|
- SysLogininfor sysLogininfor2=new SysLogininfor();
|
|
|
- sysLogininfor2.setTenantId( SecurityUtils.getLoginUser().getTenantId());
|
|
|
- sysLogininfor2.setWhichApplication("2");
|
|
|
- List<Map> loginInformationStatistics1 = logininforService.getLoginInformationStatistics(sysLogininfor2);
|
|
|
+ @GetMapping("/getProductionTaskCompletionQuantity")
|
|
|
+ public AjaxResult getProductionTaskCompletionQuantity(){
|
|
|
+ BpmExecuteProcess bpmExecuteProcess=new BpmExecuteProcess();
|
|
|
+ bpmExecuteProcess.setTaskProcessType("0");
|
|
|
+ //所有生产的,生产流程
|
|
|
+ List<Map> mapList1= bpmExecuteProcessService.selectBpmExecuteProcessListProductionCount(bpmExecuteProcess);
|
|
|
List<Map> list = new ArrayList<>();
|
|
|
HashMap hashMap1=new HashMap();
|
|
|
- hashMap1.put("name","客户端");
|
|
|
+ hashMap1.put("name","生产任务");
|
|
|
hashMap1.put("type","line");
|
|
|
hashMap1.put("smooth","true");
|
|
|
- hashMap1.put("data",loginInformationStatistics.stream().map((item->item.get("dailyLoginCount"))).collect(Collectors.toList()));
|
|
|
- hashMap1.put("date",loginInformationStatistics.stream().map((item->item.get("loginDate"))).collect(Collectors.toList()));
|
|
|
+ hashMap1.put("data",mapList1.stream().map((item->item.get("count"))).collect(Collectors.toList()));
|
|
|
+ hashMap1.put("date",mapList1.stream().map((item->item.get("month"))).collect(Collectors.toList()));
|
|
|
list.add(hashMap1);
|
|
|
+ BpmExecuteProcess bpmExecuteProcess2=new BpmExecuteProcess();
|
|
|
+ bpmExecuteProcess2.setTaskProcessType("0");
|
|
|
+ bpmExecuteProcess2.setTaskProcessState(3L);
|
|
|
+ //所有生产的,生产流程
|
|
|
+ List<Map> mapList2 = bpmExecuteProcessService.selectBpmExecuteProcessListProductionCount(bpmExecuteProcess2);
|
|
|
HashMap hashMap2=new HashMap();
|
|
|
- hashMap2.put("name","工具端");
|
|
|
+ hashMap2.put("name","完成任务");
|
|
|
hashMap2.put("type","line");
|
|
|
hashMap2.put("smooth","true");
|
|
|
- hashMap2.put("data",loginInformationStatistics1.stream().map((item->item.get("dailyLoginCount"))).collect(Collectors.toList()));
|
|
|
- hashMap2.put("date",loginInformationStatistics.stream().map((item->item.get("loginDate"))).collect(Collectors.toList()));
|
|
|
+ hashMap2.put("data",mapList2.stream().map((item->item.get("count"))).collect(Collectors.toList()));
|
|
|
+ hashMap2.put("date",mapList2.stream().map((item->item.get("month"))).collect(Collectors.toList()));
|
|
|
list.add(hashMap2);
|
|
|
- return AjaxResult.success(list);
|
|
|
+ return AjaxResult.success(list);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 数据建模统计
|
|
|
+ * 原材料
|
|
|
* DataModelingStatistics
|
|
|
*/
|
|
|
- @GetMapping("/getDataModelingStatistics")
|
|
|
- public AjaxResult getDataModelingStatistics(){
|
|
|
- String databaseType = SecurityUtils.getDatabaseType();
|
|
|
- if (databaseType.equals(DataSourceType.MYSQL.getDataSourceName())) {
|
|
|
- CommonTableOperationVO vo =new CommonTableOperationVO();
|
|
|
- vo.setDatabaseName(SecurityUtils.getDatabaseName());
|
|
|
- return AjaxResult.success(mysqlTableOperationService.selectTableList(vo).size());
|
|
|
+ @GetMapping("/getRawMaterial")
|
|
|
+ public AjaxResult getRawMaterial(){
|
|
|
+ if(SecurityUtils.getUsername().equals("huaxian")){
|
|
|
+ //总库存数量
|
|
|
+ int i1 = materialInventoryService.selectMaterialInventoryListSum();
|
|
|
+ //出库数量
|
|
|
+ int i2 = inboundRecordsService.selectInboundRecordsByQtCodeNumberCount();
|
|
|
+ //入库数量
|
|
|
+ int i3 = outboundRecordsService.selectOutboundRecordsCount();
|
|
|
+ List<Map> list=new ArrayList<>();
|
|
|
+ HashMap dragFormsMap=new HashMap();
|
|
|
+ dragFormsMap.put("name","总库存数量");
|
|
|
+ dragFormsMap.put("value",i1);
|
|
|
+ list.add(dragFormsMap);
|
|
|
+
|
|
|
+ HashMap dragTableSMap=new HashMap();
|
|
|
+ dragTableSMap.put("name","出库数量");
|
|
|
+ dragTableSMap.put("value",i2);
|
|
|
+ list.add(dragTableSMap);
|
|
|
+
|
|
|
+ HashMap dragTableGroupsSMap=new HashMap();
|
|
|
+ dragTableGroupsSMap.put("name","入库数量");
|
|
|
+ dragTableGroupsSMap.put("value",i3);
|
|
|
+ list.add(dragTableGroupsSMap);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }else {
|
|
|
+ List<Map> list=new ArrayList<>();
|
|
|
+ HashMap dragFormsMap=new HashMap();
|
|
|
+ dragFormsMap.put("name","总库存数量");
|
|
|
+ dragFormsMap.put("value",0);
|
|
|
+ list.add(dragFormsMap);
|
|
|
+
|
|
|
+ HashMap dragTableSMap=new HashMap();
|
|
|
+ dragTableSMap.put("name","出库数量");
|
|
|
+ dragTableSMap.put("value",0);
|
|
|
+ list.add(dragTableSMap);
|
|
|
+
|
|
|
+ HashMap dragTableGroupsSMap=new HashMap();
|
|
|
+ dragTableGroupsSMap.put("name","入库数量");
|
|
|
+ dragTableGroupsSMap.put("value",0);
|
|
|
+ list.add(dragTableGroupsSMap);
|
|
|
+ return AjaxResult.success(list);
|
|
|
}
|
|
|
- return AjaxResult.success(0);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 表单表格统计
|
|
|
- * DataModelingStatistics
|
|
|
+ * 最近12个月的客户端的登录情况
|
|
|
*/
|
|
|
- @GetMapping("/getTabularStatistics")
|
|
|
- public AjaxResult getTabularStatistics(){
|
|
|
- //表单
|
|
|
- DragForm dragForm =new DragForm();
|
|
|
- int dragFormsCount = dragFormService.selectDragFormListCount(dragForm);
|
|
|
- //表格
|
|
|
- DragTable dragTable =new DragTable();
|
|
|
- int dragTablesCount = dragTableService.selectDragTableListCount(dragTable);
|
|
|
- //三级联动
|
|
|
- DragTableGroup dragTableGroup =new DragTableGroup();
|
|
|
- int dragTableGroupsCount = dragTableGroupService.selectDragTableGroupListCount(dragTableGroup);
|
|
|
-
|
|
|
- List<Map> list=new ArrayList<>();
|
|
|
- HashMap dragFormsMap=new HashMap();
|
|
|
- dragFormsMap.put("name","表单");
|
|
|
- dragFormsMap.put("value",dragFormsCount);
|
|
|
- list.add(dragFormsMap);
|
|
|
-
|
|
|
- HashMap dragTableSMap=new HashMap();
|
|
|
- dragTableSMap.put("name","表格");
|
|
|
- dragTableSMap.put("value",dragTablesCount);
|
|
|
- list.add(dragTableSMap);
|
|
|
-
|
|
|
- HashMap dragTableGroupsSMap=new HashMap();
|
|
|
- dragTableGroupsSMap.put("name","三级联动");
|
|
|
- dragTableGroupsSMap.put("value",dragTableGroupsCount);
|
|
|
- list.add(dragTableGroupsSMap);
|
|
|
-
|
|
|
- return AjaxResult.success(list);
|
|
|
+ @GetMapping("/getLoginInformationStatistics")
|
|
|
+ public AjaxResult getLoginInfo(){
|
|
|
+ SysLogininfor logininfor=new SysLogininfor();
|
|
|
+ logininfor.setTenantId(SecurityUtils.getTenantId());
|
|
|
+ logininfor.setWhichApplication("1");
|
|
|
+ List<Map> loginInformationStatistics = logininforService.getLoginInformationStatistics(logininfor);
|
|
|
+ List<String> dates1=new ArrayList<>();
|
|
|
+ List<String> dates2=new ArrayList<>();
|
|
|
+ loginInformationStatistics.stream().forEach(item->{
|
|
|
+ dates1.add(item.get("month").toString());
|
|
|
+ dates2.add(item.get("loginCount").toString());
|
|
|
+ });
|
|
|
+ HashMap<String,Object> data=new HashMap<>();
|
|
|
+ data.put("name",dates1);
|
|
|
+ data.put("value",dates2);
|
|
|
+ return AjaxResult.success(data);
|
|
|
}
|
|
|
-
|
|
|
}
|