7ac5d7dd4298b55cdf450ed794c32f51c12ff4b8.svn-base 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package xin.glue.ui.H.H05;
  2. import xin.glue.ui.common.PosGridSave;
  3. //import xin.glue.ui.common.component.PosSiteConfig;
  4. import xin.glue.ui.common.component.PosSiteLog;
  5. import com.posdata.glue.biz.activity.PosActivity;
  6. import com.posdata.glue.biz.constants.PosBizControlConstants;
  7. import com.posdata.glue.context.PosContext;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. import com.posdata.glue.dao.vo.PosRowSet;
  10. /*
  11. * 钢卷仓库CRANE 命令执行
  12. * @author TangLiang 唐亮
  13. * 由于钢卷库标准登录与查询新增和修改时,更新的信息是根据种类和钢卷存放信息来判断的。
  14. * 如果已经存在种类和钢卷存放信息就更新,不存在就插入。rowStuts标识位无法起到判断左右
  15. * @data 2008.11.17
  16. */
  17. public class SaveSCOIL_NO extends PosActivity{
  18. public String runActivity(PosContext context)
  19. {
  20. // 从页面获取数据供插入和更新使用
  21. //行状态
  22. String[] rowStuts = (String[]) context.get("rowStuts");
  23. //选择标志
  24. String[] CHK = (String[]) context.get("CHK");
  25. //种类
  26. String[] AREA_KIND = (String[]) context.get("AREA_KIND");
  27. //钢卷存放地址信息
  28. String[] YARD_ADDR = (String[]) context.get("YARD_ADDR");
  29. //来源钢号
  30. String[] FROM_STL_GRD = (String[]) context.get("FROM_STL_GRD");
  31. //去向钢号
  32. String[] TO_STL_GRD = (String[]) context.get("TO_STL_GRD");
  33. //钢号1
  34. String[] STL_GRD1 = (String[]) context.get("STL_GRD1");
  35. //钢号2
  36. String[] STL_GRD2 = (String[]) context.get("STL_GRD2");
  37. //钢号3
  38. String[] STL_GRD3 = (String[]) context.get("STL_GRD3");
  39. //钢号4
  40. String[] STL_GRD4 = (String[]) context.get("STL_GRD4");
  41. //钢号5
  42. String[] STL_GRD5 = (String[]) context.get("STL_GRD5");
  43. //钢号6
  44. String[] STL_GRD6 = (String[]) context.get("STL_GRD6");
  45. //钢号7
  46. String[] STL_GRD7 = (String[]) context.get("STL_GRD7");
  47. //循环rowStuts,取出相应的接点行数
  48. for(int i=0;i<rowStuts.length;i++){
  49. //如果选择标志为Y的情况,说明是需要操作的。
  50. if(CHK[i].equals("Y")){
  51. // 定义查询sql语句
  52. String sql = "select area_kind,yard_addr from TBH05_YARD_STD_STOCK where area_kind = ? and yard_addr = ? ";
  53. PosParameter param0 = new PosParameter();
  54. param0.setWhereClauseParameter(0, AREA_KIND[i]);
  55. param0.setWhereClauseParameter(1, YARD_ADDR[i]);
  56. PosRowSet rows = getDao("mesdao").findByQueryStatement(sql, param0);
  57. if(rows.hasNext()){
  58. //更新操作
  59. PosParameter param1 = new PosParameter();
  60. param1.setWhereClauseParameter(0, FROM_STL_GRD[i]);
  61. param1.setWhereClauseParameter(1, TO_STL_GRD[i]);
  62. param1.setWhereClauseParameter(2, STL_GRD1[i]);
  63. param1.setWhereClauseParameter(3, STL_GRD2[i]);
  64. param1.setWhereClauseParameter(4, STL_GRD3[i]);
  65. param1.setWhereClauseParameter(5, STL_GRD4[i]);
  66. param1.setWhereClauseParameter(6, STL_GRD5[i]);
  67. param1.setWhereClauseParameter(7, STL_GRD6[i]);
  68. param1.setWhereClauseParameter(8, STL_GRD7[i]);
  69. param1.setWhereClauseParameter(9, AREA_KIND[i]);
  70. param1.setWhereClauseParameter(10, YARD_ADDR[i]);
  71. getDao("mesdao").update("UIH050100_01.update", param1);
  72. //打印日志
  73. // if (PosSiteConfig.writeLog)
  74. // PosSiteLog.writeLog(context, getDao("mesdao"),"UIH050100_01.update", param1.getWhereClauseParamters());
  75. }else{
  76. //插入操作
  77. PosParameter param1 = new PosParameter();
  78. param1.setValueParamter(0, AREA_KIND[i]);
  79. param1.setValueParamter(1, YARD_ADDR[i]);
  80. param1.setValueParamter(2, FROM_STL_GRD[i]);
  81. param1.setValueParamter(3, TO_STL_GRD[i]);
  82. param1.setValueParamter(4, STL_GRD1[i]);
  83. param1.setValueParamter(5, STL_GRD2[i]);
  84. param1.setValueParamter(6, STL_GRD3[i]);
  85. param1.setValueParamter(7, STL_GRD4[i]);
  86. param1.setValueParamter(8, STL_GRD5[i]);
  87. param1.setValueParamter(9, STL_GRD6[i]);
  88. param1.setValueParamter(10, STL_GRD7[i]);
  89. getDao("mesdao").insert("UIH050100_01.insert", param1);
  90. // 打印日志
  91. // if (PosSiteConfig.writeLog)
  92. // PosSiteLog.writeLog(context, getDao("mesdao"),"UIH050100_01.insert", param1.getValueParameters());
  93. }
  94. }
  95. }
  96. return PosBizControlConstants.SUCCESS;
  97. }
  98. }