修改了 业务申请 查看图片 下一页,其他 流程或者功能页面可能不通用,可以仿照着改一下;

This commit is contained in:
tenwaPC 2018-11-07 13:39:03 +08:00
parent de7726123a
commit f813f14c57
3 changed files with 147 additions and 12 deletions

View File

@ -185,8 +185,8 @@ function showWord(id,name){
}
function showImage(id,name){
var sUrl="/Tenwa/Comm/DocList/showImage.jsp";
var param="attrid="+id;
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;",function(message){
var param="attrid="+id+"&flowunid=<%=flowunid%>";
AsDialog.PopView(sUrl,param,"dialogWidth=1080px;dialogHeight=500px;",function(message){
},name);
}

View File

@ -1,5 +1,6 @@
<%@ 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">
@ -32,9 +33,22 @@ top.status="<%=LanguageManager.getSystemLanguage(CurUser.getLanguage(), JspfText
<%
String compClientID = request.getParameter("CompClientID");
String attrid = CurPage.getParameter("attrid");
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/css/viewer.min.css">
<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;}
@ -42,24 +56,57 @@ top.status="<%=LanguageManager.getSystemLanguage(CurUser.getLanguage(), JspfText
#jq22 li img { width: 100%;}
</style>
<div style="overflow:scroll;width:100%;" >
<ul id="jq22">
<li><img style="display:none" data-original="<%=sWebRootPath%>/servlet/view/image?CompClientID=<%=compClientID%>&attrid=<%=attrid %>" src="<%=sWebRootPath%>/servlet/view/image?CompClientID=<%=compClientID%>&attrid=<%=attrid %>" />
</li>
</ul>
<ul id="jq22">
<%
if(Imagelist.size()>0){
for(String imageattrid:Imagelist){
imageattridv++;
if(imageattrid.equals(attrid)){
index=imageattridv;
}
%>
<li><img style="display:none" data-original="<%=sWebRootPath%>/servlet/view/image?CompClientID=<%=compClientID%>&attrid=<%=imageattrid %>" src="<%=sWebRootPath%>/servlet/view/image?CompClientID=<%=compClientID%>&attrid=<%=imageattrid %>" /></li>
<%
}
}else{
index=1;
%>
<li><img style="display:none" data-original="<%=sWebRootPath%>/servlet/view/image?CompClientID=<%=compClientID%>&attrid=<%=attrid %>" src="<%=sWebRootPath%>/servlet/view/image?CompClientID=<%=compClientID%>&attrid=<%=attrid %>" /></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() {
$('#jq22').viewer({
url: 'data-original',
navbar:false,
inline:true
});
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()",350);
}
});
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

@ -6,6 +6,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@ -348,4 +349,91 @@ public class DocListInitAction {
return null;
}
}
@SuppressWarnings({"unchecked"})
public static List<String> nextImagebyFlowunid(String flowunid,String docClassItemno,String objecttype) throws Exception{
List<String> list = new ArrayList();
BizObjectManager bomLDR = JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME);
BizObjectManager bomLDL = JBOFactory.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME);
BizObjectManager bomLDA = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME);
BizObject boLDR = null;
List<BizObject> boListLDR = null;
if(objecttype!=null){
if(objecttype!=""){
boLDR = bomLDR.createQuery("flow_unid =:flowunid and objecttype=:objecttype")
.setParameter("flowunid", flowunid)
.setParameter("objecttype", objecttype)
.getSingleResult(false);
}else{
boLDR = bomLDR.createQuery("flow_unid =:flowunid and objecttype is null")
.setParameter("flowunid", flowunid)
.getSingleResult(false);
}
}else{
boListLDR = bomLDR.createQuery("flow_unid =:flowunid")
.setParameter("flowunid", flowunid)
.getResultList(false);
}
if(boLDR!=null){
String relative_id = boLDR.getAttribute("id").getString();
List<BizObject> boLDL = new ArrayList<BizObject>();
if(docClassItemno!=null){
String[] itemnos=docClassItemno.split(",");
String s="";
for(int i=0;i<itemnos.length;i++){
s+="'"+itemnos[i]+"',";
}
if(s.length()>0){
s=s.substring(0, s.length()-1);
}
docClassItemno=s;
boLDL = bomLDL.createQuery("relative_id=:relative_id and doc_Class_Itemno in("+docClassItemno+") order by serial_num").setParameter("relative_id", relative_id).setParameter("docClassItemno", docClassItemno).getResultList(false);
}else{
boLDL = bomLDL.createQuery("relative_id=:relative_id order by serial_num").setParameter("relative_id", relative_id).getResultList(false);
}
for(BizObject bol:boLDL){
String library_id = bol.getAttribute("id").getString();
List<BizObject> boLDA = bomLDA.createQuery("library_id=:library_id and content_type LIKE '%image%'").setParameter("library_id", library_id).getResultList(false);
if(boLDA.size()>0){
for(BizObject bo:boLDA){
// LM_NC_VERIFICATION
String attrid = bo.getAttribute("id").getString();
list.add(attrid);
}
}
}
}
if(boListLDR!=null){
String docClassItemnov= "";
for(BizObject bolr:boListLDR){
String relative_id = bolr.getAttribute("id").getString();
List<BizObject> boLDL = new ArrayList<BizObject>();
if(docClassItemno!=null){
String[] itemnos=docClassItemno.split(",");
String s="";
for(int i=0;i<itemnos.length;i++){
s+="'"+itemnos[i]+"',";
}
if(s.length()>0){
s=s.substring(0, s.length()-1);
}
docClassItemnov=s;
boLDL = bomLDL.createQuery("relative_id=:relative_id and doc_Class_Itemno in("+docClassItemnov+") order by serial_num").setParameter("relative_id", relative_id).getResultList(false);
}else{
boLDL = bomLDL.createQuery("relative_id=:relative_id order by serial_num").setParameter("relative_id", relative_id).getResultList(false);
}
for(BizObject bol:boLDL){
String library_id = bol.getAttribute("id").getString();
List<BizObject> boLDA = bomLDA.createQuery("library_id=:library_id and content_type LIKE '%image%'").setParameter("library_id", library_id).getResultList(false);
if(boLDA.size()>0){
for(BizObject bo:boLDA){
// LM_NC_VERIFICATION
String attrid = bo.getAttribute("id").getString();
list.add(attrid);
}
}
}
}
}
return list;
}
}