| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- 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<chk.length; i++){
- chmCd[i][0] = AL[i];
- chmCd[i][1] = ALS[i];
- chmCd[i][2] = ALT[i];
- chmCd[i][3] = AS[i];
- chmCd[i][4] = B[i];
- chmCd[i][5] = C[i];
- chmCd[i][6] = CE1[i];
- chmCd[i][7] = CE2[i];
- chmCd[i][8] = CE3[i];
- chmCd[i][9] = CEV[i];
- chmCd[i][10] = CA[i];
- chmCd[i][11] = CD[i];
- chmCd[i][12] = CR[i];
- chmCd[i][13] = CS[i];
- chmCd[i][14] = CU[i];
- chmCd[i][15] = FE[i];
- chmCd[i][16] = H[i];
- chmCd[i][17] = I[i];
- chmCd[i][18] = LA[i];
- chmCd[i][19] = MG[i];
- chmCd[i][20] = MN[i];
- chmCd[i][21] = MO[i];
- chmCd[i][22] = N[i];
- chmCd[i][23] = NB[i];
- chmCd[i][24] = NI[i];
- chmCd[i][25] = O[i];
- chmCd[i][26] = P[i];
- chmCd[i][27] = PB[i];
- chmCd[i][28] = PCM[i];
- chmCd[i][29] = PSR[i];
- chmCd[i][30] = QA1[i];
- chmCd[i][31] = QA2[i];
- chmCd[i][32] = QA3[i];
- chmCd[i][33] = QA4[i];
- chmCd[i][34] = QA5[i];
- chmCd[i][35] = QA6[i];
- chmCd[i][36] = QA7[i];
- chmCd[i][37] = QA8[i];
- chmCd[i][38] = QA9[i];
- chmCd[i][39] = QB1[i];
- chmCd[i][40] = QB2[i];
- chmCd[i][41] = QB3[i];
- chmCd[i][42] = S[i];
- chmCd[i][43] = SB[i];
- chmCd[i][44] = SE[i];
- chmCd[i][45] = SI[i];
- chmCd[i][46] = SN[i];
- chmCd[i][47] = TI[i];
- chmCd[i][48] = V[i];
- chmCd[i][49] = W[i];
- chmCd[i][50] = XTZ[i];
- chmCd[i][51] = ZN[i];
- chmCd[i][52] = ZR[i];
- }
- PosParameter param ;
- PosRowSet rowSet;
- PosRow row;
- int udtCnt;
-
- for(int i=0; i<chk.length; i++){
- param = new PosParameter();
- param.setWhereClauseParameter(0, chargeNo[i]);
- rowSet = getDao("mesdao").find("UIG040080_CHARGE_EXIS.select", param);
- if(rowSet.hasNext()){
- row = rowSet.next();
- BigDecimal slabCnt = (BigDecimal)row.getAttribute("SLAB_CNT");
- BigDecimal chargeWgt = (BigDecimal)row.getAttribute("SLAB_WGT");
- slabCnt = slabCnt.add(new BigDecimal(1));
- chargeWgt = chargeWgt.add(new BigDecimal(slabWgt[i]));
- logger.logInfo("yayayayayayyayayayayayyayayaya----------------------->" + 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;
- }
- }
|