Blame view

backend/calendar/src/main/java/com/hotent/Calendar/conf/CalendarConfig.java 1.12 KB
8d73e917   陈威   初始化提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.hotent.Calendar.conf;

import java.util.TreeMap;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.hotent.Calendar.calc.ICalendarCalc;
import com.hotent.Calendar.calc.impl.AbsenceCalc;
import com.hotent.Calendar.calc.impl.OverCalc;
import com.hotent.Calendar.calc.impl.ShiftCalc;

@Configuration
public class CalendarConfig {
	
	@Bean(name="shiftCalc")
	public ShiftCalc shiftCalc(){
		return  new ShiftCalc();
	}
	
	@Bean(name="absenceCalc")
	public AbsenceCalc absenceCalc(){
		return  new AbsenceCalc();
	}
	
	@Bean(name="overCalc")
	public OverCalc overCalc(){
		return  new OverCalc();
	}
	
	@Bean(name="calendarCalcMap")
	public TreeMap<Integer, ICalendarCalc> pluginExecutionCommand(
			@Qualifier("shiftCalc") ShiftCalc shiftCalc,
			@Qualifier("absenceCalc") AbsenceCalc absenceCalc,
			@Qualifier("overCalc") OverCalc overCalc){
		TreeMap map = new TreeMap<Integer, ICalendarCalc>();
		map.put(1, shiftCalc);
		map.put(2, absenceCalc);
		map.put(3, overCalc);
		return  map;
	}
	
	
}