4c848b96f7efa957aa1d482216434b904160f25e.svn-base 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. package xin.glue.nui.G.G02;
  2. import java.math.BigDecimal;
  3. import java.text.DateFormat;
  4. import java.text.SimpleDateFormat;
  5. import java.util.Date;
  6. import com.posdata.glue.biz.activity.PosActivity;
  7. import com.posdata.glue.biz.constants.PosBizControlConstants;
  8. import com.posdata.glue.context.PosContext;
  9. import com.posdata.glue.dao.vo.PosParameter;
  10. import com.posdata.glue.dao.vo.PosRow;
  11. import com.posdata.glue.dao.vo.PosRowSet;
  12. import com.posdata.glue.msg.PosMessage;
  13. import xin.glue.ui.common.PosDateFormat;
  14. /*
  15. * author:wangxiaoyan
  16. * Date:08-10-28
  17. * desc:
  18. */
  19. public class XinSaveCcmResult extends PosActivity
  20. {
  21. public String runActivity(PosContext context)
  22. {
  23. PosMessage message = context.getMessage();
  24. String MSG_RSV_DATE = (String)message.get("RSV_DATE");
  25. String MSG_CHRGE_NO = (String)message.get("CHRGE_NO");
  26. String MSG_PLAN_CHARGE_NO = (String)message.get("PLAN_CHARGE_NO");
  27. String MSG_CAST_NO = (String)message.get("CAST_NO");
  28. BigDecimal MSG_CAST_EDT_CHARGE_CNT = (BigDecimal)message.get("CAST_EDT_CHARGE_CNT");
  29. BigDecimal MSG_CAST_CHARGE_SEQ = (BigDecimal)message.get("CAST_CHARGE_SEQ");
  30. String MSG_CAST_END_YN = (String)message.get("CAST_END_YN");
  31. String MSG_CC_DEVNO = (String)message.get("CC_DEVNO");
  32. BigDecimal MSG_STLMELT_WGT = (BigDecimal)message.get("STLMELT_WGT");
  33. BigDecimal MSG_STLMELT_TEMP = (BigDecimal)message.get("STLMELT_TEMP");
  34. BigDecimal MSG_CC_END_STLMELT_USE_WGT = (BigDecimal)message.get("CC_END_STLMELT_USE_WGT");
  35. BigDecimal MSG_REM_WGT_IN_LD = (BigDecimal)message.get("REM_WGT_IN_LD");
  36. BigDecimal MSG_REM_WGT_IN_TD = (BigDecimal)message.get("REM_WGT_IN_TD");
  37. BigDecimal MSG_CC_YIELD = (BigDecimal)message.get("CC_YIELD");
  38. // String MSG_SPEC_ABBSYM = (String)message.get("SPEC_ABBSYM");
  39. // String MSG_LD_NO = (String)message.get("LD_NO");
  40. BigDecimal MSG_CC_SPEED_AVG1 = (BigDecimal)message.get("CC_SPEED_AVG1");
  41. BigDecimal MSG_CC_SPEED_MIN1 = (BigDecimal)message.get("CC_SPEED_MIN1");
  42. BigDecimal MSG_CC_SPEED_MAX1 = (BigDecimal)message.get("CC_SPEED_MAX1");
  43. BigDecimal MSG_CC_SPEED_AVG2 = (BigDecimal)message.get("CC_SPEED_AVG2");
  44. BigDecimal MSG_CC_SPEED_MIN2 = (BigDecimal)message.get("CC_SPEED_MIN2");
  45. BigDecimal MSG_CC_SPEED_MAX2 = (BigDecimal)message.get("CC_SPEED_MAX2");
  46. BigDecimal MSG_TD_TEMP_AVG = (BigDecimal)message.get("TD_TEMP_AVG");
  47. BigDecimal MSG_TD_TEMP_MIN = (BigDecimal)message.get("TD_TEMP_MIN");
  48. BigDecimal MSG_TD_TEMP_MAX = (BigDecimal)message.get("TD_TEMP_MAX");
  49. String MSG_LD_OPEN_YN = (String)message.get("LD_OPEN_YN");
  50. BigDecimal MSG_MD_LVL1 = (BigDecimal)message.get("MD_LVL1");
  51. BigDecimal MSG_MD_UPPER_WTH1 = (BigDecimal)message.get("MD_UPPER_WTH1");
  52. BigDecimal MSG_MD_LOWER_WTH1 = (BigDecimal)message.get("MD_LOWER_WTH1");
  53. BigDecimal MSG_MD_LVL2 = (BigDecimal)message.get("MD_LVL2");
  54. BigDecimal MSG_MD_UPPER_WTH2 = (BigDecimal)message.get("MD_UPPER_WTH2");
  55. BigDecimal MSG_MD_LOWER_WTH2 = (BigDecimal)message.get("MD_LOWER_WTH2");
  56. BigDecimal MSG_COOLWAT_WGT = (BigDecimal)message.get("COOLWAT_WGT");
  57. BigDecimal MSG_MD_VIBRATE_CNT1 = (BigDecimal)message.get("MD_VIBRATE_CNT1");
  58. BigDecimal MSG_MD_VIBRATE_WTH1 = (BigDecimal)message.get("MD_VIBRATE_WTH1");
  59. BigDecimal MSG_MD_VIBRATE_CNT2 = (BigDecimal)message.get("MD_VIBRATE_CNT2");
  60. BigDecimal MSG_MD_VIBRATE_WTH2 = (BigDecimal)message.get("MD_VIBRATE_WTH2");
  61. String MSG_LD_ARRV_DTIME = (String)message.get("LD_ARRV_DTIME");
  62. String MSG_CC_STA_DTIME = (String)message.get("CC_STA_DTIME");
  63. String MSG_LD_OPEN_DTIME = (String)message.get("LD_OPEN_DTIME");
  64. String MSG_LD_CLOSE_DTIME = (String)message.get("LD_CLOSE_DTIME");
  65. String MSG_CC_END_DTIME = (String)message.get("CC_END_DTIME");
  66. BigDecimal MSG_CC_HOUR = (BigDecimal)message.get("CC_HOUR");
  67. BigDecimal MSG_SLAB_TOTLEN = (BigDecimal)message.get("SLAB_TOTLEN");
  68. BigDecimal MSG_SLAB_PROD_CNT = (BigDecimal)message.get("SLAB_PROD_CNT");
  69. BigDecimal MSG_SLAB_TOTWGT = (BigDecimal)message.get("SLAB_TOTWGT");
  70. int chLth = MSG_CHRGE_NO.trim().length();
  71. if (chLth < 10 ) {
  72. logger.logError("XinSaveCcmResult CHARGE_NO ERROR !!!!-->"+MSG_CHRGE_NO );
  73. return PosBizControlConstants.SUCCESS;
  74. }
  75. String sShift = null;
  76. if (MSG_RSV_DATE == null || MSG_RSV_DATE.equals("") ) {
  77. DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
  78. MSG_RSV_DATE = formatter.format(new Date());
  79. }
  80. sShift = PosDateFormat.getShift(MSG_RSV_DATE);
  81. PosParameter paramA = new PosParameter();
  82. paramA.setWhereClauseParameter(0, MSG_RSV_DATE.substring(0,6));
  83. paramA.setWhereClauseParameter(1, MSG_RSV_DATE.substring(6,8));
  84. paramA.setWhereClauseParameter(2, sShift);
  85. paramA.setWhereClauseParameter(3, "S");
  86. PosRowSet groupVO = this.getDao("mesdao").find("NIG020210_SHIFT.select", paramA);
  87. String sGroup = null;
  88. if (groupVO.hasNext()){
  89. PosRow groupROW = groupVO.next();
  90. sGroup = (String)groupROW.getAttribute("GR_GROUP_CD");
  91. }
  92. /*
  93. //获取计划牌号
  94. PosParameter paramB = new PosParameter();
  95. paramB.setWhereClauseParameter(0, "J"+MSG_PLAN_CHARGE_NO.substring(1));
  96. PosRowSet GETSTLGRD = this.getDao("mesdao").find("NIG020620_02.select", paramB);
  97. String stlgrd = null;
  98. if (GETSTLGRD.hasNext()){
  99. PosRow stlROW = GETSTLGRD.next();
  100. stlgrd = (String)stlROW.getAttribute("STL_GRD");
  101. }
  102. */
  103. PosParameter param0 = new PosParameter();
  104. PosParameter param1 = new PosParameter();
  105. // 用电文接收的数据项修改 RH炉实绩表 tbg02_rh_result
  106. param0.setWhereClauseParameter(0, MSG_CHRGE_NO);
  107. PosRowSet rowset0 = this.getDao("mesdao").find("NIG020620_01.select", param0);
  108. if(rowset0.hasNext())
  109. {
  110. param1.setValueParamter(0,MSG_PLAN_CHARGE_NO);
  111. param1.setValueParamter(1,MSG_RSV_DATE.substring(0,8) );
  112. param1.setValueParamter(2,MSG_CAST_NO );
  113. param1.setValueParamter(3,MSG_CAST_EDT_CHARGE_CNT);
  114. param1.setValueParamter(4,MSG_CAST_CHARGE_SEQ );
  115. param1.setValueParamter(5,MSG_CAST_END_YN );
  116. param1.setValueParamter(6,MSG_CC_DEVNO );
  117. param1.setValueParamter(7,MSG_STLMELT_WGT );
  118. param1.setValueParamter(8,MSG_STLMELT_TEMP );
  119. param1.setValueParamter(9,MSG_CC_END_STLMELT_USE_WGT );
  120. param1.setValueParamter(10,MSG_REM_WGT_IN_LD );
  121. param1.setValueParamter(11,MSG_REM_WGT_IN_TD );
  122. param1.setValueParamter(12,MSG_CC_YIELD );
  123. param1.setValueParamter(13,MSG_CC_SPEED_AVG1 );
  124. param1.setValueParamter(14,MSG_CC_SPEED_MIN1 );
  125. param1.setValueParamter(15,MSG_CC_SPEED_MAX1 );
  126. param1.setValueParamter(16,MSG_CC_SPEED_AVG2 );
  127. param1.setValueParamter(17,MSG_CC_SPEED_MIN2 );
  128. param1.setValueParamter(18,MSG_CC_SPEED_MAX2 );
  129. param1.setValueParamter(19,MSG_TD_TEMP_AVG );
  130. param1.setValueParamter(20,MSG_TD_TEMP_MIN );
  131. param1.setValueParamter(21,MSG_TD_TEMP_MAX );
  132. param1.setValueParamter(22,MSG_LD_OPEN_YN );
  133. param1.setValueParamter(23,MSG_MD_LVL1 );
  134. param1.setValueParamter(24,MSG_MD_UPPER_WTH1 );
  135. param1.setValueParamter(25,MSG_MD_LOWER_WTH1 );
  136. param1.setValueParamter(26,MSG_MD_VIBRATE_CNT1 );
  137. param1.setValueParamter(27,MSG_MD_VIBRATE_WTH1 );
  138. param1.setValueParamter(28,MSG_MD_LVL2 );
  139. param1.setValueParamter(29,MSG_MD_UPPER_WTH2 );
  140. param1.setValueParamter(30,MSG_MD_LOWER_WTH2 );
  141. param1.setValueParamter(31,MSG_MD_VIBRATE_CNT2 );
  142. param1.setValueParamter(32,MSG_MD_VIBRATE_WTH2 );
  143. param1.setValueParamter(33,MSG_COOLWAT_WGT );
  144. param1.setValueParamter(34,MSG_LD_ARRV_DTIME );
  145. param1.setValueParamter(35,MSG_CC_STA_DTIME );
  146. param1.setValueParamter(36,MSG_LD_OPEN_DTIME );
  147. param1.setValueParamter(37,MSG_LD_CLOSE_DTIME );
  148. param1.setValueParamter(38,MSG_CC_END_DTIME );
  149. param1.setValueParamter(39,MSG_CC_HOUR );
  150. param1.setValueParamter(40,MSG_SLAB_TOTLEN );
  151. param1.setValueParamter(41,MSG_SLAB_PROD_CNT );
  152. param1.setValueParamter(42,MSG_SLAB_TOTWGT );
  153. param1.setValueParamter(43,sShift );
  154. param1.setValueParamter(44,sGroup );
  155. param1.setValueParamter(45,MSG_CHRGE_NO );
  156. this.getDao("mesdao").update("NIG020620_CCM.update",param1);
  157. //获取原料浇次信息便于静态报表数据统计 20190525wl
  158. this.getDao("mesdao").update("NIG020620_REPORTCCM.update",param1);
  159. }
  160. else
  161. {
  162. param1.setValueParamter(0,MSG_CHRGE_NO);
  163. param1.setValueParamter(1,MSG_PLAN_CHARGE_NO);
  164. param1.setValueParamter(2,MSG_RSV_DATE.substring(0,8) );
  165. param1.setValueParamter(3,MSG_CAST_NO );
  166. param1.setValueParamter(4,MSG_CAST_EDT_CHARGE_CNT);
  167. param1.setValueParamter(5,MSG_CAST_CHARGE_SEQ );
  168. param1.setValueParamter(6,MSG_CAST_END_YN );
  169. param1.setValueParamter(7,MSG_CC_DEVNO );
  170. param1.setValueParamter(8,MSG_STLMELT_WGT );
  171. param1.setValueParamter(9,MSG_STLMELT_TEMP );
  172. param1.setValueParamter(10,MSG_CC_END_STLMELT_USE_WGT );
  173. param1.setValueParamter(11,MSG_REM_WGT_IN_LD );
  174. param1.setValueParamter(12,MSG_REM_WGT_IN_TD );
  175. param1.setValueParamter(13,MSG_CC_YIELD );
  176. param1.setValueParamter(14,MSG_CC_SPEED_AVG1 );
  177. param1.setValueParamter(15,MSG_CC_SPEED_MIN1 );
  178. param1.setValueParamter(16,MSG_CC_SPEED_MAX1 );
  179. param1.setValueParamter(17,MSG_CC_SPEED_AVG2 );
  180. param1.setValueParamter(18,MSG_CC_SPEED_MIN2 );
  181. param1.setValueParamter(19,MSG_CC_SPEED_MAX2 );
  182. param1.setValueParamter(20,MSG_TD_TEMP_AVG );
  183. param1.setValueParamter(21,MSG_TD_TEMP_MIN );
  184. param1.setValueParamter(22,MSG_TD_TEMP_MAX );
  185. param1.setValueParamter(23,MSG_LD_OPEN_YN );
  186. param1.setValueParamter(24,MSG_MD_LVL1 );
  187. param1.setValueParamter(25,MSG_MD_UPPER_WTH1 );
  188. param1.setValueParamter(26,MSG_MD_LOWER_WTH1 );
  189. param1.setValueParamter(27,MSG_MD_VIBRATE_CNT1 );
  190. param1.setValueParamter(28,MSG_MD_VIBRATE_WTH1 );
  191. param1.setValueParamter(29,MSG_MD_LVL2 );
  192. param1.setValueParamter(30,MSG_MD_UPPER_WTH2 );
  193. param1.setValueParamter(31,MSG_MD_LOWER_WTH2 );
  194. param1.setValueParamter(32,MSG_MD_VIBRATE_CNT2 );
  195. param1.setValueParamter(33,MSG_MD_VIBRATE_WTH2 );
  196. param1.setValueParamter(34,MSG_COOLWAT_WGT );
  197. param1.setValueParamter(35,MSG_LD_ARRV_DTIME );
  198. param1.setValueParamter(36,MSG_CC_STA_DTIME );
  199. param1.setValueParamter(37,MSG_LD_OPEN_DTIME );
  200. param1.setValueParamter(38,MSG_LD_CLOSE_DTIME );
  201. param1.setValueParamter(39,MSG_CC_END_DTIME );
  202. param1.setValueParamter(40,MSG_CC_HOUR );
  203. param1.setValueParamter(41,MSG_SLAB_TOTLEN );
  204. param1.setValueParamter(42,MSG_SLAB_PROD_CNT );
  205. param1.setValueParamter(43,MSG_SLAB_TOTWGT );
  206. param1.setValueParamter(44,sShift );
  207. param1.setValueParamter(45,sGroup );
  208. this.getDao("mesdao").insert("NIG020620_CCM.insert",param1);
  209. //获取原料浇次信息便于静态报表数据统计 20190525wl
  210. this.getDao("mesdao").insert("NIG020620_REPORTCCM.insert",param1);
  211. }
  212. PosParameter param6 = new PosParameter();
  213. param6.setValueParamter(0, MSG_CC_DEVNO );
  214. param6.setValueParamter(1, MSG_CC_STA_DTIME );
  215. param6.setValueParamter(2, MSG_CC_END_DTIME );
  216. param6.setValueParamter(3, MSG_CHRGE_NO );
  217. this.getDao("mesdao").update("NIG020620_CHARGE_COMM.update", param6);
  218. return PosBizControlConstants.SUCCESS;
  219. }
  220. }