| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254 |
- package xin.glue.nui.G.G02;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Date;
- import java.math.BigDecimal;
- import xin.glue.ui.common.PosDateFormat;
- import com.posdata.glue.biz.activity.PosActivity;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.biz.control.PosBizControlIF;
- import com.posdata.glue.biz.control.PosBizProvider;
- import com.posdata.glue.component.PosConstants;
- import com.posdata.glue.context.PosContext;
- import com.posdata.glue.dao.PosGenericDao;
- import com.posdata.glue.dao.vo.PosRowSet;
- import com.posdata.glue.dao.vo.PosRow;
- import com.posdata.glue.dao.vo.PosParameter;
- import com.posdata.glue.msg.PosMESMessageImpl;
- import com.posdata.glue.msg.PosMessage;
- //import com.sun.org.apache.xpath.internal.operations.Number;
- public class XinSaveSlabComm extends PosActivity {
- String CurrDate = null;
- String OrgOrdNo = null;
- String OrgOrdSeq = null;
- String CurProcCd = null;
- String SlabLoc = null;
- String LocDtime = null;
- String SlabStat = null;
- // String RST_SLAB_CUT_DTIME = null;
- String YardLoc = null;
- String SlabIngrDec = null;
- // Number SLAB_WGT = null;
- String sSlabWay = null;
- String MillSchStat = null;
- String NonordCause = null;
- String SLAB_SIZE_DEC_GRD = "1";
-
- Number SP_SLAB_EDT_SEQ = null;
- Number SP_CHARGE_SLAB_SEQ = null;
- String SP_SLAB_MANA_NO = null;
- String SP_PRODNM_CD = null;
- String SP_STL_GRD = null;
- String SP_SLAB_RT = null;
- Number SP_SLAB_THK = null;
- Number SP_SLAB_WTH = null;
- Number SP_SLAB_LEN = null;
- Number SP_SLAB_WGT = null;
- String SP_HCR_CLF = null;
- String SP_ORD_FL = null;
- String SP_ORD_NO = null;
- String SP_ORD_SEQ = null;
- Number SP_ORD_THK = null;
- Number SP_ORD_WTH = null;
- Number SP_ORD_LEN = null;
- Number SP_ORD_WGT = null;
- Number SP_COIL_INDIA = null;
- Number SP_COIL_OUTDIA = null;
- String SP_ORD_USEAGE_CD = null;
- String SP_CUST_CD = null;
- String SP_ORDCUST_CD = null;
- String SP_SPEC_ABBSYM = null;
- String SP_SCARPING_PROC_YN = null;
- String SP_MILL_FL = null;
- String SP_DSN_SLAB_NO = null;
- public String runActivity(PosContext context) {
- if(true)return PosBizControlConstants.SUCCESS;
- PosParameter param = null;
- DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
- CurrDate = formatter.format(new Date());
- PosMessage message = context.getMessage();
- String MSG_SLAB_NO = (String) message.get("SLAB_NO");
- String MSG_PLAN_SLAB_NO = (String) message.get("PLAN_SLAB_NO");
- String MSG_CCM_NO = (String) message.get("CCM_NO");
- String MSG_STRAND_NO = (String) message.get("STRAND_NO");
- String MSG_HCR_CLF = (String) message.get("HCR_CLF");
- String MSG_OVER_PLUS_CLF = (String) message.get("OVER_PLUS_CLF");
- BigDecimal MSG_SLAB_WGT = (BigDecimal) message.get("SLAB_WGT");
- BigDecimal MSG_SLAB_THK = (BigDecimal) message.get("SLAB_THK");
- BigDecimal MSG_SLAB_WTH = (BigDecimal) message.get("SLAB_WTH");
- BigDecimal MSG_SLAB_LEN = (BigDecimal) message.get("SLAB_LEN");
- BigDecimal MSG_SLAB_TEMP = (BigDecimal) message.get("SLAB_TEMP");
- String MSG_LAST_CUT_YN = (String) message.get("LAST_CUT_YN");
- String MSG_SLAB_CUT_DTIME = (String) message.get("SLAB_CUT_DTIME");
- String MSG_SLAB_LOC = (String) message.get("SLAB_LOC");
- String ED_DIFF_STL_GRD_STA_END_YN1 = "1";
- // 获得计划板坯号
- param = new PosParameter();
- param.setWhereClauseParameter(0, MSG_SLAB_NO);
- PosRowSet rowSet = getDao("mesdao").find("UIG02COMM_PLAN_SLABNO.select", param);
- if (rowSet.hasNext()) {
- PosRow row = rowSet.next();
- MSG_PLAN_SLAB_NO = (String) row.getAttribute("PLAN_SLAB_NO");
- }
- if (MSG_PLAN_SLAB_NO == null || MSG_PLAN_SLAB_NO.equals("")) {
- MSG_PLAN_SLAB_NO = "3" + MSG_SLAB_NO.substring(1,10) + "010";
- }
-
-
- // get shift group info
- String sShift = null;
- if (MSG_SLAB_CUT_DTIME == null || MSG_SLAB_CUT_DTIME.equals("")) {
- MSG_SLAB_CUT_DTIME = CurrDate;
- }
- PosDateFormat dateFormat = new PosDateFormat();
- sShift = dateFormat.getShift(MSG_SLAB_CUT_DTIME);
- PosParameter paramS = new PosParameter();
- paramS.setWhereClauseParameter(0, MSG_SLAB_CUT_DTIME.substring(0, 6));
- paramS.setWhereClauseParameter(1, MSG_SLAB_CUT_DTIME.substring(6, 8));
- paramS.setWhereClauseParameter(2, sShift);
- paramS.setWhereClauseParameter(3, "S");
- PosRowSet groupVO = this.getDao("mesdao").find("NIG020210_SHIFT.select", paramS);
- String sGroup = null;
- if (groupVO.hasNext()) {
- PosRow groupROW = groupVO.next();
- sGroup = (String) groupROW.getAttribute("GR_GROUP_CD");
- }
- // Slab Spec(TBF01_SPEC_SLAB ) editing
- SlabSpecEdit(MSG_PLAN_SLAB_NO);
- OrgOrdNo = SP_ORD_NO;
- OrgOrdSeq = SP_ORD_SEQ;
- MSG_HCR_CLF = SP_HCR_CLF;
- // Calculation Slab Weight
- if (MSG_SLAB_WGT == null || MSG_SLAB_WGT.intValue() == 0) {
- MSG_SLAB_WGT = calWgt(MSG_SLAB_THK, MSG_SLAB_WTH, MSG_SLAB_LEN);
- }
- // Slab Size Decision
- // SLAB SIZE DECISION CALL AT THAT TIME SLAB WEIGHTING
- if (!MSG_OVER_PLUS_CLF.equals("S") && MSG_SLAB_LOC != null && !MSG_SLAB_WGT.equals(new BigDecimal(0)) &&
- (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("2") || MSG_SLAB_LOC.equals("4"))
- && SP_SLAB_RT != null && !(SP_SLAB_RT.equals("P") || SP_SLAB_RT.equals("Z"))) {
- String RtnSizeDec = SlabSizeDec(MSG_SLAB_THK, MSG_SLAB_WTH,MSG_SLAB_LEN, MSG_SLAB_NO, MSG_PLAN_SLAB_NO, MSG_SLAB_WGT);
- if (RtnSizeDec.equals("N")) {
- SLAB_SIZE_DEC_GRD = "2";
- }else{
- SLAB_SIZE_DEC_GRD = "1";
- }
- }
- // SLAB ROUTE PLATE --> "RGB" SET TO PROG_CD
- // SLAB ROUTE HOT COIL,COIL COIL --> "RBA" SET TO PROG_CD
- String p_slab_status = null;
- // Plate Slab Setting : PROG_CD, and TBD01_SLABDN update
- String PlatSlab = "N";
- // Slab Comm Select
- String sql = "select * from TBG02_SLAB_COMM where SLAB_NO = ?";
- PosParameter paramv = new PosParameter();
- paramv.setWhereClauseParameter(0, MSG_SLAB_NO);
- PosRowSet SlabCommVo = getDao("mesdao").findByQueryStatement(sql,paramv);
- if (SlabCommVo.hasNext()) {
- PosRow SlabCommROW = SlabCommVo.next();
- SlabLoc = (String) SlabCommROW.getAttribute("CUR_LOAD_LOC");
- LocDtime = (String) SlabCommROW.getAttribute("CUR_LOAD_LOC_DTIME");
- SlabStat = (String) SlabCommROW.getAttribute("SLAB_STAT");
- SlabIngrDec = (String) SlabCommROW.getAttribute("SLAB_INGR_DEC_GRD");
- CurProcCd = (String) SlabCommROW.getAttribute("CUR_PROG_CD");
- String SLAB_CUT_DTIME = (String) SlabCommROW.getAttribute("SLAB_CUT_DTIME");
- if (SLAB_CUT_DTIME != null && !SLAB_CUT_DTIME.equals("")) {
- MSG_SLAB_CUT_DTIME = SLAB_CUT_DTIME;
- }
- // 中厚板区分
- PlatSlab = isPlatSlab(SP_SLAB_RT);
- // 是否回送
- if (PlatSlab.equals("Y")) {
- if (SlabIngrDec == null
- || !SlabIngrDec.equals("1")
- || (SLAB_SIZE_DEC_GRD != null && SLAB_SIZE_DEC_GRD
- .equals("2"))) {
- p_slab_status = "01";
- } else {
- p_slab_status = "05";
- }
- if (SP_DSN_SLAB_NO != null) {
- PosParameter paramV = new PosParameter();
- // reject
- paramV.setWhereClauseParameter(0, p_slab_status);
- paramV.setWhereClauseParameter(1, SP_DSN_SLAB_NO);
- this.getDao("mesdao").update(
- "NIG020610_TBD01_SLABDN.update", paramV);
- }
- }
- // 订单 物料进程判断
- if (PlatSlab.equals("Y")) {
- // Plate Slab PROG_CD SET
- CurProcCd = "RGB";
- SP_ORD_NO = null;
- SP_ORD_SEQ = null;
- }else if(MSG_OVER_PLUS_CLF.equals("S")){
- CurProcCd = "RRC";
- SP_ORD_NO = null;
- SP_ORD_SEQ = null;
- NonordCause = "2D";
- MSG_HCR_CLF = "C";
- SP_ORD_FL = "2";
- } else if (SlabIngrDec == null || SlabIngrDec.equals("2")
- || ED_DIFF_STL_GRD_STA_END_YN1.equals("2")) {
- // Chemistry Decision chek and PROG_CD SET
- CurProcCd = "RAB";
- SP_ORD_NO = OrgOrdNo;
- SP_ORD_SEQ = OrgOrdSeq;
- NonordCause = "";
- MSG_HCR_CLF = "C";
- SP_ORD_FL = "1";
- } else if (SLAB_SIZE_DEC_GRD.equals("2")) {
- // Slab Size Decision and PROG_CD SET
- CurProcCd = "RRC";
- SP_ORD_NO = null;
- SP_ORD_SEQ = null;
- NonordCause = "3C";
- MSG_HCR_CLF = "C";
- SP_ORD_FL = "2";
- } else if (SP_ORD_FL != null && SP_ORD_FL.equals("2")) {
- // 计划余才
- CurProcCd = "RRC";
- SP_ORD_NO = null;
- SP_ORD_SEQ = null;
- NonordCause = "1A";
- MSG_HCR_CLF = "C";
- SP_ORD_FL = "2";
- } else if (SP_HCR_CLF != null && SP_HCR_CLF.equals("H")&& SP_MILL_FL.equals("Y")) {
- CurProcCd = "RBB";
- SP_ORD_NO = OrgOrdNo;
- SP_ORD_SEQ = OrgOrdSeq;
- NonordCause = "";
- MSG_HCR_CLF = "H";
- SP_ORD_FL = "1";
- MillSchStat = "";
- } else {
- CurProcCd = "RBA";
- SP_ORD_NO = OrgOrdNo;
- SP_ORD_SEQ = OrgOrdSeq;
- NonordCause = "";
- MSG_HCR_CLF = "C";
- SP_ORD_FL = "1";
- }
- // sSlabWay =
- // DecSlabWay(MSG_SLAB_NO,MSG_HCR_CLF,SP_SLAB_RT,SP_SCARPING_PROC_YN);
- if (CurProcCd == null || CurProcCd.equals("")) {
- CurProcCd = "JJB";
- }
- if (SlabLoc != null
- && (SlabLoc.substring(0, 1).equals("Z") || SlabLoc
- .substring(0, 1).equals("L"))) {
- YardLoc = SlabLoc;
- LocDtime = MSG_SLAB_CUT_DTIME;
- } else {
- if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J2")) {
- SlabLoc = "C0";
- YardLoc = "C0";
- } else {
- SlabLoc = "A0";
- YardLoc = "A0";
- }
- LocDtime = MSG_SLAB_CUT_DTIME;
- }
- if (NonordCause != null && NonordCause.equals("2D")) {
- MSG_HCR_CLF = "C";
- SP_ORD_FL = "2";
- }
- PosParameter param1 = new PosParameter();
- param1.setValueParamter(0, CurProcCd);
- param1.setValueParamter(1, SP_ORD_NO);
- param1.setValueParamter(2, SP_ORD_SEQ);
- param1.setValueParamter(3, SP_ORD_FL);
- param1.setValueParamter(4, SP_STL_GRD);
- param1.setValueParamter(5, SP_PRODNM_CD);
- param1.setValueParamter(6, SP_CUST_CD);
- param1.setValueParamter(7, SP_ORD_USEAGE_CD);
- param1.setValueParamter(8, SP_SPEC_ABBSYM);
- param1.setValueParamter(9, SP_SLAB_THK); //指示规格
- param1.setValueParamter(10, SP_SLAB_WTH);
- param1.setValueParamter(11, SP_SLAB_LEN);
- param1.setValueParamter(12, SP_SLAB_WGT);
- param1.setValueParamter(13, MSG_HCR_CLF);
- param1.setValueParamter(14, SP_ORDCUST_CD);
- param1.setValueParamter(15, MSG_SLAB_THK);
- param1.setValueParamter(16, MSG_SLAB_WTH);
- param1.setValueParamter(17, MSG_SLAB_LEN);
- param1.setValueParamter(18, MSG_SLAB_WGT);
- param1.setValueParamter(19, MSG_SLAB_TEMP);
- param1.setValueParamter(20, MSG_SLAB_CUT_DTIME);
- param1.setValueParamter(21, MSG_LAST_CUT_YN);
- param1.setValueParamter(22, MSG_OVER_PLUS_CLF);
- param1.setValueParamter(23, SP_HCR_CLF);
- param1.setValueParamter(24, MSG_STRAND_NO);
- param1.setValueParamter(25, sSlabWay);
- param1.setValueParamter(26, SP_SLAB_RT);
- param1.setValueParamter(27, MSG_SLAB_WGT);
- param1.setValueParamter(28, SlabLoc);
- param1.setValueParamter(29, LocDtime);
- param1.setValueParamter(30, SP_SLAB_THK);
- param1.setValueParamter(31, SP_SLAB_WTH);
- param1.setValueParamter(32, SP_SLAB_LEN);
- param1.setValueParamter(33, SP_SLAB_WGT);
- param1.setValueParamter(34, sShift);
- param1.setValueParamter(35, sGroup);
- param1.setValueParamter(36, MSG_CCM_NO);
- param1.setValueParamter(37, OrgOrdNo);
- param1.setValueParamter(38, OrgOrdSeq);
- param1.setValueParamter(39, NonordCause);
- param1.setValueParamter(40, MillSchStat);
- param1.setValueParamter(41, SLAB_SIZE_DEC_GRD);
- param1.setValueParamter(42, ED_DIFF_STL_GRD_STA_END_YN1);
- param1.setValueParamter(43, SP_ORD_THK);
- param1.setValueParamter(44, SP_ORD_WTH);
- param1.setValueParamter(45, MSG_SLAB_NO);
- this.getDao("mesdao").update("NIG020610_SLAB_COMM.update", param1);
- setSlabCommD(MSG_SLAB_NO, MSG_SLAB_WGT, SP_ORD_FL, SP_ORD_NO, SP_ORD_SEQ,
- SP_ORD_THK, SP_ORD_WTH);
- // 切割事件
- if (SlabStat != null && SlabStat.equals("1")) {
- PosParameter param8 = new PosParameter();
- String ProcCd = null;
- if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J1")) {
- ProcCd = "S1";
- } else {
- ProcCd = "S2";
- }
- param8.setValueParamter(0, "");
- param8.setValueParamter(1, MSG_SLAB_NO.substring(0, 10));
- param8.setValueParamter(2, SP_STL_GRD);
- param8.setValueParamter(3, "");
- param8.setValueParamter(4, "");
- param8.setValueParamter(5, "");
- param8.setValueParamter(6, "");
- param8.setValueParamter(7, "");
- param8.setValueParamter(8, ProcCd);
- this.getDao("mesdao").insert("NIG020200_SMS_TRACK.update",
- param8);
- }
- } else {
- String InstrOrdFl = SP_ORD_FL;
-
- // 中厚板区分
- PlatSlab = isPlatSlab(SP_SLAB_RT);
- if (PlatSlab.equals("Y")) {
- CurProcCd = "RGB";
- } else {
- CurProcCd = "RRC";
- SP_ORD_NO = null;
- SP_ORD_SEQ = null;
- NonordCause = "2D";
- MSG_HCR_CLF = "C";
- SP_ORD_FL = "2";
- }
- // CURRENT LOCATION SETTING
- // if MC_NO = '1' then "A0" set to CUR_LOAD_LOC culumn of
- // tbg02_slab_comm
- // else set "C0" to CUR_LOAD_LOC culumn of tbg02_slab_comm
- if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J2")) {
- SlabLoc = "C0";
- YardLoc = "C0";
- } else {
- SlabLoc = "A0";
- YardLoc = "A0";
- }
- String sFSlabNo = MSG_SLAB_NO.substring(0, 10) + "010";
- String Fslabsql = "select SLAB_INGR_DEC_GRD,SLAB_INGR_DEC_KIND from TBG02_SLAB_COMM where SLAB_NO = ?";
- PosParameter paramY = new PosParameter();
- paramY.setWhereClauseParameter(0, sFSlabNo);
- PosRowSet fstSlabVo = getDao("mesdao").findByQueryStatement(Fslabsql, paramY);
- String IngDec = null;
- String IngDecKnd = null;
- if (fstSlabVo.hasNext()) {
- PosRow fstSlabVoROW = fstSlabVo.next();
- IngDec = (String) fstSlabVoROW.getAttribute("SLAB_INGR_DEC_GRD");
- IngDecKnd = (String) fstSlabVoROW.getAttribute("SLAB_INGR_DEC_KIND");
- }
- PosParameter param2 = new PosParameter();
- param2.setValueParamter(0, MSG_SLAB_NO);
- param2.setValueParamter(1, MSG_PLAN_SLAB_NO);
- param2.setValueParamter(2, "2");
- param2.setValueParamter(3, CurProcCd);
- param2.setValueParamter(4, "XinSaveSlabComm");
- param2.setValueParamter(5, CurrDate);
- param2.setValueParamter(6, SP_ORD_NO);
- param2.setValueParamter(7, SP_ORD_SEQ);
- param2.setValueParamter(8, SP_ORD_FL);
- param2.setValueParamter(9, SP_STL_GRD);
- param2.setValueParamter(10, SP_PRODNM_CD);
- param2.setValueParamter(11, SP_CUST_CD);
- param2.setValueParamter(12, SP_ORD_USEAGE_CD);
- param2.setValueParamter(13, SP_SPEC_ABBSYM);
- param2.setValueParamter(14, SP_SLAB_THK);
- param2.setValueParamter(15, SP_SLAB_WTH);
- param2.setValueParamter(16, SP_SLAB_LEN);
- param2.setValueParamter(17, SP_SLAB_WGT);
- param2.setValueParamter(18, MSG_HCR_CLF);
- param2.setValueParamter(19, SP_ORDCUST_CD);
- param2.setValueParamter(20, MSG_SLAB_THK);
- param2.setValueParamter(21, MSG_SLAB_WTH);
- param2.setValueParamter(22, MSG_SLAB_LEN);
- param2.setValueParamter(23, MSG_SLAB_WGT);
- param2.setValueParamter(24, MSG_SLAB_TEMP);
- param2.setValueParamter(25, MSG_SLAB_CUT_DTIME);
- param2.setValueParamter(26, MSG_LAST_CUT_YN);
- param2.setValueParamter(27, MSG_OVER_PLUS_CLF);
- param2.setValueParamter(28, SP_HCR_CLF);
- param2.setValueParamter(29, MSG_STRAND_NO);
- param2.setValueParamter(30, ED_DIFF_STL_GRD_STA_END_YN1);
- param2.setValueParamter(31, sSlabWay);
- param2.setValueParamter(32, SP_SLAB_RT);
- param2.setValueParamter(33, MSG_SLAB_WGT);
- param2.setValueParamter(34, SlabLoc);
- param2.setValueParamter(35, MSG_SLAB_CUT_DTIME);
- param2.setValueParamter(36, SP_SLAB_THK);
- param2.setValueParamter(37, SP_SLAB_WTH);
- param2.setValueParamter(38, SP_SLAB_LEN);
- param2.setValueParamter(39, SP_SLAB_WGT);
- param2.setValueParamter(40, sShift);
- param2.setValueParamter(41, sGroup);
- param2.setValueParamter(42, InstrOrdFl);
- param2.setValueParamter(43, NonordCause);
- param2.setValueParamter(44, MSG_CCM_NO);
- param2.setValueParamter(45, OrgOrdNo);
- param2.setValueParamter(46, OrgOrdSeq);
- param2.setValueParamter(47, MillSchStat);
- param2.setValueParamter(48, SLAB_SIZE_DEC_GRD);
- param2.setValueParamter(49, IngDec);
- param2.setValueParamter(50, IngDecKnd);
- this.getDao("mesdao").update("NIG020610_SLAB_COMM.insert", param2);
- PosParameter param5 = new PosParameter();
- param5.setWhereClauseParameter(0, SP_SLAB_EDT_SEQ);
- PosRowSet SlabSpecDVo = getDao("mesdao").find("NIG020610_SPEC_SLAB_D.select", param5);
- while (SlabSpecDVo.hasNext()) {
- PosRow SlabSpecDROW = SlabSpecDVo.next();
- String D_SLAB_CUT_SEQ = (String) SlabSpecDROW.getAttribute("SLAB_CUT_SEQ");
- Number D_SLAB_THK = (Number) SlabSpecDROW.getAttribute("SLAB_THK");
- Number D_SLAB_WTH = (Number) SlabSpecDROW.getAttribute("SLAB_WTH");
- Number D_SLAB_LEN = (Number) SlabSpecDROW.getAttribute("SLAB_LEN");
- Number D_ORD_THK = (Number) SlabSpecDROW.getAttribute("ORD_THK");
- Number D_ORD_WTH = (Number) SlabSpecDROW.getAttribute("ORD_WTH");
- Number D_ORD_LEN = (Number) SlabSpecDROW.getAttribute("ORD_LEN");
- Number D_ORD_WGT = (Number) SlabSpecDROW.getAttribute("ORD_WGT");
- Number D_COIL_INDIA = (Number) SlabSpecDROW.getAttribute("COIL_INDIA");
- Number D_COIL_OUTDIA = (Number) SlabSpecDROW.getAttribute("COIL_OUTDIA");
- String D_ORD_NO = (String) SlabSpecDROW.getAttribute("ORD_NO");
- String D_ORD_SEQ = (String) SlabSpecDROW.getAttribute("ORD_SEQ");
- String D_ORD_FL = (String) SlabSpecDROW.getAttribute("ORD_FL");
- PosParameter param6 = new PosParameter();
- param6.setValueParamter(0, MSG_SLAB_NO);
- param6.setValueParamter(1, D_SLAB_CUT_SEQ);
- param6.setValueParamter(2, D_SLAB_THK);
- param6.setValueParamter(3, D_SLAB_WTH);
- param6.setValueParamter(4, D_SLAB_LEN);
- param6.setValueParamter(5, D_ORD_THK);
- param6.setValueParamter(6, D_ORD_WTH);
- param6.setValueParamter(7, D_ORD_LEN);
- param6.setValueParamter(8, D_ORD_WGT);
- param6.setValueParamter(9, D_COIL_INDIA);
- param6.setValueParamter(10, D_COIL_OUTDIA);
- param6.setValueParamter(11, D_ORD_NO);
- param6.setValueParamter(12, D_ORD_SEQ);
- param6.setValueParamter(13, "2");
- this.getDao("mesdao").update("NIG020610_SLAB_COMM_D.insert",param6);
- }
- PosParameter paramz = new PosParameter();
- String ProcCd = null;
- if (MSG_CCM_NO != null && MSG_CCM_NO.equals("J1")) {
- ProcCd = "S1";
- } else {
- ProcCd = "S2";
- }
- paramz.setValueParamter(0, "");
- paramz.setValueParamter(1, MSG_SLAB_NO.substring(0, 10));
- paramz.setValueParamter(2, SP_STL_GRD);
- paramz.setValueParamter(3, "");
- paramz.setValueParamter(4, "");
- paramz.setValueParamter(5, "");
- paramz.setValueParamter(6, "");
- paramz.setValueParamter(7, "");
- paramz.setValueParamter(8, ProcCd);
- this.getDao("mesdao").insert("NIG020200_SMS_TRACK.update", paramz);
- }
- // if (MSG_SLAB_LOC != null
- // && (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("6"))) {
- // if (MSG_OVER_PLUS_CLF == null || MSG_OVER_PLUS_CLF.equals("")) {
- // SendProg_NIE012070(MSG_SLAB_NO, SP_ORD_NO, SP_ORD_SEQ, SP_ORD_NO,SP_ORD_SEQ, CurProcCd, "", "TM", MSG_SLAB_WGT);
- // }
- // }
- String RejKind = null;
- // Mill Scheduling slab check and 'H'->'C' check and send to Mill
- // Scheduling reject request
- if (SP_MILL_FL != null && SP_MILL_FL.equals("Y")) {
- if (SLAB_SIZE_DEC_GRD.equals("2")) {
- RejKind = "Z";
- SendProg_NIF024060(MSG_SLAB_NO, RejKind);
- } else if ((SlabIngrDec != null && SlabIngrDec.equals("2"))|| (SP_HCR_CLF.equals("H") && MSG_HCR_CLF.equals("C"))) {
- RejKind = "M";
- SendProg_NIF024060(MSG_SLAB_NO, RejKind);
- }
- }
- PosParameter paramA = new PosParameter();
- paramA.setWhereClauseParameter(0, MSG_PLAN_SLAB_NO);
- PosRowSet SpecChVo = getDao("mesdao").find(
- "NIG020610_SLAB_SPEC.select", paramA);
- while (SpecChVo.hasNext()) {
- PosRow SpecChROW = SpecChVo.next();
- Number nSlabEdtSeq = (Number) SpecChROW
- .getAttribute("SLAB_EDT_SEQ");
- String SlabManaNo = (String) SpecChROW.getAttribute("SLAB_MANA_NO");
- PosParameter param7 = new PosParameter();
- param7.setValueParamter(0, "C");
- param7.setValueParamter(1, SlabManaNo);
- this.getDao("mesdao").update("NIG020610_SPEC_SLAB.update", param7);
- PosParameter param8 = new PosParameter();
- param8.setValueParamter(0, "C");
- param8.setValueParamter(1, nSlabEdtSeq);
- this.getDao("mesdao")
- .update("NIG020610_SPEC_SLAB_D.update", param8);
- }
- String chargcomm = "SELECT CUR_PROG_CD,BEF_PROG_CD,CHARGE_WGT FROM TBG02_CHARGE_COMM WHERE CHARGE_NO = ? ";
- PosParameter param0 = new PosParameter();
- param0.setWhereClauseParameter(0, MSG_SLAB_NO.substring(0, 10));
- PosRowSet ChVO = this.getDao("mesdao").findByQueryStatement(chargcomm,
- param0);
- String PR_BEF_PROG_CD = null;
- Number PR_CHARGE_WGT = null;
- if (ChVO.hasNext()) {
- PosRow ChROW = ChVO.next();
- PR_BEF_PROG_CD = (String) ChROW.getAttribute("BEF_PROG_CD");
- PR_CHARGE_WGT = (Number) ChROW.getAttribute("CHARGE_WGT");
- }
- if (MSG_SLAB_LOC != null
- && (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("6"))) {
- if (MSG_OVER_PLUS_CLF == null || MSG_OVER_PLUS_CLF.equals("")) {
- SendProg_NIE012070(MSG_PLAN_SLAB_NO.substring(0, 10), "", "","", "", "JJB", PR_BEF_PROG_CD, "CH", PR_CHARGE_WGT);
- }
- }
- // Last slab check and the set end mark to charge master and spec
- // slab,spec charge
- if (MSG_LAST_CUT_YN != null && MSG_LAST_CUT_YN.equals("E")) {
- LastSlabCut(MSG_SLAB_NO, MSG_PLAN_SLAB_NO, SP_MILL_FL, SP_SLAB_RT,SP_DSN_SLAB_NO);
- SendProg_NIE012070(MSG_PLAN_SLAB_NO.substring(0, 10), "", "", "","", "JJB", PR_BEF_PROG_CD, "CH", PR_CHARGE_WGT);
- }
- SendProg_NIE012080();
- // yard map update
- if (YardLoc != null && (YardLoc.equals("A0") || YardLoc.equals("C0"))) {
- PosParameter param13 = new PosParameter();
- param13.setWhereClauseParameter(0, MSG_SLAB_NO);
- param13.setWhereClauseParameter(1, SlabLoc);
- PosRowSet slabExistVo = getDao("mesdao").find("NIG020610_YARD_SLAB_EXIST.select", param13);
- if (!slabExistVo.hasNext()) {
- PosParameter param15 = new PosParameter();
- param15.setWhereClauseParameter(0, SlabLoc);
- param15.setWhereClauseParameter(1, MSG_SLAB_NO);
- PosRowSet YardMapVo = getDao("mesdao").find("NIG020610_YARD.select", param15);
- while (YardMapVo.hasNext()) {
- PosRow YardMapROW = YardMapVo.next();
- String YARD_ADDR = (String) YardMapROW.getAttribute("YARD_ADDR");
- String YARD_LAY = (String) YardMapROW.getAttribute("YARD_LAY");
- String SLAB_NO = (String) YardMapROW.getAttribute("SLAB_NO");
- String LINE_ADDR = YARD_ADDR + YARD_LAY;
- PosParameter param16 = new PosParameter();
- param16.setValueParamter(0, SLAB_NO);
- param16.setValueParamter(1, LINE_ADDR);
- this.getDao("mesdao").update("NIG020610_YARD.update",param16);
- }
- String UpdLoc = YardLoc + "01";
- PosParameter param14 = new PosParameter();
- param14.setValueParamter(0, MSG_SLAB_NO);
- param14.setValueParamter(1, UpdLoc);
- this.getDao("mesdao").update("NIG020610_YARD.update", param14);
- }
- }
- // if (MSG_SLAB_LOC != null && (MSG_SLAB_LOC.equals("5") || MSG_SLAB_LOC.equals("6"))) {
- // SendProg_NIG020640(MSG_SLAB_NO, SP_STL_GRD, MSG_SLAB_LOC);
- // }
- // if (MSG_SLAB_LOC != null && MSG_SLAB_LOC.equals("6")) {
- // updateRHFL1(MSG_SLAB_NO, MSG_HCR_CLF);
- // }
-
- return PosBizControlConstants.SUCCESS;
- }
- public void setSlabCommD(String SlabNo, Number SlabWgt, String OrdFl,
- String ordNo, String ordSeq, Number ordThk, Number ordWth) {
- PosParameter paramz = new PosParameter();
- paramz.setValueParamter(0, OrdFl);
- paramz.setValueParamter(1, ordNo);
- paramz.setValueParamter(2, ordSeq);
- paramz.setValueParamter(3, ordThk);
- paramz.setValueParamter(4, ordWth);
- paramz.setValueParamter(5, SlabNo);
- this.getDao("mesdao").update("NIG020610_SLAB_COMM_D.update", paramz);
- }
- public void SlabSpecEdit(String PlanSlabNo) {
- PosParameter param = new PosParameter();
- param.setWhereClauseParameter(0, PlanSlabNo);
- PosRowSet SlabSpecVo = getDao("mesdao").find(
- "NIG020610_SLAB_SPEC.select", param);
- if (SlabSpecVo.hasNext()) {
- PosRow SlabSpecRow = SlabSpecVo.next();
- SP_SLAB_EDT_SEQ = (Number) SlabSpecRow.getAttribute("SLAB_EDT_SEQ");
- SP_CHARGE_SLAB_SEQ = (Number) SlabSpecRow
- .getAttribute("CHARGE_SLAB_SEQ");
- SP_SLAB_MANA_NO = (String) SlabSpecRow.getAttribute("SLAB_MANA_NO");
- SP_PRODNM_CD = (String) SlabSpecRow.getAttribute("PRODNM_CD");
- SP_STL_GRD = (String) SlabSpecRow.getAttribute("STL_GRD");
- SP_SLAB_RT = (String) SlabSpecRow.getAttribute("SLAB_RT");
- SP_SLAB_THK = (Number) SlabSpecRow.getAttribute("SLAB_THK");
- SP_SLAB_WTH = (Number) SlabSpecRow.getAttribute("SLAB_WTH");
- SP_SLAB_LEN = (Number) SlabSpecRow.getAttribute("SLAB_LEN");
- SP_SLAB_WGT = (Number) SlabSpecRow.getAttribute("SLAB_WGT");
- SP_HCR_CLF = (String) SlabSpecRow.getAttribute("HCR_CLF");
- SP_ORD_FL = (String) SlabSpecRow.getAttribute("ORD_FL");
- SP_ORD_NO = (String) SlabSpecRow.getAttribute("ORD_NO");
- SP_ORD_SEQ = (String) SlabSpecRow.getAttribute("ORD_SEQ");
- SP_ORD_THK = (Number) SlabSpecRow.getAttribute("ORD_THK");
- SP_ORD_WTH = (Number) SlabSpecRow.getAttribute("ORD_WTH");
- SP_ORD_LEN = (Number) SlabSpecRow.getAttribute("ORD_LEN");
- SP_ORD_WGT = (Number) SlabSpecRow.getAttribute("ORD_WGT");
- SP_COIL_INDIA = (Number) SlabSpecRow.getAttribute("COIL_INDIA");
- SP_COIL_OUTDIA = (Number) SlabSpecRow.getAttribute("COIL_OUTDIA");
- SP_ORD_USEAGE_CD = (String) SlabSpecRow
- .getAttribute("ORD_USEAGE_CD");
- SP_CUST_CD = (String) SlabSpecRow.getAttribute("CUST_CD");
- SP_ORDCUST_CD = (String) SlabSpecRow.getAttribute("ORDCUST_CD");
- SP_SPEC_ABBSYM = (String) SlabSpecRow.getAttribute("SPEC_ABBSYM");
- SP_SCARPING_PROC_YN = (String) SlabSpecRow
- .getAttribute("SCARPING_PROC_YN");
- SP_MILL_FL = (String) SlabSpecRow.getAttribute("MILL_FL");
- SP_DSN_SLAB_NO = (String) SlabSpecRow.getAttribute("DSN_SLAB_NO");
- }
- }
- public BigDecimal calWgt(BigDecimal SlabThk, BigDecimal SlabWth,
- BigDecimal Slab_Len) {
- BigDecimal SLAB_WGT = new BigDecimal(0);
- if (SlabThk != null && SlabWth != null && Slab_Len != null) {
- PosParameter paramP = new PosParameter();
- paramP.setWhereClauseParameter(0, SlabThk);
- paramP.setWhereClauseParameter(1, SlabWth);
- paramP.setWhereClauseParameter(2, Slab_Len);
- PosRowSet CalWgtVo = getDao("mesdao").findByQueryStatement(
- "UIG02COMM_CACUL_SLAB_WGT.select", paramP);
- if (CalWgtVo.hasNext()) {
- PosRow CalWgtROW = CalWgtVo.next();
- SLAB_WGT = (BigDecimal) CalWgtROW.getAttribute("CAL_WGT");
- }
- }
- return SLAB_WGT;
- }
- public String isPlatSlab(String SlabRt) {
- String RtCd = null;
- if (SlabRt != null && (SlabRt.equals("P") || SlabRt.equals("Z"))) {
- RtCd = "Y";
- } else {
- RtCd = "N";
- }
- return RtCd;
- }
- public void LastSlabCut(String SlabNo, String PlanSlabNo, String MillFl,
- String SlabRt, String DsnSlabNo) {
- PosParameter param9 = new PosParameter();
- param9.setValueParamter(0, "C");
- param9.setValueParamter(1, "JJB");
- param9.setValueParamter(2, "3" + SlabNo.substring(1, 10));
- this.getDao("mesdao").update("NIG020610_SPEC_CHARGE.update", param9);
- PosParameter param10 = new PosParameter();
- param10.setValueParamter(0, "C");
- param10.setValueParamter(1, "3" + SlabNo.substring(1, 10));
- this.getDao("mesdao").update("NIG020610_SPEC_CHARGE_IDX.update",
- param10);
- PosParameter param11 = new PosParameter();
- param11.setValueParamter(0, "3");
- param11.setValueParamter(1, "JJB");
- param11.setValueParamter(2, "NIG020610");
- param11.setValueParamter(3, SlabNo.substring(0, 10));
- this.getDao("mesdao").update("NIG020610_CHARGE_COMM.update", param11);
- PosParameter param12 = new PosParameter();
- param12.setValueParamter(0, "3");
- param12.setValueParamter(1, SlabNo.substring(0, 10));
- this.getDao("mesdao").update("NIG020610_STLMAKE_PROG.update", param12);
- // if slab cutting result less than slab schedule then reminding
- // schedule should be finished
- PosParameter paramB = new PosParameter();
- paramB.setWhereClauseParameter(0, "3" + SlabNo.substring(1, 10));
- PosRowSet LastSlabVo = getDao("mesdao").find(
- "NIG020610_SPEC_LAST_SLAB.select", paramB);
- if (LastSlabVo.hasNext()) {
- PosRow LastSlabROW = LastSlabVo.next();
- String SLAB_EDIT_NO = (String) LastSlabROW
- .getAttribute("SLAB_EDIT_NO");
- if (SlabNo.substring(10, 13).compareTo(SLAB_EDIT_NO) < 0) {
- PosParameter paramC = new PosParameter();
- paramC.setWhereClauseParameter(0, SlabNo);
- paramC.setWhereClauseParameter(1, SlabNo);
- PosRowSet remSlabVo = getDao("mesdao").find(
- "NIG020610_REM_SLAB.select", paramC);
- while (remSlabVo.hasNext()) {
- PosRow remSlabROW = remSlabVo.next();
- String RemSlabNo = (String) remSlabROW
- .getAttribute("SLAB_NO");
- String RemPlnSlabNo = (String) remSlabROW
- .getAttribute("PLAN_SLAB_NO");
- String RemDsnSlabNo = (String) remSlabROW
- .getAttribute("DSN_SLAB_NO");
- String RemMillFl = (String) remSlabROW
- .getAttribute("MILL_FL");
- if (RemMillFl != null && RemMillFl.equals("Y")) {
- SendProg_NIF024060(RemSlabNo, "M");
- }
- PosParameter param13 = new PosParameter();
- param13.setValueParamter(0, "5");
- param13.setValueParamter(1, "3");
- param13.setValueParamter(2, RemSlabNo);
- this.getDao("mesdao").update("NIG020610_SLAB_END.update",
- param13);
- param13 = new PosParameter();
- param13.setValueParamter(0, RemSlabNo);
- this.getDao("mesdao").update("NIG020610_SLAB_END_D.update",
- param13);
- PosParameter paramD = new PosParameter();
- paramD.setWhereClauseParameter(0, RemPlnSlabNo);
- PosRowSet remSpecVo = getDao("mesdao").find(
- "NIG020610_SLAB_SPEC.select", paramD);
- while (remSpecVo.hasNext()) {
- PosRow remSpecROW = remSpecVo.next();
- Number nSlabEdtSeq = (Number) remSpecROW
- .getAttribute("SLAB_EDT_SEQ");
- String SlabManaNo = (String) remSpecROW
- .getAttribute("SLAB_MANA_NO");
- PosParameter paramE = new PosParameter();
- paramE.setValueParamter(0, "C");
- paramE.setValueParamter(1, SlabManaNo);
- this.getDao("mesdao").update(
- "NIG020610_SPEC_SLAB.update", paramE);
- PosParameter paramF = new PosParameter();
- paramF.setValueParamter(0, "C");
- paramF.setValueParamter(1, nSlabEdtSeq);
- this.getDao("mesdao").update(
- "NIG020610_SPEC_SLAB_D.update", paramF);
- }
- if (SlabRt.equals("P") || SlabRt.equals("Z")) {
- PosParameter paramV = new PosParameter();
- paramV.setWhereClauseParameter(0, "01");
- paramV.setWhereClauseParameter(1, RemDsnSlabNo);
- this.getDao("mesdao").update(
- "NIG020610_TBD01_SLABDN.update", paramV);
- }
- }
- }
- }
- }
- public String DiffStlGrd(String Slabno, String McNo, String StlGrd) {
- String Get_StlGrd = null;
- PosParameter param3 = new PosParameter();
- param3.setWhereClauseParameter(0, Slabno.substring(0, 10));
- param3.setWhereClauseParameter(1, McNo);
- param3.setWhereClauseParameter(2, Slabno.substring(0, 10));
- PosRowSet DiffStlGrdVO = getDao("mesdao").find(
- "NIG020610_DIFF_STL_GRD.select", param3);
- if (DiffStlGrdVO.hasNext()) {
- PosRow DiffStlGrdROW = DiffStlGrdVO.next();
- Get_StlGrd = (String) DiffStlGrdROW.getAttribute("STL_GRD");
- if (StlGrd != null && Get_StlGrd != null) {
- if (!StlGrd.equals(Get_StlGrd)) {
- return Get_StlGrd;
- }
- }
- return null;
- }
- return null;
- }
- public String DecSlabWay(String Slabno, String hcrcd, String slabrt,
- String sf) {
- String way = null;
- if (hcrcd != null && hcrcd.equals("C")) {
- if ((sf != null && sf.equals("Y"))
- || (slabrt != null && slabrt.equals("P"))) {
- way = "1";
- } else {
- way = "2";
- }
- } else {
- way = "3";
- }
- return way;
- }
- // SLAB SIZE DECISION ( RESULT SLAB WGT,ORDER WGT COMPARE)
- // TBG02_SLAB_COMM--> SLAB_WGT
- // TBG02_SLAB_COMM_D --> ORD_NO,ORD_SEQ
- // TBA01_ORD_LINE --> PROD_WGT_MIN,PROD_WGT_MAX
- public String SlabSizeDec(String SlabNo, String PlanSlabNo, Number SlabWgt) {
- logger.logInfo("XinSaveSlabComm runActivity SlabSizeDec:");
- BigDecimal SLAB_WGT = new BigDecimal(SlabWgt.doubleValue());
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, SlabNo);
- PosRowSet CommDVO = getDao("mesdao").find(
- "NIG020610_SLAB_COMM_D.select", param1);
- if (CommDVO.hasNext()) {
- PosRow CommDROW = CommDVO.next();
- BigDecimal PROD_WGT_MIN = (BigDecimal) CommDROW
- .getAttribute("PROD_WGT_MIN");
- BigDecimal PROD_WGT_MAX = (BigDecimal) CommDROW
- .getAttribute("PROD_WGT_MAX");
- logger.logInfo("XinSaveSlabComm runActivity PROD_WGT_MIN:"
- + PROD_WGT_MIN);
- if ((PROD_WGT_MIN != null && !PROD_WGT_MIN.equals(""))
- && (PROD_WGT_MAX != null && !PROD_WGT_MAX.equals(""))) {
- if (SLAB_WGT.compareTo(PROD_WGT_MIN) < 0
- || PROD_WGT_MAX.compareTo(SLAB_WGT) < 0) {
- return "N";
- }
- }
- }
- return "Y";
- }
- public PosContext SendProg_NIE012070(String MatNo, String sOrdNo,
- String sOrdSeq, String sBefOrdNo, String sBefOrdSeq,
- String sProgCd, String BefProcCd, String sKind, Number nwgt) {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
- String TcId = "NIE012070";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("BEF_ORD_NO", sBefOrdNo);
- message.setObject("BEF_ORD_SEQ", sBefOrdSeq);
- message.setObject("ORD_NO", sOrdNo);
- message.setObject("ORD_SEQ", sOrdSeq);
- message.setObject("BEF_PROG_CD", BefProcCd);
- message.setObject("PROG_CD", sProgCd);
- message.setObject("MAT_TYPE", sKind);
- message.setObject("MAT_NO", MatNo);
- message.setObject("WGT", nwgt);
- message.setObject("PGMID", "XinSaveSlabComm");
- message.setObject("REG_ID", "CCM L2");
- message.setTCID(TcId);
- context.setMessage(message);
- // this.processComponent(PosConstants.CREATE_MESSAGE, context);
- // String transactionCode = context.getMessage().getTC();
- String SERVICE_POSTFIX = "-service";
- context
- .put(PosBizControlConstants.SERVICE_NAME, TcId
- + SERVICE_POSTFIX);
- // context.setMessage(message);
- PosBizControlIF controller = PosBizProvider.getController();
- controller.doSubController(context, false);
- return null;
- }
- public PosContext SendProg_NIE012080() {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
- String TcId = "NIE012080";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("AA", null);
- context.setMessage(message);
- this.processComponent(PosConstants.CREATE_MESSAGE, context);
- String transactionCode = context.getMessage().getTC();
- message.setTCID(TcId);
- String serviceName = "NIE012080";
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, serviceName
- + SERVICE_POSTFIX);
- context.setMessage(message);
- PosBizControlIF controller = PosBizProvider.getController();
- controller.doSubController(context, false);
- return null;
- }
- public PosContext SendProg_NIG020640(String SlabNo, String Stlgrd,
- String SlabLoc) {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
- String TcId = "NIG020640";
- // message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("SLAB_NO", SlabNo);
- message.setObject("STL_GRD", Stlgrd);
- message.setObject("SLAB_LOC", SlabLoc);
- message.setTCID(TcId);
- context.setMessage(message);
- // this.processComponent(PosConstants.CREATE_MESSAGE, context);
- // String transactionCode = context.getMessage().getTC();
- String serviceName = "NIG020640";
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, serviceName
- + SERVICE_POSTFIX);
- // context.setMessage(message);
- PosBizControlIF controller = PosBizProvider.getController();
- controller.doSubController(context, false);
- return null;
- }
- // call mill scheduling reject service class
- public void SendProg_NIF024060(String SlabNo, String RejType) {
- logger.logInfo("PosSaveMissionNo SendProg_NIF024060 ");
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
- String TcId = "NIF024060";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("TYPE", RejType);
- message.setObject("FROM", SlabNo);
- message.setObject("TO", SlabNo);
- message.setObject("REG_ID", "NIG020610");
- context.setMessage(message);
- this.processComponent(PosConstants.CREATE_MESSAGE, context);
- String transactionCode = context.getMessage().getTC();
- message.setTCID(TcId);
- String serviceName = "NIF024060";
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, serviceName
- + SERVICE_POSTFIX);
- context.setMessage(message);
- PosBizControlIF controller = PosBizProvider.getController();
- controller.doSubController(context, false);
- }
- // call mill scheduling reject service class
- public void searchBeforeEnd(String SlabNo, String CCM_NO, String PlanSlabNo) {
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, SlabNo);
- param1.setWhereClauseParameter(1, CCM_NO);
- PosRowSet LastCutVO = getDao("mesdao").find(
- "NIG020610_LAST_CUT.select", param1);
- if (LastCutVO.hasNext()) {
- PosRow LastCutROW = LastCutVO.next();
- String CutCnt = (String) LastCutROW.getAttribute("LAST_SLAB_YN");
- String SLAB_NO = (String) LastCutROW.getAttribute("SLAB_NO");
- String SLAB_RT = (String) LastCutROW.getAttribute("SLAB_RT");
- String PLAN_CHARGE_NO = (String) LastCutROW
- .getAttribute("PLAN_CHARGE_NO");
- if (CutCnt.equals("0")) {
- LastSlabCut(SLAB_NO, PLAN_CHARGE_NO + "010", "", SLAB_RT, "");
- PosParameter paramz = new PosParameter();
- paramz.setValueParamter(0, "E");
- paramz.setValueParamter(1, SLAB_NO);
- this.getDao("mesdao").update("NIG020610_SLAB_COMM_LAST.update",
- paramz);
- }
- }
- }
- // RHF Level1,Level2 Slab Take In Sending
- public void updateRHFL1(String SlabNo, String HcrFl) {
- HcrFl = "H";
- String DestPos = null;
- if (HcrFl != null && HcrFl.equals("H")) {
- DestPos = "A7";
- } else {
- DestPos = "A1";
- }
- PosParameter paramz = new PosParameter();
- paramz.setValueParamter(0, "FML010");
- paramz.setValueParamter(1, SlabNo);
- paramz.setValueParamter(2, "A1");
- paramz.setValueParamter(3, HcrFl);
- paramz.setValueParamter(4, DestPos);
- this.getDao("mesdao").update("UIG040042_L1_TAKEIN.insert", paramz);
- }
- public String SlabSizeDec(BigDecimal slabThk, BigDecimal slabWth,
- BigDecimal slabLen, String SlabNo, String PlanSlabNo,
- BigDecimal SlabWgt) {
- logger.logInfo("XinSaveSlabComm SlabWgt:" + SlabWgt);
- BigDecimal SlabThk = slabThk;
- BigDecimal SlabWth = slabWth;
- BigDecimal SlabLen = slabLen;
-
- BigDecimal ordThk = new BigDecimal(0);
- BigDecimal ordWth = new BigDecimal(0);
- BigDecimal ordLen = new BigDecimal(0);
- BigDecimal ordWgt = new BigDecimal(0);
- BigDecimal coilOutDia = new BigDecimal(0);
- BigDecimal coilInDia = new BigDecimal(0);
-
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, SlabNo);
- PosRowSet CommDVO = getDao("mesdao").find(
- "NIG020610_SLAB_COMM_D.select", param1);
- PosRowSet CommDVO2 = getDao("mesdao").find(
- "UIG020060_SLAB_COMMD_ORD.select", param1);
- if (CommDVO2.hasNext()) {
- PosRow row = CommDVO2.next();
- ordThk = (BigDecimal) row.getAttribute("ORD_THK");
- ordWth = (BigDecimal) row.getAttribute("ORD_WTH");
- coilInDia = (BigDecimal) row.getAttribute("COIL_INDIA");
- }
- BigDecimal total = ordWth.add(new BigDecimal(100));
- if (SlabWth.compareTo(ordWth) < 0 || total.compareTo(SlabWth) < 0) {
- return "N";
- }
- param1 = new PosParameter();
- PosRowSet rateVo = getDao("mesdao").find("UIG020060_proc_rate.select",
- param1);
- BigDecimal procRate = new BigDecimal(1);
- if (rateVo.hasNext()) {
- PosRow posrow = rateVo.next();
- procRate = (BigDecimal) posrow.getAttribute("PROC_RATE");
- }
- if (CommDVO.hasNext()) {
- PosRow CommDROW = CommDVO.next();
- BigDecimal PROD_WGT_MIN = (BigDecimal) CommDROW
- .getAttribute("PROD_WGT_MIN");
- BigDecimal PROD_WGT_MAX = (BigDecimal) CommDROW
- .getAttribute("PROD_WGT_MAX");
- logger.logInfo("XinSaveSlabComm PROD_WGT_MIN:" + PROD_WGT_MIN);
- logger.logInfo(PROD_WGT_MIN);
- logger.logInfo(PROD_WGT_MAX);
- ordWgt = SlabWgt.multiply(procRate);
- ordWgt = ordWgt.divide(new BigDecimal(100));
- logger.logInfo("XinSaveSlabComm ordWgt:" + ordWgt);
- if (PROD_WGT_MIN == null)
- PROD_WGT_MIN = new BigDecimal(0);
- if (PROD_WGT_MAX == null)
- PROD_WGT_MAX = new BigDecimal(300000);
- // 如果板坯重量不在订单重量范围内
- if (ordWgt.compareTo(PROD_WGT_MIN) < 0
- || PROD_WGT_MAX.compareTo(ordWgt) < 0) {
- // 取消订单
- return "N";
- }
- }
- logger.logInfo("ordWgt=" + ordWgt);
- logger.logInfo("ordThk=" + ordThk);
- logger.logInfo("SlabWth=" + SlabWth);
- ordLen = ordWgt.multiply(new BigDecimal(1000000));
- ordLen = ordLen.divide(ordThk, 3, BigDecimal.ROUND_HALF_UP);
- ordLen = ordLen.divide(ordWth, 3, BigDecimal.ROUND_HALF_UP);
- ordLen = ordLen.divide(new BigDecimal(7.8), 0,BigDecimal.ROUND_HALF_UP);
- coilOutDia = new BigDecimal(Math.sqrt(ordWgt.multiply(
- new BigDecimal(1000000).multiply(new BigDecimal(4)).divide(
- new BigDecimal(7.8 * 3.14 * 0.98), 3,
- BigDecimal.ROUND_HALF_UP).divide(ordWth, 0,
- BigDecimal.ROUND_HALF_UP)).add(
- coilInDia.multiply(coilInDia)).doubleValue()));
- param1 = new PosParameter();
- param1.setWhereClauseParameter(0, slabThk);
- param1.setWhereClauseParameter(1, slabWth);
- param1.setWhereClauseParameter(2, slabLen);
- param1.setWhereClauseParameter(3, ordLen);
- param1.setWhereClauseParameter(4, ordWgt);
- param1.setWhereClauseParameter(5, coilOutDia);
- param1.setWhereClauseParameter(6, SlabNo);
- int rowset = getDao("mesdao").update("UIG020060_slab_comm_d.update",param1);
- return "Y";
- }
- }
|