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; import java.util.Iterator; import java.util.List; import java.util.Map; public class FundIncomeMethod { private String planIDs; private String flowunid; private String overMoneys; private String balance; private String portionCollectionID; private String portionMoney; private String oldFactMoney; private String newFactMoney; private String isChanged; private String CONTRACT_ID; private String contractIds; private String userId; private String orgId; private String status; private String payType; private String contract_number; private String channel_name; private String product_id; private String customer_name; private String fact_object; private String fact_money; private String CLIENT_BANK; private String CLIENT_ACCOUNT; private String CLIENT_ACCNUMBER; private String username; public String getIsChanged() { return isChanged; } public void setIsChanged(String isChanged) { this.isChanged = isChanged; } public String getFlowunid() { return flowunid; } public void setFlowunid(String flowunid) { this.flowunid = flowunid; } public String getPlanIDs() { return planIDs; } public void setPlanIDs(String planIDs) { this.planIDs = planIDs; } public String getOverMoneys() { return overMoneys; } public void setOverMoneys(String overMoneys) { this.overMoneys = overMoneys; } public String getBalance() { return balance; } public void setBalance(String balance) { this.balance = balance; } public String getPortionCollectionID() { return portionCollectionID; } public void setPortionCollectionID(String portionCollectionID) { this.portionCollectionID = portionCollectionID; } public String getPortionMoney() { return portionMoney; } public void setPortionMoney(String portionMoney) { this.portionMoney = portionMoney; } public String getOldFactMoney() { return oldFactMoney; } public void setOldFactMoney(String oldFactMoney) { this.oldFactMoney = oldFactMoney; } public String getNewFactMoney() { return newFactMoney; } public void setNewFactMoney(String newFactMoney) { this.newFactMoney = newFactMoney; } public String getCONTRACT_ID() { return CONTRACT_ID; } public void setCONTRACT_ID(String cONTRACT_ID) { CONTRACT_ID = cONTRACT_ID; } public String getContractIds() { return contractIds; } public void setContractIds(String contractIds) { this.contractIds = contractIds; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getOrgId() { return orgId; } public void setOrgId(String orgId) { this.orgId = orgId; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getPayType() { return payType; } public void setPayType(String payType) { this.payType = payType; } public String getContract_number() { return contract_number; } public void setContract_number(String contract_number) { this.contract_number = contract_number; } public String getChannel_name() { return channel_name; } public void setChannel_name(String channel_name) { this.channel_name = channel_name; } public String getProduct_id() { return product_id; } public void setProduct_id(String product_id) { this.product_id = product_id; } public String getCustomer_name() { return customer_name; } public void setCustomer_name(String customer_name) { this.customer_name = customer_name; } public String getFact_object() { return fact_object; } public void setFact_object(String fact_object) { this.fact_object = fact_object; } public String getFact_money() { return fact_money; } public void setFact_money(String fact_money) { this.fact_money = fact_money; } public String getCLIENT_BANK() { return CLIENT_BANK; } public void setCLIENT_BANK(String cLIENT_BANK) { CLIENT_BANK = cLIENT_BANK; } public String getCLIENT_ACCOUNT() { return CLIENT_ACCOUNT; } public void setCLIENT_ACCOUNT(String cLIENT_ACCOUNT) { CLIENT_ACCOUNT = cLIENT_ACCOUNT; } public String getCLIENT_ACCNUMBER() { return CLIENT_ACCNUMBER; } public void setCLIENT_ACCNUMBER(String cLIENT_ACCNUMBER) { CLIENT_ACCNUMBER = cLIENT_ACCNUMBER; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getContactId(JBOTransaction tx) throws SQLException, Exception{ SqlObject s = 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.ID=LC_FUND_INCOME_TEMP.CONTRACT_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+"'"); Transaction sqlTran = Transaction.createTransaction(tx); ASResultSet rs = sqlTran.getResultSet(s); String customertype = null; String contract_number = null; String customer_id = null; String project_id = null; String Product_Id = null; if(rs.next()){ customertype = rs.getString("customertype"); contract_number = rs.getString("contract_number"); customer_id = rs.getString("customer_id"); project_id = rs.getString("project_id"); Product_Id = rs.getString("Product_Id"); } return customertype+"@"+contract_number+"@"+customer_id+"@"+project_id+"@"+Product_Id; } public String delTemp(JBOTransaction tx) throws JBOException { try { for(String contractId : contractIds.split("@")){ BussinessStatusAndDetailAction.CancelRun(tx, userId, contractId, "30"); } } catch (Exception e) { e.printStackTrace(); tx.rollback(); return "ERROR"; } return "SUCCESS"; } public String updateTemp(JBOTransaction tx) throws JBOException { try { Transaction sqlTran = Transaction.createTransaction(tx); ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status='apply_pass' group by flowunid")); if(rs.next()){ BigDecimal totalMoney = new BigDecimal(rs.getString("total_money")); int contractCount = Integer.parseInt(rs.getString("contract_count")); SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); so.setRunSql(so.getRunSql().replaceAll("@", ":")); sqlTran.executeSQL(so); so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); sqlTran.executeSQL(so); }else{ BigDecimal totalMoney = new BigDecimal("0"); int contractCount = 0; SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); so.setRunSql(so.getRunSql().replaceAll("@", ":")); sqlTran.executeSQL(so); so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); sqlTran.executeSQL(so); } } catch (Exception e) { e.printStackTrace(); tx.rollback(); return "ERROR"; } return "SUCCESS"; } public String setFundDataToFundIncome(JBOTransaction tx) throws JBOException{ try{ boolean flag = false; if("Y".equals(isChanged)){ flag = true; } BigDecimal bel = new BigDecimal(balance); BigDecimal allFactMoney = bel; BigDecimal zero = new BigDecimal(0); BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME); tx.join(bomEb); BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID") .setParameter("FLOWUNID", flowunid).getSingleResult(true); if(flag){ bel = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getString()); allFactMoney = bel; } String[] moneys = overMoneys.split("@"); String[] ids = planIDs.split("@"); for(int i=0;i boLCFI = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i]) .getResultList(false); List boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = 0 and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i]) .getResultList(false); boLFIT.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1); boLFIT.setAttributeValue("FACT_DATE", boEb.getAttribute("FACT_DATE").getString()); if(!flag){ if(!ids[i].equals(portionCollectionID) && bel.subtract(new BigDecimal(moneys[i])).compareTo(new BigDecimal(0)) >= 0){ bel = bel.subtract(new BigDecimal(moneys[i])); boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(moneys[i])); }else{ boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(portionMoney)); bel = bel.subtract(new BigDecimal(portionMoney)); } }else{ moneys[i] = boVLFP.getAttribute("OVERMONEY").getString(); if(bel.subtract(new BigDecimal(moneys[i])).compareTo(new BigDecimal(0)) >= 0){ bel = bel.subtract(new BigDecimal(moneys[i])); boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(moneys[i])); }else{ boLFIT.setAttributeValue("FACT_MONEY",bel); bel = zero; } } boLFIT.setAttributeValue("FEE_ADJUST", 0); boLFIT.setAttributeValue("FACT_OBJECT", boVLF.getAttribute("PAY_OBJ").getString()); boLFIT.setAttributeValue("EBANK_NUMBER", boEb.getAttribute("EBANK_NUMBER").getString()); boLFIT.setAttributeValue("BANK", boEb.getAttribute("OWN_BANK").getString()); boLFIT.setAttributeValue("ACCOUNT", boEb.getAttribute("OWN_ACCOUNT").getString()); boLFIT.setAttributeValue("ACC_NUMBER", boEb.getAttribute("OWNACC_NUMBER").getString()); boLFIT.setAttributeValue("CLIENT_BANK", boEb.getAttribute("CLIENT_BANK").getString()); boLFIT.setAttributeValue("CLIENT_ACCOUNT", boEb.getAttribute("CLIENT_ACCOUNT").getString()); boLFIT.setAttributeValue("CLIENT_ACCNUMBER", boEb.getAttribute("CLIENT_ACC_NUMBER").getString()); boLFIT.setAttributeValue("ACCOUNTING_DATE", StringFunction.getToday()); boLFIT.setAttributeValue("ROLL_BACK", 0); boLFIT.setAttributeValue("COIN", boVLF.getAttribute("COIN").getString()); boLFIT.setAttributeValue("IS_FLOWING", 0); boLFIT.setAttributeValue("FLOWUNID", flowunid); boLFI.saveObject(boLFIT); } if(bel.compareTo(new BigDecimal(0)) > 0){ allFactMoney = allFactMoney.subtract(bel);//一共多少余额减去用剩多少等于用了多少 } BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME); tx.join(bomLEP); BizObject boLEP = bomLEP.createQuery("FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", flowunid).getSingleResult(true); BigDecimal processMoney = new BigDecimal(boLEP.getAttribute("PROCESS_MONEY").getDouble()); boLEP.setAttributeValue("PROCESS_MONEY", processMoney.add(allFactMoney)); bomLEP.saveObject(boLEP); BigDecimal hadMoney = new BigDecimal(boEb.getAttribute("HAD_MONEY").getDouble()).add(allFactMoney); BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble()); boEb.setAttributeValue("HAD_MONEY", hadMoney); boEb.setAttributeValue("MAYOPE_MONEY", factMoney.subtract(hadMoney)); bomEb.saveObject(boEb); }catch(Exception e){ e.printStackTrace(); return "ERROR"; } return "SUCCESS"; } public String updateEbankAndEbankProcess(JBOTransaction tx){ try{ BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME); tx.join(bomEb); BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID") .setParameter("FLOWUNID", flowunid).getSingleResult(true); BigDecimal hadMoney = new BigDecimal(boEb.getAttribute("HAD_MONEY").getDouble()) .subtract(new BigDecimal(oldFactMoney)).add(new BigDecimal(newFactMoney)); BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble()); boEb.setAttributeValue("HAD_MONEY", hadMoney); boEb.setAttributeValue("MAYOPE_MONEY", factMoney.subtract(hadMoney)); BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME); tx.join(bomLEP); bomLEP.createQuery("update O set process_money=:allFactMoney where flowunid=:flowUnid") .setParameter("allFactMoney", newFactMoney).setParameter("flowUnid", flowunid).executeUpdate(); bomEb.saveObject(boEb); }catch(Exception e){ e.printStackTrace(); return "ERROR"; } return "SUCCESS"; } public String createActualPayment(JBOTransaction tx) throws JBOException{ try{ for(String contractId : contractIds.split("@")){ @SuppressWarnings("unchecked") List bos = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME) .createQuery("contract_id='"+contractId+"' and pay_type='pay_type_out' and pay_status='apply_pass'") .getResultList(false); BigDecimal totalMoney = new BigDecimal("0"); int contractCount = 0; if(bos.size() > 0){ BizObject lci = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,tx) .createQuery(" id=:id ").setParameter("id", contractId).getSingleResult(false); Map fromCondition = new HashMap(); Map otherProperty = new HashMap(); for(BizObject bo:bos){ fromCondition.clear(); fromCondition.put("ID", bo.getAttribute("ID").getString()); fromCondition.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod6"); otherProperty.clear(); otherProperty.put("FlowUnid", flowunid); otherProperty.put("IS_FLOWING", "0"); otherProperty.put("ACCOUNTING_DATE", StringFunction.getTodayNow().split(" ")[0]); otherProperty.put("INCOME_ID", bo.getAttribute("ID").getString()); otherProperty.put(LC_FUND_INCOME.EBANK_STATUS, "03"); if("0020".equals(payType)||"0030".equals(payType)){ otherProperty.put(LC_FUND_INCOME.EBANK_STATUS, "05"); } if("0030".equals(payType)){ otherProperty.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod13"); } if("0010"!=payType){ otherProperty.put("FACT_DATE", StringFunction.getToday()); } DataOperatorUtil.copySingleJBO(LC_FUND_INCOME.CLASS_NAME, fromCondition,LC_FUND_INCOME_TEMP.CLASS_NAME, null, otherProperty,tx); } } Transaction sqlTran = Transaction.createTransaction(tx); ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,sum(fact_money) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status<>'apply_return' group by flowunid")); if(rs.next()){ totalMoney = new BigDecimal(rs.getString("total_money")); contractCount = Integer.parseInt(rs.getString("contract_count")); SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); so.setRunSql(so.getRunSql().replaceAll("@", ":")); sqlTran.executeSQL(so); so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); sqlTran.executeSQL(so); } } }catch(Exception e){ e.printStackTrace(); tx.rollback(); return "ERROR"; } return "SUCCESS"; } public String updateFundIncomeStatus(JBOTransaction tx) throws JBOException{//target try{ for(String contractId : contractIds.split("@")){ JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME,tx).createQuery("update O set "+("cancel".equals(status)?"pay_status='apply_return'":"pay_status=null")+" where flowunid='"+flowunid+"' and contract_id='"+contractId+"'").executeUpdate(); } Transaction sqlTran = Transaction.createTransaction(tx); ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status<>'apply_return' group by flowunid")); if(rs.next()){ BigDecimal totalMoney = new BigDecimal(rs.getString("total_money")); int contractCount = Integer.parseInt(rs.getString("contract_count")); SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); so.setRunSql(so.getRunSql().replaceAll("@", ":")); sqlTran.executeSQL(so); so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); sqlTran.executeSQL(so); } }catch(Exception e){ e.printStackTrace(); tx.rollback(); return "ERROR"; } return "SUCCESS"; } public static String setCerificationMoney(String corpus,String interest,String penalty){ BigDecimal c = new BigDecimal(corpus); BigDecimal i = new BigDecimal(interest); BigDecimal p = new BigDecimal(penalty); c=c.add(i).add(p); // double CerificationMoney= Double.valueOf(corpus)+Double.valueOf(interest)+Double.valueOf(penalty); return c.doubleValue()+""; } public String check(JBOTransaction tx) throws Exception{ String sql = "SELECT lfit.project_id,lpi.product_id,psl.paytype AS payType FROM "+ "lc_fund_income_temp lfit "+ "LEFT JOIN lb_project_info lpi ON lfit.project_id=lpi.id "+ "LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id "+ "WHERE lfit.flowunid=:flowunid"; Map params=new HashMap(); params.put("flowunid", flowunid); List> payTypeList = DataOperatorUtil.getDataBySql(tx,sql,params); if(payTypeList.size()<1){ return "0"; } for(Map payType:payTypeList){ String paytype = payType.get("payType"); if(this.payType.equals(paytype)){ return "0"; } return "1"; } return "1"; } public String paymentReturn(JBOTransaction tx){ try { Transaction sqlTran = Transaction.createTransaction(tx); sqlTran.executeSQL(new SqlObject("delete from lc_fund_income where CONTRACT_ID='"+CONTRACT_ID+"'")); BizObjectManager lplManage = JBOFactory.getBizObjectManager(LB_PAYMENTRETURN_LOG.CLASS_NAME,tx); BizObject lpl = lplManage.newObject(); lpl.setAttributeValue("contract_no",contract_number); lpl.setAttributeValue("distributor_name",channel_name); lpl.setAttributeValue("product_name",product_id); lpl.setAttributeValue("person_name",customer_name); lpl.setAttributeValue("pay_object",fact_object); lpl.setAttributeValue("pay_number",fact_money); lpl.setAttributeValue("distributor_bank_name",CLIENT_BANK); lpl.setAttributeValue("distributor_Account_name",CLIENT_ACCOUNT); lpl.setAttributeValue("distributor_bank_number",CLIENT_ACCNUMBER); lpl.setAttributeValue("loan_type",payType); lpl.setAttributeValue("INPUTUSERNAME",username); lpl.setAttributeValue("INPUTUSERID",userId); lpl.setAttributeValue("INPUTORGID",orgId); lpl.setAttributeValue("INPUTTIME",StringFunction.getTodayNow()); lplManage.saveObject(lpl); sqlTran.commit(); return "success"; } catch (Exception e) { e.printStackTrace(); return "系统错误!"; } } public String checkManySubject(JBOTransaction tx){ String meaage = ""; Transaction sqlTran; try { sqlTran = Transaction.createTransaction(tx); contractIds= contractIds.substring(contractIds.indexOf("@")+1).replaceAll("@", "','"); String selectSql = "SELECT subjectId AS subjectuid FROM lb_contract_info WHERE id IN ('"+contractIds+"') GROUP BY subjectId"; List> results = DataOperatorUtil.getDataBySql(selectSql); if(results.size()==0){ meaage="没有查询到对应的合同,请与管理员联系!"; }else if(results.size()==1){ String subjectuid = results.get(0).get("subjectuid"); String flowSql = "select lci.subjectId as subjectuid from LC_FUND_INCOME_TEMP lfit left join lb_contract_info lci on lci.id=lfit.contract_id where lfit.flowUnid='"+flowunid+"' group by lci.subjectId"; List> flowSubjectIds = DataOperatorUtil.getDataBySql(flowSql); if(flowSubjectIds.size()==0){ meaage="true"; }else if(subjectuid.equals(flowSubjectIds.get(0).get("subjectuid"))){ meaage="true"; }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="所选合同涉及多个主体,请检查!"; } } catch (Exception e) { meaage="无法处理,请与管理员联系!!!"; e.printStackTrace(); } return meaage; } //放款前校验保证金是否到账 public String checkDeposit(JBOTransaction tx){ String meaage = ""; Transaction sqlTran; try { sqlTran = Transaction.createTransaction(tx); contractIds= contractIds.substring(contractIds.indexOf("@")+1).replaceAll("@", "','"); String selectSql = "SELECT lul.customer_name,lfp.plan_money,lpi.product_data,vlfp.fact_money,vlfp.overmoney"+ " FROM LC_FUND_PLAN lfp LEFT JOIN vi_lc_fund_plan vlfp ON lfp.id = vlfp.id"+ " LEFT JOIN LB_CONTRACT_INFO lci ON lfp.contract_id = lci.id"+ " LEFT JOIN LB_UNION_LESSEE lul ON lul.contract_id = lci.id AND lul.is_main = 'Y' join lb_product_info lpi on lpi.PRODUCT_ID=lci.PRODUCT_ID "+ " WHERE lci.businesstype = '1' and lfp.fee_type='feetype2' and lfp.pay_type='pay_type_in' and vlfp.overmoney>0 "+//and vlfp.overmoney>0 " and lci.id IN ('"+contractIds+"') "; List> results = DataOperatorUtil.getDataBySql(selectSql); if(results.size()==0){ meaage="true"; }else { int alertCount=0; String alertName=""; for (int i = 0; i < results.size(); i++) { String pData = results.get(i).get("product_data"); if("".equals(pData)){ }else{ JSONArray jsonArray = JSONArray.fromObject(pData); Iterator it = jsonArray.iterator(); while(it.hasNext()){ JSONObject component=(JSONObject)it.next().get("jbo.sample.Component"); if("保证金".equals(component.getString("NAME"))){ JSONArray parameters=component.getJSONArray("Parameter"); for (int j = 0; j 0){ meaage="["+alertName+"]等"+alertCount+"个客户保证金没有核销"; } } //meaage="true22"; } catch (Exception e) { meaage="无法处理,请与管理员联系!!!"; e.printStackTrace(); } return meaage; } }