package xin.glue.nui.G.G02; import java.math.BigDecimal; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRow; import com.posdata.glue.dao.vo.PosRowSet; import com.posdata.glue.msg.PosMessage; /* * author:wangxiaoyan * Date:08-10-28 * desc:接收LF炉实绩的电文信息 更新LF炉实绩表 TBG02_CAS_RESULT以后 相应的修改炼钢公共表 TBG02_CHARGE_COMM */ public class XinSaveLFProcChargeComm extends PosActivity { public String runActivity(PosContext context) { PosMessage message = context.getMessage(); // 从电文中获取的数据项 String chargeNo = (String) message.get("CHARGE_NO"); String planChargeNo = (String) message.get("PLAN_CHARGE_NO"); String lfNo = (String) message.get("LF_NO"); BigDecimal arrvWgt = (BigDecimal) message.get("ARRV_WGT"); BigDecimal lfTreatWgt = (BigDecimal) message.get("LF_TREAT_WGT"); int chLth = chargeNo.trim().length(); if (chLth < 10 ) { logger.logInfo("XinSaveLFProcChargeComm CHARGE_NO ERROR !!!!-->"+chargeNo ); return PosBizControlConstants.SUCCESS; } // 从炉次参数表 TBF01_SPEC_CHARGE 查询出来的数据项 用于插入 炉次参数表 String lineProcCd = ""; String prodnmCd = ""; String stlGrd = ""; String hcrClf = ""; String castManaNo = ""; BigDecimal castChargeSeq = null; BigDecimal castEdtChargeCnt = null; PosParameter param0 = new PosParameter(); PosParameter param1 = new PosParameter(); PosParameter param2 = new PosParameter(); param2.setWhereClauseParameter(0, planChargeNo); PosRowSet rowset2 = this.getDao("mesdao").find("NIG020510_02.select", param2); if (rowset2.hasNext()) { PosRow row2 = rowset2.next(); lineProcCd = (String) row2.getAttribute("LINE_PROC_CD"); prodnmCd = (String) row2.getAttribute("PRODNM_CD"); stlGrd = (String) row2.getAttribute("STL_GRD"); hcrClf = (String) row2.getAttribute("HCR_CLF"); castManaNo = (String) row2.getAttribute("CAST_MANA_NO"); castChargeSeq = (BigDecimal) row2.getAttribute("CAST_CHARGE_SEQ"); castEdtChargeCnt = (BigDecimal) row2 .getAttribute("CAST_EDT_CHARGE_CNT"); } param0.setWhereClauseParameter(0, chargeNo); PosRowSet rowset0 = this.getDao("mesdao").find("NIG020510_03.select", param0); if (rowset0.hasNext()) { PosRow rowsetROW = rowset0.next(); String currProgCd = (String) rowsetROW.getAttribute("CUR_PROG_CD"); String befProgCd = (String) rowsetROW.getAttribute("BEF_PROG_CD"); String CHARGE_STAT = (String) rowsetROW.getAttribute("CHARGE_STAT"); if (CHARGE_STAT != null && CHARGE_STAT.equals("2")) { if (currProgCd != null) { if (currProgCd.equals("JRF")) { currProgCd = "JLF"; befProgCd = "JRF"; } else if (currProgCd.equals("JLF")) { currProgCd = "JLF"; } else if (!currProgCd.equals("JJB")) { befProgCd = currProgCd; currProgCd = "JLF"; } } else { currProgCd = "JLF"; befProgCd = "JBB"; } param1.setWhereClauseParameter(0, lfNo); param1.setWhereClauseParameter(1, currProgCd); param1.setWhereClauseParameter(2, befProgCd); param1.setWhereClauseParameter(3, arrvWgt); param1.setWhereClauseParameter(4, lfTreatWgt); param1.setWhereClauseParameter(5, lfTreatWgt); param1.setWhereClauseParameter(6, chargeNo); this.getDao("mesdao").update("NIG020510_02.update", param1); } } else { param1.setValueParamter(0, chargeNo); param1.setValueParamter(1, planChargeNo); param1.setValueParamter(2, lineProcCd); param1.setValueParamter(3, prodnmCd); param1.setValueParamter(4, stlGrd); param1.setValueParamter(5, hcrClf); param1.setValueParamter(6, castManaNo); param1.setValueParamter(7, castChargeSeq); param1.setValueParamter(8, castEdtChargeCnt); param1.setValueParamter(9, lfNo); param1.setValueParamter(10, arrvWgt); param1.setValueParamter(11, lfTreatWgt); param1.setValueParamter(12, lfTreatWgt); this.getDao("mesdao").insert("NIG020510_02.insert", param1); } return PosBizControlConstants.SUCCESS; } }