invoiceSave.jsp
1.12 KB
<%@page import="net.sf.json.JSONObject"%>
<%@page import="weaver.conn.RecordSet"%>
<%@page import="weaver.general.Util"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
RecordSet rs = new RecordSet();
String symbol = Util.null2String(request.getParameter("symbol"));
String type = Util.null2String(request.getParameter("type"));
String workflowid = Util.null2String(request.getParameter("workflowid"));
JSONObject jsonObject = new JSONObject();
int counts = 0;
if("1".equals(type)){//主表
String sql = "select 1 from fnaInvoiceWfInfoField where workflowid = ? and fieldname = ? and tabindex = 0 and fieldid > 0 ";
rs.executeQuery(sql, workflowid,"fieldIdInvoice");
counts = rs.getCounts();
}else{//明细表
String index = symbol.split("_")[1];
String sql = "select 1 from fnaInvoiceWfInfoField where workflowid = ? and tabindex = ? and fieldname = ? and fieldid > 0 ";
rs.executeQuery(sql, workflowid,index,"fieldIdInvoice");
counts = rs.getCounts();
}
if(counts == 0){
jsonObject.put("flag", true);
}else{
jsonObject.put("flag", false);
}
out.print(jsonObject);
%>