| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- package xin.glue.nui.G.G02;
- import java.math.BigDecimal;
- import java.text.DateFormat;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- 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.vo.PosParameter;
- import com.posdata.glue.dao.vo.PosRow;
- import com.posdata.glue.dao.vo.PosRowSet;
- import com.posdata.glue.msg.PosMESMessageImpl;
- import com.posdata.glue.msg.PosMessage;
- /*
- * author:wangxiaoyan
- * Date:08-10-28
- * desc:接收RH炉实绩的电文信息 更新rh炉实绩表 TBG02_RH_RESULT
- */
- public class XinSaveLFResult extends PosActivity {
- public String runActivity(PosContext context) {
- PosMessage message = context.getMessage();
- // 从电文中获取的数据项
- String RsvDate = (String) message.get("DATE");
- String chargeNo = (String) message.get("CHARGE_NO"); // 1 炉次号
- String planChargeNo = (String) message.get("PLAN_CHARGE_NO"); // 2
- // 炉次计划号
- BigDecimal arrvWgt = (BigDecimal) message.get("ARRV_WGT"); // 3 处理前钢水重量
- BigDecimal lfTreatWgt = (BigDecimal) message.get("LF_TREAT_WGT"); // 4
- // LF处理后重量
- BigDecimal slagThk = (BigDecimal) message.get("SLAG_THK"); // 5 炉渣厚度
- BigDecimal slagWgt = (BigDecimal) message.get("SLAG_WGT"); // 6 渣量
- String lfArrvDtime = (String) message.get("LF_ARRV_DTIME"); // 7 LF 到达时刻
- String lfStaDtime = (String) message.get("LF_STA_DTIME"); // 8 LF 开始时刻
- String lfEndDtime = (String) message.get("LF_END_DTIME"); // 9 LF 完成时刻
- String lfDepDtime = (String) message.get("LF_DEP_DTIME"); // 10LF 出发时刻
- String elecflowStaDtime = (String) message.get("ELECFLOW_STA_DTIME"); // 11通电开始时刻
- BigDecimal lfTreatHour = (BigDecimal) message.get("LF_TREAT_HOUR"); // 12LF处理时间
- BigDecimal arGasBlowHour = (BigDecimal) message.get("AR_GAS_BLOW_HOUR"); // 13氩气吹入时间
- BigDecimal lfWaitHour = (BigDecimal) message.get("LF_WAIT_HOUR"); // 14LF
- // 待机时间
- BigDecimal elecflowHour = (BigDecimal) message.get("ELECFLOW_HOUR"); // 15通电时间
- BigDecimal elecflowWgt = (BigDecimal) message.get("ELECFLOW_WGT"); // 16通电量
- BigDecimal lfArrvTemp = (BigDecimal) message.get("LF_ARRV_TEMP"); // 17LF
- // 到达温度
- BigDecimal lfStaTemp = (BigDecimal) message.get("LF_STA_TEMP"); // 18LF
- // 开始温度
- String lfEndTemp = (String) message.get("LF_END_TEMP"); // 19LF 完成温度
- String lfDepTemp = (String) message.get("LF_DEP_TEMP"); // 20LF 出发温度
- BigDecimal treatBefO2Wgt = (BigDecimal) message.get("TREAT_BEF_O2_WGT"); // 21LF
- // 开始时含氧量
- BigDecimal treatAftO2Wgt = (BigDecimal) message.get("TREAT_AFT_O2_WGT"); // 22LF
- // 结束时含氧量
- BigDecimal o2UseWgt = (BigDecimal) message.get("O2_USE_WGT"); // 23氧气用量
- BigDecimal arGasUseWgt = (BigDecimal) message.get("AR_GAS_USE_WGT"); // 24Ar
- // GAS
- // 使用量
- BigDecimal electrodContactQnty1 = (BigDecimal) message
- .get("ELECTROD_CONTACT_QNTY_1"); // 25电极通电次数 1极
- BigDecimal electrodContactQnty2 = (BigDecimal) message
- .get("ELECTROD_CONTACT_QNTY_2"); // 26电极通电次数 2极
- BigDecimal electrodContactQnty3 = (BigDecimal) message
- .get("ELECTROD_CONTACT_QNTY_3"); // 27电极通电次数3极
- String lfNo = (String) message.get("LF_NO"); // 28LF炉号
- int chLth = chargeNo.trim().length();
-
- if (chLth < 10 ) {
-
- logger.logError("XinSaveLFResult CHARGE_NO ERROR !!!!-->"+chargeNo );
-
- return PosBizControlConstants.SUCCESS;
- }
-
-
- String sShift = null;
- if (RsvDate == null || RsvDate.equals("")) {
- DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
- RsvDate = formatter.format(new Date());
- }
- sShift = PosDateFormat.getShift(RsvDate);
- PosParameter paramA = new PosParameter();
- paramA.setWhereClauseParameter(0, RsvDate.substring(0, 6));
- paramA.setWhereClauseParameter(1, RsvDate.substring(6, 8));
- paramA.setWhereClauseParameter(2, sShift);
- paramA.setWhereClauseParameter(3, "S");
- PosRowSet groupVO = this.getDao("mesdao").find(
- "NIG020210_SHIFT.select", paramA);
- String sGroup = null;
- if (groupVO.hasNext()) {
- PosRow groupROW = groupVO.next();
- sGroup = (String) groupROW.getAttribute("GR_GROUP_CD");
- }
- PosParameter param0 = new PosParameter();
- PosParameter param1 = new PosParameter();
- // PosParameter param2 = new PosParameter();
- // 用电文接收的数据项修改 LF炉实绩表 tbg02_rh_result
- param0.setWhereClauseParameter(0, chargeNo);
- PosRowSet LfRstVO = this.getDao("mesdao").find("NIG020510_01.select",
- param0);
- if (LfRstVO.hasNext()) {
- param1.setValueParamter(0, planChargeNo); // 1 炉次计划号
- param1.setValueParamter(1, arrvWgt); // 2 处理前钢水重量
- param1.setValueParamter(2, lfTreatWgt); // 3 LF处理后重量
- param1.setValueParamter(3, slagThk); // 4 炉渣厚度
- param1.setValueParamter(4, slagWgt); // 5 渣量
- param1.setValueParamter(5, lfArrvDtime); // 6 LF 到达时刻
- param1.setValueParamter(6, lfStaDtime); // 7 LF 开始时刻
- param1.setValueParamter(7, lfEndDtime); // 8 LF 完成时刻
- param1.setValueParamter(8, lfDepDtime); // 9 LF 出发时刻
- param1.setValueParamter(9, elecflowStaDtime); // 10通电开始时刻
- param1.setValueParamter(10, lfTreatHour); // 11LF处理时间
- param1.setValueParamter(11, arGasBlowHour); // 12氩气吹入时间
- param1.setValueParamter(12, lfWaitHour); // 13LF 待机时间
- param1.setValueParamter(13, elecflowHour); // 14通电时间
- param1.setValueParamter(14, elecflowWgt); // 15通电量
- param1.setValueParamter(15, lfArrvTemp); // 16LF 到达温度
- param1.setValueParamter(16, lfStaTemp); // 17LF 开始温度
- param1.setValueParamter(17, lfEndTemp); // 18LF 完成温度
- param1.setValueParamter(18, lfDepTemp); // 19LF 出发温度
- param1.setValueParamter(19, treatBefO2Wgt); // 20LF 开始时含氧量
- param1.setValueParamter(20, treatAftO2Wgt); // 21LF 结束时含氧量
- param1.setValueParamter(21, o2UseWgt); // 22氧气用量
- param1.setValueParamter(22, arGasUseWgt); // 23Ar GAS 使用量
- param1.setValueParamter(23, electrodContactQnty1); // 24电极通电次数 1极
- param1.setValueParamter(24, electrodContactQnty2); // 25电极通电次数 2极
- param1.setValueParamter(25, electrodContactQnty3); // 26电极通电次数3极
- param1.setValueParamter(26, lfNo); // 27lf炉机号
- param1.setValueParamter(27, sShift); // 27lf炉机号
- param1.setValueParamter(28, sGroup); // 27lf炉机号
- param1.setValueParamter(29, RsvDate.substring(0, 8)); // 27lf炉机号
- param1.setValueParamter(30, chargeNo); // 28炉次号
- this.getDao("mesdao").update("NIG020510_01.update", param1);
- } else {
- param1.setValueParamter(0, chargeNo); // 1 炉次号
- param1.setValueParamter(1, planChargeNo); // 2 炉次计划号
- param1.setValueParamter(2, arrvWgt); // 3 处理前钢水重量
- param1.setValueParamter(3, lfTreatWgt); // 4 LF处理后重量
- param1.setValueParamter(4, slagThk); // 5 炉渣厚度
- param1.setValueParamter(5, slagWgt); // 6 渣量
- param1.setValueParamter(6, lfArrvDtime); // 7 LF 到达时刻
- param1.setValueParamter(7, lfStaDtime); // 8 LF 开始时刻
- param1.setValueParamter(8, lfEndDtime); // 9 LF 完成时刻
- param1.setValueParamter(9, lfDepDtime); // 10 LF 出发时刻
- param1.setValueParamter(10, elecflowStaDtime); // 11 通电开始时刻
- param1.setValueParamter(11, lfTreatHour); // 12 LF处理时间
- param1.setValueParamter(12, arGasBlowHour); // 13 氩气吹入时间
- param1.setValueParamter(13, lfWaitHour); // 14 LF 待机时间
- param1.setValueParamter(14, elecflowHour); // 15 通电时间
- param1.setValueParamter(15, elecflowWgt); // 16 通电量
- param1.setValueParamter(16, lfArrvTemp); // 17 LF 到达温度
- param1.setValueParamter(17, lfStaTemp); // 18 LF 开始温度
- param1.setValueParamter(18, lfEndTemp); // 19 LF 完成温度
- param1.setValueParamter(19, lfDepTemp); // 20 LF 出发温度
- param1.setValueParamter(20, treatBefO2Wgt); // 21 LF 开始时含氧量
- param1.setValueParamter(21, treatAftO2Wgt); // 22 LF 结束时含氧量
- param1.setValueParamter(22, o2UseWgt); // 23 氧气用量
- param1.setValueParamter(23, arGasUseWgt); // 24 Ar GAS 使用量
- param1.setValueParamter(24, electrodContactQnty1); // 25 电极通电次数 1极
- param1.setValueParamter(25, electrodContactQnty2); // 26 电极通电次数 2极
- param1.setValueParamter(26, electrodContactQnty3); // 27 电极通电次数3极
- param1.setValueParamter(27, lfNo); // 27lf炉机号
- param1.setValueParamter(28, sShift); // 27lf炉机号
- param1.setValueParamter(29, sGroup); // 27lf炉机号
- param1.setValueParamter(30, RsvDate.substring(0, 8)); // 27lf炉机号
- this.getDao("mesdao").insert("NIG020510_01.insert", param1);
- String BefProg = null;
- String ChargeStat = null;
- String PlanhargeNo = null;
-
- PosParameter paramZ = new PosParameter();
- paramZ.setWhereClauseParameter(0, chargeNo);
- PosRowSet chargeVO = this.getDao("mesdao").find("NIG020210_03.select", paramZ);
- if (chargeVO.hasNext()) {
- PosRow chargeROW = chargeVO.next();
- BefProg = (String) chargeROW.getAttribute("CUR_PROG_CD");
- ChargeStat = (String) chargeROW.getAttribute("CHARGE_STAT");
- PlanhargeNo = (String)chargeROW.getAttribute("PLAN_CHARGE_NO");
- }
- if (ChargeStat != null && ChargeStat.equals("2") && PlanhargeNo != null) {
- PosParameter param5 = new PosParameter();
- String sProgCd = "JLF";
- param5.setValueParamter(0, sProgCd);
- param5.setValueParamter(1, "B");
- param5.setValueParamter(2, PlanhargeNo);
- this.getDao("mesdao").update("NIG020200_SPEC_PROG.update",param5);
- SendProg_NIE012070(planChargeNo, BefProg, lfTreatWgt);
- SendProg_NIE012080();
- }
- }
- return PosBizControlConstants.SUCCESS;
- }
- public PosContext SendProg_NIE012070(String ChargeNo, String BefProg,
- BigDecimal wgt) {
- logger.logDebug("XinSaveLfResult SendProg_NIE012070 ");
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
- String TcId = "NIE012070";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("BEF_ORD_NO", null);
- message.setObject("BEF_ORD_SEQ", null);
- message.setObject("ORD_NO", null);
- message.setObject("ORD_SEQ", null);
- message.setObject("BEF_PROG_CD", BefProg);
- message.setObject("PROG_CD", "JLF");
- message.setObject("MAT_TYPE", "CH");
- message.setObject("MAT_NO", ChargeNo);
- message.setObject("WGT", wgt);
- message.setObject("PGMID", "XinSaveLfResult");
- message.setObject("REG_ID", "LEVEL2");
- context.setMessage(message);
- this.processComponent(PosConstants.CREATE_MESSAGE, context);
- String transactionCode = context.getMessage().getTC();
- logger.logDebug("XinSaveLfResult---> transactionCode:("
- + transactionCode + ")");
- message.setTCID(TcId);
- String serviceName = "NIE012070";
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, serviceName
- + SERVICE_POSTFIX);
- context.setMessage(message);
- PosBizControlIF controller = PosBizProvider.getController();
- controller.doSubController(context, false);
- logger.logDebug("XinSaveLfResult---> NIE012070 TC SendProgress end");
- return null;
- }
- public PosContext SendProg_NIE012080() {
- logger.logDebug("XinSaveLfResult 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();
- logger.logDebug("XinSaveLfResult---> transactionCode:("
- + transactionCode + ")");
- 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);
- logger.logDebug("XinSaveLfResult---> NIE012080 TC SendProgress end");
- return null;
- }
- }
|