根据客户类型 加载附件库

This commit is contained in:
liujiaji 2018-08-21 14:49:45 +08:00
parent 6da3fab81f
commit 79ab4580d2
2 changed files with 80 additions and 52 deletions

View File

@ -6,6 +6,7 @@ import java.util.Map;
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
import jbo.sys.FLOW_OBJECT;
import apx.com.amarsoft.als.base.awe.execute.method.BusinessCustomerMethod;
import com.amarsoft.app.lc.workflow.action.GetFlowAction;
import com.amarsoft.app.util.ProductParamUtil;
@ -19,16 +20,18 @@ import com.amarsoft.context.ASUser;
import com.tenwa.doc.action.DocListInitAction;
public class InitDocListTools {
@SuppressWarnings({ "unchecked", "rawtypes" })
public static String getdocClassItemno (List<Object> list, String flowInfo) {
String s="";
public static String getdocClassItemno(List<Object> list, String flowInfo) {
String s = "";
String type = "";
String docList = "";
try {
for (int i = 0; i < list.size(); i++) {
Map<String, Object> map = (Map<String, Object>) list.get(i);
// if ("BusinessApplyFlow".equals(map.get("FLOW_INFO").toString())) {
// if
// ("BusinessApplyFlow".equals(map.get("FLOW_INFO").toString()))
// {
if (flowInfo.equals(map.get("FLOW_INFO").toString())) {
type = map.get("TYPE").toString();
if ("SingleRow".equals(type)) {
@ -40,22 +43,23 @@ public class InitDocListTools {
}
}
String docClassItemno = docList;// CurPage.getParameter("docList");
String[] itemnos=docClassItemno.split(",");
for(int i=0;i<itemnos.length;i++){
s+="'"+itemnos[i]+"',";
String[] itemnos = docClassItemno.split(",");
for (int i = 0; i < itemnos.length; i++) {
s += "'" + itemnos[i] + "',";
}
if(s.length()>0){
s=s.substring(0, s.length()-1);
if (s.length() > 0) {
s = s.substring(0, s.length() - 1);
}
return s+"@"+docClassItemno;
return s + "@" + docClassItemno;
} catch (Exception e) {
ARE.getLog().error(e);
}
return "";
}
public static boolean initDocList(String flowUnid, String userId, String carAttributes, String flowInfo) throws Exception {
public static boolean initDocList(String flowUnid, String userId,
String carAttributes, String flowInfo) throws Exception {
try {
BizObjectManager objectManage = JBOFactory
.getBizObjectManager(FLOW_OBJECT.CLASS_NAME);
@ -63,10 +67,11 @@ public class InitDocListTools {
.setParameter("OBJECTNO", flowUnid).getSingleResult(false);
if (null == object)
return false;
String sObjectType = object.getAttribute("flowno") == null ? "" : object
.getAttribute("flowno").toString();
// String sObjectType = object.getAttribute("ObjectType") == null ? ""
// : object.getAttribute("ObjectType").toString();
String sObjectType = 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)
@ -75,7 +80,8 @@ public class InitDocListTools {
BizObjectManager businessManage = JBOFactory
.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME);
BizObject business = businessManage.createQuery("flow_unid=:flow_unid")
BizObject business = businessManage
.createQuery("flow_unid=:flow_unid")
.setParameter("flow_unid", flowUnid).getSingleResult(false);
if (null == business)
return false;
@ -86,29 +92,31 @@ public class InitDocListTools {
ARE.getLog().error(e);
return false;
}
// String type = "";
// String docList = "";
// for (int i = 0; i < list.size(); i++) {
// Map<String, Object> map = (Map<String, Object>) 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;i<itemnos.length;i++){
// s+="'"+itemnos[i]+"',";
// }
// if(s.length()>0){
// s=s.substring(0, s.length()-1);
// }
// String type = "";
// String docList = "";
// for (int i = 0; i < list.size(); i++) {
// Map<String, Object> map = (Map<String, Object>) 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;i<itemnos.length;i++){
// s+="'"+itemnos[i]+"',";
// }
// if(s.length()>0){
// s=s.substring(0, s.length()-1);
// }
String s1 = getdocClassItemno(list, flowInfo);
String s = "";
String docClassItemno = "";
@ -118,20 +126,34 @@ public class InitDocListTools {
}
try {
ASUser CurUser = new ASUser(userId);
Map<String,String> docParam=new HashMap<String,String>();
Map<String,String> other=new HashMap<String,String>();
Map<String, String> docParam = new HashMap<String, String>();
Map<String, String> other = new HashMap<String, String>();
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("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());
String customerType = "";
BusinessCustomerMethod method = new BusinessCustomerMethod();
BizObject customerInfo = method
.getCustomerInfoByFlowUnid(flowUnid);
if (null != customerInfo) {
customerType = customerInfo.getAttribute("CUSTOMERTYPE") == null ? ""
: customerInfo.getAttribute("CUSTOMERTYPE")
.toString();
}
other.put("customerType", customerType);
@SuppressWarnings("deprecation")
Configure CurConfig = Configure.getInstance();
//判断是否存在不存在就从配置表倒到临时表
DocListInitAction.initDocList(docParam,other,docClassItemno,CurConfig);
// 判断是否存在不存在就从配置表倒到临时表
DocListInitAction.initDocList(docParam, other, docClassItemno,
CurConfig);
} catch (Exception e) {
ARE.getLog().error(e);
return false;

View File

@ -1,16 +1,13 @@
package apx.com.amarsoft.als.base.awe.execute.method;
import net.sf.json.JSONObject;
import jbo.app.CUSTOMER_INFO;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.base.util.JsonUtil;
public class BusinessCustomerMethod {
@ -48,6 +45,15 @@ public class BusinessCustomerMethod {
.getAttribute("customer_id").toString();
return customerId;
}
public BizObject getCustomerInfoByFlowUnid(String flowUnid) throws JBOException {
String CustomerId = getCustomerIdByFlowUnid(flowUnid);
BizObjectManager customerInfoManage = JBOFactory.getBizObjectManager(CUSTOMER_INFO.CLASS_NAME);
return customerInfoManage.createQuery("customerid=:customerid")
.setParameter("customerid", CustomerId).getSingleResult(false);
}
/**
* 根据流程编号获取客户IDCUSTOMER_PERSON_TEMP表中ID流程编号均不唯一