package xin.glue.ui.G.G04; import java.math.BigDecimal; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRow; import com.posdata.glue.dao.vo.PosRowSet; public class XinReceiveSlab extends PosActivity { public String runActivity(PosContext context) { String[] chargeNo = (String[])context.get("CHARGE_NO"); String[] slabNo = (String[])context.get("SLAB_NO"); String[] stlGrd = (String[])context.get("STL_GRD"); String[] curLoc = (String[])context.get("CUR_LOAD_LOC"); String[] slabThk = (String[])context.get("SLAB_THK"); String[] slabWth = (String[])context.get("SLAB_WTH"); String[] slabLen = (String[])context.get("SLAB_LEN"); String[] slabWgt = (String[])context.get("SLAB_WGT"); String[] trsTime = (String[])context.get("TRS_DTIME"); String[] trsCd = (String[])context.get("TRS_CD"); String[] chk = (String[])context.get("CHK"); String[] cheCd = new String[53]; String[] AL = (String[])context.get("AL"); String[] ALS = (String[])context.get("ALS"); String[] ALT = (String[])context.get("ALT"); String[] AS = (String[])context.get("A_S"); String[] B = (String[])context.get("B"); String[] C = (String[])context.get("C"); String[] CE1 = (String[])context.get("CE1"); String[] CE2 = (String[])context.get("CE2"); String[] CE3 = (String[])context.get("CE3"); String[] CEV = (String[])context.get("CEV"); String[] CA = (String[])context.get("CA"); String[] CD = (String[])context.get("CD"); String[] CR = (String[])context.get("CR"); String[] CS = (String[])context.get("CS"); String[] CU = (String[])context.get("CU"); String[] FE = (String[])context.get("FE"); String[] H = (String[])context.get("H"); String[] I = (String[])context.get("I"); String[] LA = (String[])context.get("LA"); String[] MG = (String[])context.get("MG"); String[] MN = (String[])context.get("MN"); String[] MO = (String[])context.get("MO"); String[] N = (String[])context.get("N"); String[] NB = (String[])context.get("NB"); String[] NI = (String[])context.get("NI"); String[] O = (String[])context.get("O"); String[] P = (String[])context.get("P"); String[] PB = (String[])context.get("PB"); String[] PCM = (String[])context.get("PCM"); String[] PSR = (String[])context.get("PSR"); String[] QA1 = (String[])context.get("QA1"); String[] QA2 = (String[])context.get("QA2"); String[] QA3 = (String[])context.get("QA3"); String[] QA4 = (String[])context.get("QA4"); String[] QA5 = (String[])context.get("QA5"); String[] QA6 = (String[])context.get("QA6"); String[] QA7 = (String[])context.get("QA7"); String[] QA8 = (String[])context.get("QA8"); String[] QA9 = (String[])context.get("QA9"); String[] QB1 = (String[])context.get("QB1"); String[] QB2 = (String[])context.get("QB2"); String[] QB3 = (String[])context.get("QB3"); String[] S = (String[])context.get("S"); String[] SB = (String[])context.get("SB"); String[] SE = (String[])context.get("SE"); String[] SI = (String[])context.get("SI"); String[] SN = (String[])context.get("SN"); String[] TI = (String[])context.get("TI"); String[] V = (String[])context.get("V"); String[] W = (String[])context.get("W"); String[] XTZ = (String[])context.get("XTZ"); String[] ZN = (String[])context.get("ZN"); String[] ZR = (String[])context.get("ZR"); cheCd[0 ]="AL"; cheCd[1 ]="ALS"; cheCd[2 ]="ALT"; cheCd[3 ]="AS"; cheCd[4 ]="B"; cheCd[5 ]="C"; cheCd[6 ]="CE1"; cheCd[7 ]="CE2"; cheCd[8 ]="CE3"; cheCd[9 ]="CEV"; cheCd[10]="CA"; cheCd[11]="CD"; cheCd[12]="CR"; cheCd[13]="CS"; cheCd[14]="CU"; cheCd[15]="FE"; cheCd[16]="H"; cheCd[17]="I"; cheCd[18]="LA"; cheCd[19]="MG"; cheCd[20]="MN"; cheCd[21]="MO"; cheCd[22]="N"; cheCd[23]="NB"; cheCd[24]="NI"; cheCd[25]="O"; cheCd[26]="P"; cheCd[27]="PB"; cheCd[28]="PCM"; cheCd[29]="PSR"; cheCd[30]="QA1"; cheCd[31]="QA2"; cheCd[32]="QA3"; cheCd[33]="QA4"; cheCd[34]="QA5"; cheCd[35]="QA6"; cheCd[36]="QA7"; cheCd[37]="QA8"; cheCd[38]="QA9"; cheCd[39]="QB1"; cheCd[40]="QB2"; cheCd[41]="QB3"; cheCd[42]="S"; cheCd[43]="SB"; cheCd[44]="SE"; cheCd[45]="SI"; cheCd[46]="SN"; cheCd[47]="TI"; cheCd[48]="V"; cheCd[49]="W"; cheCd[50]="XTZ"; cheCd[51]="ZN"; cheCd[52]="ZR"; String[][] chmCd = new String[chk.length][53]; for(int i=0; i" + slabCnt); logger.logInfo("yayayayayayyayayayayayyayayaya----------------------->" + chargeWgt); param = new PosParameter(); param.setWhereClauseParameter(0, slabCnt); param.setWhereClauseParameter(1, chargeWgt); param.setWhereClauseParameter(2, chargeNo[i]); udtCnt = getDao("mesdao").update("UIE012130.Charge.Update",param); }else{ param = new PosParameter(); param.setValueParamter(0, chargeNo[i]); param.setValueParamter(1, stlGrd[i]); param.setValueParamter(2, new BigDecimal(1)); param.setValueParamter(3, slabWgt[i]); udtCnt = getDao("mesdao").insert("UIE012130.Charge.Insert", param); } param = new PosParameter(); param.setWhereClauseParameter(0, slabNo[i]); rowSet = getDao("mesdao").find("UIG040080_SLAB_EXIS.select", param); if(rowSet.hasNext()){ param = new PosParameter(); param.setWhereClauseParameter(0, slabNo[i]); param.setWhereClauseParameter(1, slabThk[i]); param.setWhereClauseParameter(2, slabWth[i]); param.setWhereClauseParameter(3, slabLen[i]); param.setWhereClauseParameter(4, slabWgt[i]); param.setWhereClauseParameter(5, "H"); param.setWhereClauseParameter(6, ""); param.setWhereClauseParameter(7, slabNo[i]); udtCnt = getDao("mesdao").update("UIE012130.Slab.Update",param); }else{ // 板坯号, 计划板坯号, 子板坯号, 钢号, 厚度, 宽度, 长度, 重量, 板坯去向, // -- 购入MAKER名称, 购入炉次, 购入板坯码, 作业班次, 作业组, 录入者 param = new PosParameter(); param.setValueParamter(0, slabNo[i]); param.setValueParamter(1, slabNo[i]); param.setValueParamter(2, slabNo[i]); param.setValueParamter(3, stlGrd[i]); param.setValueParamter(4, slabThk[i]); param.setValueParamter(5, slabWth[i]); param.setValueParamter(6, slabLen[i]); param.setValueParamter(7, slabWgt[i]); param.setValueParamter(8, "H"); param.setValueParamter(9, trsCd[i]); param.setValueParamter(10, chargeNo[i]); param.setValueParamter(11, slabLen[i]); param.setValueParamter(12, ""); param.setValueParamter(13, ""); param.setValueParamter(14, ""); param.setValueParamter(15, curLoc[i]); udtCnt = getDao("mesdao").insert("UIE012130.Slab.Insert", param); param = new PosParameter(); param.setWhereClauseParameter(0, curLoc[i]); rowSet = getDao("mesdao").find("UIG040060_COMPLUS_TO_ADDR.select", param); if(rowSet.hasNext()) { PosRow CompToVoROW = rowSet.next(); String StoreLay = (String)CompToVoROW.getAttribute("STORELAY"); // TO Address SLAB NO Setting PosParameter param2 = new PosParameter(); param2.setValueParamter(0, slabNo[i]); param2.setValueParamter(1, "UIG040080"); param2.setValueParamter(2, "T001"); param2.setValueParamter(3, StoreLay); param2.setValueParamter(4, curLoc[i]); getDao("mesdao").update("UIG040060_COMPLUS_MOVE.update",param2); } } for(int j=0; j<53; j++){ param = new PosParameter(); param.setWhereClauseParameter(0, new BigDecimal(chmCd[i][j])); param.setWhereClauseParameter(1, "USER003"); param.setWhereClauseParameter(2, chargeNo[i]); param.setWhereClauseParameter(3, cheCd[j]); udtCnt = getDao("mesdao").update("UIE012130.WorkIngr.pdate", param); if(udtCnt == 0){ param = new PosParameter(); param.setValueParamter(0, chargeNo[i]); param.setValueParamter(1, cheCd[j]); param.setValueParamter(2, new BigDecimal(chmCd[i][j])); param.setValueParamter(3, "USER003"); udtCnt = getDao("mesdao").insert("UIE012130.WorkIngr.Insert", param); } } } param = new PosParameter(); getDao("mesdao").update("UIG040080_SLAB_RECEIVED.update", param); context.put("MESSAGES", "操作成功!"); return PosBizControlConstants.SUCCESS; } }