From 4ef275e96bf1d54de0862a1354a18f2d5c6bf2e0 Mon Sep 17 00:00:00 2001 From: liujiaji Date: Fri, 22 Jun 2018 09:31:49 +0800 Subject: [PATCH] bug --- .../impl/BusinessApplyStartServiceImpl.java | 35 +- .../FlowActionCommitController.java | 94 ++-- .../service/FlowActionCommitService.java | 32 +- .../impl/FlowActionCommitServiceImpl.java | 514 +++++++++--------- .../SelectProductAttributeServiceImpl.java | 6 +- 5 files changed, 344 insertions(+), 337 deletions(-) diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java index c3b0992a0..3e04fb158 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java @@ -33,42 +33,45 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService String uid = fieldMap.get("userid") == null ? "" : fieldMap.get( "userid").toString(); BusinessApprovalStartAction BusinessApprovalStartAction = new BusinessApprovalStartAction(); - + BusinessApprovalStartAction.setApplyType(applyType); BusinessApprovalStartAction.setCurUserID(uid); - + BusinessApprovalStartAction.setFixedFlowParam(bo.getFixedFlowParam()); - + // 产品租赁信息 BusinessApprovalStartAction.setProductID(bo.getProductId()); BusinessApprovalStartAction.setProductId(bo.getProductId()); BusinessApprovalStartAction.setLeasehold(bo.getLeasehold()); - + // 车辆信息 BusinessApprovalStartAction.setCarAttributes(bo.getCarAttributes()); BusinessApprovalStartAction.setProductModel(bo.getProductModel()); BusinessApprovalStartAction.setCarSystem(bo.getCarSystem()); BusinessApprovalStartAction.setCarSeries(bo.getCarSeries()); - + // 用户信息 BusinessApprovalStartAction.setCertid(bo.getCertid()); BusinessApprovalStartAction.setCerttype(bo.getCerttype()); BusinessApprovalStartAction.setCustname(bo.getCUSTOMERNAME()); BusinessApprovalStartAction.setCustomerType(bo.getCustomerType()); - + String sReturnInfo = BusinessApprovalStartAction.initFLow(tx); - if (sReturnInfo.startsWith("success")){ - //获取当前申请的相关参数,包含FlowUnid - Map params = BusinessApprovalStartAction.getFlowParam(); - //返回前台的数据 - Map body = new HashMap(); - body.put("flowUnid",params.get("FlowUnid")); - body.put("objectNo",params.get("FlowUnid")); + if (sReturnInfo.startsWith("success")) { + String serialNo = sReturnInfo.split("@")[1]; + // 获取当前申请的相关参数,包含FlowUnid + Map params = BusinessApprovalStartAction + .getFlowParam(); + // 返回前台的数据 + Map body = new HashMap(); + body.put("flowUnid", params.get("FlowUnid")); + body.put("objectNo", params.get("FlowUnid")); + body.put("taskNo", serialNo); + body.put("serialNo", serialNo); ReturnMapUtil.setReturnMap(body, RestfullConstant.baseProperty.get("success").toString(), - "发起成功"); - } - else + "发起成功"); + } else ReturnMapUtil.setReturnMap(null, RestfullConstant.baseProperty.get("FAIL").toString(), "发起失败"); diff --git a/src_app_fresh/apx/com/amarsoft/als/business/action/submit/controller/FlowActionCommitController.java b/src_app_fresh/apx/com/amarsoft/als/business/action/submit/controller/FlowActionCommitController.java index d7aa47e1e..98a59f523 100644 --- a/src_app_fresh/apx/com/amarsoft/als/business/action/submit/controller/FlowActionCommitController.java +++ b/src_app_fresh/apx/com/amarsoft/als/business/action/submit/controller/FlowActionCommitController.java @@ -1,47 +1,47 @@ -//package apx.com.amarsoft.als.business.action.submit.controller; -// -//import java.util.Map; -// -//import javax.servlet.http.HttpServletRequest; -//import javax.ws.rs.POST; -//import javax.ws.rs.Path; -//import javax.ws.rs.core.Context; -// -//import apx.com.amarsoft.als.business.action.submit.service.FlowActionCommitService; -//import apx.com.amarsoft.als.business.action.submit.service.impl.FlowActionCommitServiceImpl; -// -//import com.amarsoft.are.ARE; -//import com.amarsoft.are.jbo.JBOTransaction; -//import com.amarsoft.awe.util.Transaction; -//import com.base.util.ReturnMapUtil; -// -//@Path("/flow/action") -//public class FlowActionCommitController { -// FlowActionCommitService service = new FlowActionCommitServiceImpl(); -// /** -// * 通用流程提交 -// * -// * @param request -// * @param sqlca -// * @param tx -// * @return -// * @throws Exception -// */ -// @Path("/commit") -// @POST -// public Map commit(@Context HttpServletRequest request, -// @Context Transaction sqlca, @Context JBOTransaction tx) -// throws Exception { -// ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca); -// ARE.getLog() -// .info("[CONTROLLER] FlowActionCommitController run ................."); -// ARE.getLog().info( -// "[Path] /flow/action/commit" + " run ................."); -// try { -// -// return service.commit(request, sqlca, tx, ReturnMapUtil); -// } catch (Exception e) { -// return ReturnMapUtil.rollback(e); -// } -// } -//} +package apx.com.amarsoft.als.business.action.submit.controller; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.core.Context; + +import apx.com.amarsoft.als.business.action.submit.service.FlowActionCommitService; +import apx.com.amarsoft.als.business.action.submit.service.impl.FlowActionCommitServiceImpl; + +import com.amarsoft.are.ARE; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.awe.util.Transaction; +import com.base.util.ReturnMapUtil; + +@Path("/flow/action") +public class FlowActionCommitController { + FlowActionCommitService service = new FlowActionCommitServiceImpl(); + /** + * 通用流程提交 + * + * @param request + * @param sqlca + * @param tx + * @return + * @throws Exception + */ + @Path("/commit") + @POST + public Map commit(@Context HttpServletRequest request, + @Context Transaction sqlca, @Context JBOTransaction tx) + throws Exception { + ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca); + ARE.getLog() + .info("[CONTROLLER] FlowActionCommitController run ................."); + ARE.getLog().info( + "[Path] /flow/action/commit" + " run ................."); + try { + + return service.commit(request, sqlca, tx, ReturnMapUtil); + } catch (Exception e) { + return ReturnMapUtil.rollback(e); + } + } +} diff --git a/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/FlowActionCommitService.java b/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/FlowActionCommitService.java index 5aa928ba6..fc5d787e8 100644 --- a/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/FlowActionCommitService.java +++ b/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/FlowActionCommitService.java @@ -1,16 +1,16 @@ -//package apx.com.amarsoft.als.business.action.submit.service; -// -//import java.util.Map; -// -//import javax.servlet.http.HttpServletRequest; -//import javax.ws.rs.core.Context; -// -//import com.amarsoft.are.jbo.JBOTransaction; -//import com.amarsoft.awe.util.Transaction; -//import com.base.util.ReturnMapUtil; -// -//public interface FlowActionCommitService { -// Map commit(@Context HttpServletRequest request, -// @Context Transaction sqlca, @Context JBOTransaction tx, -// ReturnMapUtil ReturnMapUtil) throws Exception; -//} +package apx.com.amarsoft.als.business.action.submit.service; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Context; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.awe.util.Transaction; +import com.base.util.ReturnMapUtil; + +public interface FlowActionCommitService { + Map commit(@Context HttpServletRequest request, + @Context Transaction sqlca, @Context JBOTransaction tx, + ReturnMapUtil ReturnMapUtil) throws Exception; +} diff --git a/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/impl/FlowActionCommitServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/impl/FlowActionCommitServiceImpl.java index 4e35ace86..7e680dfa7 100644 --- a/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/impl/FlowActionCommitServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/business/action/submit/service/impl/FlowActionCommitServiceImpl.java @@ -1,255 +1,259 @@ -//package apx.com.amarsoft.als.business.action.submit.service.impl; -// -//import java.util.Map; -// -//import javax.servlet.http.HttpServletRequest; -// -//import apx.com.amarsoft.als.base.flow.FlowTask; -//import apx.com.amarsoft.als.business.action.submit.service.FlowActionCommitService; -// -//import com.amarsoft.app.flow.FlowAction; -//import com.amarsoft.are.jbo.BizObject; -//import com.amarsoft.are.jbo.JBOTransaction; -//import com.amarsoft.are.lang.StringX; -//import com.amarsoft.awe.util.Transaction; -//import com.base.constant.RestfullConstant; -//import com.base.util.MultipartDataUtil; -//import com.base.util.ReturnMapUtil; -// -//public class FlowActionCommitServiceImpl implements FlowActionCommitService { -// private Map fieldMap; -// -// private String taskNo; // 流水号 -// -// private String message; -// private String phaseOpinion; -// private String phaseAction; -// private String nextPhaseInfo; -// private String isPool; -// -// public Map endMeetingTask(Transaction sqlca, -// JBOTransaction tx, ReturnMapUtil ReturnMapUtil) throws Exception { -// FlowAction FlowAction = new FlowAction(); -// FlowAction.setTaskNo(taskNo); -// FlowAction.endMeetingTask(tx); -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("SUCCESS").toString(), ""); -// return ReturnMapUtil.getReturnMap(); -// } -// -// public Map AssignedTaskNo(Transaction sqlca, -// JBOTransaction tx, ReturnMapUtil ReturnMapUtil) throws Exception { -// FlowAction FlowAction = new FlowAction(); -// FlowAction.setTaskNo(taskNo); -// FlowAction.setPhaseOpinion("null"); -// FlowAction.setPhaseAction("null"); -// FlowAction.submit(tx); -// String returnValue = FlowAction.submit(tx); -// -// if (StringX.isSpace(returnValue) || "undefined".equals(returnValue) -// || "null".equals(returnValue) || "_CANCEL_".equals(returnValue)) { -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("SUCCESS").toString(), -// returnValue); -// return ReturnMapUtil.getReturnMap(); -// } else if ("Success".toLowerCase().equals(returnValue.toLowerCase())) { -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("SUCCESS").toString(), -// returnValue); -// } else { -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("SUCCESS").toString(), -// returnValue); -// } -// return ReturnMapUtil.getReturnMap(); -// } -// -// @SuppressWarnings("unchecked") -// @Override -// public Map commit(HttpServletRequest request, -// Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil) -// throws Exception { -// -// Map testMap = (Map) MultipartDataUtil -// .readRequestParam(request, "UTF-8"); -// this.fieldMap = (Map) testMap.get("fieldMap"); -// -// String type = this.fieldMap.get("submittype") == null ? "" -// : this.fieldMap.get("submittype").toString(); -// -// FlowTask FlowTask = new FlowTask(); -// BizObject bo = FlowTask -// .queryFlowTask(request, sqlca, tx, this.fieldMap); -// if (null != bo) { -// this.taskNo = bo.getAttribute("SERIALNO") == null ? "" : bo -// .getAttribute("SERIALNO").toString(); -// } else { -// ReturnMapUtil.setReturnMap(null, -// (String) RestfullConstant.baseProperty.get("FAIL"), -// "请选择一条有效流程!"); -// return ReturnMapUtil.getReturnMap(); -// } -// String endTime = bo.getAttribute("ENDTIME") == null ? "" : bo.getAttribute("ENDTIME").toString(); -// if (!"".equals(endTime)) { -// message = "此流程任务已提交!"; -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("FAIL").toString(), -// message); -// return ReturnMapUtil.getReturnMap(); -// } -// -// switch (type) { -// case "1": -// return AssignedTaskNo(sqlca, tx, ReturnMapUtil); -// case "2": -// return endMeetingTask(sqlca, tx, ReturnMapUtil); -// } -// -// FlowAction FlowAction = new FlowAction(); -// FlowAction.setTaskNo(this.taskNo); -// String isCommited = FlowAction.isCommited(tx); -// -// if ("yes".equals(isCommited)) { -// message = "此流程任务已提交!"; -// } else { -// this.phaseOpinion = this.fieldMap.get("phaseopinion") == null ? "" -// : this.fieldMap.get("phaseopinion").toString(); -// -// this.phaseAction = this.fieldMap.get("phaseaction") == null ? "" -// : this.fieldMap.get("phaseaction").toString(); -// this.nextPhaseInfo = this.fieldMap.get("bodymessage") == null ? "" -// : this.fieldMap.get("bodymessage").toString(); -// if (StringX.isSpace(phaseOpinion)) { -// message = "请选择提交动作!"; -// } else { -// FlowAction.setPhaseOpinion(phaseOpinion); -// String nextPhaseAttrs = FlowAction.getNextPhaseAttr(tx); -// -// String[] nextPhases = nextPhaseAttrs.split("@"); -// -// String phaseAction = ""; -// -// phaseAction = getNextActionValue(nextPhases, FlowAction, tx); -// if (StringX.isSpace(phaseAction)) { -// message = "请选择提交用户信息!"; -// } else { -// FlowAction.setPhaseAction(phaseAction); -// String joinNode = FlowAction.isJoinNode(tx); -// -// if ("1".equals(joinNode)) {// 如果是join节点 -// String joinUserID = FlowAction.getJoinUser(tx); -// String curUserID = phaseAction.split(" ")[0]; -// if ((!curUserID.equals(joinUserID) && (!"" -// .equals(joinUserID)))) { -// message = "先前分支的提交人为" + joinUserID + ",请选择相同人员!"; -// } -// } -// String commitPeopleTip = ""; -// boolean bPool = Boolean.valueOf(isPool); -// if (bPool) {// 如果下一阶段是任务池,则提示 可以挑选任务的用户 -// String[] arr = phaseAction.split("@"); -// -// for (int i = 0; i < arr.length; i++) { -// String userID = arr[i].split(" ")[0]; -// if (userID.indexOf("|") > -1) {// 并行任务 -// String[] phaseUser = userID.split("|"); -// userID = "阶段:" + phaseUser[0] + "-用户:" -// + phaseUser[1]; -// } -// commitPeopleTip = commitPeopleTip + userID + " "; -// } -// } -// String readUserIds = ""; -// -// FlowAction.setTaskNo(this.taskNo); -// FlowAction.setPhaseOpinion(this.phaseOpinion); -// FlowAction.setPhaseAction(this.phaseAction); -// FlowAction.setNextPhaseInfo(nextPhaseInfo); -// FlowAction.setReadUserIds(readUserIds); -// FlowAction.setUserID(request.getSession() -// .getAttribute("userid").toString()); -// String returnValue = FlowAction.submit(tx); -// -// if (StringX.isSpace(returnValue) -// || "undefined".equals(returnValue) -// || "null".equals(returnValue) -// || "_CANCEL_".equals(returnValue)) { -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("SUCCESS") -// .toString(), ""); -// return ReturnMapUtil.getReturnMap(); -// } else if ("Success".toLowerCase().equals( -// returnValue.toLowerCase())) { -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("SUCCESS") -// .toString(), ""); -// return ReturnMapUtil.getReturnMap(); -// } else { -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("FAIL") -// .toString(), "提交失败!"); -// return ReturnMapUtil.getReturnMap(); -// } -// } -// } -// -// } -// -// if (!StringX.isSpace(message)) { -// ReturnMapUtil.setReturnMap(null, -// RestfullConstant.baseProperty.get("FAIL").toString(), -// message); -// } -// return ReturnMapUtil.getReturnMap(); -// } -// -// public String getNextActionValue(String[] nextPhases, -// FlowAction FlowAction, JBOTransaction tx) throws Exception { -// String phaseAction = ""; -// if (nextPhases.length == 1) { -// String nextPhaseDes = ""; -// nextPhaseDes = nextPhases[0].split(",")[2]; -// if ("POOL".equals(nextPhaseDes) || "FORK&POOL".equals(nextPhaseDes)) { -// phaseAction = FlowAction.getActionList(tx); -// } else if ("END".equals(nextPhaseDes)) { -// phaseAction = "system"; -// } else { -// phaseAction = this.phaseAction; -// } -// } else { -// String actionList = FlowAction.getActionList(tx); -// for (int i = 0; i < nextPhases.length; i++) { -// String mPhaseName = nextPhases[i].split(",")[1]; -// String mPhaseNo = nextPhases[i].split(",")[0]; -// String mPhaseDes = nextPhases[i].split(",")[2]; -// String mPhaseAction = ""; -// if ("POOL".equals(mPhaseDes) || "FORK&POOL".equals(mPhaseDes)) { -// for (int j = 0; j < actionList.split("@").length; j++) { -// String userIDStr = actionList.split("@")[j]; -// String userID = userIDStr.split(" ")[0]; -// if (userID.indexOf("|") > -1) { -// String phaseNo = userID.split("|")[0]; -// if (mPhaseNo.equals(phaseNo)) { -// mPhaseAction = mPhaseAction + "@" + userIDStr; -// } -// } -// } -// if (mPhaseAction.indexOf("@") > -1) -// mPhaseAction = mPhaseAction.substring(1); -// phaseAction += "@" + mPhaseAction; -// } else { -// mPhaseAction = this.phaseAction; -// phaseAction += "@" + mPhaseNo + "|" + mPhaseAction; -// } -// -// if (StringX.isSpace(mPhaseAction)) { -// message = "请选择" + mPhaseName + "用户!"; -// } -// } -// if (phaseAction.indexOf("@") > -1) -// phaseAction = phaseAction.substring(1); -// -// } -// return phaseAction; -// } -//} +package apx.com.amarsoft.als.business.action.submit.service.impl; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import apx.com.amarsoft.als.base.flow.FlowTask; +import apx.com.amarsoft.als.business.action.submit.service.FlowActionCommitService; + +import com.amarsoft.app.flow.FlowAction; +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.lang.StringX; +import com.amarsoft.awe.util.Transaction; +import com.base.constant.RestfullConstant; +import com.base.util.MultipartDataUtil; +import com.base.util.ReturnMapUtil; + +public class FlowActionCommitServiceImpl implements FlowActionCommitService { + private Map fieldMap; + + private String taskNo; // 流水号 + + private String message; + private String phaseOpinion; + private String phaseAction; + private String nodeType; + private String isPool; + + public Map endMeetingTask(Transaction sqlca, + JBOTransaction tx, ReturnMapUtil ReturnMapUtil) throws Exception { + FlowAction FlowAction = new FlowAction(); + FlowAction.setTaskNo(taskNo); + FlowAction.endMeetingTask(tx); + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("SUCCESS").toString(), ""); + return ReturnMapUtil.getReturnMap(); + } + + public Map AssignedTaskNo(Transaction sqlca, + JBOTransaction tx, ReturnMapUtil ReturnMapUtil) throws Exception { + FlowAction FlowAction = new FlowAction(); + FlowAction.setTaskNo(taskNo); + FlowAction.setPhaseOpinion("null"); + FlowAction.setPhaseAction("null"); + FlowAction.submit(tx); + String returnValue = FlowAction.submit(tx); + + if (StringX.isSpace(returnValue) || "undefined".equals(returnValue) + || "null".equals(returnValue) || "_CANCEL_".equals(returnValue)) { + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("SUCCESS").toString(), + returnValue); + return ReturnMapUtil.getReturnMap(); + } else if ("Success".toLowerCase().equals(returnValue.toLowerCase())) { + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("SUCCESS").toString(), + returnValue); + } else { + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("SUCCESS").toString(), + returnValue); + } + return ReturnMapUtil.getReturnMap(); + } + + @SuppressWarnings("unchecked") + @Override + public Map commit(HttpServletRequest request, + Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil) + throws Exception { + + Map testMap = (Map) MultipartDataUtil + .readRequestParam(request, "UTF-8"); + this.fieldMap = (Map) testMap.get("fieldMap"); + + String type = this.fieldMap.get("submittype") == null ? "" + : this.fieldMap.get("submittype").toString(); + + FlowTask FlowTask = new FlowTask(); + BizObject bo = FlowTask + .queryFlowTask(request, sqlca, tx, this.fieldMap); + if (null != bo) { + this.taskNo = bo.getAttribute("SERIALNO") == null ? "" : bo + .getAttribute("SERIALNO").toString(); + } else { + ReturnMapUtil.setReturnMap(null, + (String) RestfullConstant.baseProperty.get("FAIL"), + "请选择一条有效流程!"); + return ReturnMapUtil.getReturnMap(); + } + String endTime = bo.getAttribute("ENDTIME") == null ? "" : bo + .getAttribute("ENDTIME").toString(); + if (!"".equals(endTime)) { + message = "此流程任务已提交!"; + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("FAIL").toString(), + message); + return ReturnMapUtil.getReturnMap(); + } + + switch (type) { + case "1": + return AssignedTaskNo(sqlca, tx, ReturnMapUtil); + case "2": + return endMeetingTask(sqlca, tx, ReturnMapUtil); + } + + FlowAction FlowAction = new FlowAction(); + FlowAction.setTaskNo(this.taskNo); + String isCommited = FlowAction.isCommited(tx); + + if ("yes".equals(isCommited)) { + message = "此流程任务已提交!"; + } else { + this.phaseOpinion = this.fieldMap.get("phaseopinion") == null ? "" + : this.fieldMap.get("phaseopinion").toString(); + + this.phaseAction = this.fieldMap.get("phaseaction") == null ? "" + : this.fieldMap.get("phaseaction").toString(); + + this.nodeType = this.fieldMap.get("nodetype") == null ? "" + : this.fieldMap.get("nodetype").toString(); + + if (StringX.isSpace(phaseOpinion)) { + message = "请选择提交动作!"; + } else { + FlowAction.setPhaseOpinion(phaseOpinion); + String nextPhaseAttrs = FlowAction.getNextPhaseAttr(tx); + + String[] nextPhases = nextPhaseAttrs.split("@"); + + String phaseAction = ""; + + phaseAction = getNextActionValue(nextPhases, FlowAction, tx); + if (StringX.isSpace(phaseAction)) { + message = "请选择提交用户信息!"; + } else { + FlowAction.setPhaseAction(phaseAction); + String joinNode = FlowAction.isJoinNode(tx); + + if ("1".equals(joinNode)) {// 如果是join节点 + String joinUserID = FlowAction.getJoinUser(tx); + String curUserID = phaseAction.split(" ")[0]; + if ((!curUserID.equals(joinUserID) && (!"" + .equals(joinUserID)))) { + message = "先前分支的提交人为" + joinUserID + ",请选择相同人员!"; + } + } + String commitPeopleTip = ""; + boolean bPool = Boolean.valueOf(isPool); + if (bPool) {// 如果下一阶段是任务池,则提示 可以挑选任务的用户 + String[] arr = phaseAction.split("@"); + + for (int i = 0; i < arr.length; i++) { + String userID = arr[i].split(" ")[0]; + if (userID.indexOf("|") > -1) {// 并行任务 + String[] phaseUser = userID.split("|"); + userID = "阶段:" + phaseUser[0] + "-用户:" + + phaseUser[1]; + } + commitPeopleTip = commitPeopleTip + userID + " "; + } + } + String readUserIds = ""; + + FlowAction.setTaskNo(this.taskNo); + FlowAction.setPhaseOpinion(this.phaseOpinion); + FlowAction.setPhaseAction(this.phaseAction); + FlowAction.setReadUserIds(readUserIds); + FlowAction.setUserID(request.getSession() + .getAttribute("userid").toString()); + FlowAction.setNextNodeType(this.nodeType); + + String returnValue = FlowAction.submit(tx); + + if (StringX.isSpace(returnValue) + || "undefined".equals(returnValue) + || "null".equals(returnValue) + || "_CANCEL_".equals(returnValue)) { + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("SUCCESS") + .toString(), ""); + return ReturnMapUtil.getReturnMap(); + } else if ("Success".toLowerCase().equals( + returnValue.toLowerCase())) { + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("SUCCESS") + .toString(), ""); + return ReturnMapUtil.getReturnMap(); + } else { + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("FAIL") + .toString(), "提交失败!"); + return ReturnMapUtil.getReturnMap(); + } + } + } + + } + + if (!StringX.isSpace(message)) { + ReturnMapUtil.setReturnMap(null, + RestfullConstant.baseProperty.get("FAIL").toString(), + message); + } + return ReturnMapUtil.getReturnMap(); + } + + public String getNextActionValue(String[] nextPhases, + FlowAction FlowAction, JBOTransaction tx) throws Exception { + String phaseAction = ""; + if (nextPhases.length == 1) { + String nextPhaseDes = ""; + nextPhaseDes = nextPhases[0].split(",")[2]; + if ("POOL".equals(nextPhaseDes) || "FORK&POOL".equals(nextPhaseDes)) { + phaseAction = FlowAction.getActionList(tx); + } else if ("END".equals(nextPhaseDes)) { + phaseAction = "system"; + } else { + phaseAction = this.phaseAction; + } + } else { + String actionList = FlowAction.getActionList(tx); + for (int i = 0; i < nextPhases.length; i++) { + String mPhaseName = nextPhases[i].split(",")[1]; + String mPhaseNo = nextPhases[i].split(",")[0]; + String mPhaseDes = nextPhases[i].split(",")[2]; + String mPhaseAction = ""; + if ("POOL".equals(mPhaseDes) || "FORK&POOL".equals(mPhaseDes)) { + for (int j = 0; j < actionList.split("@").length; j++) { + String userIDStr = actionList.split("@")[j]; + String userID = userIDStr.split(" ")[0]; + if (userID.indexOf("|") > -1) { + String phaseNo = userID.split("|")[0]; + if (mPhaseNo.equals(phaseNo)) { + mPhaseAction = mPhaseAction + "@" + userIDStr; + } + } + } + if (mPhaseAction.indexOf("@") > -1) + mPhaseAction = mPhaseAction.substring(1); + phaseAction += "@" + mPhaseAction; + } else { + mPhaseAction = this.phaseAction; + phaseAction += "@" + mPhaseNo + "|" + mPhaseAction; + } + + if (StringX.isSpace(mPhaseAction)) { + message = "请选择" + mPhaseName + "用户!"; + } + } + if (phaseAction.indexOf("@") > -1) + phaseAction = phaseAction.substring(1); + + } + return phaseAction; + } +} diff --git a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java index 2bfb5e1eb..7d35c0c3e 100644 --- a/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/currency/select/apzl/product/service/impl/SelectProductAttributeServiceImpl.java @@ -185,10 +185,10 @@ public class SelectProductAttributeServiceImpl implements ListLibrary.add(mapLibrary2); ListLibrary.add(mapLibrary3); + // 字段入记录 记录添加集合 + row.put("row", ListLibrary); + rows.add(row); } - // 字段入记录 记录添加集合 - row.put("row", ListLibrary); - rows.add(row); // map.put("product", rows); // ListCatalog2.add(map);