b7580dfcb1c251d22f1c35290bb01bcefc2adccb.svn-base 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.kingdee.eas.hr.affair.app;
  2. import com.kingdee.bos.BOSException;
  3. import com.kingdee.bos.Context;
  4. import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
  5. import com.kingdee.bos.util.BOSUuid;
  6. import com.kingdee.eas.basedata.person.PersonFactory;
  7. import com.kingdee.eas.basedata.person.PersonInfo;
  8. import com.kingdee.eas.common.EASBizException;
  9. import com.kingdee.eas.custom.facade.leave.LeaveAllowanceFacadeFactory;
  10. import com.kingdee.eas.hr.affair.*;
  11. import com.kingdee.eas.hr.base.HRBillBaseEntryInfo;
  12. import com.kingdee.util.DateTimeUtils;
  13. import java.util.Date;
  14. import java.util.HashMap;
  15. /**
  16. * @ClassName FluctuationBizBillControllerBeanEx
  17. * @Description 调动单controllerbean扩展
  18. * @Author VenkoXie
  19. * @Date 2024/2/22 11:02
  20. * @Version 1.0
  21. **/
  22. public class FluctuationBizBillControllerBeanEx extends FluctuationBizBillControllerBean{
  23. /**
  24. * 审批通过
  25. * @param ctx
  26. * @param entry
  27. * @throws BOSException
  28. * @throws EASBizException
  29. */
  30. @Override
  31. protected void _entryEffectOthers(Context ctx, HRBillBaseEntryInfo entry) throws BOSException, EASBizException {
  32. super._entryEffectOthers(ctx, entry);
  33. HRAffairBizBillEntryInfo affairEntry = (HRAffairBizBillEntryInfo)entry;
  34. HashMap param = new HashMap();
  35. int year = DateTimeUtils.getYear(new Date());
  36. PersonInfo pInfo = PersonFactory.getLocalInstance(ctx).getPersonInfo(new ObjectUuidPK(affairEntry.getPerson().getId()));
  37. LeaveAllowanceFacadeFactory.getLocalInstance(ctx).createAnnualLeave(year, pInfo.getNumber());
  38. }
  39. /**
  40. * 反审批
  41. * @param ctx
  42. * @param billId
  43. * @throws BOSException
  44. * @throws EASBizException
  45. */
  46. @Override
  47. protected void _passUnaudit(Context ctx, BOSUuid billId) throws BOSException, EASBizException {
  48. super._passUnaudit(ctx, billId);
  49. FluctuationBizBillEntryCollection entryCollection = FluctuationBizBillEntryFactory.getLocalInstance(ctx).getFluctuationBizBillEntryCollection("where bill.id = '" + billId + "'");
  50. int year = DateTimeUtils.getYear(new Date());
  51. for (int i = 0; i < entryCollection.size(); i++) {
  52. HRAffairBizBillEntryInfo affairEntry = (HRAffairBizBillEntryInfo)entryCollection.get(i);
  53. PersonInfo pInfo = PersonFactory.getLocalInstance(ctx).getPersonInfo(new ObjectUuidPK(affairEntry.getPerson().getId()));
  54. LeaveAllowanceFacadeFactory.getLocalInstance(ctx).createAnnualLeave(year, pInfo.getNumber());
  55. }
  56. }
  57. }