LineInformationServiceImpl.java
2.42 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.bsth.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.bsth.common.ResponseCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bsth.entity.LineInformation;
import com.bsth.repository.LineInformationRepository;
import com.bsth.service.LineInformationService;
import com.google.common.base.Splitter;
import org.springframework.transaction.annotation.Transactional;
/**
*
* @ClassName: LineInformationServiceImpl(线路标准信息service业务层实现类)
*
* @Extends : BaseService
*
* @Description: TODO(路段service业务层)
*
* @Author bsth@lq
*
* @Date 2016年05月03日 上午9:21:17
*
* @Version 公交调度系统BS版 0.1
*
*/
@Service
public class LineInformationServiceImpl extends BaseServiceImpl<LineInformation, Integer> implements LineInformationService{
@Autowired
LineInformationRepository lineInformationRepository;
@Override
public List<LineInformation> findByLine(String lineCodes) {
List<String> list = Splitter.on(",").omitEmptyStrings().splitToList(lineCodes);
if(list.size() == 0)
return null;
return lineInformationRepository.findByLine(list);
}
@Transactional
@Override
public Map<String, Object> update(LineInformation i) {
Map<String, Object> map = new HashMap<>();
int status = lineInformationRepository.update(i.getType(), i.getTotalMileage(), i.getEmptyMileage(), i.getUpMileage(),
i.getDownMileage(), i.getUpTravelTime(), i.getDownTravelTime(), i.getEarlyStartTime(), i.getEarlyEndTime(),i.getLateStartTime(),
i.getLateEndTime(), i.getXygfkssj(), i.getXygfjssj(), i.getEarlyUpTime(), i.getEarlyDownTime(),i.getLateUpTime(),
i.getLateDownTime(), i.getNightStartTime(), i.getNightEndTime(), i.getTroughUpTime(), i.getTroughDownTime(),i.getCarPark(),
i.getUpInTimer(), i.getUpOutTimer(), i.getDownInTimer(), i.getDownOutTimer(), i.getEarlyIntervalLg(),i.getLateIntervalLg(),
i.getIntervalLg(), i.getSpeedLimit(), i.getRainLimit(), i.getFogLimit(), i.getSnowLimit(),i.getFestivalSpeedLimit(),
i.getLagStation(), i.getSkip(), i.getSpeeding(), i.getCrossedLine(), i.getOverflights(),i.getDescriptions(),
i.getLine().getId());
if (status==1) {
map.put("status", ResponseCode.SUCCESS);
} else {
map.put("status", ResponseCode.ERROR);
}
return map;
}
}