Quellcode durchsuchen

[task-1521] 【首页】用户信息、仪表盘模块调整.
仪表盘新增设备维护、我的考试、我的培训模块,我的办结隐藏

Li Yuan vor 2 Jahren
Ursprung
Commit
0cb824d6d8

+ 57 - 11
ibps-provider-root/modules/provider-bpmn/src/main/java/com/lc/ibps/office/provider/BpmInitiatedProvider.java

@@ -2,12 +2,14 @@ package com.lc.ibps.office.provider;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.function.Function;
 
 import javax.annotation.Resource;
 
+import com.lc.ibps.base.framework.table.ICommonDao;
 import org.slf4j.event.Level;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -444,7 +446,7 @@ public class BpmInitiatedProvider extends GenericProvider implements IBpmInitiat
 		infobox.setAlias("myCompleted");
 		infobox.setDataText("-1");
 		list.add(infobox);
-		
+
 		if("executor".equalsIgnoreCase(multiTaskType)) {
 			executor.addTask(name+"."+infobox.getUrl(), new Callable<Void>() {
 				
@@ -1458,7 +1460,59 @@ public class BpmInitiatedProvider extends GenericProvider implements IBpmInitiat
 			
 			List<Infobox> list = new ArrayList<Infobox>();
 			result.setData(list);
-			
+
+			//========== 我的办结
+			StopWatchUtil.stopAndStartNewLocal(localId, step, "my completed count");
+			try {
+//				final Infobox infobox = new Infobox();
+//				myCompleted(multiTaskType, name, executor, workerWrappers, list, infobox);
+
+				ICommonDao<?> commonDao = AppUtil.getBean(ICommonDao.class);
+				String currentUserId = ContextUtil.getCurrentUserId();
+
+				Infobox infobox2 = new Infobox();
+				infobox2.setIcon("ibps-icon-file-o");
+				infobox2.setColor(Infobox.COLOR_BLUE2);
+				infobox2.setDataContent("我的培训");
+				infobox2.setUrl("myTraining");
+				infobox2.setAlias("myTraining");
+				infobox2.setDataText("-1");
+				infobox2.setAccessToken(ContextUtil.getCurrentAccessToken());
+				List<Map<String,Object>> objects =
+						(List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total FROM v_wodepeixun WHERE peixunrenyuan=#{p0}", new String[]{currentUserId});
+				infobox2.setDataText(objects.get(0).get("total").toString());
+				list.add(infobox2);
+
+				infobox2 = new Infobox();
+				infobox2.setIcon("ibps-icon-file-o");
+				infobox2.setColor(Infobox.COLOR_WOOD);
+				infobox2.setDataContent("我的考试");
+				infobox2.setUrl("myTesting");
+				infobox2.setAlias("myTesting");
+				infobox2.setDataText("-1");
+				infobox2.setAccessToken(ContextUtil.getCurrentAccessToken());
+				List<Map<String,Object>> object2 =
+						(List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total FROM v_examination WHERE examinee=#{p0}", new String[]{currentUserId});
+				infobox2.setDataText(object2.get(0).get("total").toString());
+				list.add(infobox2);
+
+				infobox2 = new Infobox();
+				infobox2.setIcon("ibps-icon-file-o");
+				infobox2.setColor(Infobox.COLOR_RED);
+				infobox2.setDataContent("今天设备维护剩余数");
+				infobox2.setUrl("myDevices");
+				infobox2.setAlias("myDevices");
+				infobox2.setDataText("-1");
+				infobox2.setAccessToken(ContextUtil.getCurrentAccessToken());
+				List<Map<String,Object>> object3 =
+						(List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total FROM  t_mjsbwhbyjlby v,ibps_party_employee u " +
+								"	WHERE FIND_IN_SET(v.bian_zhi_bu_men_, u.positions_) AND u.id_=#{p0} " +
+								"	AND DATE(v.create_time_)=CURDATE() AND shi_fou_guo_shen_='待处理'", new String[]{currentUserId});
+				infobox2.setDataText(object3.get(0).get("total").toString());
+				list.add(infobox2);
+			} catch (Exception e) {
+				logger.error(e.getMessage(), e);
+			}
 			//========== 新建流程
 			StopWatchUtil.initAndStartLocal(localId, Level.DEBUG, step, "new process count");
 			try {
@@ -1494,15 +1548,7 @@ public class BpmInitiatedProvider extends GenericProvider implements IBpmInitiat
 			} catch (Exception e) {
 				logger.error(e.getMessage(), e);
 			}
-			
-			//========== 我的办结
-			StopWatchUtil.stopAndStartNewLocal(localId, step, "my completed count");
-			try {
-				final Infobox infobox = new Infobox();
-				myCompleted(multiTaskType, name, executor, workerWrappers, list, infobox);
-			} catch (Exception e) {
-				logger.error(e.getMessage(), e);
-			}
+
 			
 			//========== 我的草稿
 			StopWatchUtil.stopAndStartNewLocal(localId, step, "my draft count");