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"; } }