邮储资方租前部分

This commit is contained in:
ap007 2021-06-17 19:06:33 +08:00
parent f6e6fe997c
commit 48918e9303
22 changed files with 1396 additions and 207 deletions

View File

@ -0,0 +1,325 @@
<%@page import="com.tenwa.util.QuartzPropertiesUtil"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@include file="/Frame/resources/include/include_begin_info.jspf"%>
<%
//获得组件参数
String flowNo=CurPage.getParameter("FlowNo");
String fcQueuestId = CurPage.getParameter("fcQueuestId");
String fcFlowType = CurPage.getParameter("fcFlowType");
String fcFileCode = CurPage.getParameter("fcFileCode");
%>
<html>
<head>
<meta charset="GBK">
<title>File Upload</title>
<!--引入CSS-->
<link rel="stylesheet" type="text/css" href="<%=sWebRootPath%>/Frame/page/webuploader/webuploader.css">
<link rel="stylesheet" type="text/css" href="<%=sWebRootPath%>/Frame/page/webuploader/upload.css">
<link rel="stylesheet" type="text/css" href="<%=sWebRootPath%>/Frame/page/bootstrap/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="<%=sWebRootPath%>/Frame/page/bootstrap/css/bootstrap-theme.min.css"/>
<!--引入JS-->
<script type="text/javascript" src="<%=sWebRootPath%>/js/jquery/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/webuploader/webuploader.js"></script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div style="overflow:auto;height:500px">
<div class="form-group">
<table class="table table-striped">
<%-- <tr>
<td><label for="docType">一级分类</label><input readonly type="text" class="form-control" id="docType" value="<%=docType %>"></td>
<td><label for="oneClassify">二级分类</label><input readonly type="text" class="form-control" id="oneClassify" value="<%=oneClassify %>"></td>
</tr> --%>
<tr>
<td><h5><b>上传附件</b></h5></td>
</tr>
<!-- <tr>
<td colspan="2">
<label for="remark">备注</label>
<textarea class="form-control" rows="4" id="remark"></textarea>
</td>
</tr> -->
</table>
</div>
<div id="uploader" class="wu-example">
<div class="memo">未选择任何文件</div>
<!--用来存放文件信息-->
<div id="thelist" class="uploader-list filelist"></div>
<div class="btns">
<div id="picker" style="display:inline-block">选择文件</div>
<%
if(!"true".equals(QuartzPropertiesUtil.get("autoUpload"))) {%>
<button id="ctlBtn" class="btn btn-default">开始上传</button>
<%}
%>
<button id="backBtn" class="btn btn-default" style="margin-left:11px;" onclick="AsDialog.ClosePage();">返回</button>
</div>
</div>
</div>
<script>
// 文件上传
jQuery(function() {
var $ = jQuery,
$list = $('#thelist'),
$btn = $('#ctlBtn'),
state = 'pending',
// 优化retina, 在retina下这个值是2
ratio = window.devicePixelRatio || 1,
// 缩略图大小
thumbnailWidth = 100 * ratio,
thumbnailHeight = 100 * ratio,
uploader,
percentages = {},
supportTransition = (function(){
var s = document.createElement('p').style,
r = 'transition' in s ||
'WebkitTransition' in s ||
'MozTransition' in s ||
'msTransition' in s ||
'OTransition' in s;
s = null;
return r;
})(),
uploader = WebUploader.create({
fileNumLimit: <%=QuartzPropertiesUtil.get("fileNumLimit") %>,
fileSizeLimit: <%=QuartzPropertiesUtil.get("fileSizeLimit") %> * 1024 * 1024,
fileSingleSizeLimit: <%=QuartzPropertiesUtil.get("fileSingleSizeLimit") %> * 1024 * 1024,
dnd: document.body,
paste: document.body,
disableGlobalDnd: true,
// 不压缩image
//resize: false,
//设置文件是否压缩如果不压缩直接写false如果需要压缩则需要添加对应的参数详情请看百度文档。
compress:false,
auto: <%=QuartzPropertiesUtil.get("autoUpload") %>,
prepareNextFile: true,
threads:<%=QuartzPropertiesUtil.get("fileNumLimit") %>,
formData: {
fcQueuestId:'<%=fcQueuestId%>',
fcFlowType:'<%=fcFlowType%>',
fcFileCode:'<%=fcFileCode%>'
},
// swf文件路径
swf: '<%=sWebRootPath%>/Frame/page/webuploader/Uploader.swf',
// 文件接收服务端。
server: '<%=sWebRootPath%>/Ample/Doc/DocListUploadNew.jsp?CompClientID=<%=CurComp.getClientID()%>',
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id: '#picker',
multiple: true
},
accept: {
extensions: '<%=QuartzPropertiesUtil.get("fileType") %>'
}
});
uploader.on('beforeFileQueued',function(file){
var reg = RegExp(/[^%&',;=?$\x22]+/);
if(file.name.match(reg)){
AsDebug.alert("警告","上传出错!请不要上传名称中带有%&',;=?$等特殊字符的文件");
return false;
}
});
// 当有文件添加进来的时候
uploader.on( 'fileQueued', function( file ) {
var $li = $(
'<div id="' + file.id + '" class="file-item thumbnail">' +
'<img>' +
'<div class="info" style = "height:0px">' + file.name + '</div>' +
'</div>'
),
$img = $li.find('img');
var $btns = $('<div class="file-panel">' +
'<span class="cancel">取消</span>' +
'<span class="rotateRight">向左旋转</span>' +
'<span class="rotateLeft">向右旋转</span></div>').appendTo( $li );
$li.on( 'mouseenter', function() {
$btns.stop().animate({height: 30});
$li.find(".info").stop().animate({height: 20});
});
$li.on( 'mouseleave', function() {
$btns.stop().animate({height: 0});
$li.find(".info").stop().animate({height: 0});
});
percentages[file.id] = file.size;
file.rotation = 0;
$btns.on( 'click', 'span', function() {
var index = $(this).index()
switch ( index ) {
case 0:
removeFile( file );
return;
case 1:
file.rotation += 90;
break;
case 2:
file.rotation -= 90;
break;
}
if ( supportTransition ) {
deg = 'rotate(' + file.rotation + 'deg)';
$img.css({
'-webkit-transform': deg,
'-mos-transform': deg,
'-o-transform': deg,
'transform': deg
});
} else {
$img.css( 'filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation='+ (~~((file.rotation/90)%4 + 4)%4) +')');
}
});
$list.append( $li );
// 创建缩略图
uploader.makeThumb( file, function( error, src ) {
if ( error ) {
$img.replaceWith('<span>无法预览</span>');
$li.css("width",thumbnailWidth + 10).css("height",thumbnailHeight + 10);
return;
}
$img.attr( 'src', src );
}, thumbnailWidth, thumbnailHeight );
$(".memo").hide();
});
// 文件上传过程中创建进度条实时显示。
uploader.on( 'uploadProgress', function( file, percentage ) {
var $li = $( '#'+file.id ),
$percent = $li.find('.progress span');
// 避免重复创建
if ( !$percent.length ) {
$percent = $('<p class="progress" style="height:7%"><span></span></p>')
.appendTo( $li )
.find('span');
}
$percent.css( 'width', percentage * 100 + '%' );
});
// 文件上传成功给item添加成功class, 用样式标记上传成功。
uploader.on( 'uploadSuccess', function( file, ret) {
file["attribute_id"] = ret["_raw"];
$( '#'+file.id ).addClass('upload-state-done');
});
// 文件上传失败,现实上传出错。
uploader.on( 'uploadError', function( file ) {
var $li = $( '#'+file.id ),
$error = $li.find('div.error');
// 避免重复创建
if ( !$error.length ) {
$error = $('<div class="error"></div>').appendTo( $li );
}
$error.text('上传失败');
});
uploader.on( 'all', function( type ) {
if ( type === 'startUpload' ) {
state = 'uploading';
} else if ( type === 'stopUpload' ) {
state = 'paused';
} else if ( type === 'uploadFinished' ) {
state = 'done';
}
if ( state === 'uploading' ) {
$btn.text('暂停上传');
} else {
$btn.text('开始上传');
}
});
$btn.on( 'click', function() {
if ( state === 'uploading' ) {
uploader.stop();
} else {
uploader.upload();
}
});
// 完成上传完了,成功或者失败,先删除进度条。
uploader.on( 'uploadComplete', function( file ) {
$( '#'+file.id ).find('.progress').remove();
});
uploader.on("error", function (type) {
if(file.name=='测试用图片.jpg'){
AsDebug.alert("警告","上传出错!");
}
if (type == "Q_TYPE_DENIED") {
AsDebug.alert("警告","请上传" + "<%=QuartzPropertiesUtil.get("fileType") %>".toUpperCase() + "格式文件");
} else if (type == "Q_EXCEED_SIZE_LIMIT") {
AsDebug.alert("警告","文件大小不能超过<%=QuartzPropertiesUtil.get("fileSingleSizeL imit") %>M");
}else {
AsDebug.alert("警告","上传出错!请检查后重新上传!错误代码"+type);
}
});
uploader.on( 'fileDequeued', function( file ) {
//removeFile( file );
});
function removeFile( file ) {
var $li = $('#'+file.id);
if(file["attribute_id"]) {
var result = AsControl.RunJsp("/Tenwa/Comm/DocList/DeleteDocFile.jsp", "AttributeId=" + file["attribute_id"]);
if(result == "FAILED") {
$error = $li.find('div.error');
// 避免重复创建
if ( !$error.length ) {
$error = $('<div class="error"></div>').appendTo( $li );
}
$error.text('删除失败');
return;
}
}
uploader.removeFile(file);
delete percentages[ file.id ];
var flag = false;
for(var p in percentages) {
flag = true;
break;
}
if(!flag) {
$(".memo").show();
}
$li.off().find('.file-panel').off().end().remove();
}
});
</script>
</body>
</html>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,90 @@
<%@page import="java.io.File"
%><%@page import="org.apache.commons.io.FileUtils"
%><%@page import="com.amarsoft.are.jbo.BizObject"
%><%@page import="com.amarsoft.are.jbo.BizObjectManager"
%><%@page import="com.amarsoft.are.jbo.JBOFactory"
%><%@page import="org.apache.commons.fileupload.FileItem"
%><%@page import="org.apache.commons.fileupload.servlet.ServletFileUpload"
%><%@page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"
%>
<%@ page import="com.amarsoft.are.jbo.JBOException" %>
<%@ page import="java.util.regex.Pattern" %>
<%@ page import="java.util.regex.Matcher" %>
<%@ page contentType="text/html; charset=GBK"
%><%@ include file="/IncludeBeginMDAJAX.jsp"%><%
//1.创建DiskFileItemFactory对象配置缓存用
DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory();
// 2. 创建 ServletFileUpload对象
ServletFileUpload servletFileUpload = new ServletFileUpload(diskFileItemFactory);
// 3. 设置文件名称编码
servletFileUpload.setHeaderEncoding("utf-8");
List<FileItem> items = servletFileUpload.parseRequest(request);
String inputTime = StringFunction.getTodayNow(); //附件编号上传时间
InputStream is = null;
//当一次传多个图片时会多次执行这个页面下面for循环只是将参数读取出来将普通数据封装为map然后将map传给写入数据库的方法。
Map<String,String> params = new HashMap<>();
for (FileItem fileItem : items) {
if (fileItem.isFormField()) { // >> 普通数据
String fieldValue = fileItem.getString("utf-8");
String fieldName = fileItem.getFieldName();
params.put(fieldName,fieldValue);
ARE.getLog().info(fieldName + ": " + fieldValue);
} else {
//获取文件的实际内容
is = fileItem.getInputStream();
}
}
//找出配置的存储路径
String sFileSavePath = CurConfig.getConfigure("FileSavePath");
String uuid = java.util.UUID.randomUUID().toString().replaceAll("-", "");
String sFullPath = com.tenwa.officetempalte.util.FileOperatorUtil.getuploadFileDir(sFileSavePath) + uuid + "_" + params.get("name");
params.put("filePath",sFullPath);
params.put("inputTime",inputTime);
params.put("inputUserId",CurUser.getUserID());
try{
if(Integer.parseInt(params.get("size")) <= 0){
throw new Exception("上传文件失败,请联系管理员!");
}
//保存实体文件
FileUtils.copyInputStreamToFile(is, new File(sFullPath));
//保存文件信息
fileInfoSave(params,Sqlca);
Sqlca.commit();
}catch (Exception e){
e.printStackTrace();
Sqlca.rollback();
out.print("FAILED");
}
%>
<%!
public void fileInfoSave(Map<String,String> params,Transaction Sqlca) throws JBOException {
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_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("CREATE_TIME",params.get("inputTime"));
frfBo.setAttributeValue("UPDATE_TIME",params.get("inputTime"));
frfBo.setAttributeValue("DEL_FLAG","0");
frfBo.setAttributeValue("INPUTTIME",params.get("inputTime"));
frfBo.setAttributeValue("INPUTUSER",params.get("inputUserId"));
frfBom.saveObject(frfBo);
}
}
%>
<%@ include file="/IncludeEndAJAX.jsp"%>

