|
|
@@ -58,6 +58,89 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|
|
return operLogMapper.deleteOperLogByIds(operIds);
|
|
|
}
|
|
|
|
|
|
+ public void createDefaultForm(List<SysOperLog> zr,List<SysOperLog> zz,List<SysOperLog> yg) {
|
|
|
+ // wbzr 列表转换
|
|
|
+ SysOperLog log1 = new SysOperLog();
|
|
|
+ log1.setTitle("工单管理");
|
|
|
+ log1.setIcon("fa fa-tasks");
|
|
|
+ log1.setColor("blue");
|
|
|
+
|
|
|
+ SysOperLog log2 = new SysOperLog();
|
|
|
+ log2.setTitle("班组管理");
|
|
|
+ log2.setIcon("fa fa-users");
|
|
|
+ log2.setColor("cyan");
|
|
|
+
|
|
|
+ SysOperLog log3 = new SysOperLog();
|
|
|
+ log3.setTitle("工分管理");
|
|
|
+ log3.setIcon("fa fa-star");
|
|
|
+ log3.setColor("orange");
|
|
|
+
|
|
|
+ SysOperLog log4 = new SysOperLog();
|
|
|
+ log4.setTitle("工时分析");
|
|
|
+ log4.setIcon("fa fa-clock-o");
|
|
|
+ log4.setColor("gray");
|
|
|
+
|
|
|
+ SysOperLog log5 = new SysOperLog();
|
|
|
+ log5.setTitle("通知中心");
|
|
|
+ log5.setIcon("fa fa-bell");
|
|
|
+ log5.setColor("red");
|
|
|
+ zr.add(log1);
|
|
|
+ zr.add(log2);
|
|
|
+ zr.add(log3);
|
|
|
+ zr.add(log4);
|
|
|
+ zr.add(log5);
|
|
|
+
|
|
|
+// zz 列表转换
|
|
|
+ SysOperLog log11 = new SysOperLog();
|
|
|
+ log11.setTitle("工单分配");
|
|
|
+ log11.setIcon("fa fa-tasks");
|
|
|
+ log11.setColor("blue");
|
|
|
+
|
|
|
+ SysOperLog log12 = new SysOperLog();
|
|
|
+ log12.setTitle("组员管理");
|
|
|
+ log12.setIcon("fa fa-user");
|
|
|
+ log12.setColor("cyan");
|
|
|
+
|
|
|
+ SysOperLog log13 = new SysOperLog();
|
|
|
+ log13.setTitle("工分管理");
|
|
|
+ log13.setIcon("fa fa-star");
|
|
|
+ log13.setColor("orange");
|
|
|
+
|
|
|
+ SysOperLog log14 = new SysOperLog();
|
|
|
+ log14.setTitle("超时工单");
|
|
|
+ log14.setIcon("fa fa-exclamation-circle");
|
|
|
+ log14.setColor("red");
|
|
|
+ zz.add(log11);
|
|
|
+ zz.add(log12);
|
|
|
+ zz.add(log13);
|
|
|
+ zz.add(log14);
|
|
|
+
|
|
|
+// yg 列表转换
|
|
|
+ SysOperLog log21 = new SysOperLog();
|
|
|
+ log21.setTitle("我的工单");
|
|
|
+ log21.setIcon("fa fa-tasks");
|
|
|
+ log21.setColor("blue");
|
|
|
+
|
|
|
+ SysOperLog log22 = new SysOperLog();
|
|
|
+ log22.setTitle("我的工分");
|
|
|
+ log22.setIcon("fa fa-star");
|
|
|
+ log22.setColor("orange");
|
|
|
+
|
|
|
+ SysOperLog log23 = new SysOperLog();
|
|
|
+ log23.setTitle("扣分工单");
|
|
|
+ log23.setIcon("fa fa-minus-circle");
|
|
|
+ log23.setColor("red");
|
|
|
+
|
|
|
+ SysOperLog log24 = new SysOperLog();
|
|
|
+ log24.setTitle("历史记录");
|
|
|
+ log24.setIcon("fa fa-history");
|
|
|
+ log24.setColor("gray");
|
|
|
+ yg.add(log21);
|
|
|
+ yg.add(log22);
|
|
|
+ yg.add(log23);
|
|
|
+ yg.add(log24);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 统计用户操作次数
|
|
|
*
|
|
|
@@ -65,33 +148,21 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<Map<String, Object>> selectOperLogCountByOperName(String operName, int postType)
|
|
|
+ public List<SysOperLog> selectOperLogCountByOperName(String operName, int postType)
|
|
|
{
|
|
|
- List<Map<String, Object>> wbzr = new ArrayList<>();
|
|
|
- wbzr.add(createMenu("工单管理", "fa fa-tasks", "blue"));
|
|
|
- wbzr.add(createMenu("班组管理", "fa fa-users", "cyan"));
|
|
|
- wbzr.add(createMenu("工分管理", "fa fa-star", "orange"));
|
|
|
- wbzr.add(createMenu("工时分析", "fa fa-clock-o", "gray"));
|
|
|
- wbzr.add(createMenu("通知中心", "fa fa-bell", "red"));
|
|
|
- List<Map<String, Object>> result = operLogMapper.selectOperLogCountByOperName(operName);
|
|
|
+ List<SysOperLog> wbzr = new ArrayList<>();
|
|
|
+ List<SysOperLog> zz = new ArrayList<>();
|
|
|
+ List<SysOperLog> yg = new ArrayList<>();
|
|
|
+ createDefaultForm(wbzr,zz,yg);
|
|
|
+ List<SysOperLog> result = operLogMapper.selectOperLogCountByOperName(operName);
|
|
|
if (!result.isEmpty()) {
|
|
|
for (int i=0;i<result.size();i++) {
|
|
|
- Map<String, Object> map = result.get(i);
|
|
|
- map.put("color",wbzr.get(i).get("color"));
|
|
|
+ SysOperLog map = result.get(i);
|
|
|
+ map.setColor(wbzr.get(i).getColor());
|
|
|
}
|
|
|
}
|
|
|
if (result.size()<5) {
|
|
|
- List<Map<String, Object>> zz = new ArrayList<>();
|
|
|
- zz.add(createMenu("工单分配", "fa fa-tasks", "blue"));
|
|
|
- zz.add(createMenu("组员管理", "fa fa-user", "cyan"));
|
|
|
- zz.add(createMenu("工分管理", "fa fa-star", "orange"));
|
|
|
- zz.add(createMenu("超时工单", "fa fa-exclamation-circle", "red"));
|
|
|
- List<Map<String, Object>> yg = new ArrayList<>();
|
|
|
- yg.add(createMenu("我的工单", "fa fa-tasks", "blue"));
|
|
|
- yg.add(createMenu("我的工分", "fa fa-star", "orange"));
|
|
|
- yg.add(createMenu("扣分工单", "fa fa-minus-circle", "red"));
|
|
|
- yg.add(createMenu("历史记录", "fa fa-history", "gray"));
|
|
|
- List<Map<String, Object>> highUse = new ArrayList<>();
|
|
|
+ List<SysOperLog> highUse = new ArrayList<>();
|
|
|
if (postType==2) {
|
|
|
highUse.addAll(wbzr);
|
|
|
} else if (postType==1) {
|
|
|
@@ -102,13 +173,13 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|
|
if (result.isEmpty()) {
|
|
|
result.addAll(highUse);
|
|
|
} else {
|
|
|
- for (Map<String, Object> map : highUse) {
|
|
|
+ for (SysOperLog map : highUse) {
|
|
|
if (result.size()>3) {
|
|
|
break;
|
|
|
}
|
|
|
boolean isadd = true;
|
|
|
- for (Map<String, Object> map1 : result) {
|
|
|
- if (map1.get("title").equals(map.get("title"))) {
|
|
|
+ for (SysOperLog map1 : result) {
|
|
|
+ if (map1.getTitle().equals(map.getTitle())) {
|
|
|
isadd = false;
|
|
|
break;
|
|
|
}
|
|
|
@@ -122,8 +193,8 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private static Map<String, Object> createMenu(String title, String icon, String color) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
+ private static Map<String, String> createMenu(String title, String icon, String color) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
map.put("title", title);
|
|
|
map.put("icon", icon);
|
|
|
map.put("color", color);
|