124ddcd134593dede8453caf16ee41268324a9f3.svn-base 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package xin.glue.ui.D.D01;
  2. import java.sql.CallableStatement;
  3. import com.posdata.glue.PosException;
  4. import com.posdata.glue.biz.activity.PosActivity;
  5. import com.posdata.glue.biz.constants.PosBizControlConstants;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.PosGenericDao;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. import com.posdata.glue.dao.vo.PosRowSet;
  10. /**
  11. * 板坯组合设计
  12. * @author 万磊
  13. * @date 2019-9-10
  14. */
  15. public class SaveAssembleAddSlab extends PosActivity
  16. {
  17. public String runActivity(PosContext context)
  18. {
  19. //从页面获取一系列参数,供更新数据所用
  20. String[] chk = (String[]) context.get("CHK");
  21. String[] ORD_NO = (String[]) context.get("ORD_NO");//板坏号
  22. String[] ORD_SEQ = (String[])context.get("ORD_SEQ");
  23. StringBuffer P_ORD = new StringBuffer();
  24. //组织三个参数群,分别供查询,更新和插入数据所用
  25. //PosParameter parameter = null;
  26. CallableStatement cstm = null;
  27. PosGenericDao dao = this.getDao("mesdao");
  28. //PosRowSet rowSet = null;
  29. if (chk != null)
  30. {
  31. for (int i = 0; i < chk.length; i++)
  32. {
  33. if(chk[i] == null || chk[i].equals("false")){
  34. continue;
  35. }else{
  36. P_ORD.append(ORD_NO[i]).append("+").append(ORD_SEQ[i]).append("|");
  37. }
  38. }
  39. try
  40. {
  41. cstm = dao.getCallableStatement("tbd01_slabdn_addassemble.call");
  42. cstm.setString(1, P_ORD.toString());
  43. cstm.setString(2, "");
  44. cstm.setString(3, "");
  45. cstm.setString(4, "");
  46. cstm.registerOutParameter(5, java.sql.Types.VARBINARY);
  47. cstm.registerOutParameter(6, java.sql.Types.VARBINARY);
  48. cstm.execute();
  49. //String errorCD = cstm.getString(5);
  50. String errorMsg = cstm.getString(6);
  51. if(errorMsg != null && !"".equals(errorMsg)){
  52. context.put("errorMsg", errorMsg);
  53. return PosBizControlConstants.FAILURE;
  54. }
  55. }catch(Exception ex)
  56. {
  57. return PosBizControlConstants.FAILURE;
  58. }
  59. finally
  60. {
  61. if(cstm != null)
  62. {
  63. try
  64. {
  65. cstm.close();
  66. }
  67. catch(Exception e)
  68. {
  69. e.printStackTrace();
  70. }
  71. }
  72. }
  73. }
  74. return PosBizControlConstants.SUCCESS;
  75. }
  76. }