<%@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");
|
DBSession sn = null;
|
boolean ok = false;
|
|
try {
|
|
sn = mes.getMesDBHelper().createSession(false);
|
String qSQL = "";
|
|
if ("获取列表".equals(caozuo)) {
|
|
qSQL = "select stop_rank,ifnull(rank,''),ifnull(processcard_id,''),processcardcount,ifnull(RankOrientation,''),if(sign=0,'','占用'),if(flag=0,'禁用','启用'),null,id from y_station_shelf";
|
}
|
//System.out.println("0-1"+caozuo);
|
/* if("获取料架".equals(caozuo)){
|
//System.out.println("0-1-1");
|
qSQL = "select number,processcard_id,orientation,falg from gmms_shelf_rack_2 where Id<42";
|
//System.out.println("1-1");
|
} */
|
|
if("获取料架".equals(caozuo)){
|
|
qSQL="select id,orientation,processcard_id from gmms_shelf_rack_2 where id<42 and id not in(select rank from gmms_drop_frame_5 where rank is not null) and"
|
+" id not in (select rackid from gmms_shelf_tasks2 where taskstatus!='已完成' and isrepeal='正常');";
|
}
|
|
if("获取流程卡".equals(caozuo)){
|
qSQL = "select processcard_id,shu from (select processcard_id,count(*) as shu from gmms_galss_task_shelf where work_state='已完成' and work_procedure='钢化后下片' group by processcard_id) as a where a.processcard_id not in(select processcard_id from gmms_shelf_rack_2 where processcard_id is not null)";
|
|
}
|
|
//System.out.print(qSQL);
|
if ("修改".equals(leixing)) {
|
|
if ("人工拿走".equals(caozuo)) {
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_drop_frame_5 as dr left join gmms_shelf_rack_2 as sr on dr.rank=sr.id set sr.processcard_id=null where sr.id is not null and dr.id='"+Id+"' and dr.sign=0";
|
sn.createSql(qSQL);
|
int s=sn.update();//括号内是参数,没有参数不输入
|
out.print(s);
|
}
|
if ("启用".equals(caozuo)) {
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_drop_frame_5 set flag='0' where id='"+Id+"'";
|
sn.createSql(qSQL);
|
int s=sn.update();//括号内是参数,没有参数不输入
|
out.print(s);
|
}
|
if ("禁用".equals(caozuo)) {
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_drop_frame_5 set flag='1' where id='"+Id+"'";
|
sn.createSql(qSQL);
|
int s=sn.update();//括号内是参数,没有参数不输入
|
out.print(s);
|
}
|
if ("A".equals(caozuo)) {
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_shelf_rack_2 set orientation='B' where id ='"+Id+"'";
|
sn.createSql(qSQL);
|
int s=sn.update();//括号内是参数,没有参数不输入
|
out.print(s);
|
}
|
if ("B".equals(caozuo)) {
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_shelf_rack_2 set orientation='A' where id ='"+Id+"'";
|
sn.createSql(qSQL);
|
int s=sn.update();//括号内是参数,没有参数不输入
|
out.print(s);
|
}
|
if("绑定料架".equals(caozuo)){
|
String Id = request.getParameter("Id");
|
String ljh = request.getParameter("LiaoJiaHao");
|
|
//如果当前料架已经在工位上存在了,则先赋空再修改,避免一个料架存在两个工位的情况
|
//禁用才可以绑料架,flag=0意思未知
|
qSQL = "update gmms_drop_frame_5 set rank=null where rank="+ljh+" and groups_=100 and flag=0";
|
//System.out.println(qSQL);
|
sn.createSql(qSQL);
|
sn.update();
|
//
|
qSQL = "update gmms_drop_frame_5 set rank="+ljh+" where id="+Id+" and groups_=100 and flag=0";
|
sn.createSql(qSQL);
|
int s=sn.update();
|
out.print(s);
|
}
|
if("绑定流程卡".equals(caozuo)){
|
String Id = request.getParameter("Id");
|
String lckh = request.getParameter("LCKNo");
|
qSQL = "update gmms_drop_frame_5 as dr left join gmms_shelf_rack_2 as sr on dr.rank=sr.id set sr.processcard_id='"+lckh+"' where sr.id is not null and dr.id="+Id+" and dr.sign=0 and dr.flag=0";
|
|
|
sn.createSql(qSQL);
|
int s=sn.update();
|
out.print(s);
|
}
|
if ("去除架子".equals(caozuo)) {
|
System.out.println("11231");
|
String Id = request.getParameter("Id");
|
qSQL="update gmms_drop_frame_5 set rank=null where id='"+Id+"'";
|
System.out.println(qSQL);
|
sn.createSql(qSQL);
|
int s=sn.update();//括号内是参数,没有参数不输入
|
out.print(s);
|
}
|
}
|
|
if ("查询".equals(leixing)) {
|
sn.createSql(qSQL);
|
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();
|
}
|
}
|
|
|
%>
|