diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/init/InitDocListTools.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/init/InitDocListTools.java new file mode 100644 index 000000000..6074355d7 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/init/InitDocListTools.java @@ -0,0 +1,98 @@ +package apx.com.amarsoft.als.apzl.apply.business.start.init; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT; +import jbo.sys.FLOW_OBJECT; + +import com.amarsoft.app.lc.workflow.action.GetFlowAction; +import com.amarsoft.app.util.ProductParamUtil; +import com.amarsoft.are.ARE; +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.util.StringFunction; +import com.amarsoft.awe.Configure; +import com.amarsoft.context.ASUser; +import com.tenwa.doc.action.DocListInitAction; + +public class InitDocListTools { + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static void initDocList(String flowUnid, String userId, String carAttributes) throws Exception { + BizObjectManager objectManage = JBOFactory + .getBizObjectManager(FLOW_OBJECT.CLASS_NAME); + BizObject object = objectManage.createQuery("OBJECTNO=:OBJECTNO") + .setParameter("OBJECTNO", flowUnid).getSingleResult(false); + if (null == object) + return; + String flowNo = object.getAttribute("flowno") == null ? "" : object + .getAttribute("flowno").toString(); + String sObjectType = object.getAttribute("ObjectType") == null ? "" + : object.getAttribute("ObjectType").toString(); + String productId = ""; + BizObject flow = GetFlowAction.getFlowBussinessObject(flowUnid); + if (null == flow) + return; + productId = flow.getAttribute("productId").getString(); + + BizObjectManager businessManage = JBOFactory + .getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME); + BizObject business = businessManage.createQuery("flow_unid=:flow_unid") + .setParameter("flow_unid", flowUnid).getSingleResult(false); + if (null == business) + return; + List list; + try { + list = ProductParamUtil.getProductDocInfo(productId, "PRD0412"); + } catch (Exception e) { + ARE.getLog().error(e); + return; + } + String type = ""; + String docList = ""; + for (int i = 0; i < list.size(); i++) { + Map map = (Map) list.get(i); + if ("BusinessApplyFlow".equals(map.get("FLOW_INFO").toString())) { + type = map.get("TYPE").toString(); + if ("SingleRow".equals(type)) { + docList = map.get("DOCLIST").toString(); + } else { + List l = (List) map.get("DOCCONFIG"); + docList = l.toString(); + } + } + } + String docClassItemno = docList;// CurPage.getParameter("docList"); + String[] itemnos=docClassItemno.split(","); + String s=""; + for(int i=0;i0){ + s=s.substring(0, s.length()-1); + } + + try { + ASUser CurUser = new ASUser(userId); + Map docParam=new HashMap(); + Map other=new HashMap(); + other.put("carAttributes", carAttributes); + docParam.put("ObjectType",sObjectType); + docParam.put("proj_id", flow.getAttribute("proj_id").getString()); + docParam.put("contract_id", flow.getAttribute("contract_id").getString()); + docParam.put("flow_unid", flowUnid); + docParam.put("inputtime", StringFunction.getTodayNow()); + docParam.put("inputuserid", CurUser.getUserID()); + docParam.put("inputorgid", CurUser.getOrgID()); + @SuppressWarnings("deprecation") + Configure CurConfig = Configure.getInstance(); + //判断是否存在,不存在就从配置表倒到临时表 + DocListInitAction.initDocList(docParam,other,docClassItemno,CurConfig); + } catch (Exception e) { + ARE.getLog().error(e); + return; + } + } +} 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 b1e7556a2..79b35be73 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 @@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse; import apx.com.amarsoft.als.apzl.apply.business.start.bo.BusinessBO; import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService; +import apx.com.amarsoft.als.apzl.apply.business.start.init.InitDocListTools; import com.amarsoft.are.jbo.JBOTransaction; import com.amarsoft.awe.util.Transaction; @@ -27,7 +28,7 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService .readRequestParam(request, "UTF-8"); fieldMap = (Map) testMap.get("fieldMap"); BusinessBO bo = new BusinessBO(fieldMap, tx); - + tx.commit(); String sReturnInfo = bo.getMsg(); if (sReturnInfo.startsWith("success")) { String serialNo = sReturnInfo.split("@")[1]; @@ -43,6 +44,7 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService ReturnMapUtil.setReturnMap(body, RestfullConstant.baseProperty.get("success").toString(), "发起成功"); + InitDocListTools.initDocList(params.get("FlowUnid"), fieldMap.get("userid").toString(), bo.getCarAttributes()); } else if (sReturnInfo.startsWith("failed")) { ReturnMapUtil.setReturnMap(null, RestfullConstant.baseProperty.get("FAIL").toString(), diff --git a/src_app_fresh/apx/com/amarsoft/als/business/action/service/DoSubmitService.java b/src_app_fresh/apx/com/amarsoft/als/business/action/service/DoSubmitService.java index 3640467b5..7aaec4ea7 100644 --- a/src_app_fresh/apx/com/amarsoft/als/business/action/service/DoSubmitService.java +++ b/src_app_fresh/apx/com/amarsoft/als/business/action/service/DoSubmitService.java @@ -363,20 +363,31 @@ public class DoSubmitService { mMap.put("nodeType", joNodeType); mMap.put("headMessage", headMessage); mMap.put("flowUserOperatorType", joFlowUserOperatorType); - String [] vUser = joUserInfo.split("@"); - if (!"01".equals(joFlowUserOperatorType)) { type = "checkBox"; } mMap.put("type", type); List> list = new ArrayList>(); - for (int i=0; i < vUser.length; i ++) { + if(StringX.isSpace(joUserInfo.trim())) { Map map = new HashMap(); - String [] vUserinfo=vUser[i].split(" "); - map.put("userId", vUser[i]); - map.put("userName", vUserinfo[1]); + map.put("userId", ""); + map.put("userName", ""); list.add(map); + } else { + String [] vUser = joUserInfo.split("@"); + + + + for (int i=0; i < vUser.length; i ++) { + Map map = new HashMap(); + String [] vUserinfo=vUser[i].split(" "); + map.put("userId", vUser[i]); + map.put("userName", vUserinfo[1]); + list.add(map); + } } + + mMap.put("userInfo", list); list2.add(mMap); }