📄 savenewpn.jsp
字号:
<%-- Created by IntelliJ IDEA. User: jtgao Date: 2006-5-21 Time: 16:39:10 To change this template use File | Settings | File Templates.//--%><%@ page contentType="text/html;charset=GBK" %><%@ page import="com.hexiesoft.utils.PrintAddPN" %><%@ include file="/IncludeBeginMD.jsp" %><% String strpnno =""; String sWorkno = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("Worksno")); String sgross = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("gross")); String scoils = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("coils")); String sstandno = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("standno")); String sinsertwgt = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("insertwgt")); String sctrno = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("ctrno")); String sctrwgt = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("ctrwgt")); String spaltno = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("paltno")); String spaltwgt = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("paltwgt")); String scaseno = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("scaseno")); //out.println(scaseno); String scasewgt = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("casewgt")); String sdividerwgt = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("dividerwgt")); java.text.SimpleDateFormat fYear = new java.text.SimpleDateFormat("yyyy"); java.text.SimpleDateFormat fMonth = new java.text.SimpleDateFormat("MM"); java.text.SimpleDateFormat fDays = new java.text.SimpleDateFormat("yyyyMMddHHmmss"); java.util.Date currentTime_1 = new java.util.Date(); //out.print(formatter.format(currentTime_1)); String sYear = fYear.format(currentTime_1); String sMonth = fMonth.format(currentTime_1); String sDays = fDays.format(currentTime_1); String spnno=sYear.substring(3,4) + sMonth.substring(1,2) + sDays.substring(6,14); //在表 packnote 中增加一条记录 此次插入数据 为 worksno 和 pnno String sinsSql =" insert packnote "; sinsSql += "select "; sinsSql += "o.plant,o.worksno,s.blno "; sinsSql += ",'" + spnno + "' pnno,getdate() pndate,s.[desc],o.mt_gauge,o.mt_width "; sinsSql += ",s.custpo,o.custspec,o.custprod,s.account,s.subacct,s.[name],s.add1,s.add2 "; sinsSql += ",null gross,null coils,null standno,null standwgt,null insertwgt,null dividerwgt,null ctrno,null ctrwgt,null paltno,null paltwgt,null caseno,null casewgt "; sinsSql += ",null tare,null net "; sinsSql += ",o.islbs,c.ordertype,null finblno,null dpaid,null npaid,null nvalue,null skid "; sinsSql += "from shipment s,ord_item o,customer c "; sinsSql += "where s.worksno = o.worksno and o.account = c.account and o.subacct = c.subacct and o.plant is not null "; sinsSql += "and s.worksno = " + sWorkno; //out.println(sinsSql); //Update the table ord_item String sUpdSql = "update packnote set gross=" + PrintAddPN.rep0(sgross) + ",coils= " + PrintAddPN.rep0(scoils) + ", standno='" + sstandno + "', insertwgt=" + PrintAddPN.rep0(sinsertwgt) + ", standwgt=isnull(( select top 1 (standwgt) from stands where standno ='" + sstandno + "'),0)" + ", ctrno='" + sctrno + "', ctrwgt=" + PrintAddPN.rep0(sctrwgt) + ", paltno='" + spaltno + "', paltwgt=" + PrintAddPN.rep0(spaltwgt) + ", caseno='" + scaseno + "', casewgt=" + PrintAddPN.rep0(scasewgt) + ", dividerwgt=" + PrintAddPN.rep0(sdividerwgt) + " where Worksno=" + sWorkno + " and pnno ='" + spnno + "'"; out.println(sUpdSql); /*STORE m.standwgt + m.insertwgt + m.dividerwgt + m.ctrwgt ; + m.paltwgt + m.casewgt TO m.tare STORE m.gross - m.tare TO m.net */ String sUpdSql2= "update packnote set tare=standwgt+insertwgt+dividerwgt+ctrwgt+paltwgt+casewgt where pnno='" + spnno + "'"; //out.println(sUpdSql2); String sUpdSql3= "update packnote set net = gross-tare where pnno='" + spnno + "'"; //out.println(sUpdSql3); //out.println(" select * from packnote where pnno ='" + spnno + "'"); /* *在stands表修改下列有关数据 SELECT stands DO da_rlock REPLACE blno WITH SPACE(6) REPLACE shipdt WITH CTOD('') REPLACE account WITH m.account REPLACE subacct WITH m.subacct REPLACE worksno WITH RIGHT(STR(m.worksno),6) UNLOCK FLUSH DO untalk */ String sUpdSql4 = "update stands set blno='', shipdt=getdate(),account=a.account,subacct=a.subacct,worksno='"+sWorkno+"' from dbo.shipment a where standno= '" +sstandno +"' and a.worksno=" +sWorkno ; try { Sqlca.executeSQL(sinsSql); //strpnno="1"; Sqlca.executeSQL(sUpdSql); //strpnno="2"; Sqlca.executeSQL(sUpdSql2); //strpnno="3"; Sqlca.executeSQL(sUpdSql3); //strpnno="4"; Sqlca.executeSQL(sUpdSql4); strpnno = spnno; } catch (Exception e) { e.printStackTrace(); out.println(e.toString()); strpnno = ""; } //out.println(strpnno); //isEmpty = !rs.next();%><script language=javascript> self.returnValue = "<%=strpnno%>"; self.close();</script><%@ include file="/IncludeEnd.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -