<%@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 zhuangtai = request.getParameter("zhuangtai");
|
String lckh = request.getParameter("lckhs");
|
DBSession sn = null;
|
boolean ok = false;
|
|
try {
|
|
sn = mes.getMesDBHelper().createSession(false);
|
String qSQL = "";
|
|
if ("获取列表".equals(caozuo)) {
|
if("0".equals(zhuangtai)){
|
qSQL = "select id,galss_id,width,height,thickness,processcard_id,stop_rank,out_rank,work_procedure,work_state,gc_number,null,"
|
+"SUBSTR(processcard_id,LOCATE('/',processcard_id)+1) as cardrank from gmms_galss_task_shelf where "
|
+"gc_number= (select lk.parent_liuchengka from gmms_drop_frame_5 as dr5 left join gmms_shelf_rack_2 as sr "
|
+"on dr5.rank=sr.id left join gmms_liuchengka as lk on sr.processcard_id=lk.liuchengka left join gmms_liuchengka as lk2 "
|
+"on lk.parent_liuchengka=lk2.liuchengka where groups_=4 and drop_groups="+pLine+" and sr.id is not null and lk.liuchengka is not null "
|
+"and lk2.liuchengka is not null and lk2.current_status='正在工作' and lk2.current_work_position='中空' order by lk.liuchengka limit 0,1) "
|
+"order by out_rank desc,cardrank desc";
|
|
}else if("1".equals(zhuangtai)){
|
|
qSQL = "select id,galss_id,width,height,thickness,processcard_id,stop_rank,stop_position,work_procedure,work_state,gc_number,null from gmms_galss_task_shelf where position('"+lckh+"' in gc_number) order by gc_number,processcard_id,stop_rank";
|
|
}
|
}
|
|
//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_galss_task_shelf set work_state='破损' where id="+Id+" ";
|
sn.createSql(qSQL);
|
int s=sn.update();//括号内是参数,没有参数不输入
|
out.print(s);
|
|
}if ("完成".equals(caozuo)) {
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_galss_task_shelf set work_state='已完成' where id="+Id+" and work_state='正在工作')";
|
sn.createSql(qSQL);
|
int s=sn.update();
|
out.print(s);
|
}
|
if ("重新开始".equals(caozuo)) {
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_galss_task_shelf set work_state='等待中' where id="+Id+" and work_state='正在工作')";
|
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();
|
}
|
}
|
|
|
%>
|