55240898b82d46954c873991357b6cdfda97d2e9.svn-base 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package xin.glue.ui.H.H01;
  2. /********
  3. 为轧制标准作一个维护厚度组的类,以便厚度组范围变化的时候使用
  4. ************/
  5. import com.posdata.glue.biz.activity.PosActivity;
  6. import com.posdata.glue.biz.constants.PosBizControlConstants;
  7. import com.posdata.glue.biz.control.PosBizControlIF;
  8. import com.posdata.glue.biz.control.PosBizProvider;
  9. import com.posdata.glue.component.PosConstants;
  10. import com.posdata.glue.context.PosContext;
  11. import com.posdata.glue.dao.vo.PosParameter;
  12. import com.posdata.glue.dao.vo.PosRow;
  13. import com.posdata.glue.dao.vo.PosRowSet;
  14. import com.posdata.glue.msg.PosMESMessageImpl;
  15. import com.posdata.glue.msg.PosMessage;
  16. public class XINTHKStd extends PosActivity{
  17. public String runActivity(PosContext context)
  18. {
  19. // 从页面获取参数数据,供更新页面使用
  20. //行状态
  21. String[] rowStuts = (String[])context.get("rowStuts1");
  22. //选择标志
  23. String[] CHK = (String[])context.get("CHK");
  24. //厚度组
  25. String[] THK_TGT = (String[])context.get("THK_TGT");
  26. //钢号
  27. String[] STL_GRD = (String[])context.get("STL_GRD");
  28. //下限值
  29. String[] THK_MIN = (String[])context.get("THK_MIN");
  30. //下限值符号标志
  31. String[] THK_MIN_LABEL = (String[])context.get("THK_MIN_LABEL");
  32. //上限值
  33. String[] THK_MAX = (String[])context.get("THK_MAX");
  34. //上限值符号标志
  35. String[] THK_MAX_LABEL = (String[])context.get("THK_MAX_LABEL");
  36. //登录人
  37. String[] REG_ID = (String[])context.get("REG_ID");
  38. //登录人
  39. String name = null;
  40. //这里需要获取登录的用户名,但是数组中只有一个存在值,所以循环取出
  41. for(int j=0;j<REG_ID.length;j++){
  42. if(!REG_ID[j].equals("") && REG_ID[j] != null){
  43. name = REG_ID[j];
  44. }
  45. }
  46. for(int i=0;i<rowStuts.length;i++){
  47. //选中的情况,才能够增加或者更新厚度组数据
  48. if(CHK[i].equals("Y")){
  49. //这里需要判断厚度组标志是否存在,不存在就更新。存在就插入
  50. PosParameter param0 = new PosParameter();
  51. param0.setWhereClauseParameter(0, THK_TGT[i]);
  52. PosRowSet thkVow = getDao("mesdao").find("UIH010030_02.select", param0);
  53. if(thkVow.hasNext()){
  54. //更新
  55. PosParameter param1 = new PosParameter();
  56. param1.setWhereClauseParameter(0, STL_GRD[i]);
  57. param1.setWhereClauseParameter(1, THK_MIN[i]);
  58. param1.setWhereClauseParameter(2, THK_MIN_LABEL[i]);
  59. param1.setWhereClauseParameter(3, THK_MAX[i]);
  60. param1.setWhereClauseParameter(4, THK_MAX_LABEL[i]);
  61. param1.setWhereClauseParameter(5, name);
  62. param1.setWhereClauseParameter(6, THK_TGT[i]);
  63. getDao("mesdao").update("UIH010030_01.update", param1);
  64. logger.logInfo("THKStd---> THK_tgt UPDATE"+param1);
  65. }else{
  66. //插入
  67. //if(!THK_TGT[i].equals("") && THK_TGT[i]!= null){
  68. PosParameter param1 = new PosParameter();
  69. //param1.setValueParamter(0, THK_TGT[i]);
  70. param1.setValueParamter(0, STL_GRD[i]);
  71. param1.setValueParamter(1, THK_MIN[i]);
  72. param1.setValueParamter(2, THK_MIN_LABEL[i]);
  73. param1.setValueParamter(3, THK_MAX[i]);
  74. param1.setValueParamter(4, THK_MAX_LABEL[i]);
  75. param1.setValueParamter(5, name);
  76. getDao("mesdao").insert("UIH010030_01.insert", param1);
  77. logger.logInfo("THKStd---> THK_tgt INSERT"+param1);
  78. //}
  79. }
  80. }
  81. }
  82. return PosBizControlConstants.SUCCESS;
  83. }
  84. }