1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.batch;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.kuali.ole.gl.batch.service.OrganizationReversionProcessService;
22 import org.kuali.ole.gl.batch.service.YearEndService;
23 import org.kuali.ole.sys.OLEConstants;
24 import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
25 import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
26 import org.springframework.util.StopWatch;
27
28
29
30
31
32 public class OrganizationReversionPriorYearAccountStep extends AbstractWrappedBatchStep {
33 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(OrganizationReversionPriorYearAccountStep.class);
34 private OrganizationReversionProcessService organizationReversionProcessService;
35 private YearEndService yearEndService;
36
37
38
39
40 @Override
41 protected CustomBatchExecutor getCustomBatchExecutor() {
42 return new CustomBatchExecutor() {
43
44
45
46
47
48
49 public boolean execute() {
50 StopWatch stopWatch = new StopWatch();
51 stopWatch.start("OrganizationReversionPriorYearAccountStep");
52
53 Map jobParameters = organizationReversionProcessService.getJobParameters();
54 Map<String, Integer> organizationReversionCounts = new HashMap<String, Integer>();
55
56 getYearEndService().logAllMissingPriorYearAccounts((Integer) jobParameters.get(OLEConstants.UNIV_FISCAL_YR));
57 getYearEndService().logAllMissingSubFundGroups((Integer) jobParameters.get(OLEConstants.UNIV_FISCAL_YR));
58
59 getOrganizationReversionProcessService().organizationReversionPriorYearAccountProcess(jobParameters, organizationReversionCounts);
60
61 stopWatch.stop();
62 LOG.info("OrganizationReversionPriorYearAccountStep took " + (stopWatch.getTotalTimeSeconds() / 60.0) + " minutes to complete");
63 return true;
64 }
65 };
66 }
67
68
69
70
71
72
73
74
75
76 public void setOrganizationReversionProcessService(OrganizationReversionProcessService organizationReversionProcessService) {
77 this.organizationReversionProcessService = organizationReversionProcessService;
78 }
79
80
81
82
83
84 public YearEndService getYearEndService() {
85 return yearEndService;
86 }
87
88
89
90
91
92 public void setYearEndService(YearEndService yearEndService) {
93 this.yearEndService = yearEndService;
94 }
95
96
97
98
99
100 public OrganizationReversionProcessService getOrganizationReversionProcessService() {
101 return organizationReversionProcessService;
102 }
103
104 }