严智鑫
2025-08-18 3b65a5dc04be7cdac460c84ebaa38bf009405128
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<%@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());
    }
    
%>