ZnddLbServiceImpl.java
2.07 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
package com.bsth.service.zndd.impl;
import com.bsth.common.ResponseCode;
import com.bsth.data.schedule.DayOfSchedule;
import com.bsth.entity.realcontrol.ScheduleRealInfo;
import com.bsth.entity.zndd.ZnddLb;
import com.bsth.service.impl.BaseServiceImpl;
import com.bsth.service.realcontrol.ScheduleRealInfoService;
import com.bsth.service.zndd.ZnddLbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class ZnddLbServiceImpl extends BaseServiceImpl<ZnddLb, Integer> implements ZnddLbService {
@Autowired
DayOfSchedule dayOfSchedule;
@Autowired
ScheduleRealInfoService scheduleRealInfoService;
public ScheduleRealInfo queryLineCar(Map m){
String lineCode = m.get("lineCode").toString().trim();
String clZbh = m.get("clZbh").toString().trim();
List<ScheduleRealInfo> srList = dayOfSchedule.findByLineCode(lineCode);
for (ScheduleRealInfo st : srList){
if(st.getClZbh().equals(clZbh) && st.getBcType().equals("normal")){
return st;
}
}
return null;
}
public Map cxlb(Map m){
Map<String, Object> rs = new HashMap<>();
String lineCode = m.get("lineCode").toString().trim();
String clZbh = m.get("clZbh").toString().trim();
List<ScheduleRealInfo> list = new ArrayList();
List<ScheduleRealInfo> srList = dayOfSchedule.findByLineCode(lineCode);
for (ScheduleRealInfo st : srList){
if(st.getClZbh().equals(clZbh)){
Map<String, Object> remap = scheduleRealInfoService.revokeDestroy(st.getId());
//修改成功
if (remap.get("status").toString().equals("200")){
list.add(st);
}
}
}
if (list.size() > 0){
rs.put("status", ResponseCode.SUCCESS);
rs.put("list", list);
return rs;
}
return rs;
}
}