diff --git a/WebContent/Accounting/LoanSimulation/LoanBasicInfoBusiness.jsp b/WebContent/Accounting/LoanSimulation/LoanBasicInfoBusiness.jsp index 222c5821e..70899694f 100644 --- a/WebContent/Accounting/LoanSimulation/LoanBasicInfoBusiness.jsp +++ b/WebContent/Accounting/LoanSimulation/LoanBasicInfoBusiness.jsp @@ -706,8 +706,10 @@ function changeSettleMethod2(){ function changeRateType(){ var a={}; - a["fixed"]={"fixed":1,"add":1}; - a["base"]={"fixed":1,"add":1}; + //a["fixed"]={"fixed":1,"add":1}; + //a["base"]={"fixed":1,"add":1}; + a["fixed"]={"fixed":1,"calculation":1,"add":1}; + a["base"]={"fixed":1,"calculation":1,"add":1}; a["proportion"]={"fixed":1,"calculation":1,"add":1}; a["add"]={"fixed":1,"calculation":1,"add":1}; diff --git a/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java b/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java index c53d8ac59..ad4370d92 100644 --- a/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java +++ b/calc/com/tenwa/reckon/executor/FundFundPlanExecutor.java @@ -156,11 +156,7 @@ public class FundFundPlanExecutor { Map cleanLeaseMoney = new HashMap(); cleanLeaseMoney.put("CostType01", "pay_type_out"); cleanLeaseMoney.put("CostType02", "PaymentTime1"); - if(!"business_product".equals(tcb.getProductType())) { - map.put("CLEAN_LEASE_MONEY", cleanLeaseMoney); - } else { - map.put("EQUIP_AMT", cleanLeaseMoney); - } + map.put("CLEAN_LEASE_MONEY", cleanLeaseMoney); String custid=""; if("quoted_price".equals(tcb.getCalType())){ custid=tcb.getDocId(); @@ -192,7 +188,15 @@ public class FundFundPlanExecutor { } //取值 - BigDecimal temp =new BigDecimal(con.getAttribute(key).getDouble()); + BigDecimal temp = null; + + if("business_product".equals(tcb.getProductType()) + && "CLEAN_LEASE_MONEY".equals(key)) { + temp = new BigDecimal(con.getAttribute("EQUIP_AMT").getDouble()); + } else { + temp = new BigDecimal(con.getAttribute(key).getDouble()); + } + Item item = null; for(Item it : items) { if(key.equals(it.getRelativeCode())) { diff --git a/src/com/amarsoft/app/flow/FlowAction.java b/src/com/amarsoft/app/flow/FlowAction.java index b6556d9bc..132ce379e 100644 --- a/src/com/amarsoft/app/flow/FlowAction.java +++ b/src/com/amarsoft/app/flow/FlowAction.java @@ -23,6 +23,9 @@ import jbo.sys.USER_TASK_INFO; import org.apache.commons.lang.StringUtils; +import com.amarsoft.amarscript.Any; +import com.amarsoft.amarscript.ELContext; +import com.amarsoft.amarscript.Expression; import com.amarsoft.app.lc.util.DateAssistant; import com.amarsoft.are.ARE; import com.amarsoft.are.jbo.BizObject; @@ -492,6 +495,36 @@ public class FlowAction { "select O.flowno,O.phaseno,O.objecttype,O.objectno,O.userid,O.orgid from O where serialNo=:serialNo ") .setParameter("serialNo", taskNo).getSingleResult(false); + String objectNo = ft.getAttribute("objectno").getString(); + + BizObject boFBO = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME, tx) + .createQuery("flow_unid = '" + objectNo + "'").getSingleResult(false); + + String fixedFlowParam = boFBO.getAttribute("FixedFlowParam").getString(); + + JSONObject jsonFixedFlowParam = JSONDecoder.decode(fixedFlowParam.replaceAll("@", ",")); + Map scriptMap = FileOperatorUtil.getJsonObjectToMap(jsonFixedFlowParam); + + scriptMap.put("ObjectNo", objectNo); + + BizObjectManager bm1 = JBOFactory.getFactory().getManager(FLOW_MODEL.CLASS_NAME); + BizObjectQuery bq1 = bm1 + .createQuery( + "SELECT o.BACKSCRIPT FROM O where O.flowno=:flowno and O.phaseno='" + ft.getAttribute("phaseno").getString() + "'") + .setParameter("flowno", ft.getAttribute("flowno").getString()); + BizObject stepConfig = bq1.getSingleResult(false); + String strScript = stepConfig.getAttribute("BACKSCRIPT").getString(); + if (null != strScript && strScript.length() > 5) { + ELContext context = new ELContext(); + context.setJBOTransaction(tx); + for (String key : scriptMap.keySet()) { + context.defineVarible("#" + key, scriptMap.get(key)); + } + context.defineBean("flowBussinessObject", boFBO); + + Any returnData = Expression.getExpressionValue(strScript, context); + } + //处理任务池 BizObjectManager utdbom = JBOFactory.getBizObjectManager(USER_TASK_DATA.CLASS_NAME, tx); BizObjectManager utibom = JBOFactory.getBizObjectManager(USER_TASK_INFO.CLASS_NAME, tx); diff --git a/src_sys/com/tenwa/flow/action/comm/FlowBussionAction.java b/src_sys/com/tenwa/flow/action/comm/FlowBussionAction.java index 25da4111d..08518a1d9 100644 --- a/src_sys/com/tenwa/flow/action/comm/FlowBussionAction.java +++ b/src_sys/com/tenwa/flow/action/comm/FlowBussionAction.java @@ -125,6 +125,45 @@ public class FlowBussionAction extends CommonAction { Any returnData = Expression.getExpressionValue(strScript, context); } } + + public void executeFlowBackScript(JBOTransaction tx, + BizObject flowBussinessObject) throws Exception { + Item item = CodeManager.getItem("ApplyType", this.getApplyType()); + String flowno = item.getAttribute2(); + Map scriptMap = new HashMap(); + scriptMap.put("ObjectNo", flowBussinessObject.getAttribute("flow_unid") + .getString()); + scriptMap.put("UserID", this.getAsUser().getUserID()); + scriptMap.put("UserName", this.getAsUser().getUserName()); + scriptMap.put("OrgID", this.getAsUser().getOrgID()); + scriptMap.put("OrgName", this.getAsUser().getOrgName()); + scriptMap.put("FlowUnid", flowBussinessObject.getAttribute("flow_unid").getString()); + scriptMap.put("FlowNo", flowno); + scriptMap.put("FlowName", this.getFlowName()); + scriptMap.put("FlowKey", this.getFlowKey()); + scriptMap.put("custname",this.getCustname()); + Transaction Sqlca = null; + BizObjectManager bm1 = null; + BizObjectQuery bq1 = null; + bm1 = JBOFactory.getFactory().getManager(FLOW_MODEL.CLASS_NAME); + bq1 = bm1 + .createQuery( + "SELECT o.PRESCRIPT FROM O where O.flowno=:flowno") + .setParameter("flowno", flowno); + BizObject stepConfig = bq1.getSingleResult(true); + String strScript = stepConfig.getAttribute("PRESCRIPT").getString(); + if (null != strScript && strScript.length() > 5) { + ELContext context = new ELContext(); + context.setJBOTransaction(tx); + for (String key : scriptMap.keySet()) { + context.defineVarible("#" + key, scriptMap.get(key)); + } + context.defineBean("flowBussinessObject", flowBussinessObject); + + Any returnData = Expression.getExpressionValue(strScript, context); + } + } + public void initFlowInfo() throws Exception{ BizObjectManager code = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME); BizObjectManager cataLog = JBOFactory.getBizObjectManager(FLOW_CATALOG.CLASS_NAME); diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/DeleteDiscountOccupy.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/DeleteDiscountOccupy.java index b2b25b24f..edad09623 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/DeleteDiscountOccupy.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/DeleteDiscountOccupy.java @@ -17,7 +17,7 @@ import com.tenwa.flow.baseBussion.BaseBussiness; public class DeleteDiscountOccupy extends BaseBussiness { @Override public Object run(Transaction Sqlca) throws Exception { - this.initBussinessParam(Sqlca); + //this.initBussinessParam(Sqlca); String projectId=this.getAttribute("ProjectId").toString(); BizObjectManager ldoManage = JBOFactory.getBizObjectManager(LB_DISCOUNT_OCCUPY.CLASS_NAME,Sqlca); BizObject ldo = ldoManage.createQuery("project_id=:projectid").setParameter("projectid", projectId).getSingleResult(true); diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/InsertDiscountOccupy.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/InsertDiscountOccupy.java index f0400ca2e..72020bb44 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/InsertDiscountOccupy.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/InsertDiscountOccupy.java @@ -27,6 +27,7 @@ public class InsertDiscountOccupy extends BaseBussiness { String curUserID=this.getAttribute("CurUserID").toString(); String flowUnid=this.getAttribute("FlowUnid").toString(); String productId=this.getAttribute("ProductId").toString(); + String projectId=this.getAttribute("ProjectId").toString(); Map discount = ProductParamUtil.getProductComponentAllParameters(productId, "PRD0315", "DISCOUNT"); if(!discount.isEmpty() && !"".equals(discount.get("DISCOUNT_ALL")) && !"".equals(discount.get("CostType08"))) { synchronized (this) { @@ -37,7 +38,7 @@ public class InsertDiscountOccupy extends BaseBussiness { if("0".equals(result)) { ASUser user = ASUser.getUser(curUserID, tran); tran.executeSQL(new SqlObject("insert into lb_discount_occupy(id, product_id, flowunid, project_id, discount, inputuserid, inputorgid, inputtime) " - + " values (replace(uuid(),'-',''), '" + productId + "', '" + flowUnid + "', '" + uuid.replaceAll("-", "") + "'," + + " values (replace(uuid(),'-',''), '" + productId + "', '" + flowUnid + "', '" + projectId + "'," + " " + discountValue + ", '" + curUserID + "', '" + user.getOrgID() + "', replace(now(),'-','/'))")); } else { throw new BusinessException("产品额度已用完");