ChildTaskPlanServiceImpl.java
1.23 KB
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
package com.bsth.service.realcontrol.impl;
import java.util.Map;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bsth.entity.realcontrol.ChildTaskPlan;
import com.bsth.entity.realcontrol.ScheduleRealInfo;
import com.bsth.service.impl.BaseServiceImpl;
import com.bsth.service.realcontrol.ChildTaskPlanService;
import com.bsth.service.realcontrol.buffer.ScheduleBuffer;
import com.bsth.vehicle.common.CommonMapped;
@Service
public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{
@Autowired
ScheduleRealInfoServiceImpl scheduleRealInfoService;
@Transactional
@Override
public Map<String, Object> save(ChildTaskPlan t) {
Map<String, Object> rs;
//保存起终点名称
Map<String, String> map = CommonMapped.stationCodeMap;
t.setStartStationName(map.get(t.getStartStation()));
t.setEndStationName(map.get(t.getEndStation()));
//rs = super.save(t);
ScheduleRealInfo sch = ScheduleBuffer.findOne(t.getSchedule().getId());
sch.getcTasks().add(t);
rs = scheduleRealInfoService.save(sch);
return rs;
}
}