From 080954033c75cac18213dfc04a9358497fde49fc Mon Sep 17 00:00:00 2001 From: liujiaji Date: Fri, 3 Aug 2018 22:18:24 +0800 Subject: [PATCH] =?UTF-8?q?app=20=E6=B5=8B=E8=AF=95=E5=B7=A5=E5=85=B7=20al?= =?UTF-8?q?t+c=20=E5=8A=9F=E8=83=BD=20=E6=B8=85=E9=99=A4=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E8=84=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/Frame/page/js/as_debug.js | 51 +++--- WebContent/WEB-INF/etc/app_config.properties | 1 + .../reckon/product/ProductCondition.java | 2 +- .../app/util/ReloadCalculationToolAction.java | 29 ++++ .../loan/product/ProductBaseLoanTools.java | 162 +++++++++++------- .../impl/LoanSimulationBasicServiceImpl.java | 34 ++-- .../apply/business/start/bo/BusinessBO.java | 5 +- .../com/base/constant/RestfullConstant.java | 3 + src_app_fresh/com/base/util/DateUtil.java | 80 ++++++--- 9 files changed, 245 insertions(+), 122 deletions(-) create mode 100644 src/com/amarsoft/app/util/ReloadCalculationToolAction.java diff --git a/WebContent/Frame/page/js/as_debug.js b/WebContent/Frame/page/js/as_debug.js index 65a0667e8..a2c64a04e 100644 --- a/WebContent/Frame/page/js/as_debug.js +++ b/WebContent/Frame/page/js/as_debug.js @@ -11,7 +11,7 @@ var AsDebug = { showWindow:function() { var d = top.dialog({ id: 'as-debug-dialog', - title: 'µ÷ÊÔ¹¤¾ßÀ¸['+AsDebug.getURL()+"]", + title: '���Թ�����['+AsDebug.getURL()+"]", onclose: function () { AsDebug.removeWindow(); }, @@ -27,8 +27,8 @@ var AsDebug = { html+=""; //html+=""+AsDebug.getPage()+" "; html+=""+AsDebug.getPage()+" "; - //html+="¡¾"+AsDebug.getURL()+"¡¿"; - html+="¡¾"+AsDebug.getURL()+"¡¿"; + //html+="��"+AsDebug.getURL()+"��"; + html+="��"+AsDebug.getURL()+"��"; html+=""; d.content(html); d.showModal(); @@ -46,8 +46,8 @@ var AsDebug = { width:width?width:"350px", height:height?height:"50px", skin:"ui-popup-show", - title: "" == title?"Ìáʾ":title, - okValue: 'È·¶¨', + title: "" == title?"��ʾ":title, + okValue: 'ȷ��', ok:function(){ AsDebug.removeMessage(); }, @@ -65,7 +65,7 @@ var AsDebug = { width:width?width:"350px", height:height?height:"40px", skin:"ui-popup-show", - title: "" == title?"Ìáʾ":title, + title: "" == title?"��ʾ":title, onclose: function(){ AsDebug.removeMessage(); }, @@ -105,28 +105,34 @@ var AsDebug = { reloadAREService:function(serviceId){ if (typeof(serviceId) == "undefined" || serviceId.length == 0) serviceId = "JBO"; var sReturn = RunJavaMethod("com.amarsoft.app.util.ReloadServiceAction","reloadService","ServiceId="+serviceId); - if(sReturn=="SUCCESS") alert(getMessageText("AWES0017")); // ÖØÔØARE·þÎñ³É¹¦£¡ - else alert(getMessageText("AWES0018")); // ÖØÔØARE·þÎñʧ°Ü£¡ + if(sReturn=="SUCCESS") alert(getMessageText("AWES0017")); // ����ARE����ɹ��� + else alert(getMessageText("AWES0018")); // ����ARE����ʧ�ܣ� + }, + reloadAppCalculation:function(){ + if (typeof(serviceId) == "undefined" || serviceId.length == 0) serviceId = "JBO"; + var sReturn = RunJavaMethod("com.amarsoft.app.util.ReloadCalculationToolAction","cleanCalculationToolData",""); + if(sReturn=="SUCCESS") alert("CLEAN Calculation Tool SUCCESS"); + else alert("CLEAN Calculation Tool FAIL"); }, reloadCacheAll:function(){ var sReturn = RunJavaMethod("com.amarsoft.app.util.ReloadCacheConfigAction","reloadCacheAll",""); - if(sReturn=="SUCCESS") alert(getMessageText("AWES0015")); // ÖØÔØ²ÎÊý»º´æ³É¹¦£¡ - else alert(getMessageText("AWES0016")); // ÖØÔØ²ÎÊý»º´æÊ§°Ü£¡ + if(sReturn=="SUCCESS") alert(getMessageText("AWES0015")); // ���ز����ɹ��� + else alert(getMessageText("AWES0016")); // ���ز����ʧ�ܣ� }, reloadCache:function(CacheType){ var sReturn = RunJavaMethod("com.amarsoft.app.util.ReloadCacheConfigAction","reloadCache","ConfigName="+CacheType); - if(sReturn=="SUCCESS") alert(getMessageText("AWES0019")); // ˢвÎÊý»º´æ³É¹¦£¡ - else alert(getMessageText("AWES0020")); // ˢвÎÊý»º´æÊ§°Ü£¡ + if(sReturn=="SUCCESS") alert(getMessageText("AWES0019")); // ˢ�²����ɹ��� + else alert(getMessageText("AWES0020")); // ˢ�²����ʧ�ܣ� }, reloadFixSkins:function(){ var sReturn = AsControl.RunJsp("/AppConfig/ControlCenter/ReloadSkin.jsp","ReloadType=FixSkins"); - if(sReturn=="SUCCESS") alert(getMessageText("AWES0021")); // ÖØÔØ¶¨ÖÆÆ¤·ô³É¹¦£¡ - else alert(getMessageText("AWES0022")); // ÖØÔØ¶¨ÖÆÆ¤·ôʧ°Ü£¡ + if(sReturn=="SUCCESS") alert(getMessageText("AWES0021")); // ���ض���Ƥ���ɹ��� + else alert(getMessageText("AWES0022")); // ���ض���Ƥ��ʧ�ܣ� }, reloadConfigFile:function(){ var sReturn = AsControl.RunJsp("/AppConfig/ControlCenter/ClearConfigFileCache.jsp","",""); - if(sReturn=="SUCCESS") alert(getMessageText("AWES0023")); // ÖØÔØÅäÖÃÎļþ³É¹¦£¡ - else alert(getMessageText("AWES0024")); // ÖØÔØÅäÖÃÎļþʧ°Ü£¡ + if(sReturn=="SUCCESS") alert(getMessageText("AWES0023")); // ���������ļ��ɹ��� + else alert(getMessageText("AWES0024")); // ���������ļ�ʧ�ܣ� }, openControlCenter:function() { this.removeWindow(); @@ -136,7 +142,7 @@ var AsDebug = { var d = dialog({ height:400, width:800, - title: 'Ò³ÃæÔËÐдúÂë['+AsDebug.getURL()+"]", + title: 'ҳ�����д���['+AsDebug.getURL()+"]", content: '', onshow: function () { $("#testSource").text(oBody.ownerDocument.documentElement.innerHTML); @@ -191,7 +197,7 @@ var AsDebug = { /** * * @param event - * @returns {Boolean} true ´¥·¢ÁËijЩʼþ false û´¥·¢Ê¼þ + * @returns {Boolean} true ������ijЩ�¼� false û�����¼� */ function keydownAction(event){ if(event.altKey && event.keyCode == 49){ //alt+1 @@ -207,15 +213,18 @@ function keydownAction(event){ }else if(event.altKey && event.keyCode == 52){ //alt+4 AsDebug.reloadAREService(); return true; + }else if(event.altKey && event.keyCode == 67){ //alt+c + AsDebug.reloadAppCalculation(); + return true; }else if(event.keyCode == "27"){ //esc AsDebug.removeWindow(); return true; - }else if(event.keyCode==113 && window.as_defaultExport){//F2µ¼³öexcel - as_defaultExport("F2µ¼³ö"); + }else if(event.keyCode==113 && window.as_defaultExport){//F2����excel + as_defaultExport("F2����"); return true; }else if(event.keyCode==8){ // backspace var target = $(event.target); - // ¿ÉÒÔÈ¡µ½Öµ¡¢Îª¿É±à¼­µÄ±íµ¥¡¢²»Îª°´Å¥/ÏÂÀ­Ñ¡Ôñ/¹´Ñ¡/Ö»¶ÁµÈÔÊÐíʹÓÃbackspace¼ü + // ����ȡ��ֵ��Ϊ�ɱ༭�ı?����Ϊ��ť/����ѡ��/��ѡ/ֻ��������ʹ��backspace�� return !!target.val() && target.is(":input:enabled") && !target.is(":button,:selected,:checked,[readonly]"); } } diff --git a/WebContent/WEB-INF/etc/app_config.properties b/WebContent/WEB-INF/etc/app_config.properties index 81cc204f7..18b1aa304 100644 --- a/WebContent/WEB-INF/etc/app_config.properties +++ b/WebContent/WEB-INF/etc/app_config.properties @@ -72,3 +72,4 @@ base.business.type=1 base.company.doc.name=\u627F\u79DF\u4EBA\u8EAB\u4EFD\u8BC1\uFF08\u6B63\u53CD\u9762\uFF09@\u627F\u79DF\u4EBA\u8EAB\u4EFD\u8BC1\uFF08\u6B63\u53CD\u9762\uFF09 base.person.doc.name=\u5171\u540C\u627F\u79DF\u4EBA\u8EAB\u4EFD\u8BC1\uFF08\u6B63\u53CD\u9762\uFF09@\u5171\u540C\u627F\u79DF\u4EBA\u8EAB\u4EFD\u8BC1\uFF08\u6B63\u53CD\u9762\uFF09,\u62C5\u4FDD\u4EBA\u8EAB\u4EFD\u8BC1\uFF08\u6B63\u53CD\u9762\uFF09@\u62C5\u4FDD\u4EBA\u8EAB\u4EFD\u8BC1\uFF08\u6B63\u53CD\u9762\uFF09 +base.calculation.tool.flow.unid=TENWA123 \ No newline at end of file diff --git a/calc/com/tenwa/reckon/product/ProductCondition.java b/calc/com/tenwa/reckon/product/ProductCondition.java index ed4e35086..a7ebd9a6b 100644 --- a/calc/com/tenwa/reckon/product/ProductCondition.java +++ b/calc/com/tenwa/reckon/product/ProductCondition.java @@ -816,8 +816,8 @@ public class ProductCondition { for(String key:map.keySet()){ if(!("EQUIP_AMT".equals(key)||"FIRST_PAYMENT".equals(key))){//É豸¿îºÍÊ׸¶¿î²»¹Ü if("feetype_test".equals(key)){//²âÊÔ·ÑÓà - this.prodSer.createFeeColRatioApp(appList, key, map.get(key)); this.prodSer.createFeeColApp(appList, key, map.get(key)); + this.prodSer.createFeeColRatioApp(appList, key, map.get(key)); } } } diff --git a/src/com/amarsoft/app/util/ReloadCalculationToolAction.java b/src/com/amarsoft/app/util/ReloadCalculationToolAction.java new file mode 100644 index 000000000..870d7ff65 --- /dev/null +++ b/src/com/amarsoft/app/util/ReloadCalculationToolAction.java @@ -0,0 +1,29 @@ +package com.amarsoft.app.util; + +import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP; +import jbo.app.tenwa.calc.LC_CASH_FLOW_TEMP; +import jbo.app.tenwa.calc.LC_RENT_PLAN_TEMP; + +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.base.constant.RestfullConstant; + +public class ReloadCalculationToolAction { + + public String cleanCalculationToolData() throws Exception { + // ¶¨Òå±äÁ¿ + String sReturn = "SUCCESS"; + String flowUnid = RestfullConstant.baseProperty + .get("CALCULATION_TOOL_FLOW_UNID") == null ? "" + : RestfullConstant.baseProperty.get( + "CALCULATION_TOOL_FLOW_UNID").toString(); + BizObjectManager conditionM = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME); + BizObjectManager rentM = JBOFactory.getBizObjectManager(LC_RENT_PLAN_TEMP.CLASS_NAME); + BizObjectManager cash = JBOFactory.getBizObjectManager(LC_CASH_FLOW_TEMP.CLASS_NAME); + + conditionM.createQuery("delete from O WHERE FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", flowUnid).executeUpdate(); + rentM.createQuery("delete from O WHERE FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", flowUnid).executeUpdate(); + cash.createQuery("delete from O WHERE FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", flowUnid).executeUpdate(); + return sReturn; + } +} diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/product/ProductBaseLoanTools.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/product/ProductBaseLoanTools.java index cc9791940..cda00d82f 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/product/ProductBaseLoanTools.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/product/ProductBaseLoanTools.java @@ -20,6 +20,8 @@ import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.are.jbo.JBOTransaction; import com.amarsoft.are.lang.StringX; import com.amarsoft.awe.dw.ui.validator.ValidateRule; +import com.base.constant.RestfullConstant; +import com.base.util.DateUtil; import com.tenwa.reckon.bean.TabCalBean; import com.tenwa.reckon.product.ProductCondition; import com.tenwa.reckon.util.TbBeanTools; @@ -27,7 +29,7 @@ import com.tenwa.util.SerialNumberUtil; public class ProductBaseLoanTools { @SuppressWarnings("unchecked") - public static Map checkSource(Map app, + public static Map checkSource(Map app, String colName, String operation, Object value) { if (operation.contains("defaultValue")) { app.put("coldefaultvalue", value); @@ -36,58 +38,69 @@ public class ProductBaseLoanTools { return app; } } - - Map donoTemp = (Map) (AppAweDoCache.getAppAweDoCachePool().get("LoanSimulationBasicInfoApp")); - List> libarary = (List>) (donoTemp.get("library")); + + Map donoTemp = (Map) (AppAweDoCache + .getAppAweDoCachePool().get("LoanSimulationBasicInfoApp")); + List> libarary = (List>) (donoTemp + .get("library")); String source = ""; String sourceType = ""; app.put("coldefaultitemno", value); for (Map col : libarary) { - String sColName = col.get("colname") == null ? "" : col.get("colname").toString(); + String sColName = col.get("colname") == null ? "" : col.get( + "colname").toString(); if (sColName.equals(colName)) { - source = col.get("coleditsource") == null ? "" : col.get("coleditsource").toString(); - sourceType = col.get("coleditsourcetype") == null ? "" : col.get("coleditsourcetype").toString(); + source = col.get("coleditsource") == null ? "" : col.get( + "coleditsource").toString(); + sourceType = col.get("coleditsourcetype") == null ? "" : col + .get("coleditsourcetype").toString(); break; } } - source = app.get("coleditsource") == null ? source : app.get("coleditsource").toString(); - sourceType = app.get("coleditsourcetype") == null ? sourceType : app.get("coleditsourcetype").toString(); + source = app.get("coleditsource") == null ? source : app.get( + "coleditsource").toString(); + sourceType = app.get("coleditsourcetype") == null ? sourceType : app + .get("coleditsourcetype").toString(); if (StringX.isSpace(source)) { return app; } - + if (StringX.isSpace(sourceType)) { return app; } - + if ("Code".equals(sourceType)) { // CODENO='SettleMethod' try { String itemno = value == null ? null : value.toString(); - BizObjectManager bom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME); - BizObject bo = bom.createQuery("CODENO=:CODENO and itemno=:itemno") - .setParameter("CODENO", source).setParameter("itemno", itemno) - .getSingleResult(false); + BizObjectManager bom = JBOFactory + .getBizObjectManager(CODE_LIBRARY.CLASS_NAME); + BizObject bo = bom + .createQuery("CODENO=:CODENO and itemno=:itemno") + .setParameter("CODENO", source) + .setParameter("itemno", itemno).getSingleResult(false); if (null == bo) { return app; } - app.put("coldefaultvalue", bo.getAttribute("itemname").getValue()); + app.put("coldefaultvalue", bo.getAttribute("itemname") + .getValue()); return app; } catch (JBOException e) { ARE.getLog().error(e); return app; } - + } else if ("CodeTable".equals(sourceType)) { // °à,°à,ÐÝ,ÐÝ try { String itemno = value == null ? null : value.toString(); int size = source.split(",").length; if (size > 0 && size % 2 == 0) { - String [] array = source.split(","); + String[] array = source.split(","); for (int i = 0; i < size; i++) { - if (i!=0 && i + 1 > size) break; + if (i != 0 && i + 1 > size) + break; String itemno2 = array[i]; if (itemno2.equalsIgnoreCase(itemno)) { - app.put("coldefaultvalue", array[i+1]); + app.put("coldefaultvalue", array[i + 1]); break; } i++; @@ -118,45 +131,43 @@ public class ProductBaseLoanTools { } BizObjectManager bom = JBOFactory .getBizObjectManager(sClass); - BizObjectQuery boq = bom.createQuery("SELECT " - + sKey + ", " + sValue - + " FROM O WHERE " + sWhere); + BizObjectQuery boq = bom.createQuery("SELECT " + sKey + + ", " + sValue + " FROM O WHERE " + sWhere); List bos = boq.getResultList(false); for (BizObject bo : bos) { // sDefult - if (itemno.equals(bo.getAttribute(sKey) - .getValue())) { - app.put("coldefaultvalue", bo.getAttribute(sValue) - .getValue()); + if (itemno.equals(bo.getAttribute(sKey).getValue())) { + app.put("coldefaultvalue", + bo.getAttribute(sValue).getValue()); return app; } - } + } } } } catch (JBOException e) { ARE.getLog().error(e); return app; } - + } else if ("@MIN_MAX".equals(sourceType)) { // 6,8 try { String itemno = value == null ? null : value.toString(); int size = source.split(",").length; if (size == 2) { - String [] array = source.split(","); - String itemno2 = array[0]; - String itemno3 = array[1]; - int min = Integer.valueOf(itemno2); - int max = Integer.valueOf(itemno3); - int iin = Integer.valueOf(itemno); - - if(min <= iin && iin <= max) { - app.put("coldefaultvalue", iin); - return app; - } else { - app.put("coldefaultvalue", value); - return app; - } + String[] array = source.split(","); + String itemno2 = array[0]; + String itemno3 = array[1]; + int min = Integer.valueOf(itemno2); + int max = Integer.valueOf(itemno3); + int iin = Integer.valueOf(itemno); + + if (min <= iin && iin <= max) { + app.put("coldefaultvalue", iin); + return app; + } else { + app.put("coldefaultvalue", value); + return app; + } } else { return app; } @@ -204,14 +215,16 @@ public class ProductBaseLoanTools { appList = new ArrayList>(); ProductCondition pc = new ProductCondition(); pc.getProductFundRulesApp(appList, productId); - - - //»ñÈ¡²úÆ·Ãû³Æ - BizObject bo = JBOFactory.createBizObjectQuery(BUSINESS_TYPE.CLASS_NAME,"typeno=:productID") - .setParameter("productID", productId).getSingleResult(false); + + // »ñÈ¡²úÆ·Ãû³Æ + BizObject bo = JBOFactory + .createBizObjectQuery(BUSINESS_TYPE.CLASS_NAME, + "typeno=:productID") + .setParameter("productID", productId).getSingleResult(false); String productName = bo.getAttribute("typename").getString(); - - ProductBaseLoanTools.addAppList(appList, "PRODUCT_NAME", "coldefaultvalue", productName); + + ProductBaseLoanTools.addAppList(appList, "PRODUCT_NAME", + "coldefaultvalue", productName); /* ÉèÖÃÄ£°åÊôÐÔ */ Vector vali = new Vector(); String calcRules = pc.getProductRulesApp(appList, productId, vali); @@ -219,26 +232,55 @@ public class ProductBaseLoanTools { } // end + + @SuppressWarnings("unused") + public static String getProdouctName(String productId) throws JBOException { + String productName = ""; + BizObject bo = JBOFactory + .createBizObjectQuery(BUSINESS_TYPE.CLASS_NAME, + "typeno=:productID") + .setParameter("productID", productId).getSingleResult(false); + productName = bo.getAttribute("typename").getString(); + if (null == bo) return productName; + return productName; + } // begin »ñÈ¡ ²âËã»ù´¡Öµ¼°Á÷Ë®ºÅ public static Map deadWork(String productId, String calType, String planCName, String plannumber, String tb, - String flowunid, JBOTransaction tx) throws Exception { + String flowunid, String userId, JBOTransaction tx) throws Exception { Map map = new HashMap(); - /* »ñÈ¡²ÎÊý */ - /* ¸ù¾Ý²ÎÊýÅÐ¶Ï ÊÇ·ñÈ¥Êý¾Ý¿â²éѯ */ - BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid); - if (productId == null) { - productId = flow.getAttribute("productId").getString(); - } - map.put("productId", productId); + if (calType == null) { calType = "proj_process"; } map.put("calType", calType); TabCalBean tcb = TbBeanTools.getTabInfo(calType); planCName = tcb.getPlanCName(); - map.put("planCName", planCName); + map.put("planCName", planCName); // ²âËã¼Æ»®Ìõ¼þ±àºÅ×Ö¶ÎÃû³Æ + tb = tcb.getCondition_tb(); + map.put("tb", tb); // ²âËã¼Æ»®Ìõ¼þÖ÷±íÃû³Æ + /* »ñÈ¡²ÎÊý */ + /* ¸ù¾Ý²ÎÊýÅÐ¶Ï ÊÇ·ñÈ¥Êý¾Ý¿â²éѯ */ + BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid); + if (productId == null) { + productId = flow.getAttribute("productId").getString(); + map.put("productId", productId); + map.put("productName", getProdouctName(productId)); + map.put("objectNo", flowunid); + } else { + String ts = DateUtil.timeStamp(); + map.put("plannumber", userId + ts); + flowunid = RestfullConstant.baseProperty + .get("CALCULATION_TOOL_FLOW_UNID") == null ? "" + : RestfullConstant.baseProperty.get( + "CALCULATION_TOOL_FLOW_UNID").toString(); + map.put("objectNo", flowunid); + map.put("productId", productId); // ²úÆ·id + map.put("productName", getProdouctName(productId)); + return map; + } + // ·½°¸±àºÅ if (plannumber == null) { if ("pay_process".equals(calType) @@ -290,8 +332,6 @@ public class ProductBaseLoanTools { tx.commit(); } map.put("plannumber", plannumber); - tb = tcb.getCondition_tb(); - map.put("tb", tb); return map; } // end diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java index cdbd59e35..115591f0d 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java @@ -8,7 +8,6 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import jbo.prd.BUSINESS_TYPE; import apx.com.amarsoft.als.apzl.apply.business.loan.manage.LCRentPlanTempDoQueryManage; import apx.com.amarsoft.als.apzl.apply.business.loan.manage.LoanSimulationBasicInfoAppInfoDoManage; import apx.com.amarsoft.als.apzl.apply.business.loan.manage.LoanSimulationBasicInfoAppInfoSaveDoManage; @@ -17,8 +16,8 @@ import apx.com.amarsoft.als.apzl.apply.business.loan.service.LoanSimulationBasic import com.amarsoft.app.lc.workflow.action.GetFlowAction; import com.amarsoft.are.jbo.BizObject; -import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.lang.StringX; import com.amarsoft.awe.util.Transaction; import com.amarsoft.context.ASUser; import com.base.constant.RestfullConstant; @@ -48,14 +47,23 @@ public class LoanSimulationBasicServiceImpl implements fieldMap.put("flow_unid".toLowerCase(), flowunid); fieldMap.put("flow_unid".toUpperCase(), flowunid); + String productId = fieldMap.get("productId".toLowerCase()) == null ? null + : fieldMap.get("productId".toLowerCase()).toString(); + String userId = fieldMap.get("userId".toLowerCase()) == null ? "" + : fieldMap.get("userId".toLowerCase()).toString(); + productId = StringX.isSpace(productId) ? null : productId; // »ñÈ¡ ²âËã»ù´¡Öµ¼°Á÷Ë®ºÅ - Map baseMap = ProductBaseLoanTools.deadWork(null, null, - null, null, null, flowunid, tx); + Map baseMap = productId == null ? ProductBaseLoanTools + .deadWork(null, null, null, null, null, flowunid, userId, tx) + : ProductBaseLoanTools.deadWork(productId, null, null, null, + null, null, userId, tx); + productId = baseMap.get("productId") == null ? "" : baseMap.get( + "productId").toString(); // ·ÑÓùæÔò List> appList = new ArrayList>(); String calcRules = ProductBaseLoanTools.getProductFundRules(appList, - baseMap.get("productId").toString()); + productId); Map calcRulesMap = JsonUtil.str2JSONObject(calcRules); @@ -65,18 +73,12 @@ public class LoanSimulationBasicServiceImpl implements body.put("tb", baseMap.get("tb")); body.put("calType", baseMap.get("calType")); + body.put("objectNo", baseMap.get("objectNo")); body.put("productId", baseMap.get("productId")); + body.put("productName", baseMap.get("productName")); body.put("productDatas", appList); body.put("productFundRules", calcRulesMap); - // »ñÈ¡²úÆ·Ãû³Æ - BizObject bo = JBOFactory - .createBizObjectQuery(BUSINESS_TYPE.CLASS_NAME, - "typeno=:productID") - .setParameter("productID", baseMap.get("productId").toString()) - .getSingleResult(false); - String productName = bo.getAttribute("typename").getString(); - body.put("productName", productName); - + ReturnMapUtil.setReturnMap(body, RestfullConstant.baseProperty.get("success").toString(), ""); return ReturnMapUtil.getReturnMap(); @@ -172,6 +174,10 @@ public class LoanSimulationBasicServiceImpl implements /* »ñÈ¡²ÎÊý */ /* ¸ù¾Ý²ÎÊýÅÐ¶Ï ÊÇ·ñÈ¥Êý¾Ý¿â²éѯ */ BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid); + if (null == flow) { + productId = fieldMap.get("productId".toLowerCase()) == null ? null + : fieldMap.get("productId".toLowerCase()).toString(); // ·½°¸±àºÅ + } if (productId == null) { productId = flow.getAttribute("productId").getString(); } diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java index 6ae2dbccf..c04167151 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/BusinessBO.java @@ -11,7 +11,6 @@ import jbo.app.tenwa.calc.LC_RENT_PLAN_TEMP; import jbo.app.tenwa.doc.LB_DOCATTRIBUTE; import jbo.app.tenwa.doc.LB_DOCRELATIVE; import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT; -import net.sf.json.JSON; import net.sf.json.JSONObject; import com.amarsoft.are.ARE; @@ -138,8 +137,8 @@ public class BusinessBO implements Serializable { : fieldMap.get("CUSTOMERID".toLowerCase()).toString(); // ¿Í»§±àºÅ this.CUSTOMERNAME = fieldMap.get("CUSTOMERNAME".toLowerCase()) == null ? "" : fieldMap.get("CUSTOMERNAME".toLowerCase()).toString(); // ¿Í»§Ãû³Æ - this.customerType = fieldMap.get("customerType".toLowerCase()) == null ? "" - : fieldMap.get("customerType".toLowerCase()).toString(); // ¿Í»§ÀàÐÍ + this.customerType = fieldMap.get("customer_Type".toLowerCase()) == null ? "" + : fieldMap.get("customer_Type".toLowerCase()).toString(); // ¿Í»§ÀàÐÍ // 01,·¨ÈË,03,¸öÈË this.certtype = "01".equals(this.customerType) ? "Ent02" : "03" .equals(this.customerType) ? "Ind01" : ""; // Ö¤¼þÀàÐÍ diff --git a/src_app_fresh/com/base/constant/RestfullConstant.java b/src_app_fresh/com/base/constant/RestfullConstant.java index 50c62711c..db2f61432 100644 --- a/src_app_fresh/com/base/constant/RestfullConstant.java +++ b/src_app_fresh/com/base/constant/RestfullConstant.java @@ -92,6 +92,7 @@ public class RestfullConstant { public static final String COMPANY_DOC_NAME = "base.company.doc.name"; public static final String PERSON_DOC_NAME = "base.person.doc.name"; + public static final String CALCULATION_TOOL_FLOW_UNID = "base.calculation.tool.flow.unid"; /** * APP SESSION ÅäÖà @@ -199,6 +200,8 @@ public class RestfullConstant { pro.getProperty(COMPANY_DOC_NAME)); setMap(baseProperty, "PERSON_DOC_NAME", pro.getProperty(PERSON_DOC_NAME)); + setMap(baseProperty, "CALCULATION_TOOL_FLOW_UNID", + pro.getProperty(CALCULATION_TOOL_FLOW_UNID)); } private static void loadSessionKey(Properties pro) { diff --git a/src_app_fresh/com/base/util/DateUtil.java b/src_app_fresh/com/base/util/DateUtil.java index 29476bb1e..f60ddb568 100644 --- a/src_app_fresh/com/base/util/DateUtil.java +++ b/src_app_fresh/com/base/util/DateUtil.java @@ -7,11 +7,45 @@ import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; +import com.amarsoft.are.ARE; + public class DateUtil { public final static String FULL_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; public final static String TIME_MONTH = "MONTH"; public final static String TIME_DAY = "DAY"; public final static String TIME_YEAR = "YEAR"; +public static void main(String[] args) throws InterruptedException { + System.out.println(timeStamp()); + Thread.sleep(1000*5); + System.out.println(timeStamp(new Date())); + Thread.sleep(1000*5); + System.out.println(timeStamp(getDateTime(new Date()), "yyyy-MM-dd HH:mm:ss")); +} + /** + * È¡µÃµ±Ç°Ê±¼ä´Á£¨¾«È·µ½Ã룩 + * + * @return + */ + public static String timeStamp() { + long time = System.currentTimeMillis(); + String t = String.valueOf(time / 1000); + return t; + } + + public static String timeStamp(String dateStr, String format) { + try { + SimpleDateFormat sdf = new SimpleDateFormat(format); + return String.valueOf(sdf.parse(dateStr).getTime() / 1000); + } catch (Exception e) { + System.out.println(e); + e.printStackTrace(); + } + return ""; + } + + public static String timeStamp(Date date) { + return timeStamp(getDateTime(date), "yyyy-MM-dd HH:mm:ss"); + } public static int getIntervalDays(Date startDate, Date endDate) { if ((null == startDate) || (null == endDate)) { @@ -20,13 +54,14 @@ public class DateUtil { long intervalMilli = (endDate.getTime() - startDate.getTime()); return (int) (intervalMilli / (24 * 60 * 60 * 1000)); } - + @SuppressWarnings("static-access") - public static String getNexMonthDate(Date date, int iInterval, String returnForMat) { + public static String getNexMonthDate(Date date, int iInterval, + String returnForMat) { Calendar calendar = new GregorianCalendar(); calendar.setTime(date); calendar.add(calendar.MONTH, iInterval);// °ÑÈÕÆÚÍùºóÔö¼ÓÒ»¸öÔÂ.ÕûÊýÍùºóÍÆ,¸ºÊýÍùÇ°ÒÆ¶¯ - date=calendar.getTime(); //Õâ¸öʱ¼ä¾ÍÊÇÈÕÆÚÍùºóÍÆÒ»ÌìµÄ½á¹û + date = calendar.getTime(); // Õâ¸öʱ¼ä¾ÍÊÇÈÕÆÚÍùºóÍÆÒ»ÌìµÄ½á¹û String sDate = DateUtil.getSystemTimeByFormat(date, returnForMat); return sDate; } @@ -39,25 +74,25 @@ public class DateUtil { int day2 = aCalendar.get(Calendar.DAY_OF_YEAR); return day2 - day1; } - + public static int getMonthSpace(String date1, String date2) - throws ParseException { + throws ParseException { - int result = 0; + int result = 0; - SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); - Calendar c1 = Calendar.getInstance(); - Calendar c2 = Calendar.getInstance(); + Calendar c1 = Calendar.getInstance(); + Calendar c2 = Calendar.getInstance(); - c1.setTime(sdf.parse(date1)); - c2.setTime(sdf.parse(date2)); + c1.setTime(sdf.parse(date1)); + c2.setTime(sdf.parse(date2)); - result = c2.get(Calendar.MONTH) - c1.get(Calendar.MONTH); + result = c2.get(Calendar.MONTH) - c1.get(Calendar.MONTH); - return result+( c2.get(Calendar.YEAR) - c1.get(Calendar.YEAR))*12; + return result + (c2.get(Calendar.YEAR) - c1.get(Calendar.YEAR)) * 12; - } + } public static String addDate(Date startDate, String type, Integer num) { Calendar aCalendar = Calendar.getInstance(); @@ -170,12 +205,13 @@ public class DateUtil { return sdf.format(date); } - public static void main(String[] args) { - String date = getSystemTimeByFormat(new Date(), "yyyy/MM/dd HH:mm:ss"); - System.out.println(date); - String []dateArray = date.split("/"); - System.out.println("year :" + dateArray[0]); - System.out.println("month :" + dateArray[1]); - System.out.println("day :" + dateArray[2]); - } + +// public static void main(String[] args) { +// String date = getSystemTimeByFormat(new Date(), "yyyy/MM/dd HH:mm:ss"); +// System.out.println(date); +// String[] dateArray = date.split("/"); +// System.out.println("year :" + dateArray[0]); +// System.out.println("month :" + dateArray[1]); +// System.out.println("day :" + dateArray[2]); +// } }