AtsLeaveBillOperationUtil.java 2.0 KB

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