08b7508baa23cf6a32cd688227e60e98b3759069.svn-base 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package xin.glue.ui.G.G02;
  2. import xin.glue.ui.common.component.PosSiteLog;
  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.PosRowSet;
  8. /*
  9. * 生产计划 登录与查询
  10. * @author TangLiang 唐亮
  11. * @data 2008.11.7
  12. */
  13. public class SavePRD_QTY extends PosActivity{
  14. public String runActivity(PosContext context)
  15. {
  16. // 从页面获取数据供插入和更新使用
  17. //String[] status = (String[]) context.get("rowStuts");
  18. //日期
  19. String[] PRD_DD = (String[]) context.get("PRD_DD");
  20. //热轧材块数
  21. String[] PRD_HOT_COIL_CH_CNT = (String[]) context.get("PRD_HOT_COIL_CH_CNT");
  22. String[] PRD_HOT_COIL_CH_QTY = (String[]) context.get("PRD_HOT_COIL_CH_QTY");
  23. //厚板材块数
  24. String[] PRD_PLAT_CH_CNT = (String[]) context.get("PRD_PLAT_CH_CNT");
  25. String[] PRD_PLAT_CH_QTY = (String[]) context.get("PRD_PLAT_CH_QTY");
  26. //冷轧材块数
  27. String[] PRD_COLD_COIL_CH_CNT = (String[]) context.get("PRD_COLD_COIL_CH_CNT");
  28. String[] PRD_COLD_COIL_CH_QTY = (String[]) context.get("PRD_COLD_COIL_CH_QTY");
  29. String[] PRD_OUT_SLAB_CH_CNT = (String[]) context.get("PRD_OUT_SLAB_CH_CNT");
  30. String[] PRD_OUT_SLAB_CH_QTY = (String[]) context.get("PRD_OUT_SLAB_CH_QTY");
  31. //热轧材板坯数
  32. String[] PRD_HOT_COIL_SLAB_QTY = (String[]) context.get("PRD_HOT_COIL_SLAB_QTY");
  33. //厚板材板坯树
  34. String[] PRD_PLAT_SLAB_QTY = (String[]) context.get("PRD_PLAT_SLAB_QTY");
  35. //冷轧材板坯数
  36. String[] PRD_COLD_COIL_SLAB_QTY = (String[]) context.get("PRD_COLD_COIL_SLAB_QTY");
  37. String[] PRD_OUT_SLAB_SLAB_QTY = (String[]) context.get("PRD_OUT_SLAB_SLAB_QTY");
  38. String[] PRD_HOT_COIL_QTY = (String[]) context.get("PRD_HOT_COIL_QTY");
  39. String[] PRD_COIL_COIL_QTY = (String[]) context.get("PRD_COIL_COIL_QTY");
  40. //年月
  41. String[] PRD_YYYYMM = (String[]) context.get("PRD_YYYYMM");
  42. for(int i=0;i<PRD_DD.length;i++){
  43. PosParameter param0 = new PosParameter();
  44. //判断日期信息是否存在,如果存在的话使用更新,否则使用插入
  45. param0.setWhereClauseParameter(0, PRD_YYYYMM[i]);
  46. param0.setWhereClauseParameter(1, PRD_DD[i]);
  47. String sql = "select * from TBG02_SMS_DAILY_REPORT where SUBSTR(REP_DATE,1,6) = ? and SUBSTR(REP_DATE,7,2) = ?";
  48. PosRowSet rowset1 = getDao("mesdao").findByQueryStatement(sql, param0);
  49. if(rowset1.hasNext()){
  50. //更新
  51. PosParameter param1 = new PosParameter();
  52. param1.setWhereClauseParameter(0, PRD_HOT_COIL_CH_CNT[i]);
  53. param1.setWhereClauseParameter(1, PRD_HOT_COIL_CH_QTY[i]);
  54. param1.setWhereClauseParameter(2, PRD_PLAT_CH_CNT[i]);
  55. param1.setWhereClauseParameter(3, PRD_PLAT_CH_QTY[i]);
  56. param1.setWhereClauseParameter(4, PRD_COLD_COIL_CH_CNT[i]);
  57. param1.setWhereClauseParameter(5, PRD_COLD_COIL_CH_QTY[i]);
  58. param1.setWhereClauseParameter(6, PRD_OUT_SLAB_CH_CNT[i]);
  59. param1.setWhereClauseParameter(7, PRD_OUT_SLAB_CH_QTY[i]);
  60. param1.setWhereClauseParameter(8, PRD_HOT_COIL_SLAB_QTY[i]);
  61. param1.setWhereClauseParameter(9, PRD_PLAT_SLAB_QTY[i]);
  62. param1.setWhereClauseParameter(10,PRD_COLD_COIL_SLAB_QTY[i]);
  63. param1.setWhereClauseParameter(11,PRD_OUT_SLAB_SLAB_QTY[i]);
  64. param1.setWhereClauseParameter(12,PRD_HOT_COIL_QTY[i]);
  65. param1.setWhereClauseParameter(13,PRD_COIL_COIL_QTY[i]);
  66. param1.setWhereClauseParameter(14,PRD_DD[i]);
  67. param1.setWhereClauseParameter(15,PRD_YYYYMM[i]);
  68. getDao("mesdao").update("UIG020200_01.update", param1);
  69. // 打印日志
  70. PosSiteLog.writeLog(context, getDao("mesdao"),"UIG020200_01.update", param1.getWhereClauseParamters());
  71. }else{
  72. //插入
  73. PosParameter param1 = new PosParameter();
  74. param1.setValueParamter(0, PRD_YYYYMM[i]);
  75. param1.setValueParamter(1, PRD_DD[i]);
  76. param1.setValueParamter(2, PRD_HOT_COIL_CH_CNT[i]);
  77. param1.setValueParamter(3, PRD_HOT_COIL_CH_QTY[i]);
  78. param1.setValueParamter(4, PRD_PLAT_CH_CNT[i]);
  79. param1.setValueParamter(5, PRD_PLAT_CH_QTY[i]);
  80. param1.setValueParamter(6, PRD_COLD_COIL_CH_CNT[i]);
  81. param1.setValueParamter(7, PRD_COLD_COIL_CH_QTY[i]);
  82. param1.setValueParamter(8, PRD_OUT_SLAB_CH_CNT[i]);
  83. param1.setValueParamter(9, PRD_OUT_SLAB_CH_QTY[i]);
  84. param1.setValueParamter(10, PRD_HOT_COIL_SLAB_QTY[i]);
  85. param1.setValueParamter(11, PRD_PLAT_SLAB_QTY[i]);
  86. param1.setValueParamter(12, PRD_COLD_COIL_SLAB_QTY[i]);
  87. param1.setValueParamter(13, PRD_OUT_SLAB_SLAB_QTY[i]);
  88. param1.setValueParamter(14, PRD_HOT_COIL_QTY[i]);
  89. param1.setValueParamter(15, PRD_COIL_COIL_QTY[i]);
  90. getDao("mesdao").insert("UIG020200_01.insert", param1);
  91. // 打印日志
  92. PosSiteLog.writeLog(context, getDao("mesdao"),"UIG020200_01.insert", param1.getValueParameters());
  93. }
  94. }
  95. return PosBizControlConstants.SUCCESS;
  96. }
  97. }