8f7353189ce5462d15df3d46c89992aa1f6daa0d.svn-base 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package xin.glue.ui.B.B01;
  2. import com.posdata.glue.biz.activity.PosActivity;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.context.PosContext;
  5. import com.posdata.glue.dao.vo.PosParameter;
  6. import com.posdata.glue.dao.vo.PosRow;
  7. import com.posdata.glue.dao.vo.PosRowSet;
  8. public class SaveFacIngr extends PosActivity
  9. {
  10. public String runActivity(PosContext context)
  11. {
  12. String[] no = (String[])context.get("no");
  13. String[] seq = (String[])context.get("seq");
  14. String[] fac = (String[])context.get("fac");
  15. String[] ord = (String[])context.get("ord");
  16. PosParameter param = new PosParameter();
  17. param.setWhereClauseParameter(0, fac[0]);
  18. PosRowSet rowset = getDao("mesdao").find("UIB015020_08.SELECT", param);
  19. param = new PosParameter();
  20. param.setWhereClauseParameter(0, no[0]);
  21. param.setWhereClauseParameter(1, seq[0]);
  22. getDao("mesdao").delete("UIB015020_09.DELETE", param);
  23. param = new PosParameter();
  24. param.setWhereClauseParameter(0, fac[0]);
  25. param.setWhereClauseParameter(1, no[0]);
  26. param.setWhereClauseParameter(2, seq[0]);
  27. getDao("mesdao").update("UIB015020_10.UPDATE", param);
  28. PosRow row = null;
  29. while(rowset.hasNext()){
  30. row = rowset.next();
  31. param = new PosParameter();
  32. param.setValueParamter(0, no[0]);
  33. param.setValueParamter(1, seq[0]);
  34. if(row.getAttribute("chem_cd") == null)
  35. {
  36. param.setValueParamter(2,"");
  37. }
  38. else
  39. {
  40. param.setValueParamter(2,row.getAttribute("chem_cd").toString());
  41. }
  42. if(row.getAttribute("chem_aim") == null)
  43. {
  44. param.setValueParamter(3,"");
  45. }
  46. else
  47. {
  48. param.setValueParamter(3,row.getAttribute("chem_aim").toString());
  49. }
  50. if(row.getAttribute("chem_min") == null)
  51. {
  52. param.setValueParamter(4,"");
  53. }
  54. else
  55. {
  56. param.setValueParamter(4,row.getAttribute("chem_min").toString());
  57. }
  58. if(row.getAttribute("chem_max") == null)
  59. {
  60. param.setValueParamter(5,"");
  61. }
  62. else
  63. {
  64. param.setValueParamter(5,row.getAttribute("chem_max").toString());
  65. }
  66. getDao("mesdao").insert("UIB015020_11.INSERT", param);
  67. }
  68. return PosBizControlConstants.SUCCESS;
  69. }
  70. }