diff --git a/WebContent/Frame/page/ow/ListSearch.jsp b/WebContent/Frame/page/ow/ListSearch.jsp index 25692f965..7d52c3cf2 100644 --- a/WebContent/Frame/page/ow/ListSearch.jsp +++ b/WebContent/Frame/page/ow/ListSearch.jsp @@ -58,6 +58,9 @@ if(customFilter!=null){ asObj.appendJboWhere(customFilter.getWhereClauses(asObj, request)); } + + int filter_count = 0; + if(asObj.Filters!=null){ for(int k=0;k + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebContent/WEB-INF/etc/jbo/jbo_sys.xml b/WebContent/WEB-INF/etc/jbo/jbo_sys.xml index e54db8eb1..0846b3e7f 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_sys.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_sys.xml @@ -3230,6 +3230,7 @@ + diff --git a/src/com/amarsoft/awe/dw/ui/list/FlowMonitorListHtmlGenerator.java b/src/com/amarsoft/awe/dw/ui/list/FlowMonitorListHtmlGenerator.java new file mode 100644 index 000000000..f8bde3509 --- /dev/null +++ b/src/com/amarsoft/awe/dw/ui/list/FlowMonitorListHtmlGenerator.java @@ -0,0 +1,20 @@ +package com.amarsoft.awe.dw.ui.list; + +import com.amarsoft.awe.dw.ASDataObject; +import com.amarsoft.awe.dw.ui.htmlfactory.imp.DefaultListHtmlGenerator; + +import javax.servlet.http.HttpServletRequest; + +public class FlowMonitorListHtmlGenerator extends DefaultListHtmlGenerator { + + + @Override + public void initConstructParams(ASDataObject asObj, String indexName, String paramstr, int pageSize, int curPage, HttpServletRequest request) { + super.initConstructParams(asObj, indexName, paramstr, pageSize, curPage, request); + try { + this.rowCount = Integer.parseInt(asObj.getCurPage().getAttribute("flowRowCount") == null ? "-1" : asObj.getCurPage().getAttribute("flowRowCount")); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/com/amarsoft/dict/als/manage/ColRelativeInfo.java b/src/com/amarsoft/dict/als/manage/ColRelativeInfo.java index 188880751..ca58cb097 100644 --- a/src/com/amarsoft/dict/als/manage/ColRelativeInfo.java +++ b/src/com/amarsoft/dict/als/manage/ColRelativeInfo.java @@ -7,6 +7,7 @@ import com.amarsoft.are.jbo.BizObject; import com.amarsoft.are.jbo.JBOException; import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.awe.util.ASResultSet; import com.amarsoft.awe.util.SqlObject; import com.amarsoft.awe.util.Transaction; @@ -174,7 +175,43 @@ public class ColRelativeInfo { return "已收款"; } } - + } + + public static String getFundPlanPayStatusNew(String planID) throws Exception { + Transaction sqlca = null; + String result = null; + try { + sqlca = Transaction.createTransaction(JBOFactory.createJBOTransaction()); + ASResultSet asResultSet2 = sqlca.getASResultSet2("select plan_money,getSumFundMoney(payment_number,plan_list,fee_type,pay_type) as fact_money,pay_type from lc_fund_plan where id = '" + planID + "'"); + if (asResultSet2.next()) { + double factMOney = asResultSet2.getDouble("fact_money"); + double planmoney = asResultSet2.getDouble("plan_money"); + String paytype = asResultSet2.getString("pay_type"); + if ("pay_type_out".equals(paytype)) { + if (factMOney == 0) { + result = "未付款"; + } else if (planmoney - factMOney > 0) { + result = "部分付款"; + } else { + result = "已付款"; + } + } else { + if (factMOney == 0) { + result = "未收款"; + } else if (planmoney - factMOney > 0) { + result = "部分收款"; + } else { + result = "已收款"; + } + } + } + asResultSet2.close(); + sqlca.commit(); + } catch (Exception e) { + e.printStackTrace(); + if (sqlca != null) sqlca.rollback(); + } + return result; } public static String getRentPlanPayStatus(String planID) throws Exception{ diff --git a/src/com/amarsoft/dict/als/manage/NameManager.java b/src/com/amarsoft/dict/als/manage/NameManager.java index 9766fd79b..1c9ee1e40 100644 --- a/src/com/amarsoft/dict/als/manage/NameManager.java +++ b/src/com/amarsoft/dict/als/manage/NameManager.java @@ -316,4 +316,123 @@ public class NameManager Sqlca.disConnect(); return addressName; }*/ + + + public static String getCustomerName(String flowUnid, String flowNo, String contractId) throws Exception { + boolean state = false; + if ("BusinessApplyFlow,BusinessChangeFlow,BusinessCancelFlow".indexOf(flowNo) < 0) { + state = true; + } + if (state && contractId.length() == 0) { + return ""; + } else { + Transaction Sqlca = null; + String customerName = ""; + try { + Sqlca = Transaction.createTransaction("als"); + String quySql = "select customer_name from lb_union_lessee_temp where FLOWUNID = '" + flowUnid + "' and is_main = 'Y' limit 1"; + if (state) { + quySql = "select customer_name from lb_union_lessee where contract_id = '" + contractId + "' and is_main = 'Y' limit 1"; + } + customerName = Sqlca.getString(quySql); + Sqlca.commit(); + } catch (Exception e) { + Sqlca.rollback(); + } + return customerName == null ? "" : customerName; + } + + } + + + public static String getDistributorName(String flowUnid, String flowNo, String contractId) throws Exception { + + boolean state = false; + if ("BusinessApplyFlow,BusinessChangeFlow,BusinessCancelFlow".indexOf(flowNo) < 0) { + state = true; + } + if (state && contractId.length() == 0) { + return ""; + } else { + Transaction Sqlca = null; + String distirbutorName = ""; + try { + Sqlca = Transaction.createTransaction("als"); + String quySql = "select DISTRIBUTOR_NAME from lb_project_info_temp lpit join distributor_info di on lpit.distributor_id = di.distributor_no where FLOWUNID = '" + flowUnid + "'"; + if (state) { + quySql = "select DISTRIBUTOR_NAME from lb_contract_info lci join distributor_info di on lci.distributor_id = di.distributor_no where lci.id = '" + contractId + "'"; + } + distirbutorName = Sqlca.getString(quySql); + Sqlca.commit(); + } catch (Exception e) { + Sqlca.rollback(); + } + return distirbutorName == null ? "" : distirbutorName; + } + } + + public static String getTelphone(String flowUnid, String flowNo, String contractId) throws Exception { + boolean state = false; + if ("BusinessApplyFlow,BusinessChangeFlow,BusinessCancelFlow".indexOf(flowNo) < 0) { + state = true; + } + if (state && contractId.length() == 0) { + return ""; + } else { + Transaction Sqlca = null; + String tel = ""; + try { + Sqlca = Transaction.createTransaction("als"); + String quySql = "select ifnull(cct.tel,cpt.mobile) from lb_union_lessee_temp lult left join customer_company_temp cct on lult.FLOWUNID = cct.flowunid left join customer_person_temp cpt on lult.FLOWUNID = cpt.flowunid where lult.FLOWUNID = '" + flowUnid + "' and lult.IS_MAIN = 'Y' limit 1"; + if (state) { + quySql = "select ifnull(cc.tel, cp.mobile) from lb_union_lessee lul left join customer_company cc on lul.CUSTOMER_ID = cc.customerid left join customer_person cp on lul.CUSTOMER_ID = cp.CUSTOMERID where lul.CONTRACT_ID = '" + contractId + "' and lul.IS_MAIN = 'Y' limit 1"; + } + tel = Sqlca.getString(quySql); + Sqlca.commit(); + } catch (Exception e) { + Sqlca.rollback(); + } + return tel == null ? "" : tel; + } + } + + + public static String getFrameNumber(String flowUnid, String flowNo, String contractId) throws Exception { + boolean state = false; + if ("BusinessApplyFlow,BusinessChangeFlow,BusinessCancelFlow".indexOf(flowNo) < 0) { + state = true; + } + if (state && contractId.length() == 0) { + return ""; + } else { + Transaction Sqlca = null; + String frameNum = ""; + try { + Sqlca = Transaction.createTransaction("als"); + String quySql = "select case when length(group_concat(FRAME_NUMBER)) < 5 then null else group_concat(FRAME_NUMBER) end from lb_equipment_car_temp where flowunid = '" + flowUnid + "'"; + if (state) { + quySql = "select case when length(group_concat(FRAME_NUMBER)) < 5 then null else group_concat(FRAME_NUMBER) end from lb_equipment_car where contract_id = '" + contractId + "'"; + } + frameNum = Sqlca.getString(quySql); + Sqlca.commit(); + } catch (Exception e) { + Sqlca.rollback(); + } + return frameNum == null ? "" : frameNum; + } + } + + public static String getPlateNumber(String contractId) throws Exception { + Transaction Sqlca = null; + String plateNum = ""; + try { + Sqlca = Transaction.createTransaction("als"); + String quySql = "select group_concat(distinct lcl.plate_number) from LB_EQUIPMENT_CAR LEC join LB_CAR_LICENSE_PLATE_INFO lcl on LEC.CONTRACT_ID = lcl.contract_id and LEC.FRAME_NUMBER = lcl.frame_number where LEC.CONTRACT_ID = '" + contractId + "' and LEC.car_attribute = 'head'"; + plateNum = Sqlca.getString(quySql); + Sqlca.commit(); + } catch (Exception e) { + Sqlca.rollback(); + } + return plateNum == null ? "" : plateNum; + } } \ No newline at end of file diff --git a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java index 2fd414732..7e9ce3153 100644 --- a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java +++ b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java @@ -326,29 +326,19 @@ public class AllinpayPaymentQueryRun implements Runnable{ } } public void insertMessage(BizObject boLRP,String finishAmount,JBOTransaction tx) throws Exception{ - Transaction Sqlca =null; - ASResultSet rs = null; - ASResultSet rs2 = null; - Sqlca = Transaction.createTransaction(tx); + Transaction Sqlca = Transaction.createTransaction(tx); String ln_contract_id = boLRP.getAttribute("contract_id").toString(); String ln_plan_date = boLRP.getAttribute("plan_date").toString(); - String plan_list = boLRP.getAttribute("plan_list").toString(); String in_rent = finishAmount; - String sql2 = "select IFNULL(max(hire_list),0) as hire_list from lc_rent_income where contract_id='"+ln_contract_id+"' and plan_list = '"+plan_list+"'"; - SqlObject asq2 = new SqlObject(sql2); - rs2 = Sqlca.getASResultSet(asq2); - String in_hire_list =""; - if(rs2.next()){ - in_hire_list =Integer.parseInt(rs2.getString("hire_list"))+1+""; - } - String in_type = "5"; - String SQL="{call proc_insert_hexiao('"+ln_contract_id+"','"+ln_plan_date+"','"+in_rent+"','"+in_hire_list+"','"+in_type+"')}"; + String SQL="{call proc_insert_hexiao('"+ln_contract_id+"','"+ln_plan_date+"','"+in_rent+"','1','5')}"; SqlObject asql = new SqlObject(SQL); - rs = Sqlca.getASResultSet(asql); - - // 代偿红冲处理 - CollectAuditInfoCache caic = new CollectAuditInfoCache(); - caic.writeBackDistributor(boLRP.getAttribute("ID").toString(), finishAmount, Sqlca); - + ASResultSet rs = Sqlca.getASResultSet(asql); + if(rs.next()){ + in_rent = rs.getString(1); + // 代偿红冲处理 + CollectAuditInfoCache caic = new CollectAuditInfoCache(); + caic.writeBackDistributor(boLRP.getAttribute("ID").toString(), in_rent, Sqlca); + } + rs.close(); } } diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/MarginDeduction.java b/src_tenwa/com/tenwa/lease/app/quartzmession/MarginDeduction.java index ff1d7fecf..318f9205f 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/MarginDeduction.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/MarginDeduction.java @@ -11,6 +11,8 @@ import com.base.util.DateUtil; import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherDepositDeductionToMoney2; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; @@ -25,6 +27,10 @@ import com.base.util.QuartzUtil; /**保证金抵扣租金*/ public class MarginDeduction implements Job{ + + + private static Log logger = LogFactory.getLog(MarginDeduction.class); + @Override public void execute(JobExecutionContext arg0) throws JobExecutionException{ SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); @@ -37,7 +43,7 @@ public class MarginDeduction implements Job{ BizObjectManager lriBm = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_RENT_INCOME"); BizObjectManager lfiBm = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_FUND_INCOME"); BizObjectManager lfpBm = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_FUND_PLAN"); - BizObjectManager vlrpBm = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.VI_LC_RENT_PLAN"); + BizObjectManager vlrpBm = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.VI_LC_RENT_PLAN_NEW"); List> listData = DataOperatorUtil.getDataBySql("select cast(lfp.PLAN_MONEY as decimal(18,2))-cast(ifnull(lfit.fact_money,'0') as decimal(18,2))-cast(IfNULL(lfi.fact_money,'0') as decimal(18,2)) as fact_money,lci.id as contractId " + "from lc_fund_plan lfp left join lb_contract_info lci on lci.id=lfp.CONTRACT_ID " + " left join (select sum(fact_money) fact_money,PAYMENT_NUMBER from lc_fund_income_temp where FEE_TYPE='feetype16' and is_flowing='0' and ROLL_BACK='0' group by PAYMENT_NUMBER) lfit on lfp.PAYMENT_NUMBER=lfit.PAYMENT_NUMBER " + @@ -93,15 +99,14 @@ public class MarginDeduction implements Job{ money=money.subtract(corpusOver); } - BizObject lrp = lrpBm.createQuery(" id=:id ").setParameter("id",vlrpBo.getAttribute("ID").toString()).getSingleResult(true); BigDecimal drent = new BigDecimal(lriBo.getAttribute("CORPUS").toString()).add( new BigDecimal( lriBo.getAttribute("INTEREST").toString() ) ); BigDecimal rentOver = new BigDecimal(vlrpBo.getAttribute("rent_over").toString()); String fundIncomeId = UUID.randomUUID().toString().replaceAll("-",""); lriBo.setAttributeValue("PROJECT_ID",vlrpBo.getAttribute("PROJECT_ID")); - lriBo.setAttributeValue("PROJECT_PLAN_NUMBER",lrp.getAttribute("PROJECT_PLAN_NUMBER")); + lriBo.setAttributeValue("PROJECT_PLAN_NUMBER",vlrpBo.getAttribute("PROJECT_PLAN_NUMBER")); lriBo.setAttributeValue("CONTRACT_ID",vlrpBo.getAttribute("CONTRACT_ID")); - lriBo.setAttributeValue("CONTRACT_PLAN_NUMBER",lrp.getAttribute("CONTRACT_PLAN_NUMBER")); + lriBo.setAttributeValue("CONTRACT_PLAN_NUMBER",vlrpBo.getAttribute("CONTRACT_PLAN_NUMBER")); lriBo.setAttributeValue("PAYMENT_NUMBER",vlrpBo.getAttribute("PAYMENT_NUMBER")); lriBo.setAttributeValue("PLAN_ID",vlrpBo.getAttribute("ID")); lriBo.setAttributeValue("PLAN_LIST",vlrpBo.getAttribute("PLAN_LIST")); @@ -148,11 +153,11 @@ public class MarginDeduction implements Job{ lfiBm.saveObject(lfiBo); if( drent.compareTo(rentOver) == 0 ){//如果租金等于应该租金,修改租金计划表中的状态 - lrp.setAttributeValue("COLLECT_STATUS","保证金抵扣"); - lrp.setAttributeValue("COLLECT_MSG","保证金抵扣"); - lrpBm.saveObject(lrp); + Sqlca.executeSQL("update lc_rent_plan set collect_status='保证金抵扣',collect_msg='保证金抵扣' where id = '" + vlrpBo.getAttribute("ID").toString() + "'"); } - + + logger.warn("contract_id:" + contractId + " plan_id:" + vlrpBo.getAttribute("ID").toString() + " fact_money:" + listData.get(i).get("fact_money")); + /** * 生成凭证 */ @@ -166,7 +171,7 @@ public class MarginDeduction implements Job{ } catch (Exception e1) { try { - if(tx!=null)tx.rollback(); + if (tx != null) tx.rollback(); } catch (JBOException e) { e.printStackTrace(); }