c97045a8eb8461799c24f87e6157d1191f6122fd.svn-base 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. package xin.glue.nui.G.G02;
  2. import java.math.BigDecimal;
  3. import com.posdata.glue.biz.activity.PosActivity;
  4. import com.posdata.glue.biz.constants.PosBizControlConstants;
  5. import com.posdata.glue.context.PosContext;
  6. import com.posdata.glue.dao.vo.PosParameter;
  7. import com.posdata.glue.dao.vo.PosRow;
  8. import com.posdata.glue.dao.vo.PosRowSet;
  9. import com.posdata.glue.msg.PosMessage;
  10. /*
  11. * author:wangxiaoyan
  12. * Date:08-10-28
  13. * desc:接收RH炉实绩的电文信息 更新RH炉实绩表 TBG02_BOF_RESULT以后 相应的修改炼钢公共表 TBG02_CHARGE_COMM
  14. */
  15. public class XinSaveRHProcChargeComm extends PosActivity {
  16. public String runActivity(PosContext context) {
  17. PosMessage message = context.getMessage();
  18. // 从电文中获取的数据项
  19. String chargeNo = (String) message.get("CHARGE_NO");
  20. String planChargeNo = (String) message.get("PLAN_CHARGE_NO");
  21. String rhNo = (String) message.get("RH_NO");
  22. BigDecimal arrvWgt = (BigDecimal) message.get("ARRV_WGT");
  23. BigDecimal rhTreatWgt = (BigDecimal) message.get("RH_TREAT_WGT");
  24. int chLth = chargeNo.trim().length();
  25. if (chLth < 10 ) {
  26. logger.logInfo("XinSaveRHProcChargeComm CHARGE_NO ERROR !!!!-->"+chargeNo );
  27. return PosBizControlConstants.SUCCESS;
  28. }
  29. // 从炉次参数表 TBF01_SPEC_CHARGE 查询出来的数据项 用于插入 炉次参数表
  30. String lineProcCd = "";
  31. String prodnmCd = "";
  32. String stlGrd = "";
  33. String hcrClf = "";
  34. String castManaNo = "";
  35. BigDecimal castChargeSeq = null;
  36. BigDecimal castEdtChargeCnt = null;
  37. PosParameter param0 = new PosParameter();
  38. PosParameter param1 = new PosParameter();
  39. PosParameter param2 = new PosParameter();
  40. param2.setWhereClauseParameter(0, planChargeNo);
  41. PosRowSet rowset2 = this.getDao("mesdao").find("NIG020310_02.select",
  42. param2);
  43. if (rowset2.hasNext()) {
  44. PosRow row2 = rowset2.next();
  45. lineProcCd = (String) row2.getAttribute("LINE_PROC_CD");
  46. prodnmCd = (String) row2.getAttribute("PRODNM_CD");
  47. stlGrd = (String) row2.getAttribute("STL_GRD");
  48. hcrClf = (String) row2.getAttribute("HCR_CLF");
  49. castManaNo = (String) row2.getAttribute("CAST_MANA_NO");
  50. castChargeSeq = (BigDecimal) row2.getAttribute("CAST_CHARGE_SEQ");
  51. castEdtChargeCnt = (BigDecimal) row2
  52. .getAttribute("CAST_EDT_CHARGE_CNT");
  53. }
  54. param0.setWhereClauseParameter(0, chargeNo);
  55. PosRowSet rowset0 = this.getDao("mesdao").find("NIG020310_03.select",
  56. param0);
  57. if (rowset0.hasNext()) {
  58. PosRow rowsetROW = rowset0.next();
  59. String currProgCd = (String) rowsetROW.getAttribute("CUR_PROG_CD");
  60. String befProgCd = (String) rowsetROW.getAttribute("BEF_PROG_CD");
  61. String CHARGE_STAT = (String) rowsetROW.getAttribute("CHARGE_STAT");
  62. if (CHARGE_STAT != null && CHARGE_STAT.equals("2")) {
  63. if (currProgCd != null) {
  64. if (currProgCd.equals("JLF")) {
  65. currProgCd = "JRF";
  66. befProgCd = "JLF";
  67. } else if (currProgCd.equals("JRF")) {
  68. currProgCd = "JRF";
  69. } else if (!currProgCd.equals("JJB")) {
  70. befProgCd = currProgCd;
  71. currProgCd = "JRF";
  72. }
  73. } else {
  74. currProgCd = "JRF";
  75. befProgCd = "JBB";
  76. }
  77. param1.setWhereClauseParameter(0, rhNo);
  78. param1.setWhereClauseParameter(1, currProgCd);
  79. param1.setWhereClauseParameter(2, befProgCd);
  80. param1.setWhereClauseParameter(3, arrvWgt);
  81. param1.setWhereClauseParameter(4, rhTreatWgt);
  82. param1.setWhereClauseParameter(5, rhTreatWgt);
  83. param1.setWhereClauseParameter(6, chargeNo);
  84. this.getDao("mesdao").update("NIG020310_02.update", param1);
  85. }
  86. } else {
  87. param1.setValueParamter(0, chargeNo);
  88. param1.setValueParamter(1, planChargeNo);
  89. param1.setValueParamter(2, lineProcCd);
  90. param1.setValueParamter(3, prodnmCd);
  91. param1.setValueParamter(4, stlGrd);
  92. param1.setValueParamter(5, hcrClf);
  93. param1.setValueParamter(6, castManaNo);
  94. param1.setValueParamter(7, castChargeSeq);
  95. param1.setValueParamter(8, castEdtChargeCnt);
  96. param1.setValueParamter(9, rhNo);
  97. param1.setValueParamter(10, arrvWgt);
  98. param1.setValueParamter(11, rhTreatWgt);
  99. param1.setValueParamter(12, rhTreatWgt);
  100. this.getDao("mesdao").insert("NIG020310_02.insert", param1);
  101. }
  102. return PosBizControlConstants.SUCCESS;
  103. }
  104. }