严智鑫
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
<%@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 yemian = request.getParameter("gongyi");
    String lineName = request.getParameter("lineName");
    String caozuo = request.getParameter("caozuo");
    String startDate = request.getParameter("sDate");
    String endDate = request.getParameter("eDate");
    DBSession sn = null;
    boolean ok = false;
    //System.out.println("操作类型:" + caozuo + ";工艺:" + lineName+";开始日期:"+startDate+";结束日期:"+endDate);
    try {
 
        
        String strSQL = "";
        if ("电量".equals(caozuo)) {
            sn = mes.getMesDBHelper().createErpSession(false,"gmms_data");
            strSQL = "Select 日期,"+lineName+" from v_daily_dianliang where 日期>='"+startDate+"' and 日期 <= '"+endDate+"'";
            // System.out.println("信息查询:" + strSQL);
 
            sn.createSql(strSQL);
            JSONArray a = sn.query().resultToJson(false);
            if (a != null) {
                out.print(a.toString());
            } else {
                out.print("[]");
            }
            if(sn!=null){
                sn.close();
            }
        }
 
        if ("产量".equals(caozuo)) {
 
            sn = mes.getMesDBHelper().createErpSession(false,"sappp");
            strSQL = "call dapingchanliangchaxun('"+lineName+"','"+startDate+"','"+endDate+"') ";
             System.out.println("信息查询1:" + strSQL);
 
            sn.createSql(strSQL);
            JSONArray a = sn.query().resultToJson(false);
            if (a != null) {
                out.print(a.toString());
            } else {
                out.print("[]");
            }
        }
         
        
        if("产量2".equals(caozuo)){
            
            sn = mes.getMesDBHelper().createErpSession(false,"sappp");
            strSQL = "call proc_dapingDataByDateSelect('"+lineName+"','"+startDate+"','"+endDate+"') ";
            System.out.println("信息查询2:" + strSQL);
 
            sn.createSql(strSQL);
            JSONArray a = sn.query().resultToJson(false);
            if (a != null) {
                out.print(a.toString());
            } else {
                out.print("[]");
            }
        }
         
         
         if("班组".equals(lineName)){
             
             
             
         }
 
    } catch (Exception e) {
        e.printStackTrace();
 
    } finally {
        if (sn != null)
            sn.close();
    }
    
    
    
%>