You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.2 KiB
Plaintext

2 years ago
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
2 years ago
<%@ page import="java.util.ArrayList" %>
2 years ago
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%!
private boolean isEmpty(String str) {
if ("".equals(str) ||"(null)".equals(str) || str == null) {
return true;
} else {
return false;
}
}
%>
<%
RecordSet rs = new RecordSet();
BaseBean bb=new BaseBean();
JSONArray array = new JSONArray();
JSONObject json = new JSONObject();
bb.writeLog("进入getdeleCount.jsp-->");
String resquestid=request.getParameter("resquestid");
int count=0;
String mainWorkflowid = "0";
String touchnodeid = "0";
2 years ago
String currentnodeid = "0";
2 years ago
if (!isEmpty(resquestid)){
2 years ago
String queryMainWorkflowidSql = "select workflowid ,lastnodeid , currentnodeid from workflow_requestbase where requestid="+resquestid;
2 years ago
bb.writeLog("queryMainWorkflowidSql-->"+queryMainWorkflowidSql);
rs.execute(queryMainWorkflowidSql);
if(rs.next()){
mainWorkflowid = rs.getString(1);
2 years ago
touchnodeid = rs.getString(2);
currentnodeid = rs.getString(3);
2 years ago
}
2 years ago
ArrayList<String> touchnodeids = new ArrayList<>();
2 years ago
String queryTouchNodeidSql = "select touchnodeid from uf_sczlc where workflowid="+mainWorkflowid;
bb.writeLog("queryTouchNodeidSql-->"+queryTouchNodeidSql);
rs.execute(queryTouchNodeidSql);
if(rs.next()){
2 years ago
String nodeid = rs.getString(1);
if(nodeid.equals(currentnodeid)){
touchnodeid = rs.getString(1);
touchnodeids.add(touchnodeid);
}
2 years ago
}
2 years ago
String sql="select COUNT(*) as cnt from workflow_requestbase where mainrequestid="+resquestid+" and workflowid in (select workflowid subWorkflowId from workflow_requestbase where requestid in (select subrequestid from workflow_subwfrequest where subrequestid in (select requestid from workflow_requestbase where mainrequestid="+resquestid+" and triggernode = "+touchnodeid+")))";
// String sql="select COUNT(*) as cnt from workflow_requestbase where mainrequestid="+resquestid+" and workflowid in (select workflowid subWorkflowId from workflow_requestbase where requestid in (select subrequestid from workflow_subwfrequest where subrequestid in (select requestid from workflow_requestbase where mainrequestid="+resquestid+" and triggernode in ( "+String.join(",",touchnodeids)+"))))";
2 years ago
bb.writeLog("sql-->"+sql);
rs.execute(sql);
if (rs.next()){
count=rs.getInt("cnt");
json.put("code",0);
json.put("count",count);
array.add(json);
out.print(array.toJSONString());
}else {
json.put("code",1);
json.put("errMsg","查无此resquestid");
array.add(json);
out.print(array.toJSONString());
}
}else {
json.put("code",1);
json.put("errMsg","resquestid为空");
array.add(json);
out.print(array.toJSONString());
}
%>