<%@page import="com.northglass.Globel.mes"%>
|
<%@page import="com.northglass.SqlHelper.*"%>
|
<%@page import="org.json.*"%>
|
<%@ page contentType="text/json;charset=UTF-8"%>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
<%
|
|
String method=request.getParameter("m");
|
|
JSONObject ret=null;
|
if("in".equals(method)){
|
long id=Long.parseLong(request.getParameter("gid"));
|
long lid=Long.parseLong(request.getParameter("tid"));
|
DBSession sn=null;
|
try{
|
sn=mes.getMesDBHelper().createSession(false);
|
sn.createStdCall("yuliao_input",2);
|
String ss= sn.stdCall(id,lid).ResultMessage;
|
ret=new JSONObject();
|
ret.put("result",ss);
|
ret.put("message",ss);
|
}
|
finally{
|
if(sn!=null)
|
sn.close();
|
}
|
}
|
|
|
if("out".equals(method)){
|
long id=Long.parseLong(request.getParameter("gid"));
|
DBSession sn=null;
|
try{
|
sn=mes.getMesDBHelper().createSession(false);
|
sn.createStdCall("yuliao_output",1);
|
String ss= sn.stdCall(id).ResultMessage;
|
ret=new JSONObject();
|
ret.put("result",ss);
|
ret.put("message",ss);
|
}
|
finally{
|
if(sn!=null)
|
sn.close();
|
}
|
}
|
|
if("q".equals(method)){
|
|
DBSession sn=null;
|
try{
|
sn=mes.getMesDBHelper().createSession(false);
|
sn.createSql("SELECT "+
|
"a.yuliao_id ,b.moxi,b.houdu,b.kuan,b.gao,a.chanxian "
|
+ "from gmms_yuliao_task a inner join gmms_glass_yuliao b on a.yuliao_id=b.Id "
|
+ " where a.state=0;");
|
// sn.createSql("select 1,2,3");
|
JSONArray arr= sn.query().resultToJson(false);
|
sn.createSql(" SELECT "
|
+"b.yuliao_id,a.id,a.slicecage_number,a.slicecage_group,c.moxi,c.houdu,c.kuan,c.gao"
|
+" from gmms_yuliao_slicecage a left join"
|
+" gmms_yuliao_task b on a.id=b.lib_id"
|
+" left join gmms_glass_yuliao c on b.yuliao_id=c.id;");
|
JSONArray arr1=sn.query().resultToJson(false);
|
|
ret=new JSONObject();
|
ret.put("result","ok");
|
ret.put("data",arr);
|
ret.put("data1",arr1);
|
}
|
catch(Exception e){
|
e.printStackTrace();
|
}
|
finally{
|
if(sn!=null)
|
sn.close();
|
}
|
}
|
if(ret!=null)
|
out.print(ret.toString());
|
else
|
{
|
ret=new JSONObject();
|
ret.put("result","fail");
|
out.print(ret.toString());
|
}
|
|
%>
|