View File

@ -0,0 +1,114 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@page import="com.amarsoft.awe.res.JspfText"%>
<%@ page import="com.tenwa.doc.action.DocListInitAction" %>
<%@include file="/Frame/page/jspf/include/jsp_runtime_context.jspf"
%><%@page import="com.amarsoft.web.dw.*"%><%@include file="/Frame/page/jspf/include/jsp_sqlca_head.jspf"
%><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<%@include file="/Frame/page/jspf/include/jsp_head_res.jspf"%>
<link rel="stylesheet" href="<%=sWebRootPath%>/Frame/page/resources/css/Style.css">
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/resources/js/checkdatavalidity.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/resources/js/as_autoScan.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/resources/js/chart/json2.js"></script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/resources/js/as_formatdoc.js"></script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/xls.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/as_webcalendar.js"></script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/as_treeview.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/widget/htmltree.js"></script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/common.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/htmlcontrol.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/message.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/dw/as_dz.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/dw/as_dz_page.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/dw/as_dz_middle.js"> </script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/page/js/as_contextmenu.js"></script>
<script type="text/javascript" src="<%=sWebRootPath%>/Frame/resources/js/dialog/dialog-min.js"></script>
<script type="text/javascript" >
var AsOne = {SetDefault:function(sURL) {document.write("<iframe name=myform999 src='"+sURL+"' frameborder=0 width=1 height=1 style='display:none'> </iframe>");},AsInit:function() {} };
top.status="<%=LanguageManager.getSystemLanguage(CurUser.getLanguage(), JspfText.Organization)%>£º<%=CurUser.getOrgID()%>-<%=CurUser.getOrgName()%> <%=LanguageManager.getSystemLanguage(CurUser.getLanguage(), JspfText.User)%>£º<%=CurUser.getUserID()%>-<%=CurUser.getUserName()%> ";
</script>
</head>
<%
String compClientID = request.getParameter("CompClientID");
String attrid = CurPage.getParameter("attrid");
String className = CurPage.getParameter("className");
String flowunid = CurPage.getParameter("flowunid");
String projectid = CurPage.getParameter("projectid");
String docClassItemno = CurPage.getParameter("docClassItemno");
String objecttype = CurPage.getParameter("objecttype");
List<String> Imagelist = new ArrayList();
if(flowunid!=null&&Imagelist.size()==0){
Imagelist=DocListInitAction.nextImagebyFlowunid(flowunid,docClassItemno,objecttype);
}
// if(projectid!=null&&Imagelist.size()==0){
// Imagelist=DocListInitAction.nextImagebyProjectId(projectid,docClassItemno,objecttype);
// }
int imageattridv = 0;
int index = 0;
%>
<body style="overflow:hidden;">
<link rel="stylesheet" href="<%=sWebRootPath%>/js/viewpicture/cssv/viewer.min.css">
<style>
* { margin: 0; padding: 0;}
#jq22 { width: 100%; margin: 0 auto; font-size: 0;}
#jq22 li { display: inline-block; width: 32%; margin-left: 1%; padding-top: 1%;}
#jq22 li img { width: 100%;}
</style>
<div style="overflow:scroll;width:100%;" >
<ul id="jq22">
<%
if(Imagelist.size()>0){
for(String imageattrid:Imagelist){
imageattridv++;
if(imageattrid.equals(attrid)){
index=imageattridv;
}
%>
<%%>
<l=i><img style="display:none" data-original="<%=sWebRootPath%>/servlet/view/image/public?CompClientID=<%=compClientID%>&attrid=<%=imageattrid %>&className=<%=className%>" src="<%=sWebRootPath%>/servlet/view/image/public?CompClientID=<%=compClientID%>&attrid=<%=imageattrid %>&className=<%=className%>" /></li>
<%
}
}else{
index=1;
%>
<li><img style="display:none" data-original="<%=sWebRootPath%>/servlet/view/image/public?CompClientID=<%=compClientID%>&attrid=<%=attrid %>&className=<%=className%>" src="<%=sWebRootPath%>/servlet/view/image/public?CompCle%>" /></li>
<%
}
%>
</ul>
</div>
</body>
<script src="<%=sWebRootPath%>/js/viewpicture/js/jquery.min.js"></script>
<script src="<%=sWebRootPath%>/js/viewpicture/js/viewer-jquery.min.js"></script>
<script src="<%=sWebRootPath%>/js/viewpicture/jsv/viewer.min.js"></script>
<script type="text/javascript">
var curWindowWidth=$(document).width();
$(function() {
viewer = new Viewer(document.getElementById('jq22'), {
url: 'data-original',
navbar:true,
inline:false,
keyboard:false,
button:false,
title:false,
zoomRatio:0.4
});
var res = viewer.show();
if(res.element){
setTimeout("clickImage()",600);
}
});
function clickImage(){
if('<%=index-1%>'!='0'){
$(".viewer-list").find("li").eq(<%=index-1%>).attr('class','');
$(".viewer-list").find("li").eq(<%=index-1%>).find('img').click();
}
}
</script>
<%@ include file="/IncludeEnd.jsp"%>

