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.
weaver-develop/interface.kr/checkJbrqCount.jsp

71 lines
2.6 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.general.Util" %>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
<%--
User: wangj
Design Ideas
康瑞-加班申请【制造中心】流程
需要:校验明细表加班日期是否重复
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%
JSONObject res = new JSONObject();
RecordSet rs = new RecordSet();
String dataStr = Util.null2String(request.getParameter("dataJson"));
JSONArray dataArr = JSONArray.parseArray(dataStr);
String sql = "";
JSONArray resArr = new JSONArray();
for (int i = 0; i < dataArr.size(); i++) {
JSONObject data = (JSONObject) dataArr.get(i);
String xm = Util.null2String(data.get("xm"));
String ksrq = Util.null2String(data.get("ksrq"));
String index = Util.null2String(data.get("index"));
sql = "SELECT \n" +
" f.requestid as requestid\n" +
" FROM \n" +
" formtable_main_19 f \n" +
" LEFT JOIN workflow_requestbase w ON f.requestid = w.requestid \n" +
" WHERE \n" +
" f.resourceId = '"+xm+"' \n" +
" AND f.fromDate = '"+ksrq+"' \n" +
" AND w.currentnodetype IN ( 1, 2, 3 ) union all SELECT \n" +
" t.requestid as requestid \n" +
" FROM \n" +
" formtable_main_20_dt1 t1 \n" +
" LEFT JOIN formtable_main_20 t ON t1.mainid = t.id \n" +
" LEFT JOIN workflow_requestbase w1 ON t.requestid = w1.requestid \n" +
" WHERE \n" +
" t1.xm = '"+xm+"' \n" +
" AND t1.ksrq = '"+ksrq+"' \n" +
" AND w1.currentnodetype IN ( 1, 2, 3 )";
rs.execute(sql);
int count = 0;
String requestids = "";
while (rs.next()) {
count ++;
requestids = requestids + "," + Util.null2String(rs.getString("requestid"));
}
JSONObject obj = new JSONObject();
obj.put(index,count);
obj.put("requestids",requestids.substring(1,requestids.length()));
resArr.add(obj);
}
res.put("resArr", resArr);
out.print(res.toJSONString());
%>