diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp index a9eae5b9b..539ac89e9 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LCContractTerminate/LCContractTerminateInfo.jsp @@ -340,8 +340,9 @@ if(SETTLE_METHOD == "SETTLE_METHOD02"){ ret = AsControl.RunJavaMethodTrans("com.tenwa.voucher.CreateVoucherProcess.EarlyContract","partSettlement","REPURCHASE_RATIO="+EQUIPMENT_RATIO+",flowunid=<%=flowunid%>,contractId=<%=contractId%>,START_DATE=<%=START_DATE%>,plannumber=<%=PAYMENT_NUMBER%>,calType=pay_process,PAYDAY_ADJUST="+PAYDAY_ADJUST+",SettleMethod="+SETTLE_METHOD); }else{ - AsControl.RunJavaMethod("com.tenwa.reckon.executor.CreateTransactionExecutor","runTerminate","flowunid=<%=flowunid%>,plannumber=<%=paymentnumber%>,productId=<%=productId%>,calType=pay_process,MAXIMUM_TOTAL=MAXIMUM_TOTAL,REPURCHASE_MONEY = REPURCHASE_MONEY"); - ret = "操作成功" + AsControl.RunJavaMethod("com.tenwa.voucher.CreateVoucherProcess.EarlyContract","alterdata","flowunid=<%=flowunid%>"); + AsControl.RunJavaMethod("com.tenwa.reckon.executor.CreateTransactionExecutor","runTerminate","flowunid=<%=flowunid%>,plannumber=<%=paymentnumber%>,productId=<%=productId%>,calType=pay_process,MAXIMUM_TOTAL=MAXIMUM_TOTAL,REPURCHASE_MONEY = REPURCHASE_MONEY"); + ret = "操作成功" } if(ret=="操作成功"){ alert("提前结清操作成功"); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java index f8ada3f5d..6b006b3fe 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/EarlyContract.java @@ -319,6 +319,26 @@ public class EarlyContract { return ""+NOMINAL_PRICE+""; } + //全部结清更新租赁物临时表 + public void alterdata(JBOTransaction tx) { + Transaction Sqlca = null; + try { + Sqlca = Transaction.createTransaction(tx); + String sql="UPDATE LB_EQUIPMENT_CAR_TEMP SET SETTLE_STATUS='3' WHERE (TERMINATE_TYPE IS NULL OR TERMINATE_TYPE='1') AND FLOWUNID='"+flowunid+"' "; + Sqlca.executeSQL(sql); + Sqlca.commit(); + }catch(Exception e) { + try { + Sqlca.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + } + + } + + /** * 全部结清,将租赁物等于未结清的标记为本次结清,如果是部分结清,将选中租赁物标记为本次结清 diff --git a/src_tenwa/com/tenwa/lease/flow/contract/commbusiness/LBInitContractStatusBusiness.java b/src_tenwa/com/tenwa/lease/flow/contract/commbusiness/LBInitContractStatusBusiness.java index c9ea03b95..8f5e661f4 100644 --- a/src_tenwa/com/tenwa/lease/flow/contract/commbusiness/LBInitContractStatusBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/contract/commbusiness/LBInitContractStatusBusiness.java @@ -2,7 +2,10 @@ package com.tenwa.lease.flow.contract.commbusiness; import com.amarsoft.are.jbo.BizObjectManager; import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.awe.util.ASResultSet; +import com.amarsoft.awe.util.SqlObject; import com.amarsoft.awe.util.Transaction; +import com.amarsoft.context.ASUser; import com.tenwa.flow.baseBussion.BaseBussiness; import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; @@ -17,7 +20,21 @@ public class LBInitContractStatusBusiness extends BaseBussiness { BizObjectManager bom=JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME); Sqlca.join(bom); bom.createQuery("update O set CONTRACT_STATUS=:contractstatus where id=:contractid").setParameter("contractstatus", contractStatus).setParameter("contractid", contractId).executeUpdate(); + if(contractStatus.equals("100")) { + settle(Sqlca); + } String sMessage="true"; return sMessage; } + + public void settle(Transaction Sqlca) throws Exception { + this.initBussinessParam(Sqlca); + String contractid = this.getAttribute("ContractId").toString(); //当前用户对象 + String CurUser = this.getAttribute("CurUserID").toString(); //当前用户对象 + String flowunid = this.getAttribute("ObjectNo").toString(); // 获取流程编号 + String SQL="call settle_contract_info('"+contractid+"','"+flowunid+"','"+CurUser+"')"; + SqlObject asql = new SqlObject(SQL); + Sqlca.executeSQL(asql); + } + } diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentFormalToTempBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentFormalToTempBusiness.java index 4b7bbe12b..da0fd23c9 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentFormalToTempBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentFormalToTempBusiness.java @@ -40,7 +40,7 @@ public class LBEquipmentFormalToTempBusiness extends BaseBussiness { String id01; String id02; String flowUnid=this.getAttribute("ObjectNo").toString(); - String sql="select round(round(lect.EQUIP_PRICE / ifnull(t.num, 1), 4), 4) as PROPROTION_NUMBER,f.id as id01,lect.id as id02 from lb_equipment_car_temp lect left join (select CONTRACT_ID,sum(ifnull(EQUIP_PRICE, 0)) as num from apzl.lb_equipment_car group by CONTRACT_ID ) t on t.CONTRACT_ID = lect.CONTRACT_ID left join (select id from apzl.lb_equipment_car_temp a where FLOWUNID = '"+flowUnid+"'order by id desc limit 1) f on 1=1 where lect.FLOWUNID = '"+flowUnid+"' order by lect.id"; + String sql="select ifnull(round(round(lect.EQUIP_PRICE / ifnull(t.num, 1), 4), 4),0) as PROPROTION_NUMBER,f.id as id01,lect.id as id02 from lb_equipment_car_temp lect left join (select CONTRACT_ID,sum(ifnull(EQUIP_PRICE, 0)) as num from apzl.lb_equipment_car group by CONTRACT_ID ) t on t.CONTRACT_ID = lect.CONTRACT_ID left join (select id from apzl.lb_equipment_car_temp a where FLOWUNID = '"+flowUnid+"'order by id desc limit 1) f on 1=1 where lect.FLOWUNID = '"+flowUnid+"' order by lect.id"; List> list=DataOperatorUtil.getDataBySql(Sqlca, sql, null); for (Map let : list) { PROPROTION_NUMBER = let.get("PROPROTION_NUMBER"); diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentTempToFormalBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentTempToFormalBusiness.java index 4cfa8e9ff..826d3afc3 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentTempToFormalBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBEquipmentTempToFormalBusiness.java @@ -21,6 +21,8 @@ public class LBEquipmentTempToFormalBusiness extends BaseBussiness { MapotherProperty=this.getDefaultOtherProperty(); if("合同起租流程".equals(flowname)){ otherProperty.put("status", "0010"); + }else if("提前结清".equals(flowname)) { + Sqlca.executeSQL(new SqlObject("update LB_EQUIPMENT_CAR_TEMP set TERMINATE_TYPE='2' where TERMINATE_TYPE = '3' and FLOWUNID='"+flowunid+"'")); } Sqlca.executeSQL(new SqlObject("update LB_EQUIPMENT_CAR_TEMP set IS_FLOW='N' where FLOWUNID='"+flowunid+"'")); service.copyOrLoadLBEquipment(Sqlca, fromCondtion, toCondtion, otherProperty, ServiceOperatorEnum.TempToFormal, null);