diff --git a/WebContent/Tenwa/Lease/Flow/Fund/ActualPayment/ActualPaymentCarTempList.jsp b/WebContent/Tenwa/Lease/Flow/Fund/ActualPayment/ActualPaymentCarTempList.jsp index 28cbc5cc2..b50e2b2cc 100644 --- a/WebContent/Tenwa/Lease/Flow/Fund/ActualPayment/ActualPaymentCarTempList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Fund/ActualPayment/ActualPaymentCarTempList.jsp @@ -8,33 +8,17 @@ String sFileSaveMode = CurConfig.getConfigure("FileSaveMode"); String sFileSavePath = CurConfig.getConfigure("FileSavePath"); String sFileNameType = CurConfig.getConfigure("FileNameType"); - String phaseNo = CurPage.getParameter("PhaseNo"); String rightType = CurComp.getParameter("RightType"); String flowunid = CurPage.getParameter("FlowUnid"); - String ishistory = CurPage.getParameter("IsHistory"); - String contract_id = CurPage.getParameter("contract_id"); - String projectId = CurPage.getParameter("ProjectId"); String payType = Sqlca.getString(new SqlObject("SELECT payType FROM LC_FUND_INCOME_TEMP_HXM WHERE flowunid='"+flowunid+"'")); - ASObjectModel doTemp = new ASObjectModel("ActualPaymentCarTempList"); -/* if(null!=ishistory&&ishistory.equals("true")){ - doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataListHistory"); - } */ - String customertype = null; - String customer_id = null; - String project_id = null; - String product_id = null; - String contract_number = null; - ASResultSet rs = Sqlca.getASResultSet(new SqlObject("select customertype,contract_number,customer_id,LC_FUND_INCOME_TEMP.project_id,Product_Id from LC_FUND_INCOME_TEMP left join LB_CONTRACT_INFO lpi on lpi.PROJECT_ID=LC_FUND_INCOME_TEMP.PROJECT_ID left join LB_UNION_LESSEE ul on LC_FUND_INCOME_TEMP.contract_id=ul.contract_id and ul.is_main='Y' left join CUSTOMER_INFO cu on ul.customer_id=cu.customerid where LC_FUND_INCOME_TEMP.contract_id = "+contract_id)); - if(rs.next()){ - customertype = rs.getString("customertype"); - customer_id = rs.getString("customer_id"); - project_id = rs.getString("project_id"); - product_id = rs.getString("Product_Id"); - contract_number = rs.getString("contract_number"); - }else{ - customertype = "gaoxiao"; - } + String payMode = Sqlca.getString(new SqlObject("SELECT pay_mode FROM LB_ACTUAL_PAYMENT_INFO_TEMP WHERE flowunid='"+flowunid+"'")); + + ASObjectModel doTemp = new ASObjectModel("ActualPaymentCarTempList"); + if("cgb".equals(payMode)){ + doTemp.setVisible("REQSTS",false); + doTemp.setVisible("RTNFLG",false); + } ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); dwTemp.Style="1"; //--设置为Grid风格-- dwTemp.MultiSelect = true; @@ -114,7 +98,7 @@ <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/src_cmb/com/tenwa/sdk/controller/CmbToPayController.java b/src_cmb/com/tenwa/sdk/controller/CmbToPayController.java index d5635a1b6..adcf44343 100644 --- a/src_cmb/com/tenwa/sdk/controller/CmbToPayController.java +++ b/src_cmb/com/tenwa/sdk/controller/CmbToPayController.java @@ -1,40 +1,24 @@ package com.tenwa.sdk.controller; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import com.amarsoft.are.jbo.BizObject; -import com.amarsoft.are.jbo.BizObjectManager; -import com.amarsoft.are.jbo.BizObjectQuery; -import com.amarsoft.are.jbo.JBOFactory; -import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.jbo.*; import com.amarsoft.awe.Configure; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.flow.action.comm.BaseFlowStartAction; -import com.tenwa.sdk.VO.SDKDcPayReqxVO; -import com.tenwa.sdk.VO.SDKInfoVO; -import com.tenwa.sdk.VO.SDKPayCallBackVO; -import com.tenwa.sdk.VO.SDKPayCallDetail; -import com.tenwa.sdk.VO.SDKPayRqxVO; -import com.tenwa.sdk.VO.SDKToPayVO; +import com.tenwa.sdk.VO.*; import com.tenwa.sdk.utils.HttpRequest; import com.tenwa.sdk.utils.XMLStream; import com.thoughtworks.xstream.XStream; - +import jbo.app.tenwa.calc.LB_ACTUAL_PAYMENT_INFO_TEMP; import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; -import jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT; import jbo.com.tenwa.lease.comm.*; import jbo.prd.LB_PRODUCTTOCOMPANY_INFO; import jbo.sys.CODE_LIBRARY; import net.sf.json.JSONObject; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + public class CmbToPayController extends BaseFlowStartAction { private String distributor_ids; //获取选择的 经销商ID private String contract_ids; //获取选择的合同ID @@ -116,26 +100,14 @@ public class CmbToPayController extends BaseFlowStartAction { /* * 本方放款账户获取######开始 */ - BizObjectManager accountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME); - List accountBoList = null; - if("aa740e4111c111eaaa0000163e0e11e6".equals(subjectId)){ - accountBoList = accountManager.createQuery("select o.id,o.acc_number,o.acc_bank,o.acc_name,o.branch_code,oi.OWN_NAME from o left join jbo.com.tenwa.entity.comm.own.OWN_INFO oi on o.own_id = oi.OWN_NUMBER where o.money_type='01' and o.state_='0010' and o.acc_type='0010' and o.FbSdk='Y' and (o.account_type='out_account' or o.account_type='inAndOut_account') and oi.OWN_NAME='安鹏国际融资租赁(深圳)有限公司'").getResultList(false); - }else if("d989246c11c111eaaa0000163e0e11e6".equals(subjectId)){ - accountBoList = accountManager.createQuery("select o.id,o.acc_number,o.acc_bank,o.acc_name,o.branch_code,oi.OWN_NAME from o left join jbo.com.tenwa.entity.comm.own.OWN_INFO oi on o.own_id = oi.OWN_NUMBER where o.money_type='01' and o.state_='0010' and o.acc_type='0010' and o.FbSdk='Y' and (o.account_type='out_account' or o.account_type='inAndOut_account') and oi.OWN_NAME='安鹏融资租赁(天津)有限公司'").getResultList(false); - } - if( accountBoList==null ||accountBoList.size()==0) { - map.put("code", "1") ; - map.put("msg", "没有匹配的本方账户,请在本方账户中检查!") ; + BizObjectManager actualPaymentMan = JBOFactory.getBizObjectManager(LB_ACTUAL_PAYMENT_INFO_TEMP.CLASS_NAME); + BizObject accountBo = actualPaymentMan.createQuery("select o.account,o.acc_number,o.bank,oa.id,oa.branch_code from o join jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT oa on o.acc_number = oa.acc_number where flowunid=:flowunid and and (oa.account_type='out_account' or oa.account_type='inAndOut_account')").setParameter("flowunid", FLOWUNID).getSingleResult(false); + if (accountBo == null) { + map.put("code", "1"); + map.put("msg", "没有匹配的本方账户,请在本方账户中检查!"); JSONObject jsonObj = JSONObject.fromObject(map); return jsonObj.toString(); } - if( accountBoList!=null && accountBoList.size()>1 ) { - map.put("code", "1") ; - map.put("msg", "启用的汽车类放款账户只能同时存在一个,请在本方账户中检查!") ; - JSONObject jsonObj = JSONObject.fromObject(map); - return jsonObj.toString(); - } - BizObject accountBo = accountBoList.get(0); /* * 本方放款账户获取######结束 */ @@ -490,6 +462,9 @@ public class CmbToPayController extends BaseFlowStartAction { income_boo.setParameter("FLOWUNID",pay_detail_one.getAttribute("FLOWUNID").toString()) ; income_boo.setParameter("CONTRACT_ID",pay_detail_one.getAttribute("CONTRACT_ID").toString()) ; income_boo.setParameter("DISTRIBUTOR_ID",pay_detail_one.getAttribute("DISTRIBUTOR_ID").toString()) ; + income_boo.setParameter("bank",accountBo.getAttribute("bank").toString()) ; + income_boo.setParameter("account",accountBo.getAttribute("account").toString()) ; + income_boo.setParameter("acc_number",accountBo.getAttribute("acc_number").toString()) ; income_boo.executeUpdate();//更新资金收付表 pay_detail_bom.saveObject(pay_detail_one); //插入支付详情表 } diff --git a/src_core/com/tenwa/comm/util/date/DateAssistant.java b/src_core/com/tenwa/comm/util/date/DateAssistant.java index f9158f227..1075f4d0b 100644 --- a/src_core/com/tenwa/comm/util/date/DateAssistant.java +++ b/src_core/com/tenwa/comm/util/date/DateAssistant.java @@ -38,7 +38,17 @@ public class DateAssistant { DateX date=new DateX(); return date.getDateString("HH:mm:ss"); } - + + /** + * 获得自定义格式日期 + * @param format + * @return + */ + public final static String getFormatDate(String format){ + DateX date=new DateX(); + return date.getDateString(format); + } + public static long getDateSubDays(String sDate1, String sDate2, String sFormat) throws Exception { Calendar calendar1 = Calendar.getInstance(); calendar1.setTime(new SimpleDateFormat(sFormat).parse(sDate1)); diff --git a/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java b/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java index bfb537804..8bda14ba3 100644 --- a/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java +++ b/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java @@ -1,5 +1,18 @@ package com.tenwa.flow.fund.fundcollection; +import com.amarsoft.are.jbo.*; +import com.amarsoft.are.util.StringFunction; +import com.amarsoft.awe.util.ASResultSet; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.flow.bussinessapprove.BussinessStatusAndDetailAction; +import com.tenwa.util.MultiSubjectUtil; +import jbo.app.tenwa.calc.*; +import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + import java.math.BigDecimal; import java.sql.SQLException; import java.util.HashMap; @@ -7,31 +20,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import com.amarsoft.app.base.businessobject.BusinessObject; -import net.sf.json.*; -import jbo.app.tenwa.calc.LB_PAYMENTRETURN_LOG; -import jbo.app.tenwa.calc.LC_EBANK_PROCESS; -import jbo.app.tenwa.calc.LC_EBANK_TEMP; -import jbo.app.tenwa.calc.LC_FUND_INCOME; -import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; -import jbo.app.tenwa.calc.LC_FUND_PLAN; -import jbo.app.tenwa.calc.VI_LC_FUND_PLAN; -import jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT; -import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; - -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; -import com.amarsoft.are.util.StringFunction; -import com.amarsoft.awe.util.ASResultSet; -import com.amarsoft.awe.util.SqlObject; -import com.amarsoft.awe.util.Transaction; -import com.tenwa.comm.util.jboutil.DataOperatorUtil; -import com.tenwa.flow.bussinessapprove.BussinessStatusAndDetailAction; -import com.tenwa.reckon.util.Conn; - public class FundIncomeMethod { private String planIDs; @@ -453,12 +441,6 @@ public String getContactId(JBOTransaction tx) throws SQLException, Exception{ } public String createActualPayment(JBOTransaction tx) throws JBOException{ try{ - //获取深圳本方账户 - BizObject boOAS = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME,tx) - .createQuery("account_purpose='default' and state_='0010' and FbSdk='Y' and own_id='807001002001' ").getSingleResult(false); - //获取天津本方账户 - BizObject boOAT = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME,tx) - .createQuery("account_purpose='default' and state_='0010' and FbSdk='Y' and own_id='807001003' ").getSingleResult(false); for(String contractId : contractIds.split("@")){ @SuppressWarnings("unchecked") List bos = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME) @@ -479,17 +461,6 @@ public String getContactId(JBOTransaction tx) throws SQLException, Exception{ otherProperty.put("FlowUnid", flowunid); otherProperty.put("IS_FLOWING", "0"); otherProperty.put("ACCOUNTING_DATE", StringFunction.getTodayNow().split(" ")[0]); - if("aa740e4111c111eaaa0000163e0e11e6".equals(lci.getAttribute("SUBJECTID").toString())){ - otherProperty.put("BANK", boOAS.getAttribute("ACC_BANK").getString()); - otherProperty.put("ACCOUNT", boOAS.getAttribute("ACC_NAME").getString()); - otherProperty.put("ACC_NUMBER", boOAS.getAttribute("ACC_NUMBER").getString()); - }else if("d989246c11c111eaaa0000163e0e11e6".equals(lci.getAttribute("SUBJECTID").toString())){ - otherProperty.put("BANK", boOAT.getAttribute("ACC_BANK").getString()); - otherProperty.put("ACCOUNT", boOAT.getAttribute("ACC_NAME").getString()); - otherProperty.put("ACC_NUMBER", boOAT.getAttribute("ACC_NUMBER").getString()); - }else{ - throw new RuntimeException("未查询到对应的主体信息!"); - } otherProperty.put("INCOME_ID", bo.getAttribute("ID").getString()); otherProperty.put(LC_FUND_INCOME.EBANK_STATUS, "03"); if("0020".equals(payType)||"0030".equals(payType)){ @@ -634,6 +605,24 @@ public String getContactId(JBOTransaction tx) throws SQLException, Exception{ }else{ meaage="已生成的本次付款明细中和已选合同主体不符!!!"; } + //付款基本信息默认本方账户 + if ("true".equals(meaage)) { + String subjectName = ""; + if (MultiSubjectUtil.SZSUBJECTID.equals(subjectuid)) { + subjectName = MultiSubjectUtil.SZSUBJECTNAME; + } else if (MultiSubjectUtil.TJSUBJECTID.equals(subjectuid)) { + subjectName = MultiSubjectUtil.TJSUBJECTNAME; + } + BizObjectManager bm_own = JBOFactory.getBizObjectManager("jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT", tx); + BizObject bo_own = bm_own.createQuery("acc_name =:accName and account_purpose = 'default' and account_type = 'out_account' and state_ = '0010'") + .setParameter("accName", subjectName).getSingleResult(false); + JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LB_ACTUAL_PAYMENT_INFO_TEMP","update o set bank=:bank,account=:account,acc_number=:acc_number where flowunid = :flowunid ") + .setParameter("bank",bo_own.getAttribute("acc_bank").getString()) + .setParameter("account",bo_own.getAttribute("acc_name").getString()) + .setParameter("acc_number",bo_own.getAttribute("acc_number").getString()) + .setParameter("flowunid",flowunid) + .executeUpdate(); + } }else{ meaage="所选合同涉及多个主体,请检查!"; }