严智鑫
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
88
<%@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("yemian");
    
    if ("中空管理".equals(yemian)) {
        String caozuo = request.getParameter("caozuo");
        String leixing = request.getParameter("leixing");
        String pLine = request.getParameter("line");
        String liuchengka = request.getParameter("liuchengka");
        DBSession sn = null;
        boolean ok = false;
        
        try {
            
            sn = mes.getMesDBHelper().createSession(false);
            String qSQL = "";
 
            if ("获取列表".equals(caozuo)) {
                
                qSQL = "select main_liuchengka,piece_count from gmms_drop_frame_5 as dr left join gmms_shelf_rack_2 as sr on dr.rank=sr.id left join gmms_liuchengka as gl on sr.processcard_id=gl.liuchengka where dr.rank is not null and sr.processcard_id is not null and (dr.groups_=4 or dr.groups_=100) group by main_liuchengka";
            }
            if ("获取列表2".equals(caozuo)) {
                
                qSQL = "select main_liuchengka,piece_count from gmms_liuchengka where  is_single=0 and main_liuchengka='"+liuchengka+"'";
            }
            
            //System.out.println(qSQL);
            sn.createSql(qSQL);
            //System.out.print(qSQL);
            if ("修改".equals(leixing)) {
                if ("领取任务".equals(caozuo)) {
                    
                    String Id = request.getParameter("Id");
                    qSQL="update gmms_liuchengka set getgroups='"+pLine+"',current_work_position='中空',current_status='等待中',getdatatime=now() where id='"+Id+"'";
                    
                    sn.createSql(qSQL);
                    int s=sn.update();//括号内是参数,没有参数不输入
                    out.print(s);    
                }
                if ("全部吸完".equals(caozuo)) {
                    String Id = request.getParameter("Id");
                    qSQL="update gmms_liuchengka set Occupied=1 where liuchengka='"+Id+"'";
                    /* qSQL="update gmms_drop_frame_5 as dr left join gmms_shelf_rack_2 as sr on dr.rank=sr.id"+
                            " left join gmms_liuchengka as lk on lk.liuchengka=sr.processcard_id set Occupied=1"+
                            " where dr.rank is not null and sr.processcard_id is not null and lk.parent_liuchengka='"+Id+"'"; */
                    sn.createSql(qSQL);
                    int s=sn.update();//括号内是参数,没有参数不输入
                    out.print(s);
                }
                if ("完工退库".equals(caozuo)) {
                    String Id = request.getParameter("Id");
                    qSQL="update gmms_liuchengka set Occupied=2 where liuchengka='"+Id+"'";
                    /* qSQL="update gmms_drop_frame_5 as dr left join gmms_shelf_rack_2 as sr on dr.rank=sr.id"+
                            " left join gmms_liuchengka as lk on lk.liuchengka=sr.processcard_id set Occupied=2"+
                            " where dr.rank is not null and sr.processcard_id is not null and lk.parent_liuchengka='"+Id+"'"; */
                    sn.createSql(qSQL);
                    int s=sn.update();//括号内是参数,没有参数不输入
                    out.print(s);
                }
            }
            
            if ("查询".equals(leixing)) {
                
                JSONArray a = sn.query().resultToJson(false);
                if (a != null) {
                    out.print(a.toString());
                } else {
                    out.print("[]");
                }
            }
            //sn.createStdCall("aaa",3);
            //String s= sn.stdCall(1,2,3).ResultMessage;
 
        } catch (Exception e) {
            e.printStackTrace();
 
        } finally {
            if (sn != null)
                sn.close();
        }
    }
 
    
%>