diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBEquipment_Car/LBEquipmentList.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBEquipment_Car/LBEquipmentList.jsp index 241897ecd..2384c9280 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBEquipment_Car/LBEquipmentList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBEquipment_Car/LBEquipmentList.jsp @@ -37,6 +37,7 @@ String contractid = CurPage.getParameter("ContractId"); String showtype = CurPage.getParameter("ShowType"); String operationType = CurPage.getParameter("operationType"); + String flowNo = CurPage.getParameter("FlowNo"); String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号 if(sFlowUnid == null)sFlowUnid = ""; @@ -69,6 +70,10 @@ <%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List03;Describe=定义数据对象;]~*/%> <% + if(flowNo==null){ + sTempletNo="LBEquipmentListT4CarContract"; + sFlowUnid=contractid; + } ASObjectModel doTemp = new ASObjectModel(sTempletNo); /* if(null!=ishistory&&ishistory.equals("true")){ doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataListHistory"); @@ -87,7 +92,7 @@ <%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List04;Describe=定义按钮;]~*/%> <% - String flowNo = CurPage.getParameter("FlowNo"); + String falg = "true"; if("BContractApproveFlow".equals(flowNo)||"BContractChangeFlow".equals(flowNo)){ falg = "false"; diff --git a/src_sql/view/vi_business_info.sql b/src_sql/view/vi_business_info.sql index 24c9248f9..142bd1300 100644 --- a/src_sql/view/vi_business_info.sql +++ b/src_sql/view/vi_business_info.sql @@ -1,10 +1,50 @@ -CREATE VIEW apzl.vi_business_info AS -(SELECT lci.id id,lci.project_id project_id,lci.PRODUCT_ID PRODUCT_ID,lci.flowunid flowunid,cs.business_status CONTRACT_STAT,lci.contract_no contract_no,lul.CUSTOMER_NAME CUSTOMER_NAME,lpi.project_no PROJECT_NO,lec.FRAME_NUMBER FRAME_NUMBER,lec.VNDR_NAME VNDR_NAME,lfi.APPLYPAY_DATE APPLYPAY_DATE,lci.PROJECT_DATE PROJECT_DATE -FROM lb_contract_info lci -LEFT JOIN (SELECT bs.contract_number,c.itemname business_status FROM business_status bs LEFT JOIN code_library c ON c.itemno = bs.business_status AND c.codeno = 'BusinessStatus' WHERE EXISTS(SELECT 1 FROM (SELECT contract_number,MAX(inputtime) AS inputtime FROM business_status GROUP BY contract_number) t WHERE t.contract_number = bs.contract_number AND inputtime = bs.inputtime)) cs ON cs.contract_number=lci.contract_no -LEFT JOIN lb_union_lessee lul ON lci.PROJECT_ID = lul.PROJECT_ID -LEFT JOIN lb_project_info lpi ON lpi.id=lci.project_id -LEFT JOIN lb_equipment_car lec ON lec.contract_id=lci.id -LEFT JOIN (SELECT flow_bussiness_object.contract_id AS contract_id,LEFT(flow_bussiness_object.InputTime,10) AS APPLYPAY_DATE FROM flow_bussiness_object WHERE (flow_bussiness_object.flow_name = '付款申请(汽车)') GROUP BY flow_bussiness_object.contract_id) lfi ON lci.ID = lfi.contract_id - WHERE lci.BUSINESSTYPE = '1' -); +DELIMITER $$ + +ALTER ALGORITHM=UNDEFINED DEFINER=`apzl`@`%` SQL SECURITY DEFINER VIEW `vi_business_info` AS ( +SELECT + `lci`.`ID` AS `id`, + `lci`.`PROJECT_ID` AS `project_id`, + `lci`.`PRODUCT_ID` AS `PRODUCT_ID`, + `lci`.`FLOWUNID` AS `flowunid`, + `cs`.`business_status` AS `CONTRACT_STAT`, + `lci`.`CONTRACT_NO` AS `contract_no`, + `lul`.`CUSTOMER_NAME` AS `CUSTOMER_NAME`, + `lpi`.`PROJECT_NO` AS `PROJECT_NO`, + `lec`.`FRAME_NUMBER` AS `FRAME_NUMBER`, + `lec`.`VNDR_NAME` AS `VNDR_NAME`, + `lfi`.`APPLYPAY_DATE` AS `APPLYPAY_DATE`, + `lci`.`PROJECT_DATE` AS `PROJECT_DATE` +FROM (((((`apzl`.`lb_contract_info` `lci` + LEFT JOIN (SELECT + `bs`.`contract_number` AS `contract_number`, + `c`.`itemname` AS `business_status` + FROM (`apzl`.`business_status` `bs` + LEFT JOIN `apzl`.`code_library` `c` + ON (((`c`.`itemno` = `bs`.`business_status`) + AND (`c`.`codeno` = 'BusinessStatus')))) + WHERE EXISTS(SELECT + 1 + FROM (SELECT + `apzl`.`business_status`.`contract_number` AS `contract_number`, + MAX(`apzl`.`business_status`.`inputtime`) AS `inputtime` + FROM `apzl`.`business_status` + GROUP BY `apzl`.`business_status`.`contract_number`) `t` + WHERE ((`t`.`contract_number` = `bs`.`contract_number`) + AND (`t`.`inputtime` = `bs`.`inputtime`)))) `cs` + ON ((`cs`.`contract_number` = `lci`.`CONTRACT_NO`))) + LEFT JOIN `apzl`.`lb_union_lessee` `lul` + ON ((`lci`.`PROJECT_ID` = `lul`.`PROJECT_ID`))) + LEFT JOIN `apzl`.`lb_project_info` `lpi` + ON ((`lpi`.`ID` = `lci`.`PROJECT_ID`))) + LEFT JOIN `apzl`.`lb_equipment_car` `lec` + ON ((`lec`.`CONTRACT_ID` = `lci`.`ID`))) + LEFT JOIN (SELECT + `apzl`.`flow_bussiness_object`.`contract_id` AS `contract_id`, + LEFT(`apzl`.`flow_bussiness_object`.`InputTime`,10) AS `APPLYPAY_DATE` + FROM `apzl`.`flow_bussiness_object` + WHERE (`apzl`.`flow_bussiness_object`.`flow_name` = '付款申请(汽车)') + GROUP BY `apzl`.`flow_bussiness_object`.`contract_id`) `lfi` + ON ((`lci`.`ID` = `lfi`.`contract_id`))) +WHERE (`lci`.`BUSINESSTYPE` = '1' AND lec.car_attribute='head'))$$ + +DELIMITER ; \ No newline at end of file diff --git a/src_tenwa/com/tenwa/flow/rent/copyrent/InsertRentPlanStatus.java b/src_tenwa/com/tenwa/flow/rent/copyrent/InsertRentPlanStatus.java index cbfc8b99b..4ff7512bf 100644 --- a/src_tenwa/com/tenwa/flow/rent/copyrent/InsertRentPlanStatus.java +++ b/src_tenwa/com/tenwa/flow/rent/copyrent/InsertRentPlanStatus.java @@ -1,52 +1,53 @@ -package com.tenwa.flow.rent.copyrent; -import java.math.BigDecimal; -import java.util.List; - -import jbo.app.tenwa.calc.LC_RENT_INCOME; -import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP; -import jbo.app.tenwa.calc.LC_RENT_PLAN; -import jbo.com.tenwa.entity.comm.flow.D_DEPOSITCHARGE_INFO; -import jbo.com.tenwa.entity.comm.flow.D_DEPOSITRETURN_INFO; - -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.awe.util.Transaction; -import com.tenwa.collectaudit.cache.CollectAuditInfoCache; -import com.tenwa.flow.baseBussion.BaseBussiness; - -public class InsertRentPlanStatus extends BaseBussiness{ - public Object run(Transaction Sqlca) throws Exception{ - this.initBussinessParam(Sqlca.getTransaction()); - String flowunid = (String)this.getAttribute("ObjectNo"); - - List boLRITs=JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME,"flowunid=:flowunid").setParameter("flowunid", flowunid).getResultList(false); - BizObjectManager bomLRP = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME, Sqlca.getTransaction()); - - CollectAuditInfoCache calc = new CollectAuditInfoCache(); - for(int i=0;i boLRITs=JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME,"flowunid=:flowunid").setParameter("flowunid", flowunid).getResultList(false); + BizObjectManager bomLRP = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME, Sqlca.getTransaction()); + CollectAuditInfoCache calc = new CollectAuditInfoCache(); + for(int i=0;i'代偿' or collect_status is null)") + .setParameter("CONTRACT_ID", contractId).setParameter("PLAN_LIST", planList).executeUpdate(); + }else{ + bomLRP.createQuery("update O set COLLECT_STATUS='网银收款',COLLECT_MSG='网银收款' where CONTRACT_ID=:CONTRACT_ID and PLAN_LIST=:PLAN_LIST") + .setParameter("CONTRACT_ID", contractId).setParameter("PLAN_LIST", planList).executeUpdate(); + } + } + String sMessage="true"; + return sMessage; + } +} diff --git a/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java b/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java index e54ec7364..fbcd4e640 100644 --- a/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java @@ -1,77 +1,78 @@ -package com.tenwa.lease.flow.rent.rentreback; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -import jbo.app.tenwa.calc.LC_FUND_INCOME; -import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; -import jbo.app.tenwa.calc.LC_RENT_INCOME; -import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP; -import jbo.app.tenwa.calc.LC_RENT_PLAN; - -import com.amarsoft.are.jbo.BizObject; -import com.amarsoft.are.jbo.BizObjectManager; -import com.amarsoft.are.jbo.JBOFactory; -import com.amarsoft.awe.util.Transaction; -import com.tenwa.comm.util.jboutil.DataOperatorUtil; -import com.tenwa.flow.baseBussion.BaseBussiness; -import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService; -import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum; -import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; - -public class LCRentIncomeTempToFormalBusiness extends BaseBussiness{ - public Object run(Transaction Sqlca) throws Exception{ - this.initBussinessParam(Sqlca); - LeaseFlowBaseService service=new LeaseFlowBaseServiceImp(); - MapfromCondtion=this.getDefaultTempToFormalFromCondtion(); - //将正式表中状态改为红冲状态 - BizObjectManager fiFormal = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME); - BizObjectManager fiTemp = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME); - BizObjectManager riFormal = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME); - BizObjectManager riTemp = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME); - BizObjectManager bom_lrp = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME); - Sqlca.join(fiFormal); - Sqlca.join(fiTemp); - Sqlca.join(riFormal); - Sqlca.join(riTemp); - Sqlca.join(bom_lrp); - List fits = DataOperatorUtil.getSetJBO(LC_FUND_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca); - List rits = DataOperatorUtil.getSetJBO(LC_RENT_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca); - String fsql="update O set ROLL_BACK=1 where ID=:ID "; - String tsql="update O set IS_FLOWING=1 where ID=:ID "; - String lsql = "update O set collect_status=:collect_status,collect_msg='租金红冲' where ID=:ID"; - MapotherProperty=this.getDefaultOtherProperty(); - if(fits.size()>0){ - for(BizObject fit:fits){ - fiFormal.createQuery(fsql).setParameter("ID", fit.getAttribute("INCOME_ID").getString()).executeUpdate(); - fiTemp.createQuery(tsql).setParameter("ID", fit.getAttribute("ID").getString()).executeUpdate(); - } - service.copyFundIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null); - } - if(rits.size()>0){ - for(BizObject rit:rits){ - riFormal.createQuery(fsql).setParameter("ID", rit.getAttribute("INCOME_ID").getString()).executeUpdate(); - riTemp.createQuery(tsql).setParameter("ID", rit.getAttribute("ID").getString()).executeUpdate(); - } - service.copyRentIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null); - } - List lrits = riTemp.createQuery("select plan_id from O where flowunid=:flowunid group by plan_id").setParameter("flowunid", this.getAttribute("flowunid").toString()).getResultList(false); - if(lrits.size()>0){ - for(BizObject lrit:lrits){ - String status = ""; - String planId = lrit.getAttribute("plan_id").toString(); - BizObject bo_lrp = bom_lrp.createQuery("select rent from O where id=:id").setParameter("id", planId).getSingleResult(false); - BizObject bo_lri = riFormal.createQuery("select sum(rent) as rent from O where plan_id=:plan_id group by plan_id").setParameter("plan_id", planId).getSingleResult(false); - String lriRent = bo_lri.getAttribute("rent").toString(); - if(new BigDecimal(lriRent).compareTo(new BigDecimal("0"))==1&&new BigDecimal(lriRent).compareTo(new BigDecimal(bo_lrp.getAttribute("rent").toString()))==-1){ - status = "部分收款"; - } - bom_lrp.createQuery(lsql).setParameter("collect_status", status).setParameter("ID", planId).executeUpdate(); - } - } - String sMessage="true"; - return sMessage; - } -} - +package com.tenwa.lease.flow.rent.rentreback; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +import jbo.app.tenwa.calc.LC_FUND_INCOME; +import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; +import jbo.app.tenwa.calc.LC_RENT_INCOME; +import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP; +import jbo.app.tenwa.calc.LC_RENT_PLAN; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.awe.util.Transaction; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.flow.baseBussion.BaseBussiness; +import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService; +import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum; +import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp; + +public class LCRentIncomeTempToFormalBusiness extends BaseBussiness{ + public Object run(Transaction Sqlca) throws Exception{ + this.initBussinessParam(Sqlca); + LeaseFlowBaseService service=new LeaseFlowBaseServiceImp(); + MapfromCondtion=this.getDefaultTempToFormalFromCondtion(); + //将正式表中状态改为红冲状态 + BizObjectManager fiFormal = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME); + BizObjectManager fiTemp = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME); + BizObjectManager riFormal = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME); + BizObjectManager riTemp = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME); + BizObjectManager bom_lrp = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME); + Sqlca.join(fiFormal); + Sqlca.join(fiTemp); + Sqlca.join(riFormal); + Sqlca.join(riTemp); + Sqlca.join(bom_lrp); + List fits = DataOperatorUtil.getSetJBO(LC_FUND_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca); + List rits = DataOperatorUtil.getSetJBO(LC_RENT_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca); + String fsql="update O set ROLL_BACK=1 where ID=:ID "; + String tsql="update O set IS_FLOWING=1 where ID=:ID "; + String lsql = "update O set collect_status=:collect_status,collect_msg='租金红冲' where ID=:ID"; + MapotherProperty=this.getDefaultOtherProperty(); + if(fits.size()>0){ + for(BizObject fit:fits){ + fiFormal.createQuery(fsql).setParameter("ID", fit.getAttribute("INCOME_ID").getString()).executeUpdate(); + fiTemp.createQuery(tsql).setParameter("ID", fit.getAttribute("ID").getString()).executeUpdate(); + } + service.copyFundIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null); + } + if(rits.size()>0){ + for(BizObject rit:rits){ + riFormal.createQuery(fsql).setParameter("ID", rit.getAttribute("INCOME_ID").getString()).executeUpdate(); + riTemp.createQuery(tsql).setParameter("ID", rit.getAttribute("ID").getString()).executeUpdate(); + } + service.copyRentIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null); + } + String flowunid= this.getAttribute("FlowUnid").toString(); + List lrits = riTemp.createQuery("select plan_id from O where flowunid=:flowunid group by plan_id").setParameter("flowunid", flowunid).getResultList(false); + if(lrits.size()>0){ + for(BizObject lrit:lrits){ + String status = ""; + String planId = lrit.getAttribute("plan_id").toString(); + BizObject bo_lrp = bom_lrp.createQuery("select rent from O where id=:id").setParameter("id", planId).getSingleResult(false); + BizObject bo_lri = riFormal.createQuery("select sum(rent) as v.rent from O where plan_id=:plan_id group by plan_id").setParameter("plan_id", planId).getSingleResult(false); + String lriRent = bo_lri.getAttribute("rent").toString(); + if(new BigDecimal(lriRent).compareTo(new BigDecimal("0"))==1&&new BigDecimal(lriRent).compareTo(new BigDecimal(bo_lrp.getAttribute("rent").toString()))==-1){ + status = "部分收款"; + } + bom_lrp.createQuery(lsql).setParameter("collect_status", status).setParameter("ID", planId).executeUpdate(); + } + } + String sMessage="true"; + return sMessage; + } +} +