📄 accredit.java
字号:
package com.icbc.inbs.operation;
import com.icbc.inbs.base.*;
import java.util.StringTokenizer;
public class AccreditOpStep extends com.ibm.dse.base.OperationStep {
/**
* AccreditOpStep constructor comment.
*/
public AccreditOpStep() {
super();
}
/**
* execute method comment.
*/
public int execute() throws Exception {
try {
String longonLevel = (String) getParams().getValueAt("Logon_level");
String longonID = (String) getParams().getValueAt("Logon_id");
String authorLogID1 = (String) getParams().getValueAt("Author_log_id_1");
String authorLogID2 = (String) getParams().getValueAt("Author_log_id_2");
String tranDateName = (String) getParams().getValueAt("TranDate");
String limitSumName = (String) getParams().getValueAt("Limit_sum");
String limitSum1Name = (String) getParams().getValueAt("Limit_sum1");
String tranAmtName = (String) getParams().getValueAt("amount");
String resultName = (String) getParams().getValueAt("Result");
String submitlogIDName = (String) getParams().getValueAt("Submit_Log_id");
int logon_level = Integer.valueOf((String) getValueAt(longonLevel)).intValue();
//StringTokenizer strToken = new StringTokenizer("|");
String logon_id = (String)getValueAt(longonID);
String firstAuthor = (String)getValueAt(authorLogID1);
String secondAuthor = (String)getValueAt(authorLogID2);
try{
//批复时间
setValueAt(tranDateName, ICBCConstants.getCurrentTime("yyyyMMddHHmmss"));
}catch(Exception e)
{}
if (logon_level != 0) {
if ((firstAuthor != null && firstAuthor.trim().length() !=0 && firstAuthor.trim().equals(logon_id.trim())) ||
(secondAuthor != null && secondAuthor.trim().length() !=0 && secondAuthor.trim().equals(logon_id.trim()))) {
//同一个授权人重复审批错误
setValueAt("TranErrorCode", "50144");
setValueAt(
"TranErrorDisplayMsg",
TranFailException.getDisplayMessage(
"50144",
(String) getValueAt("ieu")));
setValueAt(
"TranErrorLocation",
"AccreditOpStep.execute()");
return -1;
}
if (secondAuthor != null && secondAuthor.trim().length() != 0) {
//已经通过二次授权人审批,重复授权错误
setValueAt("TranErrorCode", "50145");
setValueAt(
"TranErrorDisplayMsg",
TranFailException.getDisplayMessage(
"50145",
(String) getValueAt("ieu")));
setValueAt(
"TranErrorLocation",
"AccreditOpStep.execute()");
return -1;
}
}
double limit_sum = Double.valueOf((String) getValueAt(limitSumName)).doubleValue();
double limit_sum1 = Double.valueOf((String)getValueAt(limitSum1Name)).doubleValue();
String str = tranAmtName;
double amount = Double.valueOf((String) getValueAt(str)).doubleValue();
int result = -1;
Object o = getValueAt(resultName);
if (o != null && o.toString().trim().length() != 0)
result = Integer.valueOf(o.toString()).intValue();
if (logon_level == 0) {
setValueAt(submitlogIDName, logon_id);
if (amount <= limit_sum) {
//0提交成功,等待银行处理
setValueAt(resultName, "0");
return 0;
}
else {
//2等待授权
setValueAt(resultName, "2");
return 1;
}
}
else if (logon_level == 1) {
if (getValueAt(submitlogIDName) == null)
setValueAt(submitlogIDName, logon_id);
else
setValueAt(authorLogID1, logon_id);
if (amount <= limit_sum) {
//授权成功
setValueAt(resultName, "1");
return 0;
}
else {
//3等待二次授权
setValueAt(resultName, "3");
return 1;
}
}
else if( amount <= limit_sum )
{
if (getValueAt(submitlogIDName) == null)
setValueAt(submitlogIDName,logon_id);
else if (firstAuthor == null)
setValueAt(authorLogID1, logon_id);
else
setValueAt(authorLogID2, logon_id);
//1授权成功
setValueAt(resultName, "1");
return 0;
}
else if( firstAuthor !=null && !firstAuthor.equals("") && amount <=limit_sum1 ) //判断组合授权
{
setValueAt(authorLogID2, logon_id);
setValueAt(resultName, "1");
return 0;
}
//检查操作限额失败
//20010830 Add by yfang begin
setValueAt("TranErrorCode", "50146");
setValueAt(
"TranErrorDisplayMsg",
TranFailException.getDisplayMessage(
"50146",
(String) getValueAt("ieu")));
setValueAt(
"TranErrorLocation",
"AccreditOpStep.execute()");
//20010830 Add by yfang end
return -1;
}
catch (Exception e) {
setValueAt("TranErrorCode", "50147");
setValueAt(
"TranErrorDisplayMsg",
TranFailException.getDisplayMessage(
"50147",
(String) getValueAt("ieu")));
setValueAt("TranErrorMsg", e.getMessage());
setValueAt(
"TranErrorLocation",
"AccreditOpStep.execute()");
return -1;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -