bf15f40ddc4453a2b1f5db0b15d15f80b862b5d3.svn-base 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. package xin.glue.nui.H.H02;
  2. import com.posdata.glue.PosException;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.biz.control.PosBizControlIF;
  5. import com.posdata.glue.biz.control.PosBizProvider;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.PosGenericDao;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. import com.posdata.glue.dao.vo.PosRow;
  10. import com.posdata.glue.dao.vo.PosRowSet;
  11. import com.posdata.glue.msg.PosMESMessageImpl;
  12. import com.posdata.glue.msg.PosMessage;
  13. import com.posdata.glue.scheduling.PosQuartzJobBean;
  14. import com.posdata.glue.transaction.PosTransactionManager;
  15. import com.posdata.glue.util.log.PosLog;
  16. import com.posdata.glue.util.log.PosLogFactory;
  17. import org.quartz.JobExecutionContext;
  18. public class MILLDailyProduct extends PosQuartzJobBean {
  19. protected PosGenericDao dao = (PosGenericDao)
  20. PosContext.getBeanFactory().getBeanObject("mesdao");
  21. private PosTransactionManager transaction =
  22. (PosTransactionManager) PosContext.getBeanFactory().getBeanObject("tx1");
  23. protected PosLog log = PosLogFactory.getLogger(getClass());
  24. protected void executeJob(JobExecutionContext arg0)
  25. {
  26. log.logInfo("MILLDailyProduct executeJob start " );
  27. PosRowSet RepChVO = dao.find("UIG020210_DAILY_CH.select" );
  28. while(RepChVO.hasNext()) {
  29. PosRow RepChROW = RepChVO.next();
  30. String SLAB_RT = (String)RepChROW.getAttribute("SLAB_RT");
  31. String DAY_CH_CNT = (String)RepChROW.getAttribute("DAY_CH_CNT");
  32. String DAY_CH_WGT = (String)RepChROW.getAttribute("DAY_CH_WGT");
  33. PosParameter param1 = new PosParameter();
  34. param1.setValueParamter(0,SLAB_RT );
  35. PosRowSet RepExistVO = dao.find("UIG020210_CH_EXIST.select",param1 );
  36. if (RepExistVO.hasNext()) {
  37. PosRow RepExistROW = RepExistVO.next();
  38. PosParameter param2 = new PosParameter();
  39. param2.setValueParamter(0,DAY_CH_CNT );
  40. param2.setValueParamter(1,DAY_CH_WGT );
  41. param2.setValueParamter(2,SLAB_RT );
  42. dao.update("UIG020210_DAILY_CH.update",param2);
  43. } else {
  44. PosParameter param2 = new PosParameter();
  45. param2.setValueParamter(0,SLAB_RT );
  46. param2.setValueParamter(1,DAY_CH_CNT );
  47. param2.setValueParamter(2,DAY_CH_WGT );
  48. dao.update("UIG020210_DAILY_CH.insert",param2);
  49. }
  50. }
  51. PosRowSet RepSlabVO = dao.find("UIG020210_DAILY_SLAB.select" );
  52. while(RepSlabVO.hasNext()) {
  53. PosRow RepSlabROW = RepSlabVO.next();
  54. String SLAB_RT = (String)RepSlabROW.getAttribute("SLAB_RT");
  55. String DAY_SLAB_CNT = (String)RepSlabROW.getAttribute("DAY_SLAB_CNT");
  56. String DAY_SLAB_WGT = (String)RepSlabROW.getAttribute("DAY_SLAB_WGT");
  57. PosParameter param3 = new PosParameter();
  58. param3.setValueParamter(0,SLAB_RT );
  59. PosRowSet RepExistVO = dao.find("UIG020210_CH_EXIST.select",param3 );
  60. if (RepExistVO.hasNext()) {
  61. PosRow RepExistROW = RepExistVO.next();
  62. PosParameter param4 = new PosParameter();
  63. param4.setValueParamter(0,DAY_SLAB_WGT );
  64. param4.setValueParamter(1,SLAB_RT );
  65. dao.update("UIG020210_DAILY_SLAB.update",param4);
  66. } else {
  67. PosParameter param4 = new PosParameter();
  68. param4.setValueParamter(0,SLAB_RT );
  69. param4.setValueParamter(1,DAY_SLAB_WGT );
  70. dao.update("UIG020210_DAILY_SLAB.insert",param4);
  71. }
  72. }
  73. PosRowSet RepTrbVO = dao.find("UIG020210_DAILY_TRB.select" );
  74. while(RepTrbVO.hasNext()) {
  75. PosRow RepTrbROW = RepTrbVO.next();
  76. String RST_CHEM_TRB_CNT = (String)RepTrbROW.getAttribute("RST_CHEM_TRB_CNT");
  77. String RST_CHEM_TRB_QTY = (String)RepTrbROW.getAttribute("RST_CHEM_TRB_QTY");
  78. String RST_NONORD_CNT = (String)RepTrbROW.getAttribute("RST_NONORD_CNT");
  79. String RST_NONORD_QTY = (String)RepTrbROW.getAttribute("RST_NONORD_QTY");
  80. String RST_QLTY_TRB_CNT = (String)RepTrbROW.getAttribute("RST_QLTY_TRB_CNT");
  81. String RST_QLTY_TRB_QTY = (String)RepTrbROW.getAttribute("RST_QLTY_TRB_QTY");
  82. String RST_PRT_SCR_QTY = (String)RepTrbROW.getAttribute("RST_PRT_SCR_QTY");
  83. String RST_ALL_SCR_QTY = (String)RepTrbROW.getAttribute("RST_ALL_SCR_QTY");
  84. PosParameter param5 = new PosParameter();
  85. param5.setValueParamter(0,"N" );
  86. PosRowSet RepExistVO = dao.find("UIG020210_CH_EXIST.select",param5 );
  87. if (RepExistVO.hasNext()) {
  88. PosRow RepExistROW = RepExistVO.next();
  89. PosParameter param6 = new PosParameter();
  90. param6.setValueParamter(0,RST_NONORD_CNT );
  91. param6.setValueParamter(1,RST_NONORD_QTY );
  92. param6.setValueParamter(2,RST_CHEM_TRB_CNT );
  93. param6.setValueParamter(3,RST_CHEM_TRB_QTY );
  94. param6.setValueParamter(4,RST_QLTY_TRB_CNT );
  95. param6.setValueParamter(5,RST_QLTY_TRB_QTY );
  96. param6.setValueParamter(6,RST_PRT_SCR_QTY );
  97. param6.setValueParamter(7,RST_ALL_SCR_QTY );
  98. dao.update("UIG020210_DAILY_TRB.update",param6);
  99. } else {
  100. PosParameter param6 = new PosParameter();
  101. param6.setValueParamter(0,RST_NONORD_CNT );
  102. param6.setValueParamter(1,RST_NONORD_QTY );
  103. param6.setValueParamter(2,RST_CHEM_TRB_CNT );
  104. param6.setValueParamter(3,RST_CHEM_TRB_QTY );
  105. param6.setValueParamter(4,RST_QLTY_TRB_CNT );
  106. param6.setValueParamter(5,RST_QLTY_TRB_QTY );
  107. param6.setValueParamter(6,RST_PRT_SCR_QTY );
  108. param6.setValueParamter(7,RST_ALL_SCR_QTY );
  109. dao.update("UIG020210_DAILY_TRB.insert",param6);
  110. }
  111. }
  112. log.logInfo("MILLDailyProduct END " );
  113. }
  114. }