e71ea392522add8600235721457fc0247120172f.svn-base 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package xin.glue.ui.B.B01;
  2. import xin.glue.ui.B.common.SaveModifyHistory;
  3. import com.posdata.glue.biz.activity.PosActivity;
  4. import com.posdata.glue.biz.constants.PosBizControlConstants;
  5. import com.posdata.glue.biz.control.PosBizController;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.PosGenericDao;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. /**
  10. * 客户公差信息保存(对应UIB010280界面)
  11. * @author 梅贵平
  12. * @date 2010-08-10
  13. */
  14. public class SaveCustDel extends PosActivity
  15. {
  16. public String runActivity(PosContext context)
  17. {
  18. PosGenericDao dao = this.getDao("mesdao");
  19. PosParameter param = null;
  20. String INFID = "UIB010280";
  21. String[] CUST_CD = (String[])context.get("CUST_CD");//客户公司代码
  22. String[] PRDNM_CD = (String[])context.get("PRDNM_CD");//交货状态
  23. String[] SEQ = (String[])context.get("SEQ");//序号
  24. String[] PROD_LINE = (String[])context.get("PROD_LINE");//产线
  25. String[] SPEC_STL_GRD= (String[])context.get("SPEC_STL_GRD");//标准号
  26. String[] DEL_TOL_CD = (String[])context.get("DEL_TOL_CD");//公差名
  27. String[] TOL_MIN_SYM = (String[])context.get("TOL_MIN_SYM");//下限符号
  28. String[] TOL_MIN = (String[])context.get("TOL_MIN");//下限值
  29. String[] TOL_MAX_SYM = (String[])context.get("TOL_MAX_SYM");//上限符号
  30. String[] TOL_MAX = (String[])context.get("TOL_MAX");//上限值
  31. String[] DEV_RMK = (String[])context.get("DEV_RMK");//备注
  32. String[] REG_NM = (String[])context.get("REG_ID");
  33. String[] rowStatusA = (String[])context.get("rowStatusA");//插入或者修改标记
  34. String[] rowStatusD = (String[])context.get("rowStatusD");//删除标记
  35. String custSpecNo = CUST_CD[0]+PRDNM_CD[0]+SEQ[0]+PROD_LINE[0];
  36. if(rowStatusA != null)
  37. {
  38. int len = rowStatusA.length;
  39. int j = 0;
  40. for(int i = 0; i < len; i++)
  41. {
  42. j = 0;
  43. param = new PosParameter();
  44. if("i".equals(rowStatusA[i]))
  45. {
  46. param.setValueParamter(j++, custSpecNo);
  47. param.setValueParamter(j++, DEL_TOL_CD[i]);
  48. param.setValueParamter(j++, SPEC_STL_GRD[0]);
  49. param.setValueParamter(j++, TOL_MIN_SYM[i]);
  50. param.setValueParamter(j++, TOL_MIN[i]);
  51. param.setValueParamter(j++, TOL_MAX_SYM[i]);
  52. param.setValueParamter(j++, TOL_MAX[i]);
  53. param.setValueParamter(j++, DEV_RMK[i]);
  54. param.setValueParamter(j++, REG_NM[0]);
  55. dao.insert("UIB010280_01.INSERT", param);
  56. SaveModifyHistory.writeLog(dao, INFID, "I", "UIB010280_01.INSERT", param.getValueParameters(), "", REG_NM[0]);
  57. }
  58. else if("u".equals(rowStatusA[i]))
  59. {
  60. param.setWhereClauseParameter(j++, TOL_MIN_SYM[i]);
  61. param.setWhereClauseParameter(j++, TOL_MIN[i]);
  62. param.setWhereClauseParameter(j++, TOL_MAX_SYM[i]);
  63. param.setWhereClauseParameter(j++, TOL_MAX[i]);
  64. param.setWhereClauseParameter(j++, DEV_RMK[i]);
  65. param.setWhereClauseParameter(j++, REG_NM[0]);
  66. param.setWhereClauseParameter(j++, custSpecNo);
  67. param.setWhereClauseParameter(j++, DEL_TOL_CD[i]);
  68. dao.update("UIB010280_01.UPDATE", param);
  69. SaveModifyHistory.writeLog(dao, INFID, "U", "UIB010280_01.UPDATE", param.getWhereClauseParamters(), "", REG_NM[0]);
  70. }
  71. else if("d".equals(rowStatusA[i]))
  72. {
  73. param.setWhereClauseParameter(j++, custSpecNo);
  74. param.setWhereClauseParameter(j++, DEL_TOL_CD[i]);
  75. dao.delete("UIB010280_01.DELETE", param);
  76. SaveModifyHistory.writeLog(dao, INFID, "D", "UIB010280_01.DELETE", param.getWhereClauseParamters(), "", REG_NM[0]);
  77. }
  78. }
  79. }
  80. if(rowStatusD != null)
  81. {
  82. param = new PosParameter();
  83. param.setWhereClauseParameter(0, custSpecNo);
  84. dao.delete("UIB010280_02.DELETE", param);
  85. SaveModifyHistory.writeLog(dao, INFID, "D", "UIB010280_02.DELETE", param.getWhereClauseParamters(), "", REG_NM[0]);
  86. }
  87. return PosBizControlConstants.SUCCESS;
  88. }
  89. }