app
测试工具 alt+c 功能 清除 测试脏数据
This commit is contained in:
parent
f0c20320d4
commit
080954033c
@ -11,7 +11,7 @@ var AsDebug = {
|
||||
showWindow:function() {
|
||||
var d = top.dialog({
|
||||
id: 'as-debug-dialog',
|
||||
title: '调试工具栏['+AsDebug.getURL()+"]",
|
||||
title: '<EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>['+AsDebug.getURL()+"]",
|
||||
onclose: function () {
|
||||
AsDebug.removeWindow();
|
||||
},
|
||||
@ -27,8 +27,8 @@ var AsDebug = {
|
||||
html+="</td></tr><tr><td>";
|
||||
//html+="<span class='pageversion' ondblclick='javascript:AsDebug.displayPageName();'>"+AsDebug.getPage()+" </span>";
|
||||
html+="<span class='pageversion'>"+AsDebug.getPage()+" </span>";
|
||||
//html+="<span class='pageversion' ondblclick='javascript:AsDebug.displayURL();'>【"+AsDebug.getURL()+"】</span>";
|
||||
html+="<span class='pageversion'>【"+AsDebug.getURL()+"】</span>";
|
||||
//html+="<span class='pageversion' ondblclick='javascript:AsDebug.displayURL();'><EFBFBD><EFBFBD>"+AsDebug.getURL()+"<22><></span>";
|
||||
html+="<span class='pageversion'><EFBFBD><EFBFBD>"+AsDebug.getURL()+"<22><></span>";
|
||||
html+="</td></tr></table>";
|
||||
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?"<EFBFBD><EFBFBD>ʾ":title,
|
||||
okValue: 'ȷ<EFBFBD><EFBFBD>',
|
||||
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?"<EFBFBD><EFBFBD>ʾ":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")); // <20><><EFBFBD><EFBFBD>ARE<52><45><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>
|
||||
else alert(getMessageText("AWES0018")); // <20><><EFBFBD><EFBFBD>ARE<52><45><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>
|
||||
},
|
||||
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")); // <EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>
|
||||
else alert(getMessageText("AWES0016")); // <EFBFBD><EFBFBD><EFBFBD>ز<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>
|
||||
},
|
||||
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")); // ˢ<EFBFBD>²<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>
|
||||
else alert(getMessageText("AWES0020")); // ˢ<EFBFBD>²<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>
|
||||
},
|
||||
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")); // <EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>
|
||||
else alert(getMessageText("AWES0022")); // <EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>
|
||||
},
|
||||
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")); // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>
|
||||
else alert(getMessageText("AWES0024")); // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>
|
||||
},
|
||||
openControlCenter:function() {
|
||||
this.removeWindow();
|
||||
@ -136,7 +142,7 @@ var AsDebug = {
|
||||
var d = dialog({
|
||||
height:400,
|
||||
width:800,
|
||||
title: '页面运行代码['+AsDebug.getURL()+"]",
|
||||
title: 'ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>['+AsDebug.getURL()+"]",
|
||||
content: '<textarea id=\"testSource\" style=\"width: 100%; height: 100%;\"></textarea>',
|
||||
onshow: function () {
|
||||
$("#testSource").text(oBody.ownerDocument.documentElement.innerHTML);
|
||||
@ -191,7 +197,7 @@ var AsDebug = {
|
||||
/**
|
||||
*
|
||||
* @param event
|
||||
* @returns {Boolean} true 触发了某些事件 false 没触发事件
|
||||
* @returns {Boolean} true <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijЩ<EFBFBD>¼<EFBFBD> false û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
||||
*/
|
||||
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<EFBFBD><EFBFBD><EFBFBD><EFBFBD>excel
|
||||
as_defaultExport("F2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
return true;
|
||||
}else if(event.keyCode==8){ // backspace
|
||||
var target = $(event.target);
|
||||
// 可以取到值、为可编辑的表单、不为按钮/下拉选择/勾选/只读等允许使用backspace键
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Ϊ<EFBFBD>ɱ༭<EFBFBD>ı?<3F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ť/<2F><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>/<2F><>ѡ/ֻ<><D6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>backspace<63><65>
|
||||
return !!target.val() && target.is(":input:enabled") && !target.is(":button,:selected,:checked,[readonly]");
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
src/com/amarsoft/app/util/ReloadCalculationToolAction.java
Normal file
29
src/com/amarsoft/app/util/ReloadCalculationToolAction.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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<String, Object> checkSource(Map<String, Object> app,
|
||||
public static Map<String, Object> checkSource(Map<String, Object> 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<String, Object> donoTemp = (Map<String, Object>) (AppAweDoCache.getAppAweDoCachePool().get("LoanSimulationBasicInfoApp"));
|
||||
List<Map<String, Object>> libarary = (List<Map<String, Object>>) (donoTemp.get("library"));
|
||||
|
||||
Map<String, Object> donoTemp = (Map<String, Object>) (AppAweDoCache
|
||||
.getAppAweDoCachePool().get("LoanSimulationBasicInfoApp"));
|
||||
List<Map<String, Object>> libarary = (List<Map<String, Object>>) (donoTemp
|
||||
.get("library"));
|
||||
String source = "";
|
||||
String sourceType = "";
|
||||
app.put("coldefaultitemno", value);
|
||||
for (Map<String, Object> 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<BizObject> 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<Map<String, Object>>();
|
||||
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<ValidateRule> vali = new Vector<ValidateRule>();
|
||||
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<String, Object> 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<String, Object> map = new HashMap<String, Object>();
|
||||
/* 获取参数 */
|
||||
/* 根据参数判断 是否去数据库查询 */
|
||||
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
|
||||
|
||||
@ -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<String, Object> baseMap = ProductBaseLoanTools.deadWork(null, null,
|
||||
null, null, null, flowunid, tx);
|
||||
Map<String, Object> 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<Map<String, Object>> appList = new ArrayList<Map<String, Object>>();
|
||||
|
||||
String calcRules = ProductBaseLoanTools.getProductFundRules(appList,
|
||||
baseMap.get("productId").toString());
|
||||
productId);
|
||||
|
||||
Map<String, Object> 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();
|
||||
}
|
||||
|
||||
@ -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" : ""; // 证件类型
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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]);
|
||||
// }
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user