| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- package xin.glue.ui.G.G04;
- 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 PosCmdRollerTable extends PosActivity
- {
- private String[] sSelYard = new String[10];
- private int iIdx = 0;
-
- //private String currDate = null;
- private String R_SLAB_RT = null;
- //private String R_HCR_CLF = null;
- private Number R_SLAB_WTH = null;
- private Number R_SLAB_LEN = null;
- private String R_ORD_NO = null;
- //private String R_PRODNM_CD = null;
- private String R_STL_GRD = null;
-
- //private String R_SLAB_INGR_DEC_GRD = null;
- private String R_EXTSHAPE_GRD = null;
- private String R_CORRECT_RSLT_CD = null;
-
- public String runActivity(PosContext context)
- {
- logger.logInfo("PosCmdRollerTable START " );
-
-
- String[] rowStatus = (String[]) context.get("rowStatus");
-
- String[] YARD_ADDR = (String[]) context.get("YARD_ADDR");
- String[] SLAB_NO = (String[]) context.get("SLAB_NO");
- //String[] ORD_SEQ = (String[]) context.get("ORD_SEQ");
-
-
- logger.logInfo("PosCmdRollerTable---> rowStatus LEN["+rowStatus.length+"]" );
-
-
- for(int i=0;i<rowStatus.length;i++){
-
-
-
- for ( int j = 0; j < 10 ; j++) {
- sSelYard[j] = "";
- }
- //String RtnCrCmd = null;
-
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, SLAB_NO[i]);
- PosRowSet SlabComVO = this.getDao("mesdao").find("NIG020640_SLAB_COMM.select", param1);
-
- if (SlabComVO.hasNext()) {
- PosRow SlabComROW = SlabComVO.next();
-
- R_SLAB_RT = (String)SlabComROW.getAttribute("SLAB_WAY");
- //R_HCR_CLF = (String)SlabComROW.getAttribute("HCR_CLF");
- R_SLAB_WTH = (Number)SlabComROW.getAttribute("SLAB_WTH");
- R_STL_GRD = (String)SlabComROW.getAttribute("STL_GRD");
- R_ORD_NO = (String)SlabComROW.getAttribute("ORD_NO");
- //R_SLAB_INGR_DEC_GRD = (String)SlabComROW.getAttribute("SLAB_INGR_DEC_GRD");
- R_EXTSHAPE_GRD = (String)SlabComROW.getAttribute("EXTSHAPE_GRD");
- R_CORRECT_RSLT_CD = (String)SlabComROW.getAttribute("CORRECT_RSLT_CD");
-
- String LoadAddress = null;
- String StoreLay = null;
- String Load_SlabNo = null;
- String RtnFlg = null;
- if (YARD_ADDR[i].equals("A0") || YARD_ADDR[i].equals("C0")) {
-
- sSelYard = SMSYardSearch(R_STL_GRD);
-
- for (int s = 0; s < iIdx;s++ ) {
- PosParameter param0 = new PosParameter();
- param0.setWhereClauseParameter(0, sSelYard[i]);
- param0.setWhereClauseParameter(1, sSelYard[i]);
- PosRowSet LoadYardVo = getDao("mesdao").find("UIG040060_LOAD_YARD.select", param0);
- while(LoadYardVo.hasNext()) {
- PosRow LoadYardROW = LoadYardVo.next();
- LoadAddress = (String)LoadYardROW.getAttribute("YARD_ADDR");
- StoreLay = (String)LoadYardROW.getAttribute("STORELAY");
- Load_SlabNo = (String)LoadYardROW.getAttribute("SLAB_NO");
-
- RtnFlg = chkLoadsms(SLAB_NO[i],LoadAddress,StoreLay,Load_SlabNo);
-
-
- if (RtnFlg != null && RtnFlg.equals("1")) {
- CreCrComand(YARD_ADDR[i],SLAB_NO[i],LoadAddress,StoreLay );
- break;
- }
-
- }
- if (RtnFlg != null && RtnFlg.equals("1")) {
- break;
- }
- }
- }
-
-
- }
- }
-
-
-
- return PosBizControlConstants.SUCCESS;
- }
-
- // This routine is search module for the searching to position for the from address slab
- // param : from addres slab STL_GRD
- // return: To posiotion addresses
- public String[] SMSYardSearch(String R_STL_GRD )
- {
- logger.logInfo("PosCmdRollerTable compSlab start " );
-
- String sYardAddr = null;
-
- String sFromStlGrd = null;
- String sToStlGrd = null;
- String sStlGrd1 = null;
- String sStlGrd2 = null;
- String sStlGrd3 = null;
- String sStlGrd4 = null;
- String sStlGrd5 = null;
- String sStlGrd6 = null;
- String sStlGrd7 = null;
- String sStlGrd8 = null;
- String sStlGrd9 = null;
- String sStlGrd10 = null;
-
- String[] SelAddr_G = new String[10];
-
- String FrPos = null;
- String ToPos = null;
-
- if (R_SLAB_RT.equals("P")) {
- FrPos ="L06";
- ToPos ="L08";
- } else {
- FrPos ="L01";
- ToPos ="L05";
- }
-
- if ((R_EXTSHAPE_GRD != null && R_EXTSHAPE_GRD.equals("2")) ||
- (R_CORRECT_RSLT_CD != null && R_CORRECT_RSLT_CD.equals("1"))) {
- SelAddr_G[0]= "L10";
- return SelAddr_G;
- }
-
- iIdx = 0;
-
- for (int j=0;j < 10;j++) {
- SelAddr_G[j]= "";
- }
- PosParameter param0 = new PosParameter();
- param0.setWhereClauseParameter(0, FrPos);
- param0.setWhereClauseParameter(1, ToPos);
-
- PosRowSet StdYardVo = getDao("mesdao").find("UIG040060_STD_YARD.select", param0);
-
- while(StdYardVo.hasNext()){
- PosRow StdYardROW = StdYardVo.next();
- sYardAddr = (String)StdYardROW.getAttribute("YARD_ADDR");
- sFromStlGrd = (String)StdYardROW.getAttribute("FROM_STL_GRD");
- sToStlGrd = (String)StdYardROW.getAttribute("TO_STL_GRD");
- sStlGrd1 = (String)StdYardROW.getAttribute("STL_GRD1");
- sStlGrd2 = (String)StdYardROW.getAttribute("STL_GRD2");
- sStlGrd3 = (String)StdYardROW.getAttribute("STL_GRD3");
- sStlGrd4 = (String)StdYardROW.getAttribute("STL_GRD4");
- sStlGrd5 = (String)StdYardROW.getAttribute("STL_GRD5");
- sStlGrd6 = (String)StdYardROW.getAttribute("STL_GRD6");
- sStlGrd7 = (String)StdYardROW.getAttribute("STL_GRD7");
- sStlGrd8 = (String)StdYardROW.getAttribute("STL_GRD8");
- sStlGrd9 = (String)StdYardROW.getAttribute("STL_GRD9");
- sStlGrd10 = (String)StdYardROW.getAttribute("STL_GRD10");
-
-
- logger.logInfo("PosCmdRollerTable R_STL_GRD:"+R_STL_GRD );
-
- logger.logInfo("PosCmdRollerTable sFromStlGrd:("+sFromStlGrd+"),sToStlGrd:("+sToStlGrd+")" );
-
- if (R_STL_GRD != null ) {
-
- if (sFromStlGrd != null && !sFromStlGrd.equals("") ) {
- if (sFromStlGrd.compareTo(R_STL_GRD) <= 0 && sToStlGrd.compareTo(R_STL_GRD) >= 0 ) {
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- }
-
- } else if (sStlGrd1 != null && sStlGrd1.equals(R_STL_GRD)) {
-
- logger.logInfo("PosCmdRollerTable sStlGrd1:("+sStlGrd1+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
-
- } else if (sStlGrd2 != null && sStlGrd2.equals(R_STL_GRD)) {
- logger.logInfo("PosCmdRollerTable sStlGrd2:("+sStlGrd2+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd3 != null && sStlGrd3.equals(R_STL_GRD)) {
- logger.logInfo("PosCmdRollerTable sStlGrd3:("+sStlGrd3+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd4 != null && sStlGrd4.equals(R_STL_GRD)) {
- logger.logInfo("PosCmdRollerTable sStlGrd4:("+sStlGrd4+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd5 != null && sStlGrd5.equals(R_STL_GRD)) {
- logger.logInfo("PosCmdRollerTable sStlGrd5:("+sStlGrd5+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd6 != null && sStlGrd6.equals(R_STL_GRD)) {
- logger.logInfo("PosCmdRollerTable sStlGrd6:("+sStlGrd6+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd7 != null && sStlGrd7.equals(R_STL_GRD)) {
-
- logger.logInfo("PosCmdRollerTable sStlGrd7:("+sStlGrd7+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd8 != null && sStlGrd7.equals(R_STL_GRD)) {
-
- logger.logInfo("PosCmdRollerTable sStlGrd7:("+sStlGrd8+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd9 != null && sStlGrd8.equals(R_STL_GRD)) {
-
- logger.logInfo("PosCmdRollerTable sStlGrd7:("+sStlGrd9+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- } else if (sStlGrd10 != null && sStlGrd9.equals(R_STL_GRD)) {
-
- logger.logInfo("PosCmdRollerTable sStlGrd7:("+sStlGrd10+")" );
-
- SelAddr_G[iIdx] = sYardAddr;
- iIdx++;
- }
- }
- }
- return SelAddr_G;
- }
-
- // This routine is checking module it's the available to-address for the loading from-slab
- // param : from-slab, to posiotion address,to posiotion address lay, to-slab
- // return: loading possibility or impossibility
- public String chkLoadsms(String slabno,String LoadAddress,String StoreLay,String YdSlabNo )
- {
- if (StoreLay != null && StoreLay.equals("12")) {
-
- return "0";
- }
-
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, YdSlabNo);
- PosRowSet LoadSlabVO = this.getDao("mesdao").find("NIG020640_SLAB_COMM.select", param1);
- if (LoadSlabVO.hasNext()) {
- PosRow LoadSlabROW =LoadSlabVO.next();
- Number YdSlabWth = (Number)LoadSlabROW.getAttribute("SLAB_WTH");
- Number YdSlabLen = (Number)LoadSlabROW.getAttribute("SLAB_LEN");
- String YdStlGrd = (String)LoadSlabROW.getAttribute("STL_GRD");
- String YdOrdNo = (String)LoadSlabROW.getAttribute("ORD_NO");
-
- double tol = 5;
-
- double D_R_SLAB_WTH = R_SLAB_WTH.doubleValue();
- logger.logInfo("XinDecToPosition compSlab D_R_SLAB_WTH:"+D_R_SLAB_WTH );
- double D_R_SLAB_LEN = R_SLAB_LEN.doubleValue();
- logger.logInfo("XinDecToPosition compSlab D_R_SLAB_LEN:"+D_R_SLAB_LEN );
- double D_YD_SLAB_LEN = YdSlabLen.doubleValue();
- double D_YD_SLAB_WTH = YdSlabWth.doubleValue();
-
- logger.logInfo("XinDecToPosition compSlab D_YD_SLAB_WTH:"+D_YD_SLAB_WTH );
-
- double rem_len = Math.abs(D_YD_SLAB_LEN - D_R_SLAB_LEN);
- double rem_wth = Math.abs(D_R_SLAB_WTH - D_YD_SLAB_WTH);
- logger.logInfo("XinDecToPosition compSlab rem_wth:"+rem_wth );
- logger.logInfo("XinDecToPosition compSlab rem_len:"+rem_len );
-
- String sRChargeNo = slabno.substring(0,10);
- String sYChargeNo = YdSlabNo.substring(0,10);
-
- logger.logInfo("XinDecToPosition compSlab sYChargeNo:"+sYChargeNo );
-
- //Number aa = (Number) new Double(rem_len);
-
- if (rem_len > tol ) {
- logger.logInfo("XinDecToPosition compSlab rem_len> tol " );
- return "";
- }
- logger.logInfo("XinDecToPosition compSlab rem_len comp " );
-
- if (rem_wth > tol ) {
- return "0";
- }
- if ( R_ORD_NO.equals(YdOrdNo) && R_STL_GRD.equals(YdStlGrd) ) {
- return "1";
- }
- if ( R_ORD_NO.equals(YdOrdNo) ) {
- return "1";
- }
- if ( R_STL_GRD.equals(YdStlGrd) ) {
- return "S";
- }
- if ( sRChargeNo.equals(sYChargeNo)) {
- return "1";
- }
- return "0";
- } else {
- return "1";
- }
-
- }
- // This routine is setting crane command to the crane command table
- // param : from-address,from address slabno,to to-address,to-address store lay
-
- public void CreCrComand(String FromAddr, String SlabNo,String ToAddr,String Storelay )
- {
- logger.logInfo("XinDecToPosition--->CreCrComand: start" );
-
- //String nOrdSeq = null;
- //int iSeq = 0;
-
- String CrNo = null;
- String Areas = ToAddr.substring(1,2);
-
- if ( Areas.equals("1") ) {
- CrNo = "1-2";
- } else if (Areas.equals("2")) {
- CrNo = "1-4";
- } else if (Areas.equals("3")) {
- CrNo = "1-6";
- }
-
- String To_StoreLay = null;
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, ToAddr);
- PosRowSet StoreLayVO = this.getDao("mesdao").find("UIG040060_YARD_LAY.select", param1);
- if (StoreLayVO.hasNext()) {
- PosRow StoreLayROW = StoreLayVO.next();
- To_StoreLay = (String)StoreLayROW.getAttribute("STORELAY");
-
- String ToAddress = ToAddr+To_StoreLay;
- logger.logInfo("XinDecToPosition--->CrNo:"+ CrNo );
-
- String sqlCRrOrd = "SELECT SLAB_CRANE_ORDER_SEQ.NEXTVAL SEQ_NO FROM DUAL ";
- PosRowSet CrCmdVo = getDao("mesdao").findByQueryStatement(sqlCRrOrd );
-
- if (CrCmdVo.hasNext()) {
-
- PosRow CrCmdROW = CrCmdVo.next();
- Number SEQ_NO = (Number)CrCmdROW.getAttribute("SEQ_NO");
-
- PosParameter param2 = new PosParameter();
- param2.setValueParamter(0, CrNo );
- param2.setValueParamter(1, FromAddr );
- param2.setValueParamter(2, ToAddress );
- param2.setValueParamter(3, SlabNo );
- param2.setValueParamter(4, SEQ_NO );
- this.getDao("mesdao").update("UIG040060_YARD_COMMAND.update",param2);
- } else {
- PosParameter param2 = new PosParameter();
- param2.setValueParamter(0, CrNo );
- param2.setValueParamter(1, FromAddr );
- param2.setValueParamter(2, ToAddress );
- param2.setValueParamter(3, SlabNo );
- this.getDao("mesdao").update("UIG040060_YARD_COMMAND.insert",param2);
- }
-
-
-
- PosParameter param4 = new PosParameter();
- param4.setValueParamter(0, "1");
- param4.setValueParamter(1, "UIG040060");
- param4.setValueParamter(2, SlabNo);
- param4.setValueParamter(3, FromAddr);
- getDao("mesdao").update("UIG040060_SLAB_YARD.update",param4);
- }
-
- }
-
- }
|