5e7ca6a2c0fabc1f608fdf72383317b7b7d4b5ab.svn-base 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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.PosGenericDao;
  6. import com.posdata.glue.dao.vo.PosParameter;
  7. import com.posdata.glue.dao.vo.PosRowSet;
  8. /**
  9. * 用于判断在交付条件界面中修改或插入的“交付条件标准”是否存在
  10. * 不存在则不允许插入或者修改(注意:删除在这里会受到影响)
  11. * 界面ID:UIB010260
  12. * @author 梅贵平{meiguiping}
  13. * @date 2008-10-24
  14. */
  15. public class FindExistsDevSpecCD extends PosActivity
  16. {
  17. public String runActivity(PosContext context)
  18. {
  19. String[] DEV_SPEC_CD = (String[])context.get("DEV_SPEC_CD");//交付条件标准
  20. String[] rowStatus = (String[])context.get("rowStatus");
  21. //若在交付条件界面中发生了更改(包括删除,插入,修改)
  22. if(rowStatus != null)
  23. {
  24. PosParameter param= null;
  25. PosGenericDao dao = this.getDao("mesdao");
  26. PosRowSet rowset = null;
  27. int len = rowStatus.length;
  28. for(int i=0; i < len; i++)
  29. {
  30. param = new PosParameter();
  31. param.setWhereClauseParameter(0, DEV_SPEC_CD[i]);//按“交付条件标准”查询
  32. rowset = dao.find("UIB010260_03.SELECT", param);
  33. //若无记录,则rowset.count()的值会为0
  34. if(rowset.count()==0)
  35. return "saveFailure";
  36. }
  37. }
  38. return PosBizControlConstants.SUCCESS;
  39. }
  40. }