From 1cb428ce50ebe222aa820c4dafd9f774a686a1b7 Mon Sep 17 00:00:00 2001 From: liujiaji Date: Thu, 21 Jun 2018 13:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=8F=91=E8=B5=B7=20?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apply/business/start/bo/BusinessBO.java | 111 ++++++++++++------ .../impl/BusinessApplyStartServiceImpl.java | 33 +++--- .../method/BusinessCustomerMethod.java | 22 ++++ .../als/base/awe/select/SelectCatalogWin.java | 7 +- 4 files changed, 119 insertions(+), 54 deletions(-) create mode 100644 src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java index b0d08abcb..664e89186 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java @@ -1,8 +1,16 @@ package apx.com.amarsoft.als.apzl.apply.business.start.bo; +import java.io.Serializable; +import java.util.HashMap; import java.util.Map; -public class BusinessBO { +import net.sf.json.JSONObject; + + +public class BusinessBO implements Serializable { + + private static final long serialVersionUID = -25060991874562555L; + private String carAttributes; // 车辆属性 private String leasehold; // 租赁方式 private String productModel; // 品牌选择 @@ -15,6 +23,10 @@ public class BusinessBO { private String customerType; // 客户类别 private String certtype; // 证件类型 private String certid; // 证件号码 + + private String curUserId; + + private String fixedFlowParam; public void setParam(Map fieldMap, String param, Object obj) { obj = fieldMap.get(param.toLowerCase()) == null ? null : fieldMap.get( @@ -22,43 +34,54 @@ public class BusinessBO { } public BusinessBO(Map fieldMap) { - // setParam(fieldMap, "carAttributes", this.carAttributes); - // setParam(fieldMap, "leasehold", this.leasehold); - // setParam(fieldMap, "productModel", this.productModel); - // setParam(fieldMap, "carSeries", this.carSeries); - // setParam(fieldMap, "carSystem", this.carSystem); - // setParam(fieldMap, "productId", this.productId); - // setParam(fieldMap, "productName", this.productName); - // setParam(fieldMap, "CUSTOMERID", this.CUSTOMERID); - // setParam(fieldMap, "CUSTOMERNAME", this.CUSTOMERNAME); - // setParam(fieldMap, "customerType", this.customerType); - // setParam(fieldMap, "certtype", this.certtype); - // setParam(fieldMap, "certid", this.certid); - - this.carAttributes = fieldMap.get("carAttributes".toLowerCase()) == null ? null - : fieldMap.get("carAttributes".toLowerCase()).toString(); - this.leasehold = fieldMap.get("leasehold".toLowerCase()) == null ? null - : fieldMap.get("leasehold".toLowerCase()).toString(); - this.productModel = fieldMap.get("productModel".toLowerCase()) == null ? null - : fieldMap.get("productModel".toLowerCase()).toString(); - this.carSeries = fieldMap.get("carSeries".toLowerCase()) == null ? null - : fieldMap.get("carSeries".toLowerCase()).toString(); - this.carSystem = fieldMap.get("carSystem".toLowerCase()) == null ? null - : fieldMap.get("carSystem".toLowerCase()).toString(); + this.carAttributes = fieldMap.get("carAttributes".toLowerCase()) == null ? "1" + : fieldMap.get("carAttributes".toLowerCase()).toString(); // 车辆属性 1,新车,2,二手车 + this.leasehold = fieldMap.get("leasehold".toLowerCase()) == null ? "3" + : fieldMap.get("leasehold".toLowerCase()).toString(); // 租赁方式 3,直租,4,回租 + this.productModel = fieldMap.get("productModel".toLowerCase()) == null ? "DefaultCarBrand" + : fieldMap.get("productModel".toLowerCase()).toString(); // 品牌 + this.carSeries = fieldMap.get("carSeries".toLowerCase()) == null ? "DefaultCarSeries" + : fieldMap.get("carSeries".toLowerCase()).toString(); // 车系 + this.carSystem = fieldMap.get("carSystem".toLowerCase()) == null ? "DefaultCarSystem" + : fieldMap.get("carSystem".toLowerCase()).toString(); // 车型 this.productId = fieldMap.get("productId".toLowerCase()) == null ? null - : fieldMap.get("productId".toLowerCase()).toString(); - this.productName = fieldMap.get("productName".toLowerCase()) == null ? null - : fieldMap.get("productName".toLowerCase()).toString(); + : fieldMap.get("productId".toLowerCase()).toString(); // 产品类型 + this.productName = fieldMap.get("productName".toLowerCase()) == null ? "DefaultProduct" + : fieldMap.get("productName".toLowerCase()).toString(); // 产品名称 this.CUSTOMERID = fieldMap.get("CUSTOMERID".toLowerCase()) == null ? null - : fieldMap.get("CUSTOMERID".toLowerCase()).toString(); - this.CUSTOMERNAME = fieldMap.get("CUSTOMERNAME".toLowerCase()) == null ? null - : fieldMap.get("CUSTOMERNAME".toLowerCase()).toString(); - this.customerType = fieldMap.get("customerType".toLowerCase()) == null ? null - : fieldMap.get("customerType".toLowerCase()).toString(); - this.certtype = fieldMap.get("certtype".toLowerCase()) == null ? null - : fieldMap.get("certtype".toLowerCase()).toString(); - this.certid = fieldMap.get("certid".toLowerCase()) == null ? null - : fieldMap.get("certid".toLowerCase()).toString(); + : fieldMap.get("CUSTOMERID".toLowerCase()).toString(); // 客户编号 + this.CUSTOMERNAME = fieldMap.get("CUSTOMERNAME".toLowerCase()) == null ? "DefaultUser" + : fieldMap.get("CUSTOMERNAME".toLowerCase()).toString(); // 客户名称 + this.customerType = fieldMap.get("customerType".toLowerCase()) == null ? "03" + : fieldMap.get("customerType".toLowerCase()).toString(); // 客户类型 01,法人,03,个人 + this.certtype = "01".equals(this.customerType) ? "Ent02" : "Ind01"; // 证件类型 Ent02,组织机构号,Ind01,身份证 + this.certid = fieldMap.get("certid".toLowerCase()) == null ? "" + : fieldMap.get("certid".toLowerCase()).toString(); // 证件号 + + this.curUserId = fieldMap.get("userid".toLowerCase()) == null ? "" + : fieldMap.get("userid".toLowerCase()).toString(); // 证件号 + + Map map = new HashMap(); + + map.put("ProductId", productId); + map.put("ProductName", productName); + + map.put("ApplyType", "BusinessApplyApply"); + map.put("CurUserID", curUserId); + map.put("leasehold", leasehold); + + map.put("productModel", productModel); + map.put("carSeries", carSeries); + map.put("carAttributes", carAttributes); + map.put("carSystem", carSystem); + + map.put("CustomerType", customerType); + map.put("certid", certid); + map.put("certtype", certtype); + map.put("custname", CUSTOMERNAME); + + JSONObject jsonObject = JSONObject.fromObject(map); + this.fixedFlowParam = jsonObject.toString(); } public String getCarAttributes() { @@ -156,4 +179,20 @@ public class BusinessBO { public void setCertid(String certid) { this.certid = certid; } + + public String getFixedFlowParam() { + return fixedFlowParam; + } + + public void setFixedFlowParam(String fixedFlowParam) { + this.fixedFlowParam = fixedFlowParam; + } + + public String getCurUserId() { + return curUserId; + } + + public void setCurUserId(String curUserId) { + this.curUserId = curUserId; + } } 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 40d80b0a5..c3b0992a0 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 @@ -6,17 +6,16 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; 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 com.amarsoft.are.jbo.JBOTransaction; import com.amarsoft.awe.util.Transaction; import com.base.constant.RestfullConstant; import com.base.util.MultipartDataUtil; import com.base.util.ReturnMapUtil; -import com.tenwa.flow.action.comm.CommonAction; import com.tenwa.lease.flow.project.projectapproval.BusinessApprovalStartAction; -import apx.com.amarsoft.als.apzl.apply.business.start.bo.BusinessBO; -import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService; - public class BusinessApplyStartServiceImpl implements BusinessApplyStartService { private Map fieldMap; @@ -34,26 +33,26 @@ 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); -// FixedFlowParam:{'ApplyType':'BusinessApplyApply'@'CurUserID':'administrator'@'ProductId':'004'@'ProductName':'融资租赁产品(汽车业务)'@'CustomerType':'03'@'carAttributes':'1'@'leasehold':'1'@'carSystem':'2016款 华凯皮卡 2.8T豪华型短轴JE493ZQ8'} -// ProductId:004 - String param = "{'ApplyType':'"+applyType+"'@'CurUserID':'" - + uid + "'" + "@'ProductId':'" + bo.getProductId() + "'" - + "@'ProductName':'" + bo.getProductName() + "'" - + "@'CustomerType':'" + bo.getCustomerType() + "'" - + "@'carAttributes':'" + bo.getCarAttributes() + "'" - + "@'leasehold':'" + bo.getLeasehold() + "'@'carSystem':'" - + bo.getCarSystem() + "'}"; + + BusinessApprovalStartAction.setFixedFlowParam(bo.getFixedFlowParam()); + + // 产品租赁信息 BusinessApprovalStartAction.setProductID(bo.getProductId()); - BusinessApprovalStartAction.setCarAttributes(bo.getCarAttributes()); + 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.setFixedFlowParam(param); - BusinessApprovalStartAction.setProductId(bo.getProductId()); - //用户信息 + + // 用户信息 BusinessApprovalStartAction.setCertid(bo.getCertid()); + BusinessApprovalStartAction.setCerttype(bo.getCerttype()); BusinessApprovalStartAction.setCustname(bo.getCUSTOMERNAME()); BusinessApprovalStartAction.setCustomerType(bo.getCustomerType()); diff --git a/src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java b/src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java new file mode 100644 index 000000000..94d36b798 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/base/awe/execute/method/BusinessCustomerMethod.java @@ -0,0 +1,22 @@ +package apx.com.amarsoft.als.base.awe.execute.method; + +import jbo.app.tenwa.customer.CUSTOMER_CERT; + +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.amarsoft.are.jbo.JBOTransaction; + +public class BusinessCustomerMethod { + + public String getCustomerIdByCertId(String certId) throws JBOException { + BizObjectManager bom = JBOFactory + .getBizObjectManager(CUSTOMER_CERT.CLASS_NAME); + BizObject bo = bom.createQuery("certid=:certid and certtype='Ind01'") + .setParameter("certid", certId).getSingleResult(false); + if (null == bo) + return ""; + return bo.getAttribute("customerid").toString(); + } +} diff --git a/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java b/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java index cbabdb902..b30bf3742 100644 --- a/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java +++ b/src_app_fresh/apx/com/amarsoft/als/base/awe/select/SelectCatalogWin.java @@ -290,7 +290,12 @@ public class SelectCatalogWin { } } // 显示名 , - col.put("display", aSelFieldName[i-1]); + try { + col.put("display", aSelFieldName[i-1]); + } catch (Exception e) { + ARE.getLog().error(e); + col.put("display", ""); + } colList.add(col); } row.put("row", colList);