📄 doadd.jsp
字号:
<%@ page import="com.hexiesoft.utils.StringUtils" %>
<%@ page contentType="text/html; charset=GBK" language="java" %>
<%@ include file="/IncludeBegin.jsp" %>
<html>
<head>
<title>addshippinglist</title>
</head>
<body class="pagebackground" text="#000000">
<%
String sOrdertype = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("ordertype"));
String sWorksno = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("worksno"));
String hscode = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("hscode"));
String sBlno = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("blno"));
String shipdt = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("shipdt"));
String sPlant = DataConvert.toRealString(iPostChange, (String) CurPage.getParameter("plant"));
String label1 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_1");
String label2 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_2");
String label3 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_3");
String label4 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_4");
String label5 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_5");
String label6 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_6");
String label7 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_7");
String label8 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_8");
String label9 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("ENTERWORKSNO_LABEL_9");
String label10 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("LOT");
String label11 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("NET");
String show1 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("SHOW1");
String show2a = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("SHOW2_A");
String show2b = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("SHOW2_B");
String show3 = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("SHOW3");
String buttonlable = (String) Configure.getConfigure(sIe_Language, "AddShippingList").get("BUTTON_LABLE_1");
%>
<%
int islbs = 0;
//String blno = Float.parseFloat(sBlno);
String gblno = "";
//float worksno = Float.parseFloat(sWorksno);
String internal = "";
float width = 0.0f;
float gauge = 0.0f;
String millspec = "";
String desc = "";
String sql = "";
String sWname = "";
String sAdd1 = "";
String sAdd2 = "";
String sAccount = "";
String sSubacct = "";
String sCrdflag = "";
String sOvership = "";
String sServstatus = "";
String sLstatus = "";
String sStatus = "";
String alloy = "";
String temper = "";
String custpo = "";
String custprod = "";
boolean Complete = true;
String percent = "";
ASResultSet ord_itemRs;
ASResultSet ord_hdrRs;
ASResultSet customerRs;
ASResultSet whouseRs;
ASResultSet promiseRs;
ASResultSet shipmentRs;
ASResultSet packnoteRs;
ASResultSet scheduleRs;
ASResultSet cpcardRs;
ASResultSet millcodeRs;
//检验ord_item
sql = "select * from ord_item where worksno='" + sWorksno+"'";
ord_itemRs = Sqlca.getASResultSet(sql);
if (ord_itemRs.next()) {
if (("1").equals(ord_itemRs.getString("islbs"))) {
islbs = 1;
}
millspec = ord_itemRs.getString("millspec");
alloy = ord_itemRs.getString("alloy");
temper = ord_itemRs.getString("temper");
gauge = ord_itemRs.getFloat("gauge");
width = ord_itemRs.getFloat("width");
custprod = ord_itemRs.getString("custprod");
internal = ord_itemRs.getString("internal");
sOvership = ord_itemRs.getString("overship");
sAccount = ord_itemRs.getString("account");
sSubacct = ord_itemRs.getString("subacct");
sServstatus = ord_itemRs.getString("servstatus");
sLstatus = ord_itemRs.getString("lstatus");
sStatus = ord_itemRs.getString("status");
desc = ord_itemRs.getString("alloy") + " " + ord_itemRs.getString("temper") + " " + String.valueOf(ord_itemRs.getFloat("width")) + " " + String.valueOf(ord_itemRs.getFloat("gauge"));
sql = "select * from ord_hdr where internal='" + internal+"'";
ord_hdrRs = Sqlca.getASResultSet(sql);
if (ord_hdrRs.next()) {
custpo = ord_hdrRs.getString("custpo");
}
sql = "select * from customer where account='" + sAccount + "' and subacct='" + sSubacct + "'";
customerRs = Sqlca.getASResultSet(sql);
String customerTempShadd1 = "";
String customerTempShadd2 = "";
String customerTempShcity = "";
String customerTempShprovst = "";
String customerTempShcountry = "";
if (customerRs.next()) {
sCrdflag = customerRs.getString("crdflag");
customerTempShadd1 = customerRs.getString("shadd1");
customerTempShadd2 = customerRs.getString("shadd2");
customerTempShcity = customerRs.getString("shcity");
customerTempShprovst = customerRs.getString("shprovst");
customerTempShcountry = customerRs.getString("shcountry");
}
if (!sOrdertype.equals("REG")) {
sql = "select * from whouse where wcode='" + sOrdertype + "'";
whouseRs = Sqlca.getASResultSet(sql);
if (whouseRs.next()) {
sWname = whouseRs.getString("wname");
sAdd1 = StringUtils.nullToEmpty(whouseRs.getString("shadd1")) + ";" + StringUtils.nullToEmpty(whouseRs.getString("shadd2"));
sAdd2 = StringUtils.nullToEmpty(whouseRs.getString("shcity")) + ";" + StringUtils.nullToEmpty(whouseRs.getString("shprovst")) + ";" + StringUtils.nullToEmpty(whouseRs.getString("shcountry"));
}
} else {
sAdd1 = customerTempShadd1 + ";" + customerTempShadd2;
sAdd2 = customerTempShcity + ";" + customerTempShprovst + ";" + customerTempShcountry;
}
}
String sCurpromqty = "";
float ntotship = 0.0f;
sql = "select * from promise where worksno='" + sWorksno+"'";
promiseRs = Sqlca.getASResultSet(sql);
if (promiseRs.next()) {
sCurpromqty = promiseRs.getString("curpromqty");
}
sql = "select * from shipment where worksno='" + sWorksno+"'";
shipmentRs = Sqlca.getASResultSet(sql);
while (shipmentRs.next()) {
ntotship = ntotship + shipmentRs.getFloat("net");
}
//packnote
int i = 0;
int nlen = 0;
boolean lsize = true;
String[] mzpn = new String[200];
float loaded = 0.0f;
float netwght = 0.0f;
float tnet = 0.0f;
float tcoils = 0.0f;
float tnotes = 0.0f;
float[] mzpngross = new float[200];
float[] mzpnnet = new float[200];
float[] mzpncoils = new float[200];
try{
sql = "select * from packnote where blno is null and worksno='" + sWorksno+"'";
packnoteRs = Sqlca.getASResultSet(sql);
//Sqlca.conn.setAutoCommit(false);
while (packnoteRs.next()) {
mzpn[i] = packnoteRs.getString("pnno");
mzpngross[i] = packnoteRs.getFloat("gross");
mzpnnet[i] = packnoteRs.getFloat("net");
mzpncoils[i] = packnoteRs.getFloat("coils");
loaded = loaded - packnoteRs.getFloat("gross");
netwght = netwght + packnoteRs.getFloat("net");
tnet = tnet + packnoteRs.getFloat("net");
tcoils = tcoils + packnoteRs.getFloat("coils");
if (mzpnnet[i] > 0) {
tnotes = tnotes + 1;
}
i++;
}
nlen = i;
//更新global表
float ship_weight = 0.0f;
sql = "select * from global ";
gblno = sBlno;
Sqlca.executeSQL("update global set blno=" + sBlno+"");
//插入记录到shipment表
if (sPlant.equals("HILL")) {
sql = "insert into shipment (net,notes,coils,blno,ordertype,dcdfg,islbs,plant,[desc],worksno,alloy,temper,gauge,width,account,subacct,name,add1,add2,custpo,custprod,shipdt,hscode) values (" + tnet + "," + tnotes + "," + tcoils + "," + gblno + ",'" + sOrdertype + "',1," + islbs + ",'" + sPlant + "','" + desc + "'," + sWorksno + ",'" + alloy + "','" + temper + "'," + gauge + "," + width + ",'" + sAccount + "','" + sSubacct + "','" + sWname + "','" + sAdd1 + "','" + sAdd2 + "','" + custpo + "','" + custprod + "','" + shipdt + "','" + hscode + "')";
} else {
sql = "insert into shipment (net,notes,coils,blno,ordertype,islbs,plant,[desc],worksno,alloy,temper,gauge,width,account,subacct,name,add1,add2,custpo,custprod,shipdt,hscode) values (" + tnet + "," + tnotes + "," + tcoils + "," + gblno + ",'" + sOrdertype + "'," + islbs + ",'" + sPlant + "','" + desc + "'," + sWorksno + ",'" + alloy + "','" + temper + "'," + gauge + "," + width + ",'" + sAccount + "','" + sSubacct + "','" + sWname + "','" + sAdd1 + "','" + sAdd2 + "','" + custpo + "','" + custprod + "','" + shipdt + "','" + hscode + "')";
}
Sqlca.executeSQL(sql);
//schedule
float etpship = 0.0f;
float c300ship = 0.0f;
float c420ship = 0.0f;
float WTBship = 0.0f;
float regship = 0.0f;
sql = "select * from schedule where week_date='" + shipdt + "'";
scheduleRs = Sqlca.getASResultSet(sql);
while (scheduleRs.next()) {
etpship = scheduleRs.getFloat("etpship");
c300ship = scheduleRs.getFloat("c300ship");
c420ship = scheduleRs.getFloat("c420ship");
WTBship = scheduleRs.getFloat("WTBship");
regship = scheduleRs.getFloat("regship");
}
boolean wtb = false;
sql = "select * from millcode where millspec='" + millspec+"'";
millcodeRs = Sqlca.getASResultSet(sql);
while (millcodeRs.next()) {
if(!alloy.equals(""))
{
if (alloy.substring(0, 1).equals("2")) {
if (millcodeRs.getFloat("lbsinwidth") >= 300) {
wtb = true;
}
}
}
}
//更新schedule表
if (sPlant.equals("HILL")) {
if (islbs == 1) {
ship_weight = tnet;
} else {
ship_weight = tnet * 2.2046f;
}
if (alloy.equals("11000") || alloy.equals("C1100")) {
sql = "update schedule set etpship=" + (ship_weight + etpship);
Sqlca.executeSQL(sql);
} else if (alloy.equals("12200") || alloy.equals("14300") || alloy.equals("C1400")) {
sql = "update schedule set c300ship=" + (c300ship + ship_weight);
Sqlca.executeSQL(sql);
} else if (alloy.equals("14420")) {
sql = "update schedule set c420ship=" + (c420ship + ship_weight);
Sqlca.executeSQL(sql);
} else if (wtb) {
sql = "update schedule set WTBship=" + (WTBship + ship_weight);
Sqlca.executeSQL(sql);
} else {
sql = "update schedule set regship=" + (regship + ship_weight);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -