租前部分代码二次优化

This commit is contained in:
ap007 2021-06-30 10:02:50 +08:00
parent e392850dd2
commit d56af5de4b
8 changed files with 100 additions and 51 deletions

View File

@ -4,7 +4,7 @@
<%
//获得组件参数
String flowNo=CurPage.getParameter("FlowNo");
String fcQueuestId = CurPage.getParameter("fcQueuestId");
String fcRequestId = CurPage.getParameter("fcRequestId");
String fcFlowType = CurPage.getParameter("fcFlowType");
String fcFileCode = CurPage.getParameter("fcFileCode");
@ -105,7 +105,7 @@
threads:<%=QuartzPropertiesUtil.get("fileNumLimit") %>,
formData: {
fcQueuestId:'<%=fcQueuestId%>',
fcRequestId:'<%=fcRequestId%>',
fcFlowType:'<%=fcFlowType%>',
fcFileCode:'<%=fcFileCode%>'
},

View File

@ -71,13 +71,13 @@
if(params.size()>0){
BizObjectManager frfBom = JBOFactory.getBizObjectManager("jbo.oti.FC_REQUEST_FILE",Sqlca);
BizObject frfBo = frfBom.newObject();
frfBo.setAttributeValue("FC_REQUEST_ID",params.get("fcQueuestId"));
frfBo.setAttributeValue("FC_REQUEST_ID",params.get("fcRequestId"));
frfBo.setAttributeValue("FC_FLOW_TYPE",params.get("fcFlowType"));
frfBo.setAttributeValue("FC_FILE_CODE",params.get("fcFileCode"));
frfBo.setAttributeValue("FC_FILE_TYPE",params.get("type"));
frfBo.setAttributeValue("FILE_NAME",params.get("name"));
frfBo.setAttributeValue("FILE_PATH",params.get("filePath"));
frfBo.setAttributeValue("FC_FILE_STS","");
frfBo.setAttributeValue("FC_FILE_STS","0");
frfBo.setAttributeValue("CREATE_TIME",params.get("inputTime"));
frfBo.setAttributeValue("UPDATE_TIME",params.get("inputTime"));
frfBo.setAttributeValue("DEL_FLAG","0");

View File

@ -303,8 +303,8 @@
</class>
<class name="FC_REQUEST" label="½Ó¿Ú״̬±í" describe="ÓÊ´¢/¾Å½­ÉêÇë×´Ì¬Ò³Ãæ" keyAttributes="ID">
<attributes>
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
<attribute name="FC_LOAN_QUEUEST_ID" label="资金渠道申请ID" type="STRING" length="32"/>
<attribute name="ID" label="×ʽðÇþµÀÉêÇëID" type="STRING" length="32" />
<attribute name="FC_LOAN_ID" label="×ʽðÇþµÀ·Å¿îÉêÇëID" type="STRING" length="32"/>
<attribute name="CHANNEL_NO" label="×ʽðÇþµÀ±àºÅ" type="STRING" length="32"/>
<attribute name="CHANNEL_NAME" label="×ʽðÇþµÀÃû³Æ" type="STRING" length="32"/>
<attribute name="PROJECT_ID" label="ÏîÄ¿ID" type="STRING" length="32"/>
@ -328,7 +328,6 @@
<manager>
<managerProperties>
<property name="table" value="FC_REQUEST"/>
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>

View File

@ -1,12 +1,14 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%>
<%
String fcLoanQueuestId = CurPage.getParameter("fcLoanQueuestId");
String fcRequestId = CurPage.getParameter("fcRequestId");
//todo 提交后将消息已读并已处理
String messageId = CurPage.getParameter("messageid");
String channelNo=CurPage.getParameter("channelNo");
String projectId=CurPage.getParameter("projectId");
String contractId=CurPage.getParameter("contractId");
String isReadOnly = CurPage.getParameter("isReadOnly");
String params="fcLoanQueuestId="+fcLoanQueuestId+"&channelNo="+channelNo+"&projectId="+projectId+"&contractId="+contractId+"&isReadOnly="+isReadOnly;
String params="fcRequestId="+fcRequestId+"&channelNo="+channelNo+"&projectId="+projectId+"&contractId="+contractId+"&isReadOnly="+isReadOnly+"messageId"+messageId;
//参数0.是否显示, 1.标题2.URL3参数串, 4. Strip高度(默认600px)5. 是否有关闭按钮(默认无) 6. 是否缓存(默认是)

View File

@ -7,39 +7,39 @@
Content: 示例详情页面
History Log:
*/
String productId=CurPage.getParameter("productId");
String fcFlowType=CurPage.getParameter("fcFlowType");
String fcQueuestId=CurPage.getParameter("fcLoanQueuestId");
String fcRequestId=CurPage.getParameter("fcRequestId");
String isReadOnly = CurPage.getParameter("isReadOnly");
String messageId = CurPage.getParameter("messageId");
String sPrevUrl = CurPage.getParameter("PrevUrl");
if(sPrevUrl == null) sPrevUrl = "";
if(sPrevUrl == null) sPrevUrl = "/com/tenwa/apzl/CorpusSource/FcRequestLIst.jsp";
String sTempletNo=CurPage.getParameter("TempletNo");
if(sTempletNo==null){
sTempletNo="FcRequestFileList";
}
if("N".equals(isReadOnly)){
isReadOnly = new DocListAction(fcQueuestId,fcFlowType).isFileAppendCheck();
isReadOnly = new DocListAction(fcRequestId,fcFlowType).isFileAppendCheck();
}
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setLockCount(0);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "1";//freeform
//dwTemp.ReadOnly = "-2";//只读模式
dwTemp.genHTMLObjectWindow(fcFlowType+","+fcQueuestId);
dwTemp.genHTMLObjectWindow(fcFlowType+","+fcRequestId);
String sButtons[][] = {
{"Y".equals(isReadOnly)?"false":"true","All","Button","提交资料","修改完毕,确认提交","updateStatus()","","","",""},
// {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","·µ»Ø","·µ»ØÁбí","returnList()","","","",""}
{"true","All","Button","·µ»ØÁбí","·µ»ØÁбí","returnList()","","","",""}
};
sButtonPosition = "north";
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function returnList(){
AsControl.OpenView("<%=sPrevUrl%>", "","_self","");
parent.AsControl.OpenView("<%=sPrevUrl%>", "","_self","");
}
function updateStatus(){
if(confirm("确认已补充完本合同所有资料?")){
var sParams = "fcQueuestId=<%=fcQueuestId%>";
var sParams = "fcRequestId=<%=fcRequestId%>,messageId=<%=messageId%>";
var sReturnInfo = RunJavaMethodTrans("com.ample.fundchannel.doc.action.DocListAction","requestFilePushUpdate",sParams);
if(sReturnInfo=='S'){
alert("提交成功");
@ -63,7 +63,7 @@
}
function upload(fcFileCode){
var param="fcQueuestId=<%=fcQueuestId%>&fcFlowType=<%=fcFlowType%>&fcFileCode="+fcFileCode;
var param="fcRequestId=<%=fcRequestId%>&fcFlowType=<%=fcFlowType%>&fcFileCode="+fcFileCode;
var sUrl="/Ample/Doc/DocListInfoNew.jsp";
AsDialog.PopView(sUrl,param,"dialogWidth=800px;dialogHeight=500px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
reloadSelf();
@ -87,7 +87,7 @@
function afterSearch(){
var isReadOnly="<%=isReadOnly%>";
for(var i=0;i<getRowCount(0);i++){
var sParams="fcQueuestId=<%=fcQueuestId%>,fcFlowType=<%=fcFlowType%>,fcFileCode="+getItemValue(0,i,"FC_FILE_CODE");
var sParams="fcRequestId=<%=fcRequestId%>,fcFlowType=<%=fcFlowType%>,fcFileCode="+getItemValue(0,i,"FC_FILE_CODE");
var isAppend = RunJavaMethod("com.ample.fundchannel.doc.action.DocListAction","isFileAppendCheckByRow",sParams);
if(isReadOnly!="Y"&&isAppend!="Y"&&getObj(0,i,"operation")!=null&&getObj(0,i,"operation")!="null"){
getObj(0,i,"operation").innerHTML='<a class="box" onclick="upload(\''+getItemValue(0,i,"FC_FILE_CODE")+'\')" style={color:#000;text-decoration:underline;}><font color="blue">上传</font></a>';

View File

@ -27,19 +27,18 @@
}
function viewAndEdit(){
var sUrl = "/com/tenwa/apzl/CorpusSource/FcRequestDocTab.jsp";
var fcLoanQueuestId = getItemValue(0,getRow(0),'FC_LOAN_QUEUEST_ID');
var fcRequestId = getItemValue(0,getRow(0),'ID');
var channelNo = getItemValue(0,getRow(0),'CHANNEL_NO');
var projectId = getItemValue(0,getRow(0),'PROJECT_ID');
var contractId = getItemValue(0,getRow(0),'CONTRACT_ID');
var supplementSTS = getItemValue(0,getRow(0),'SUPPLEMENT_STS');
var isReadOnly = 'Y';
debugger;
//todo 邮储发送通知后fcStatus标记是否有需要补充资料的
if(supplementSTS=='1'){
if(supplementSTS!='0'){
isReadOnly='N';
}
var sPara ='fcLoanQueuestId='+fcLoanQueuestId+'&channelNo='+channelNo+ '&projectId='+projectId+'&contractId='+contractId+'&isReadOnly='+isReadOnly;
if(projectId==null || fcLoanQueuestId==null ){
var sPara ='fcRequestId='+fcRequestId+'&channelNo='+channelNo+ '&projectId='+projectId+'&contractId='+contractId+'&isReadOnly='+isReadOnly;
if(projectId==null || fcRequestId==null ){
alert("参数不能为空!");
return ;
}

View File

@ -1,7 +1,10 @@
package com.ample.fundchannel.doc.action;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.*;
import com.amarsoft.are.util.StringFunction;
import jbo.com.tenwa.entity.comm.message.BT_BUSSINESS_MESSAGE;
import jbo.oti.FC_REQUEST;
import jbo.oti.FC_REQUEST_FILE;
import jbo.oti.FC_REQUEST_FILE_PUSH;
@ -13,12 +16,14 @@ public class DocListAction {
private String userId;
private String fcFlowType;
private String fcFileCode;
private String fcQueuestId;
private String fcRequestId;
private String messageId;
private String currentTime;
public DocListAction() {
}
public DocListAction(String fcQueuestId, String fcFlowType) {
this.fcQueuestId = fcQueuestId;
public DocListAction(String fcRequestId, String fcFlowType) {
this.fcRequestId = fcRequestId;
this.fcFlowType = fcFlowType;
}
@ -51,7 +56,7 @@ public class DocListAction {
public String isFileAppendCheck() throws JBOException {
BizObjectManager FRFbom = null;
FRFbom = JBOFactory.getBizObjectManager(FC_REQUEST_FILE.CLASS_NAME);
List<BizObject> FRFBO = FRFbom.createQuery("select FC_FILE_STS from O where FC_REQUEST_ID=:fcQueuestId and FC_FLOW_TYPE=:fcFlowType group by FC_FILE_STS").setParameter("fcQueuestId", fcQueuestId).setParameter("fcFlowType", fcFlowType).getResultList(false);
List<BizObject> FRFBO = FRFbom.createQuery("select FC_FILE_STS from O where FC_REQUEST_ID=:fcRequestId and FC_FLOW_TYPE=:fcFlowType group by FC_FILE_STS").setParameter("fcRequestId", fcRequestId).setParameter("fcFlowType", fcFlowType).getResultList(false);
if (FRFBO.size() == 1 && FRFBO.get(0).getAttribute("FC_FILE_STS") != null && "1".equals(FRFBO.get(0).getAttribute("FC_FILE_STS").toString())) {
return "Y";
}
@ -61,32 +66,62 @@ public class DocListAction {
public String isFileAppendCheckByRow() throws JBOException {
BizObjectManager FRFbom = null;
FRFbom = JBOFactory.getBizObjectManager(FC_REQUEST_FILE.CLASS_NAME);
List<BizObject> FRFBO = FRFbom.createQuery("select FC_FILE_STS from O where FC_REQUEST_ID=:fcQueuestId and FC_FLOW_TYPE=:fcFlowType and FC_FILE_CODE=:fcFileCode group by FC_FILE_STS").setParameter("fcQueuestId", fcQueuestId).setParameter("fcFlowType", fcFlowType).setParameter("fcFileCode", fcFileCode).getResultList(false);
if (FRFBO.size() == 1 && FRFBO.get(0).getAttribute("FC_FILE_STS") != null && "1".equals(FRFBO.get(0).getAttribute("FC_FILE_STS").toString())) {
List<BizObject> FRFBO = FRFbom.createQuery("select FC_FILE_STS from O where FC_REQUEST_ID=:fcRequestId and FC_FLOW_TYPE=:fcFlowType and FC_FILE_CODE=:fcFileCode group by FC_FILE_STS").setParameter("fcRequestId", fcRequestId).setParameter("fcFlowType", fcFlowType).setParameter("fcFileCode", fcFileCode).getResultList(false);
if (FRFBO.size() == 1 && FRFBO.get(0).getAttribute("FC_FILE_STS") != null && "0".equals(FRFBO.get(0).getAttribute("FC_FILE_STS").toString())) {
return "Y";
}
return "N";
}
public String requestFilePushUpdate(JBOTransaction tx) {
BizObjectManager FRFPbom = null;
BizObject FRFPBo = null;
this.setCurrentTime();
try {
FRFPbom = JBOFactory.getBizObjectManager(FC_REQUEST_FILE_PUSH.CLASS_NAME,tx);
FRFPBo = FRFPbom.createQuery("FC_REQUEST_ID=:fcQueuestId and DEL_FLAG='0'").setParameter("fcQueuestId", fcQueuestId).getSingleResult(true);
if(FRFPBo!=null){
FRFPBo.setAttributeValue("PUSH_STS","1");
String updateTime = StringFunction.getTodayNow();
FRFPBo.setAttributeValue("UPDATE_TIME",updateTime);
FRFPbom.saveObject(FRFPBo);
}else{
return "未找到对应记录请联系IT管理员";
}
updateRequestFileStatus(tx);
setMessageRead(tx);
insertRequestFilePush(tx);
} catch (JBOException e) {
e.printStackTrace();
return "error";
return "提交出现错误";
}
return "S";
}
public void updateRequestFileStatus(JBOTransaction tx) throws JBOException {
BizObjectManager FRbom = null;
BizObject FRBo = null;
FRbom = JBOFactory.getBizObjectManager(FC_REQUEST.CLASS_NAME,tx);
FRBo = FRbom.createQuery("ID=:id").setParameter("id",fcRequestId).getSingleResult(true);
String supplementSTS = FRBo.getAttribute("SUPPLEMENT_STS")==null?"":FRBo.getAttribute("SUPPLEMENT_STS").toString();
if("0".equals(supplementSTS)){
ARE.getLog().warn("邮储请求ID"+fcRequestId + "的合同无需补充资料,却显示了资料提交的按钮");
}else if("1".equals(supplementSTS)||"".equals(supplementSTS)){
FRBo.setAttributeValue("SUPPLEMENT_STS","2");
FRbom.saveObject(FRBo);
}
}
public void insertRequestFilePush(JBOTransaction tx) throws JBOException {
BizObjectManager FRFPbom = null;
BizObject FRFPBo = null;
FRFPbom = JBOFactory.getBizObjectManager(FC_REQUEST_FILE_PUSH.CLASS_NAME,tx);
FRFPBo = FRFPbom.newObject();
FRFPBo.setAttributeValue("FC_REQUEST_ID",fcRequestId);
FRFPBo.setAttributeValue("PUSH_STS","0");
FRFPBo.setAttributeValue("PUSH_STS_DESC","未提交");
FRFPBo.setAttributeValue("CREATE_TIME",currentTime);
FRFPBo.setAttributeValue("UPDATE_TIME",currentTime);
FRFPBo.setAttributeValue("DEL_FLAG","0");
FRFPbom.saveObject(FRFPBo);
}
public void setMessageRead(JBOTransaction tx) throws JBOException {
BizObjectManager BBMbom = null;
BizObject BBMBo = null;
BBMbom = JBOFactory.getBizObjectManager(BT_BUSSINESS_MESSAGE.CLASS_NAME,tx);
BBMBo = BBMbom.createQuery("ID=:id").setParameter("id",messageId).getSingleResult(true);
BBMBo.setAttributeValue("is_read","has_read");
BBMBo.setAttributeValue("message_status","has_process");
BBMBo.setAttributeValue("read_time",currentTime);
BBMBo.setAttributeValue("finish_time",currentTime);
BBMbom.saveObject(BBMBo);
}
public String getFrfId() {
return frfId;
}
@ -119,12 +154,26 @@ public class DocListAction {
this.fcFileCode = fcFileCode;
}
public String getFcQueuestId() {
return fcQueuestId;
public String getFcRequestId() {
return fcRequestId;
}
public void setFcQueuestId(String fcQueuestId) {
this.fcQueuestId = fcQueuestId;
public void setFcRequestId(String fcRequestId) {
this.fcRequestId = fcRequestId;
}
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public String getCurrentTime() {
return currentTime;
}
public void setCurrentTime() {
this.currentTime = StringFunction.getTodayNow();
}
}

View File

@ -14,13 +14,13 @@ public interface FC_REQUEST{
*/
public static final String CLASS_NAME = "jbo.oti.FC_REQUEST";
/**
* 唯一标识 STRING(32)<br>
* ×ʽðÇþµÀÉêÇëID STRING(32)<br>
*/
public static final String ID = "ID";
/**
* 资金渠道申请ID STRING(32)<br>
* ×ʽðÇþµÀ·Å¿îÉêÇëID STRING(32)<br>
*/
public static final String FC_LOAN_QUEUEST_ID = "FC_LOAN_QUEUEST_ID";
public static final String FC_LOAN_ID = "FC_LOAN_ID";
/**
* ×ʽðÇþµÀ±àºÅ STRING(32)<br>
*/