View File

@ -0,0 +1,11 @@
<%@page import="com.tenwa.doc.action.WordAction"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<%
String filePath=CurPage.getAttribute("filePath");//
String compClientID = request.getParameter("CompClientID");
filePath = java.net.URLEncoder.encode(filePath,"UTF-8");
%>
<iframe src="<%=sWebRootPath%>/servlet/view/topathpdf?CompClientID=<%=compClientID%>&filePath=<%=filePath%>" width="100%" height="800"></iframe>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -1,62 +0,0 @@
<%@page import="com.amarsoft.app.base.util.ObjectWindowHelper"%>
<%@page import="com.amarsoft.app.base.businessobject.*"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
本金资源顺序列表
*/
String productId= CurPage.getParameter("productId");
ASObjectModel doTemp = new ASObjectModel("LB_PRODUCT_CORPUS_SOURCE");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow(productId);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","新增","新增","newRecord();","","","","btn_icon_add",""},
{"true","","Button","保存","保存","save()","","","","",""},
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function newRecord(){
var position= getRowCount(0);
as_add(0);
tableDatas['myiframe0'][position][0]='<%=productId%>';
}
function save(){
if(checkAll()=='s'){
as_save(0);
self.location.reload();
}
}
function checkAll(){
//双循环来遍历查重
for(var i=0;i<getRowCount(0);i++){
for(var j = i+1; j < getRowCount(0); j++){
var orderList = getItemValue(0,i,'ORDER_LIST');
var corpusSource = getItemValue(0,i,'CORPUS_SOURCE');
var orderListLast = getItemValue(0,j,'ORDER_LIST');
var corpusSourceLast = getItemValue(0,j,'CORPUS_SOURCE');
if(i==0){
if(orderList==null||orderList==''||corpusSource==null||corpusSourceLast==''||orderListLast==null||orderListLast==''||corpusSourceLast==null||corpusSourceLast==''){
alert('资金来源或排序号不能为空');
return;
}
}
if(orderList==orderListLast){
alert('排序号不可以重复');
return;
}else if(corpusSource==corpusSourceLast){
alert('资金来源不可以重复');
return;
}
}
}
return 's';
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -1,78 +0,0 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
产品配置资金来源顺序主页面
*/
ASObjectModel doTemp = new ASObjectModel("VI_PRODUCT_CORPUS_SOURCE");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
// dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow("");
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
{"true","","Button","编辑","编辑","viewAndEdit()","","","","btn_icon_detail",""},
{"true","","Button","删除","删除","deleteProduct()","","","","btn_icon_delete",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function newRecord(){
var productId='';
AsDialog.OpenSelector("selectProductList","","dialogWidth=" + parseInt(window.screen.width * 0.6) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",
function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn=="")
{
//alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
sReturn = sReturn.split("@");
productId = sReturn[0];
var sUrl = "/Tenwa/Apzl/productCorpus/LbProductCorpusUpDown.jsp";
AsDialog.PopView(sUrl,'productId='+productId,'dialogWidth=950px;dialogHeight=500px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;',function(){reloadSelf();},'新建');
},"请选择产品",'');
//将返回的产品ID传输到编辑的info页面info页面只是展示作用然后list页面新增的时候再保存。
//编辑按钮不采用在后面添加超连接形式,曾经有的页面采用这种方式数据量大时特别卡。采用系统封装按钮事件来实现。
}
function viewAndEdit(){
var sUrl = "/Tenwa/Apzl/productCorpus/LbProductCorpusUpDown.jsp";
var sPara = getItemValue(0,getRow(0),'PRODUCT_ID');
if(typeof(sPara)=="undefined" || sPara.length==0 ){
alert("参数不能为空!");
return ;
}
AsDialog.PopView(sUrl,'productId=' +sPara ,'dialogWidth=950px;dialogHeight=500px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;',function(){reloadSelf();},'编辑');
}
/*function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
if(getObj(0,i,"action")!=null){
getObj(0,i,"action").innerHTML='<a class="box" style="text-align:center;" onclick="edit(\''+getItemValue(0,i,"PRODUCT_ID")+'\')" style={color:#000;text-decoration:underline;}><font color="blue">&nbsp&nbsp&nbsp&nbsp&nbsp编辑</font></ a>';
}
};
}
function edit(productId){
var sUrl="/Tenwa/Apzl/productCar/LmProductUpAndDown.jsp";
var sPara = "productId="+productId;
AsDialog.PopView(sUrl,sPara,"dialogWidth=950px;dialogHeight=500px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(){reloadSelf();},"配置车辆");
}*/
function deleteProduct(){
var sPara ='productId='+ getItemValue(0,getRow(0),'PRODUCT_ID');
var sResult = AsControl.RunJsp('/Tenwa/Apzl/productCorpus/deleteProductCorpus.jsp',sPara);
alert(sResult);
parent.reloadSelf();
}
/*
function mySelectRow(){
var TYPENO = getItemValue(0,getRow(0),"TYPENO");
parent.OpenInfo(TYPENO);
//list 页面同步info页面的联动传至单击事件
}
*/
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -1,20 +0,0 @@
<%@ page contentType="text/html; charset=GBK"%><%@
include file="/IncludeBegin.jsp"%><%
/*
页面说明: 示例上下联动框架页面
*/
String productId = CurPage.getParameter("productId");
%><%@include file="/Resources/CodeParts/Frame02.jsp"%>
<script type="text/javascript">
mytoptd.height=100;
OpenInfo();
OpenList();
function OpenInfo(){
AsControl.OpenView("/Tenwa/Apzl/productCorpus/LbProductInfo.jsp","productId=<%=productId%>","rightup");
}
function OpenList(){
AsControl.OpenView("/Tenwa/Apzl/productCorpus/LbCorpusSourceList.jsp","productId=<%=productId%>", "rightdown");
}
</script>
<%@ include file="/IncludeEnd.jsp"%>

View File

@ -1,26 +0,0 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
产品简介
*/
String productId = CurPage.getParameter("productId");
String sTempletNo = "LbProductInfo";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
dwTemp.ReadOnly = "-2";//只读模式
dwTemp.genHTMLObjectWindow(productId);
String sButtons[][] = {
//{"true","All","Button","保存","保存所有修改","save()","","","",""},
//{"true","All","Button","返回","返回列表","returnList()","","","",""}
};
sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
/* function save(){
as_save("myiframe0","returnList()");
} */
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -1,20 +0,0 @@
<%@page import="com.amarsoft.are.jbo.JBOTransaction"%>
<%@page import="com.amarsoft.are.jbo.JBOFactory"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
String sResult = "";
String productId = CurPage.getParameter("productId");
int count = JBOFactory.createBizObjectQuery("jbo.prd.LB_PRODUCT_CORPUS_SOURCE", "select 1 from O where PRODUCT_ID=:productId").setParameter("productId", productId).getTotalCount();
int count_d = JBOFactory.createBizObjectQuery("jbo.prd.LB_PRODUCT_CORPUS_SOURCE", "delete from O where PRODUCT_ID=:productId").setParameter("productId", productId).executeUpdate();
if(count==count_d){
sResult="删除成功";
}else if(count_d==0){
sResult="删除失败";
}else if(count>count_d&&count_d>0){
sResult="部分删除请记录当前产品ID或产品名称并联系系统管理员";
}else{
sResult="未知错误请记录当前产品ID或产品名称并联系系统管理员";
}
out.println(sResult);
%><%@ include file="/IncludeEndAJAX.jsp"%>

View File

@ -64,7 +64,20 @@
var signType = sReturn[9];
var sealType = sReturn[10];
var channel = sReturn[13];
//todo 通过projectid先看corpus_source字段是否是带有外资方的项目如果时则去查找资方返回的对应的状态
// 如果通过则可以发起,如果暂时没有结果,则提示;如果审批失败,则按顺序转换资金方,然后重新发起业务申请后的另外一个资方的调用接口;
// 如果都失败最终转换为自有资金将corpus_source字段设为AP(代码已给张磊,在接口平台实现此功能);
var checkParam = 'project_id='+project_id;
var checkResult = RunJavaMethod('com.ap.CorpusSourceCheck','corpusApplyCheck',checkParam);
if(checkResult=='F'){
alert('资金方尚未审批结束,请稍后再试');
return;
}else if(checkResult!='S'){
alert(checkResult);
return;
}
if(flowno=="BContractApproveApply"&&"03" == customertype){
if(""== signType||null == signType||"undefined" == signType){
alert("请在产品中配置签约方式!!!");

View File

@ -301,5 +301,60 @@
</managerProperties>
</manager>
</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="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"/>
<attribute name="PROJECT_NO" label="项目编号" type="STRING" length="32"/>
<attribute name="CONTRACT_ID" label="合同ID" type="STRING" length="32"/>
<attribute name="CONTRACT_NO" label="合同编号" type="STRING" length="32"/>
<attribute name="PRODUCT_ID" label="产品ID" type="STRING" length="32"/>
<attribute name="PRODUCT_NAME" label="产品名称" type="STRING" length="32"/>
<attribute name="DISTRIBUTOR_ID" label="资经销商ID" type="STRING" length="32"/>
<attribute name="DISTRIBUTOR_NAME" label="经销商名称" type="STRING" length="32"/>
<attribute name="CUSTOMER_ID" label="客户ID" type="STRING" length="32"/>
<attribute name="CUSTOMER_NAME" label="客户名称" type="STRING" length="32"/>
<attribute name="FC_STATUS" label="当前状态" type="STRING" length="32"/>
<attribute name="FC_REMARK" label="返回状态描述" type="STRING" length="32"/>
<attribute name="CREATE_TIME" label="创建时间" type="STRING" length="32"/>
<attribute name="UPDATE_TIME" label="修改时间" type="STRING" length="32"/>
<attribute name="DEL_FLAG" label="有效标志" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="FC_REQUEST"/>
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
<class name="FC_REQUEST_FILE" label="接口资料表" describe="邮储/九江资料页面" keyAttributes="ID">
<attributes>
<attribute name="ID" label="唯一标识" type="STRING" length="32" />
<attribute name="FC_REQUEST_ID" label="资金渠道申请ID" type="STRING" length="32"/>
<attribute name="FC_FLOW_TYPE" label="流程类型" type="STRING" length="32"/>
<attribute name="FC_FLOW_TYPE_NAME" label="流程类型名称" type="STRING" length="32"/>
<attribute name="FC_FILE_CODE" label="资方:文件编号" type="STRING" length="32"/>
<attribute name="FC_FILE_CODE_NAME" label="资方:文件编号名称" type="STRING" length="32"/>
<attribute name="FC_FILE_TYPE" label="资方文件类型JPG,PNG,FDP等" type="STRING" length="32"/>
<attribute name="FILE_NAME" label="文件名称" type="STRING" length="32"/>
<attribute name="FILE_PATH" label="文件路径" type="STRING" length="32"/>
<attribute name="FC_FILE_STS" label="文件状态" type="STRING" length="32"/>
<attribute name="FC_FILE_STS_DESC" label="文件状态描述" type="STRING" length="32"/>
<attribute name="CREATE_TIME" label="创建时间" type="STRING" length="32"/>
<attribute name="UPDATE_TIME" label="修改时间" type="STRING" length="32"/>
<attribute name="DEL_FLAG" label="有效标志" type="STRING" length="32"/>
<attribute name="INPUTTIME" label="上传时间" type="STRING" length="32"/>
<attribute name="INPUTUSER" label="上传人" type="STRING" length="32"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="fc_request_file"/>
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</package>
</jbo>

View File

@ -210,6 +210,14 @@
<servlet-name>ShowImageServlet</servlet-name>
<servlet-class>com.tenwa.doc.servlet.ShowImageServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>PublicShowImageServlet</servlet-name>
<servlet-class>com.ample.fundchannel.doc.servlet.PublicShowImageServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>DocDownloadServletByPath</servlet-name>
<servlet-class>com.ample.fundchannel.doc.servlet.DocDownloadServletByPath</servlet-class>
</servlet>
<servlet>
<servlet-name>ShowPDFServlet</servlet-name>
<servlet-class>com.tenwa.doc.servlet.ShowPDFServlet</servlet-class>
@ -314,6 +322,14 @@
<servlet-name>ShowImageServlet</servlet-name>
<url-pattern>/servlet/view/image</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PublicShowImageServlet</servlet-name>
<url-pattern>/servlet/view/image/public</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DocDownloadServletByPath</servlet-name>
<url-pattern>/servlet/view/docDownloadServletByPath</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ShowPDFServlet</servlet-name>
<url-pattern>/servlet/view/pdf</url-pattern>

View File

@ -0,0 +1,33 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/IncludeBegin.jsp"%>
<%
String fcLoanQueuestId = CurPage.getParameter("fcLoanQueuestId");
String channelNo=CurPage.getParameter("channelNo");
String projectId=CurPage.getParameter("projectId");
String contractId=CurPage.getParameter("contractId");
String params="fcLoanQueuestId="+fcLoanQueuestId+"&channelNo="+channelNo+"&projectId="+projectId+"&contractId="+contractId;
//动态实现固定总数页面
String buttonFlagBAF = "false";
String buttonFlagFPCF = "false";
if(1==1){
buttonFlagBAF="true";
buttonFlagFPCF = "true";
}
//参数0.是否显示, 1.标题2.URL3参数串, 4. Strip高度(默认600px)5. 是否有关闭按钮(默认无) 6. 是否缓存(默认是)
//动态实现多个页面
/*List<String[]> tabStrip = new ArrayList<String[]>();
for(int i=0;i<3;i++){
String tabName = "";
String url = "/com/tenwa/apzl/CorpusSource/FcRequestFileList.jsp";
String param = params+"&fcFlowType=BusinessApplyFlow";
tabStrip.add(new String[]{"true", tabName, url,param, "", "", "false"});
}
String sTabStrip[][] = tabStrip.toArray(new String[0][]);*/
String sTabStrip[][] = {
{buttonFlagBAF, "业务申请资料", "/com/tenwa/apzl/CorpusSource/FcRequestFileList.jsp",params+"&fcFlowType=BusinessApplyFlow", "", "", "false"},
{buttonFlagFPCF, "放款申请资料", "/com/tenwa/apzl/CorpusSource/FcRequestFileList.jsp",params+"&fcFlowType=FundPaymentCarFlow", "", "", "false"},
};
%>
<%@ include file="/Resources/CodeParts/Tab01.jsp"%>
<%@ include file="/IncludeEnd.jsp"%>

View File

@ -0,0 +1,117 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_simplelist.jspf"%>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="com.amarsoft.app.util.ProductParamUtil" %>
<%
/*
Author: undefined 2021-05-31
Content: 示例详情页面
History Log:
*/
String productId=CurPage.getParameter("productId");
String fcFlowType=CurPage.getParameter("fcFlowType");
String fcQueuestId=CurPage.getParameter("fcLoanQueuestId");
String isReadOnly = CurPage.getParameter("isReadOnly");
String sPrevUrl = CurPage.getParameter("PrevUrl");
if(sPrevUrl == null) sPrevUrl = "";
String sTempletNo=CurPage.getParameter("TempletNo");
if(sTempletNo==null){
sTempletNo="FcRequestFileList";
}
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);
String sButtons[][] = {
{isReadOnly=="Y"?"true":"false","All","Button","提交","修改完毕,确认提交","updateStatus()","","","",""},
// {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""}
};
sButtonPosition = "north";
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function returnList(){
AsControl.OpenView("<%=sPrevUrl%>", "","_self","");
}
function updateStatus(){
if(confirm("确认已修改完毕,完成提交?")){
}
}
function showPDF(filePath,name){
var sUrl="/Ample/Doc/showPDF.jsp";
var param="filePath="+filePath;
AsControl.OpenPage(sUrl,param,"",name);
}
function showImage(id,name){
var sUrl="/Ample/Doc/showImage.jsp";
var param="attrid="+id+"&className=jbo.oti.FC_REQUEST_FILE";
AsDialog.PopView(sUrl,param,"dialogWidth=1080px;dialogHeight=500px;",function(message){
},name);
}
function upload(fcFileCode){
var param="fcQueuestId=<%=fcQueuestId%>&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();
}
function downloadFile(filePath,fileName){
debugger;
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
var src = sWebRootPath+"/servlet/view/docDownloadServletByPath?CompClientID=<%=sCompClientID%>&filePath="+encodeURIComponent(encodeURIComponent(filePath))+"&fileName="+encodeURIComponent(encodeURIComponent(fileName));
window.open(src, "downloadTemplate");
}
function deleteFile(id){
var sParams="frfId="+id+",userId=<%=CurUser.getUserID()%>";
var sReturnInfo = RunJavaMethodTrans("com.ample.fundchannel.doc.action.DocListAction","deleteFileForFundChannel",sParams);
if(sReturnInfo=="error"){
alert("删除失败");
}
reloadSelf();
}
function afterSearch(){
var isReadOnly="<%=isReadOnly%>";
for(var i=0;i<getRowCount(0);i++){
if(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>';
}
var filelist=getObj(0,i,"fileList").innerHTML;
var obj=eval('('+filelist+')');
var html="";
for(var file in obj){
html+='<a onclick=downloadFile(\''+obj[file]['filepath']+'\',\''+obj[file]['filename']+'\')><font color="blue">'+obj[file]['filename']+'</font></a>';
html+='【上传时间:'+obj[file]['inputtime']+'】';
html+='【上传人:'+obj[file]['inputuser']+'】';
// html+='【大小:'+Math.floor(obj[file]['FileSize']/1024*100)/100+'kb】<a class="btn_icon_detail" onclick="editOffice(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\',\''+sRightType+'\')">&nbsp;</a> ';
if(isReadOnly!="Y"){
html+='<a class="btn_icon btn_icon_close" onclick="deleteFile(\''+obj[file]['id']+'\');">&nbsp;</a>';
}
if(obj[file]['image']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showImage(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
/*if(obj[file]['word']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showWord(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}*/
if(obj[file]['pdf']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showPDF(\''+obj[file]['filepath']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
html+='</br>';
}
getObj(0,i,"fileList").innerHTML=html;
getObj(0,i,"fileList").style["white-space"]="pre-wrap";
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,42 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2021-05-31
Content:
History Log:
*/
ASObjectModel doTemp = new ASObjectModel("FC_REQUEST");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(20);
dwTemp.genHTMLObjectWindow("");
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
// {"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
// {"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
// {"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
{"true","","Button","补充资料","补充资料","viewAndEdit()","","","","btn_icon_detail",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function newRecord(){
var sUrl = "";
AsControl.OpenView(sUrl,'','_self','');
}
function viewAndEdit(){
var sUrl = "/com/tenwa/apzl/CorpusSource/FcRequestDocTab.jsp";
var fcLoanQueuestId = getItemValue(0,getRow(0),'FC_LOAN_QUEUEST_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 sPara ='fcLoanQueuestId='+fcLoanQueuestId+'&channelNo='+channelNo+ '&projectId='+projectId+'&contractId='+contractId;
if(projectId==null || fcLoanQueuestId==null ){
alert("参数不能为空!");
return ;
}
AsControl.OpenView(sUrl,sPara ,'_self','');
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,98 @@
package com.ap;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.util.Transaction;
import jbo.com.tenwa.entity.comm.message.BT_BUSSINESS_MESSAGE_CONFIG;
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
import jbo.prd.LB_PRODUCT_CORPUS_SOURCE;
import java.util.List;
public class CorpusSourceCheck {
private String projectId;
public void setNextCorpusChannel() throws JBOException {
String nextCorpusChannel = getNextCorpusChannel(projectId);
BizObjectManager bomLPI = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME);
BizObject boLPI = bomLPI.createQuery("id=:projectId").setParameter("projectId",projectId).getSingleResult(true);
boLPI.setAttributeValue("CORPUS_SOURCE",nextCorpusChannel);
bomLPI.saveObject(boLPI);
BizObjectManager bomLCI = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME);
BizObject boLCI = bomLCI.createQuery("PROJECT_ID=:projectId").setParameter("projectId",projectId).getSingleResult(true);
if(boLCI!=null){
boLCI.setAttributeValue("CORPUS_SOURCE",nextCorpusChannel);
bomLCI.saveObject(boLCI);
}
ARE.getLog().debug("项目ID"+projectId+"的资金方变更为-->"+nextCorpusChannel);
}
public String getNextCorpusChannel(String projectId) throws JBOException {
BizObjectManager bomLPCS = JBOFactory.getBizObjectManager(LB_PRODUCT_CORPUS_SOURCE.CLASS_NAME);
BizObjectManager bomLPI = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME);
BizObject boLPI= bomLPI.createQuery("id=:projectId").setParameter("projectId",projectId).getSingleResult(false);
String productId = boLPI.getAttribute("PRODUCT_ID").toString();
String corpusSource = "AP";
if(boLPI.getAttribute("CORPUS_SOURCE")!=null&&!"".equals(boLPI.getAttribute("CORPUS_SOURCE"))){
corpusSource = boLPI.getAttribute("CORPUS_SOURCE").toString();
}
if("AP".equals(corpusSource)){
return "AP";
}
List<BizObject> boLPCSs = bomLPCS.createQuery("product_id=:productId order by order_list").setParameter("productId",productId).getResultList(false);
int nextIndex = -1;
if(boLPCSs.size()>0){
for(int i=0;i<boLPCSs.size();i++){
String corpusSourceTable = boLPCSs.get(i).getAttribute("CORPUS_SOURCE").toString();
if(corpusSource.equals(corpusSourceTable)){
nextIndex=i+1;
break;
}
}
if(nextIndex>=boLPCSs.size()||nextIndex==-1){
return "AP";
}else {
return boLPCSs.get(nextIndex).getAttribute("CORPUS_SOURCE").toString();
}
}
return "AP";
}
public String corpusApplyCheck(){
String sResult = "F";
Transaction Sqlca = Transaction.createTransaction("als");
try {
String corpusSource = Sqlca.getString("select corpus_source from lb_project_info where id = '"+projectId+"'");
if(!"AP".equals(corpusSource)&&!"".equals(corpusSource)&&corpusSource!=null){
//TODO 具体的不同状态不同提示信息需要再优化
String fcStatus = Sqlca.getString("select FC_STATUS from fc_request where del_flag='0' and project_id = '"+projectId+"'");
if(Integer.parseInt(fcStatus)==1300){
sResult = "S";
}
}
} catch (Exception e) {
sResult = "检验资金渠道信息出错,请联系系统管理员!";
e.printStackTrace();
}finally {
if(Sqlca!=null) {
try {
Sqlca.commit();
Sqlca.disConnect();
} catch (JBOException e) {
e.printStackTrace();
}
}
}
return sResult;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
}

View File

@ -0,0 +1,52 @@
package com.ample.fundchannel.doc.action;
import com.amarsoft.are.jbo.*;
import com.amarsoft.are.util.StringFunction;
import jbo.oti.FC_REQUEST_FILE;
public class DocListAction {
private String frfId;
private String userId;
/**
* 删除文件时只添加删除标记不进行物理删除
* @param tx
* @return
* @throws JBOException
*/
public String deleteFileForFundChannel(JBOTransaction tx){
String sResult = "S";
BizObjectManager FRFbom = null;
String updateTime = StringFunction.getTodayNow();
try {
FRFbom = JBOFactory.getBizObjectManager(FC_REQUEST_FILE.CLASS_NAME,tx);
BizObject FRFBO = FRFbom.createQuery("id=:id").setParameter("id",frfId).getSingleResult(true);
FRFBO.setAttributeValue("DEL_FLAG","1");
FRFBO.setAttributeValue("UPDATE_TIME",updateTime);
FRFBO.setAttributeValue("INPUTUSER",userId);
FRFbom.saveObject(FRFBO);
} catch (JBOException e) {
sResult="error";
e.printStackTrace();
}
return sResult;
}
public String getFrfId() {
return frfId;
}
public void setFrfId(String frfId) {
this.frfId = frfId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}

View File

@ -0,0 +1,83 @@
package com.ample.fundchannel.doc.cache;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.dict.als.manage.NameManager;
public class DocListCache {
public static String getFileByRequestId(String fcRequestId,String fcFileCode) throws Exception {
@SuppressWarnings("unchecked")
List<BizObject> list=JBOFactory.getBizObjectManager("jbo.oti.FC_REQUEST_FILE").createQuery("FC_REQUEST_ID=:fcRequestId and FC_FILE_CODE=:fcFileCode and (DEL_FLAG<>'1' or DEL_FLAG is null)").setParameter("fcRequestId", fcRequestId).setParameter("fcFileCode", fcFileCode).getResultList(false);
List<JSONObject> boJsonList = new ArrayList<JSONObject>();
if(list.size()==0){
return "0";
}
for(BizObject bo : list){
JSONObject boJson = new JSONObject();
boJson.put("id",bo.getAttribute("id").getString());
boJson.put("FC_FILE_TYPE",bo.getAttribute("FC_FILE_TYPE").getString());
boJson.put("FC_FLOW_TYPE",bo.getAttribute("FC_FLOW_TYPE").getString());
boJson.put("FILE_NAME",bo.getAttribute("FILE_NAME").getString());
boJson.put("FILE_PATH",bo.getAttribute("FILE_PATH").getString());
boJson.put("INPUTTIME",bo.getAttribute("INPUTTIME").getString());
boJson.put("INPUTUSER",bo.getAttribute("INPUTUSER").getString());
boJsonList.add(boJson);
}
String FileHtml = getFileHtml(boJsonList);
return FileHtml;
}
public static String getFileHtml(List<JSONObject> list) throws Exception {
StringBuffer sb=new StringBuffer();
sb.append("{");
for(int i=0;i<list.size();i++){
JSONObject bo=list.get(i);
sb.append("\"" +i+"\""+":{");
String type= bo.get("FC_FILE_TYPE").toString();
if(type.indexOf("image")>=0){
sb.append("\"image\":\""+true+"\",");
}else{
sb.append("\"image\":\""+false+"\",");
}
if(type.indexOf("application/msword")>=0||type.indexOf("application/vnd.openxmlformats-officedocument.wordprocessingml.document")>=0||type.indexOf("application/vnd.ms-excel")>=0||type.indexOf("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")>=0){
sb.append("\"word\":\""+true+"\",");
}else{
sb.append("\"word\":\""+false+"\",");
}
if(type.indexOf("application/pdf")>=0){
sb.append("\"pdf\":\""+true+"\",");
}else{
sb.append("\"pdf\":\""+false+"\",");
}
sb.append("\"id\":\""+bo.get("id").toString()+"\",");
sb.append("\"objecttype\":\""+bo.get("FC_FLOW_TYPE").toString()+"\",");
sb.append("\"filename\":\""+bo.get("FILE_NAME").toString()+"\",");
sb.append("\"filepath\":\""+bo.get("FILE_PATH").toString()+"\",");
sb.append("\"inputtime\":\""+bo.get("INPUTTIME").toString()+"\",");
sb.append("\"inputuser\":\""+NameManager.getUserName(bo.get("INPUTUSER").toString())+"\"");
sb.append("},");
}
//ɾ³ý×îºóÒ»¸öººÅ
if(sb.length()>1){
sb.deleteCharAt(sb.length() - 1);
}
sb.append("}");
return sb.toString();
}
}

View File

@ -0,0 +1,104 @@
package com.ample.fundchannel.doc.servlet;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.amarsoft.are.ARE;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.lang.StringX;
import com.amarsoft.are.util.DataConvert;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.Configure;
public class DocDownloadServletByPath extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public DocDownloadServletByPath() {
super();
// TODO Auto-generated constructor stub
}
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
ServletContext s1 = this.getServletContext();
String rootPath = s1.getRealPath("/");
HttpSession session = request.getSession(true);
if ((session == null) || (session.getAttributeNames() == null)) {
throw new Exception("------Timeout------");
}
Configure CurConfig = Configure.getInstance(session.getServletContext());
if (CurConfig == null) {
throw new ServletException("读取配置文件错误!请检查配置文件。");
}
String filePath = DataConvert.toString(request.getParameter("filePath"));
String fileName = DataConvert.toString(request.getParameter("fileName"));
if (filePath.length() < 1) {
ARE.getLog().warn("AttachViewServlet DownLoad filePath不完整[" + filePath + "]");
} else {
String sFileSavePath = CurConfig.getConfigure("fileSavePath");
sFileSavePath = rootPath + sFileSavePath;
File fileSS = new File(sFileSavePath);
if (!fileSS.exists()) fileSS.mkdirs();
fileName = URLDecoder.decode(fileName, "UTF-8");
filePath = URLDecoder.decode(filePath, "UTF-8");
System.out.println("文件名=====" + fileName);
//设置文件MIME类型
response.setContentType(getServletContext().getMimeType(fileName));
// response.setContentType("multipart/form-data");
//设置Content-Disposition
response.setHeader("Content-Disposition", "attachment;filename=" + java.net.URLEncoder.encode(fileName, "UTF-8"));
//读取目标文件通过response将目标文件写到客户端
//读取文件
InputStream in = new FileInputStream(filePath);
OutputStream out = response.getOutputStream();
//写文件
int b;
while ((b = in.read()) != -1) {
out.write(b);
}
in.close();
out.close();
}
} catch (Exception e1) {
ARE.getLog().error("AttachmentView DownLoad Error1:", e1);
}
}
protected Map<String, String> getAttr(String id, String className) throws JBOException {
Map<String, String> attrMap = new HashMap<>();
BizObject attr = JBOFactory.createBizObjectQuery(className, "id=:id").setParameter("id", id).getSingleResult(false);
String absolutePath = attr.getAttribute("FILE_PATH").getString();
String fileName = attr.getAttribute("FILE_NAME").getString();
attrMap.put("absolutePath", absolutePath);
attrMap.put("fileName", fileName);
return attrMap;
}
}

View File

@ -0,0 +1,70 @@
package com.ample.fundchannel.doc.servlet;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jbo.app.tenwa.doc.LB_DOCATTRIBUTE;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
/**
* Servlet implementation class ShowImage
*/
public class PublicShowImageServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html; charset=UTF-8");
response.setContentType("image/jpeg");
String attrid = request.getParameter("attrid");
String className = request.getParameter("className");
String absolutePath="";
try {
absolutePath = this.getFullPath(attrid,className);
} catch (JBOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
FileInputStream fis = new FileInputStream(absolutePath);
OutputStream os = response.getOutputStream();
try
{
int count = 0;
byte[] buffer = new byte[1024 * 1024];
while ((count = fis.read(buffer)) != -1)
os.write(buffer, 0, count);
os.flush();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (os != null)
os.close();
if (fis != null)
fis.close();
}
}
protected String getFullPath(String id,String className) throws JBOException {
BizObject attr = JBOFactory.createBizObjectQuery(className,"id=:id").setParameter("id", id).getSingleResult(false);
String absolutePath =attr.getAttribute("FILE_PATH").getString();
return absolutePath;
}
}

View File

@ -0,0 +1,92 @@
package jbo.oti;
import java.lang.String;
/**
* 接口状态表 - JBO命名常量类<br><br>
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
*/
public interface FC_REQUEST{
/**
* 接口状态表<br><br>
* 代表本类映射的BizObjectClass
*/
public static final String CLASS_NAME = "jbo.oti.FC_REQUEST";
/**
* 唯一标识 STRING(32)<br>
*/
public static final String ID = "ID";
/**
* 资金渠道申请ID STRING(32)<br>
*/
public static final String FC_LOAN_QUEUEST_ID = "FC_LOAN_QUEUEST_ID";
/**
* 资金渠道编号 STRING(32)<br>
*/
public static final String CHANNEL_NO = "CHANNEL_NO";
/**
* 资金渠道名称 STRING(32)<br>
*/
public static final String CHANNEL_NAME = "CHANNEL_NAME";
/**
* 项目ID STRING(32)<br>
*/
public static final String PROJECT_ID = "PROJECT_ID";
/**
* 项目编号 STRING(32)<br>
*/
public static final String PROJECT_NO = "PROJECT_NO";
/**
* 合同ID STRING(32)<br>
*/
public static final String CONTRACT_ID = "CONTRACT_ID";
/**
* 合同编号 STRING(32)<br>
*/
public static final String CONTRACT_NO = "CONTRACT_NO";
/**
* 产品ID STRING(32)<br>
*/
public static final String PRODUCT_ID = "PRODUCT_ID";
/**
* 产品名称 STRING(32)<br>
*/
public static final String PRODUCT_NAME = "PRODUCT_NAME";
/**
* 资经销商ID STRING(32)<br>
*/
public static final String DISTRIBUTOR_ID = "DISTRIBUTOR_ID";
/**
* 经销商名称 STRING(32)<br>
*/
public static final String DISTRIBUTOR_NAME = "DISTRIBUTOR_NAME";
/**
* 客户ID STRING(32)<br>
*/
public static final String CUSTOMER_ID = "CUSTOMER_ID";
/**
* 客户名称 STRING(32)<br>
*/
public static final String CUSTOMER_NAME = "CUSTOMER_NAME";
/**
* 当前状态 STRING(32)<br>
*/
public static final String FC_STATUS = "FC_STATUS";
/**
* 返回状态描述 STRING(32)<br>
*/
public static final String FC_REMARK = "FC_REMARK";
/**
* 创建时间 STRING(32)<br>
*/
public static final String CREATE_TIME = "CREATE_TIME";
/**
* 修改时间 STRING(32)<br>
*/
public static final String UPDATE_TIME = "UPDATE_TIME";
/**
* 有效标志 STRING(32)<br>
*/
public static final String DEL_FLAG = "DEL_FLAG";
}

View File

@ -0,0 +1,80 @@
package jbo.oti;
import java.lang.String;
/**
* 接口资料表 - JBO命名常量类<br><br>
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
*/
public interface FC_REQUEST_FILE{
/**
* 接口资料表<br><br>
* 代表本类映射的BizObjectClass
*/
public static final String CLASS_NAME = "jbo.oti.FC_REQUEST_FILE";
/**
* 唯一标识 STRING(32)<br>
*/
public static final String ID = "ID";
/**
* 资金渠道申请ID STRING(32)<br>
*/
public static final String FC_REQUEST_ID = "FC_REQUEST_ID";
/**
* 流程类型 STRING(32)<br>
*/
public static final String FC_FLOW_TYPE = "FC_FLOW_TYPE";
/**
* 流程类型名称 STRING(32)<br>
*/
public static final String FC_FLOW_TYPE_NAME = "FC_FLOW_TYPE_NAME";
/**
* 资方文件编号 STRING(32)<br>
*/
public static final String FC_FILE_CODE = "FC_FILE_CODE";
/**
* 资方文件编号名称 STRING(32)<br>
*/
public static final String FC_FILE_CODE_NAME = "FC_FILE_CODE_NAME";
/**
* 资方文件类型JPG,PNG,FDP等 STRING(32)<br>
*/
public static final String FC_FILE_TYPE = "FC_FILE_TYPE";
/**
* 文件名称 STRING(32)<br>
*/
public static final String FILE_NAME = "FILE_NAME";
/**
* 文件路径 STRING(32)<br>
*/
public static final String FILE_PATH = "FILE_PATH";
/**
* 文件状态 STRING(32)<br>
*/
public static final String FC_FILE_STS = "FC_FILE_STS";
/**
* 文件状态描述 STRING(32)<br>
*/
public static final String FC_FILE_STS_DESC = "FC_FILE_STS_DESC";
/**
* 创建时间 STRING(32)<br>
*/
public static final String CREATE_TIME = "CREATE_TIME";
/**
* 修改时间 STRING(32)<br>
*/
public static final String UPDATE_TIME = "UPDATE_TIME";
/**
* 有效标志 STRING(32)<br>
*/
public static final String DEL_FLAG = "DEL_FLAG";
/**
* 上传时间 STRING(32)<br>
*/
public static final String INPUTTIME = "INPUTTIME";
/**
* 上传人 STRING(32)<br>
*/
public static final String INPUTUSER = "INPUTUSER";
}