2018-06-03 22:26:41 +08:00

150 lines
5.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@page import="com.amarsoft.app.als.customer.common.CustomerHelper"%>
<%@ page contentType="text/html; charset=GBK"%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List00;Describe=注释区;]~*/%>
<%
/*
Content: 该页面主要处理业务申请相关的审查审批、最终审批意见复核、放贷申请复核
Input Param:
ApproveType:审批对象
PhaseType阶段类型
FlowNo流程模型编号
PhaseNo阶段编号
FinishFlag完成标志Y已完成N未完成
Output param:
*/
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List02;Describe=定义变量,获取参数;]~*/%>
<%
//定义变量SQL语句、模版ItemNo、阶段类型组、对象对应阶段、阶段类型强制where子句1、阶段类型强制where子句2
String sSql = "",sTempletNo = "",sPhaseTypeSet = "",sViewID = "",sWhereClause1 = "",sWhereClause2 = "";
//定义变量:按钮集、按钮、申请流程对象
String sButtonSet = "",sButton = "",sObjectType = "";
//定义变量:查询结果集
ASResultSet rs = null;
String []recTemp = null;
//获得组件参数:流程对象类型、申请类型、流程编号、阶段编号、阶段类型、完成标志
String sApproveType = CurPage.getParameter("ApproveType");
String sFlowNo = CurPage.getParameter("FlowNo");
String sPhaseNo = CurPage.getParameter("PhaseNo");
String sPhaseType = CurPage.getParameter("PhaseType");
String sFinishFlag = CurPage.getParameter("FinishFlag");
//将空值转化成空字符串
if(sApproveType == null) sApproveType = "";
if(sFlowNo == null) sFlowNo = "";
if(sPhaseNo == null) sPhaseNo = "";
if(sPhaseType == null) sPhaseType = "";
if(sFinishFlag == null) sFinishFlag = "";
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List03;Describe=定义数据对象;]~*/%>
<%
//从代码表CODE_LIBRARY中获得ApproveMain的树图以及该申请的阶段,流程对象类型,TaskList使用哪个ButtonSet
recTemp = CustomerHelper.selectApplyTv1(sApproveType,"ApproveType");
if(recTemp!=null){
sPhaseTypeSet = recTemp[0];
sObjectType = recTemp[1];
sButtonSet = recTemp[2];
if(sPhaseTypeSet == null) sPhaseTypeSet = "";
if(sObjectType == null) sObjectType = "";
if(sButtonSet == null) sButtonSet = "";
}else{
throw new Exception("没有找到相应的审批类型定义CODE_LIBRARY.ApproveType:"+sApproveType+"");
}
//从代码表CODE_LIBRARY中查询出以什么视图查看对象详情,where条件1,where条件2,ApplyList数据对象ID
recTemp = CustomerHelper.selectApplyTv2(sPhaseTypeSet, sFinishFlag);
if(recTemp!=null){
sViewID = recTemp[0];
sWhereClause1 = recTemp[1];
sWhereClause2 = recTemp[2];
sTempletNo = recTemp[3];
//将空值转化成空字符串
if(sViewID == null) sViewID = "";
if(sWhereClause1 == null) sWhereClause1 = "";
if(sWhereClause2 == null) sWhereClause2 = "";
if(sTempletNo == null) sTempletNo = "";
}else{
throw new Exception("没有找到相应的审批阶段定义CODE_LIBRARY,"+sSql+","+sFinishFlag+"");
}
if(sTempletNo.equals("")) throw new Exception("没有定义任务列表数据对象CODE_LIBRARY.ApproveType:"+sApproveType+"");
if(sViewID.equals("")) throw new Exception("没有定义审批阶段视图CODE_LIBRARY,"+sPhaseTypeSet+","+sFinishFlag+"");
recTemp = CustomerHelper.selectApplyTv3(sFlowNo, sPhaseNo);
if(sFinishFlag.equals("N")) //当前工作
sButton = recTemp[0];
if(sFinishFlag.equals("Y")) //已完成工作
sButton = recTemp[1];
//将空值转化成空字符串
if(sButton == null) sButton = "";
//根据显示模版编号生成ObjectWindow对象
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
//将where条件1和where条件2中的变量用实际的值替换生成有效的SQL语句
sWhereClause1 = StringFunction.replace(sWhereClause1,":UserID","'"+CurUser.getUserID()+"'");
sWhereClause1 = StringFunction.replace(sWhereClause1,":PhaseNo","'"+sPhaseNo+"'");
sWhereClause1 = StringFunction.replace(sWhereClause1,":FlowNo","'"+sFlowNo+"'");
sWhereClause1 = StringFunction.replace(sWhereClause1,":ObjectType","'"+sObjectType+"'");
sWhereClause2 = StringFunction.replace(sWhereClause2,":UserID","'"+CurUser.getUserID()+"'");
sWhereClause2 = StringFunction.replace(sWhereClause2,":PhaseNo","'"+sPhaseNo+"'");
sWhereClause2 = StringFunction.replace(sWhereClause2,":FlowNo","'"+sFlowNo+"'");
sWhereClause2 = StringFunction.replace(sWhereClause2,":ObjectType","'"+sObjectType+"'");
String WhereClause = "";
WhereClause += " "+sWhereClause1;
WhereClause += " "+sWhereClause2;
doTemp.appendJboWhere(WhereClause);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //设置DW风格 1:Grid 2:Freeform
dwTemp.ReadOnly = "1"; //设置是否只读 1:只读 0:可写
dwTemp.setPageSize(20);
//生成HTMLObjectWindow
dwTemp.genHTMLObjectWindow("");
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=List04;Describe=定义按钮;]~*/%>
<%
String tmpStr[][] = null;
String sButtons[][] = new String[100][9];
int iCountRecord = 0;
tmpStr = CustomerHelper.selectButtonSet(sButtonSet);
if(tmpStr != null)
for(int i=0;i<tmpStr.length;i++){
iCountRecord++;
sButtons[iCountRecord][0] = (sButton.indexOf(tmpStr[i][0])>=0?"true":"false");
sButtons[iCountRecord][1] = tmpStr[i][1];
sButtons[iCountRecord][2] = ((tmpStr[i][2])==null? tmpStr[i][2]:"Button");
sButtons[iCountRecord][3] = tmpStr[i][3];
sButtons[iCountRecord][4] = tmpStr[i][4];
if(sButtons[iCountRecord][4]==null) sButtons[iCountRecord][4] = sButtons[iCountRecord][3];
sButtons[iCountRecord][5] = tmpStr[i][5];
if(sButtons[iCountRecord][5]!=null){
sButtons[iCountRecord][5] = StringFunction.replace(sButtons[iCountRecord][5],"#ApplyType",sObjectType);
sButtons[iCountRecord][5] = StringFunction.replace(sButtons[iCountRecord][5],"#PhaseType",sPhaseType);
sButtons[iCountRecord][5] = StringFunction.replace(sButtons[iCountRecord][5],"#ObjectType",sObjectType);
sButtons[iCountRecord][5] = StringFunction.replace(sButtons[iCountRecord][5],"#ViewID",sViewID);
}
}
%>
<%/*~END~*/%>