Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

HD_wangm 1 mēnesi atpakaļ
vecāks
revīzija
31a3a40ba9

+ 19 - 19
src/main/bpm/com/yw/bpm/core/service/CoreServiceImpl.java

@@ -1005,23 +1005,23 @@ public class CoreServiceImpl implements CoreService {
 					String info = (String) result.get("info");
 					if (info != null && (
 							info.equals(ProcessDefine.FLOW_ERROR_13) ||  // 无操作人错误
-							info.equals(ProcessDefine.FLOW_ERROR_14) ||  // 没有取到下一步环节
-							info.contains("错误") || 
-							info.contains("error") ||
-							info.contains("异常") ||
-							info.contains("exception")
-						)) {
+									info.equals(ProcessDefine.FLOW_ERROR_14) ||  // 没有取到下一步环节
+									info.contains("错误") ||
+									info.contains("error") ||
+									info.contains("异常") ||
+									info.contains("exception")
+					)) {
 						hasError = true;
 						//System.out.println("[DEBUG] 检测到错误信息: " + info + ",设置提交状态为 false");
 						break;
 					}
 				}
 			}
-			
+
 			if (hasError) {
 				pr.setSubmitState(false);
 			}
-			
+
 			//System.out.println("[DEBUG] actualNextTacheInstances 包含 " + actualNextTacheInstances.size() + " 个元素");
 		}
 		pr.setNextTacheInstances(actualNextTacheInstances);
@@ -1578,7 +1578,7 @@ public class CoreServiceImpl implements CoreService {
 				SystemGroup group = bpmSystemDao.getSystemGroupById(groupid);
 				// 取部门主管,没有则提示错误
 				String person = group.getPerson();
-				if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+				if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 					throw new FlowException(ProcessDefine.FLOW_ERROR_13);
 				}
 				conditions.clear();
@@ -1598,7 +1598,7 @@ public class CoreServiceImpl implements CoreService {
 				// 取上级部门
 				SystemGroup pGroup = bpmSystemDao.getSystemGroupById(pid);
 				String person = pGroup.getPerson();
-				if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+				if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 					throw new FlowException(ProcessDefine.FLOW_ERROR_13);
 				}
 				conditions.clear();
@@ -1612,7 +1612,7 @@ public class CoreServiceImpl implements CoreService {
 				SystemGroup group = bpmSystemDao.getSystemGroupById(currentTacheInstance.getGroupid().getGroupId());
 				// 取部门主管,没有则提示错误
 				String person = group.getPerson();
-				if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+				if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 					throw new FlowException(ProcessDefine.FLOW_ERROR_13);
 				}
 				conditions.clear();
@@ -1633,7 +1633,7 @@ public class CoreServiceImpl implements CoreService {
 				// 取上级部门
 				SystemGroup pGroup = bpmSystemDao.getSystemGroupById(pid);
 				String person = pGroup.getPerson();
-				if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+				if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 					throw new FlowException(ProcessDefine.FLOW_ERROR_13);
 				}
 				conditions.clear();
@@ -2693,22 +2693,22 @@ public class CoreServiceImpl implements CoreService {
 				return actualNextTacheInstances;
 			}
 		}
-		
+
 		// 根据下一环节的选择模式取下一环节的model,放入list
 		List<TacheModel> nextTacheModelList = this.getListOfFollowingTacheModels(flowModel, flowInstance,
 				currentTacheModel, currentTacheInstance, new ArrayList<TacheModel>()); // 跳过环节时手动分支列表为空
-		
+
 		// 如果没有取到下一步环节
 		if (nextTacheModelList.size() == 0) {
 			//System.out.println("[DEBUG] 没有取到下一步环节");
 			Map<String, Object> result = new HashMap<String, Object>();
 			result.put("isCheck", false);
 			result.put("info", ProcessDefine.FLOW_ERROR_14);
-			result.put("tacheModel", currentTacheModel); 
+			result.put("tacheModel", currentTacheModel);
 			actualNextTacheInstances.add(result);
 			return actualNextTacheInstances;
 		}
-		
+
 		// 首先收集所有环节的信息,判断是否所有环节都找不到人且允许跳过
 		List<Map<String, Object>> allResults = new ArrayList<Map<String, Object>>();
 		List<TacheModel> skippedTacheModels = new ArrayList<TacheModel>(); // 存储允许跳过的环节
@@ -2755,7 +2755,7 @@ public class CoreServiceImpl implements CoreService {
 				actualNextTacheInstances.add(result);
 				continue;
 			}
-			
+
 			// 获取下一环节的操作人
 			List<SystemGroupUser> users = new ArrayList<SystemGroupUser>();
 			boolean skipCurrentTache = false;
@@ -2832,11 +2832,11 @@ public class CoreServiceImpl implements CoreService {
 				conditions.put("insId", flowInstance.getInsId());
 				List<TacheInstance> preList = bpmFlowDao.getListOfPreTacheInstanceByConditions(conditions);
 				int newPreCount = preList.size();
-				
+
 				// 递归查找后续环节
 				List<Map<String, Object>> recursiveResults = this.findSkippedTacheNextTaches(
 						flowInstance, skippedTacheModel, currentTacheInstance, nextTacheInstanceList, newPreCount);
-				
+
 				// 将递归结果添加到最终结果中,避免重复
 				for (Map<String, Object> recursiveResult : recursiveResults) {
 					TacheModel recursiveTacheModel = (TacheModel) recursiveResult.get("tacheModel");

+ 4 - 4
src/main/bpm/com/yw/bpm/instance/service/FlowServiceImpl.java

@@ -1870,7 +1870,7 @@ public class FlowServiceImpl implements FlowService {
 					SystemGroup group = bpmSystemDao.getSystemGroupById(groupid);
 					// 取部门主管,没有则提示错误
 					String person = group.getPerson();
-					if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+					if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 						throw new RuntimeException(ProcessDefine.FLOW_ERROR_13);
 					}
 					List<GroupXUser> list = treeUtilDao.loadGroupXuser(person);
@@ -1899,7 +1899,7 @@ public class FlowServiceImpl implements FlowService {
 					// 取上级部门
 					SystemGroup pGroup = bpmSystemDao.getSystemGroupById(pid);
 					String person = pGroup.getPerson();
-					if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+					if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 						throw new RuntimeException(ProcessDefine.FLOW_ERROR_13);
 					}
 					List<GroupXUser> list = treeUtilDao.loadGroupXuser(person);
@@ -1923,7 +1923,7 @@ public class FlowServiceImpl implements FlowService {
 					SystemGroup group = bpmSystemDao.getSystemGroupById(groupId);
 					// 取部门主管,没有则提示错误
 					String person = group.getPerson();
-					if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+					if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 						throw new RuntimeException(ProcessDefine.FLOW_ERROR_13);
 					}
 					List<GroupXUser> list = treeUtilDao.loadGroupXuser(person);
@@ -1954,7 +1954,7 @@ public class FlowServiceImpl implements FlowService {
 					// 取上级部门
 					SystemGroup pGroup = bpmSystemDao.getSystemGroupById(pid);
 					String person = pGroup.getPerson();
-					if ("0".equals(person) || "null".equals(person) || "".equals(person)) {
+					if ("0".equals(person) || "null".equals(person) || "".equals(person) || person == null) {
 						throw new RuntimeException(ProcessDefine.FLOW_ERROR_13);
 					}
 					List<GroupXUser> list = treeUtilDao.loadGroupXuser(person);