4cebce80fdd1de918c30edf1cba881442ef05eab.svn-base 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package com.kingdee.eas.custom.ats.util;
  2. import com.kingdee.bos.BOSException;
  3. import com.kingdee.bos.Context;
  4. import com.kingdee.bos.dao.IObjectPK;
  5. import com.kingdee.eas.common.EASBizException;
  6. import com.kingdee.eas.custom.ats.AtsLeaveBillDetailSameFactory;
  7. import com.kingdee.eas.hr.ats.AtsLeaveBillEntryCollection;
  8. import com.kingdee.eas.hr.ats.AtsLeaveBillEntryFactory;
  9. import com.kingdee.eas.hr.ats.AtsLeaveBillInfo;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. /**
  13. * 操作工具类工具类
  14. * @author zkwuh
  15. *
  16. */
  17. public class AtsLeaveBillEasOperationUtil {
  18. private static final Logger logger = LoggerFactory.getLogger(AtsLeaveBillEasOperationUtil.class);
  19. /**
  20. * 将数据存入新的拆分表
  21. * @param ctx
  22. * @param atsLeaveBillInfo
  23. * @throws BOSException
  24. * @throws EASBizException
  25. */
  26. public static void saveInfo(Context ctx,AtsLeaveBillInfo atsLeaveBillInfo) {
  27. try {
  28. logger.info("AtsLeaveBillOperationUtil....saveInfo....start");
  29. int size = atsLeaveBillInfo.getEntries().size();
  30. AtsLeaveBillEntryCollection billEntryColl = AtsLeaveBillEntryFactory.getLocalInstance(ctx)
  31. .getAtsLeaveBillEntryCollection(" where bill='" + atsLeaveBillInfo.getId().toString() + "'");
  32. for (int i = 0; i < size; ++i) {
  33. AtsLeaveEasBillSameSplitHelper atsLeaveBillSplitHelper = new AtsLeaveEasBillSameSplitHelper(ctx, atsLeaveBillInfo,
  34. billEntryColl.get(i));
  35. atsLeaveBillSplitHelper.splitLeaveBill();
  36. }
  37. }catch(Exception e) {
  38. logger.info("AtsLeaveBillOperationUtil....saveInfo...",e);
  39. }
  40. }
  41. /**
  42. * 删除拆分表数据
  43. * @param ctx
  44. * @param atsLeaveBillInfo
  45. * @throws EASBizException
  46. * @throws BOSException
  47. */
  48. public static void deleteInfo(Context ctx,String Id) {
  49. try {
  50. String sql=" where leavebill in "+Id +" ";
  51. IObjectPK[] delete = AtsLeaveBillDetailSameFactory.getLocalInstance(ctx).delete(sql);
  52. }catch(Exception e) {
  53. logger.info("AtsLeaveBillOperationUtil....deleteInfo...",e);
  54. }
  55. }
  56. }