From 7fae9a577874b551b587f73efccb635cd0f2907f Mon Sep 17 00:00:00 2001 From: liujiaji Date: Wed, 15 Aug 2018 13:27:37 +0800 Subject: [PATCH] BUG --- .../impl/BusinessDocDetailServiceImpl.java | 2 +- .../service/impl/PayDocListServiceImpl.java | 4 +- .../manage/CustomerInfoTempDoQueryManage.java | 79 +++++++++++++++++++ .../business/start/init/InitDocListTools.java | 9 ++- .../impl/BusinessApplyStartServiceImpl.java | 2 +- .../base/awe/AbstractAweDoQueryManage.java | 3 +- .../als/base/awe/util/AweDoCommUtil.java | 16 ++-- 7 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/query/manage/CustomerInfoTempDoQueryManage.java diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/BusinessDocDetailServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/BusinessDocDetailServiceImpl.java index 7ab427f21..1c8bb9814 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/BusinessDocDetailServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/BusinessDocDetailServiceImpl.java @@ -109,7 +109,7 @@ public class BusinessDocDetailServiceImpl implements BusinessDocDetailService { // 加载附件 // carAttributes - boolean flag = InitDocListTools.initDocList(flowUnid, fieldMap.get("userid").toString(), carAttributes); + boolean flag = InitDocListTools.initDocList(flowUnid, fieldMap.get("userid").toString(), carAttributes, "BusinessApplyFlow"); BizObjectManager businessManage = JBOFactory .getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME); diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/PayDocListServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/PayDocListServiceImpl.java index 10269cb61..819df6424 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/PayDocListServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/detail/service/impl/PayDocListServiceImpl.java @@ -41,7 +41,7 @@ public class PayDocListServiceImpl implements PayDocListService { fieldMap.put("FLOWUNID".toLowerCase(), objectNo); fieldMap.put("FLOW_UNID", objectNo); fieldMap.put("FLOW_UNID".toLowerCase(), objectNo); - + InitDocListTools.initDocList(objectNo, fieldMap.get("userid").toString(), null, "BContractSupportFlow"); String otherWhere = ""; BizObject flow=GetFlowAction.getFlowBussinessObject(objectNo);//流程对象 String productId = flow.getAttribute("productId").getString(); @@ -54,7 +54,7 @@ public class PayDocListServiceImpl implements PayDocListService { } String s = ""; try { - s = InitDocListTools.getdocClassItemno(list); + s = InitDocListTools.getdocClassItemno(list, "BContractSupportFlow"); if (!StringX.isSpace(s)) { s = s.split("@")[0]; } diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/query/manage/CustomerInfoTempDoQueryManage.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/query/manage/CustomerInfoTempDoQueryManage.java new file mode 100644 index 000000000..e3b683625 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/query/manage/CustomerInfoTempDoQueryManage.java @@ -0,0 +1,79 @@ +package apx.com.amarsoft.als.apzl.apply.business.query.manage; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP; +import apx.com.amarsoft.als.base.awe.AbstractAweDoQueryManage; +import apx.com.amarsoft.als.base.awe.execute.method.BusinessCustomerMethod; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.lang.StringX; +import com.amarsoft.awe.util.Transaction; +import com.base.util.ReturnMapUtil; + +public class CustomerInfoTempDoQueryManage extends AbstractAweDoQueryManage { + private String sAddWhere; + private String dono; + private Map fieldMap; + + public void setFieldMap(Map fieldMap) { + this.fieldMap = fieldMap; + } + + public void setDono(String dono) { + this.dono = dono; + } + + public void getGroupId() { + sGroupId = this.dono; + } + + public void getOtherWhere() { + super.sOtherWhere = StringX.isSpace(sAddWhere) ? "" + : this.sAddWhere; + } + + public void setsAddWhere(String sAddWhere) { + this.sAddWhere = sAddWhere; + } + + public Map queryDefaultDo(HttpServletRequest request, + Transaction sqlca, JBOTransaction tx, ReturnMapUtil ReturnMapUtil) + throws Exception { + + String flowUnid = fieldMap.get("objectno") == null ? "" : fieldMap.get( + "objectno").toString(); + + fieldMap.put("flowUnid".toLowerCase(), flowUnid); + fieldMap.put("flowUnid".toUpperCase(), flowUnid); + fieldMap.put("flow_Unid".toLowerCase(), flowUnid); + fieldMap.put("flow_Unid".toUpperCase(), flowUnid); + fieldMap.put("objectno".toLowerCase(), flowUnid); + fieldMap.put("objectno".toUpperCase(), flowUnid); + BusinessCustomerMethod mm = new BusinessCustomerMethod(); + String customerId = mm.getCustomerIdByFlowUnid(flowUnid); + BizObjectManager bom = JBOFactory + .getBizObjectManager(CUSTOMER_INFO_TEMP.CLASS_NAME); + String customerType = ((BizObject) bom + .createQuery("customerid=:customerid") + .setParameter("customerid", customerId).getResultList(false).get(0)) + .getAttribute("CUSTOMERTYPE").toString(); + fieldMap.put("customerid".toLowerCase(), customerId); + fieldMap.put("customerid".toUpperCase(), customerId); + + dono = ""; + if ("01".equals(customerType)) { + dono = "AppBusinessApplyInfo3"; + } else if ("03".equals(customerType)) { + dono = "AppBusinessApplyInfo2"; + } + + setParamMap(fieldMap); + return getData(request, sqlca, tx, ReturnMapUtil); + } +} \ No newline at end of file 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 index e41398da9..ce9eee364 100644 --- 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 @@ -21,14 +21,15 @@ import com.tenwa.doc.action.DocListInitAction; public class InitDocListTools { @SuppressWarnings({ "unchecked", "rawtypes" }) - public static String getdocClassItemno (List list) { + public static String getdocClassItemno (List list, String flowInfo) { String s=""; String type = ""; String docList = ""; try { for (int i = 0; i < list.size(); i++) { Map map = (Map) 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)) { docList = map.get("DOCLIST").toString(); @@ -54,7 +55,7 @@ public class InitDocListTools { return ""; } - public static boolean initDocList(String flowUnid, String userId, String carAttributes) 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); @@ -108,7 +109,7 @@ public class InitDocListTools { // if(s.length()>0){ // s=s.substring(0, s.length()-1); // } - String s1 = getdocClassItemno(list); + String s1 = getdocClassItemno(list, flowInfo); String s = ""; String docClassItemno = ""; if (s1.length() > 0) { 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 c0ebfa16a..6ea89b581 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 @@ -48,7 +48,7 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService Map params = bo.getParams(); // 加载附件 boolean flag = InitDocListTools.initDocList(params.get("FlowUnid"), - fieldMap.get("userid").toString(), bo.getCarAttributes()); + fieldMap.get("userid").toString(), bo.getCarAttributes(), "BusinessApplyFlow"); String certType = bo.getCerttype(); String date = DateUtil.getDateTime(new Date()); diff --git a/src_app_fresh/apx/com/amarsoft/als/base/awe/AbstractAweDoQueryManage.java b/src_app_fresh/apx/com/amarsoft/als/base/awe/AbstractAweDoQueryManage.java index e9b7f9526..05a4a4780 100644 --- a/src_app_fresh/apx/com/amarsoft/als/base/awe/AbstractAweDoQueryManage.java +++ b/src_app_fresh/apx/com/amarsoft/als/base/awe/AbstractAweDoQueryManage.java @@ -643,7 +643,7 @@ public abstract class AbstractAweDoQueryManage extends AbstractAweDoHandler { if (this.sJboGroup == null) this.sJboGroup = (donoMap.get("JBOGROUP".toLowerCase()) == null ? "" : donoMap.get("JBOGROUP".toLowerCase()).toString()).trim(); - this.sJboWhere = AweDoCommUtil.whereHandle(sJboWhere, paramMap); +// this.sJboWhere = AweDoCommUtil.whereHandle(sJboWhere, paramMap); if (this.sJboWhere.length() > 0) { this.sJboWhere = " WHERE " + this.sJboWhere; } @@ -657,6 +657,7 @@ public abstract class AbstractAweDoQueryManage extends AbstractAweDoHandler { String sSql = "SELECT " + sJboQuery + " "; sSql += "FROM " + sJboFrom + this.sJboWhere + this.sJboGroup + " " + this.sJboOrder; + sSql = AweDoCommUtil.whereHandle(sSql, paramMap); sSql = sSql.replace("\r\n", " "); sSql = sSql.replace("\n", " "); sSql = sSql.replace("\t", " "); diff --git a/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java b/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java index 78e5c57ab..09bac07fb 100644 --- a/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java +++ b/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java @@ -8,11 +8,11 @@ public static void main(String[] args) throws Exception { - String str = "flowunid=:id1 and (ida>=:id2 or idb<=:id3) and idc >: id4 (idd <: id5 and ide <>:id6)"; + String str = "select a.CHANGETYPE,a.memo,a.ADVANCE_DATE,b.CONTRACT_BUSSINESS_NO,b.lender,b.LOAN_MONEY,b.project_name,b.customer_name ,a.currency,calc.LOAN_AMOUNT bankmoney,a.loan_amount_over,a.advance_money,a.COMPENSATE_MONEY,a.PAY_MONEY from ( select flowunid ,getitemname('billChangeType',CHANGETYPE) CHANGETYPE ,MEMO ,ADVANCE_DATE,getitemname('Currency',currency)currency,LOAN_AMOUNT_OVER,ADVANCE_MONEY,COMPENSATE_MONEY,PAY_MONEY from LOAN_BILL_ADVANCE_INFO_TEMP where flowunid=:flowunid)a left join ( select flowunid,CONTRACT_BUSSINESS_NO,ld.lender,to_number(lo.LOAN_MONEY)LOAN_MONEY,lo.project_name,lo.customer_name from loan_contract_info_temp lo left join loan_lender ld on lo.lender_id=ld.id where flowunid=:flowunid union all select lb.flowunid,lo.contract_bussiness_no,ld.lender,to_number(lo.loan_money)LOAN_MONEY,lo.project_name,lo.customer_name from LOAN_BILL_INFO_TEMP lb left join loan_contract_info lo on lb.contract_id=lo.id left join loan_lender ld on lo.lender_id=ld.id where lb.flowunid=:flowunid )b on a.flowunid=b.flowunid left join (select flowunid,LOAN_AMOUNT from loan_calc_condition_temp where flowunid=:flowunid)calc on a.flowunid=calc.flowunid"; System.out.println(str); Map map = new HashMap(); - map.put("flowunid", "1"); + map.put("flowunid", "FBO2018042500000096"); map.put("ida", "2"); map.put("idb", "3"); map.put("idc", "4"); @@ -45,10 +45,16 @@ public static void main(String[] args) throws Exception { String key = array[i - 1].trim(); String value = array[i].trim(); - - if (value.endsWith(")")) { - value = value.substring(0, value.length() - 1).trim(); + if (value.contains(")")) { + value = value.substring(0, value.indexOf(")")).trim(); } + if (value.contains("(")) { + value = value.substring(0, value.indexOf("(")).trim(); + } + if (value.contains(" ")) { + value = value.substring(0, value.indexOf(" ")).trim(); + } + String sKey = "", sKeyStr = ""; if (key.endsWith("==") || key.endsWith("!=") || key.endsWith("<>") || key.endsWith(">=") || key.endsWith("<=") || key.equals("!<") || key.equals("!>")) {