Commit f2f80edc377306aef62fe034bf4752ef10f0ec0e

Authored by 王通
1 parent 033a3f71

1.浦东路单rest接口

src/main/java/com/bsth/entity/ScheduleRealInfo.java
@@ -52,14 +52,10 @@ public class ScheduleRealInfo implements Serializable{ @@ -52,14 +52,10 @@ public class ScheduleRealInfo implements Serializable{
52 private String jGh; 52 private String jGh;
53 /** 驾驶员名字 */ 53 /** 驾驶员名字 */
54 private String jName; 54 private String jName;
55 - /** 驾驶员身份证 */  
56 - private String jId;  
57 /** 售票员工号 */ 55 /** 售票员工号 */
58 private String sGh; 56 private String sGh;
59 /** 售票员名字 */ 57 /** 售票员名字 */
60 private String sName; 58 private String sName;
61 - /** 售票员身份证 */  
62 - private String sId;  
63 59
64 /** 线路方向 */ 60 /** 线路方向 */
65 private String xlDir; 61 private String xlDir;
@@ -275,14 +271,6 @@ public class ScheduleRealInfo implements Serializable{ @@ -275,14 +271,6 @@ public class ScheduleRealInfo implements Serializable{
275 this.jName = jName; 271 this.jName = jName;
276 } 272 }
277 273
278 - public String getjId() {  
279 - return jId;  
280 - }  
281 -  
282 - public void setjId(String jId) {  
283 - this.jId = jId;  
284 - }  
285 -  
286 public String getsGh() { 274 public String getsGh() {
287 return sGh; 275 return sGh;
288 } 276 }
@@ -299,14 +287,6 @@ public class ScheduleRealInfo implements Serializable{ @@ -299,14 +287,6 @@ public class ScheduleRealInfo implements Serializable{
299 this.sName = sName; 287 this.sName = sName;
300 } 288 }
301 289
302 - public String getsId() {  
303 - return sId;  
304 - }  
305 -  
306 - public void setsId(String sId) {  
307 - this.sId = sId;  
308 - }  
309 -  
310 public String getXlDir() { 290 public String getXlDir() {
311 return xlDir; 291 return xlDir;
312 } 292 }
src/main/java/com/bsth/server_rs/waybill/WaybillRestService.java
@@ -9,6 +9,7 @@ import java.util.Set; @@ -9,6 +9,7 @@ import java.util.Set;
9 9
10 import javax.ws.rs.GET; 10 import javax.ws.rs.GET;
11 import javax.ws.rs.Path; 11 import javax.ws.rs.Path;
  12 +import javax.ws.rs.PathParam;
12 import javax.ws.rs.Produces; 13 import javax.ws.rs.Produces;
13 import javax.ws.rs.core.MediaType; 14 import javax.ws.rs.core.MediaType;
14 15
@@ -47,16 +48,15 @@ public class WaybillRestService { @@ -47,16 +48,15 @@ public class WaybillRestService {
47 fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); 48 fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
48 49
49 @GET 50 @GET
50 - @Path("/")  
51 - public Map<String, Object> waybill(Map<String, Object> param) { 51 + @Path("/{companyCode}/{rq}")
  52 + public Map<String, Object> waybill(@PathParam("companyCode") String companyCode, @PathParam("rq") String rq) {
52 Map<String, Object> map = new HashMap<String, Object>(); 53 Map<String, Object> map = new HashMap<String, Object>();
53 - String rq = (String)param.get("date"), companyId = (String)param.get("companyCode");  
54 try { 54 try {
55 //日期减一天,老接口是这样的 55 //日期减一天,老接口是这样的
56 String prveRq = fmtyyyyMMdd.print(fmtyyyyMMdd.parseDateTime(rq).minusDays(1)); 56 String prveRq = fmtyyyyMMdd.print(fmtyyyyMMdd.parseDateTime(rq).minusDays(1));
57 57
58 //实际排班 58 //实际排班
59 - ArrayListMultimap<String, ScheduleRealInfo> listMap = scheduleRedisService.findByDateAndGroupByNbbm(prveRq, companyId); 59 + ArrayListMultimap<String, ScheduleRealInfo> listMap = scheduleRedisService.findByDateAndGroupByNbbm(prveRq, companyCode);
60 //当班调派 60 //当班调派
61 long st = fmtyyyyMMddHHmm.parseMillis(prveRq + "00:00"), et = fmtyyyyMMddHHmm.parseMillis(prveRq + "23:59"); 61 long st = fmtyyyyMMddHHmm.parseMillis(prveRq + "00:00"), et = fmtyyyyMMddHHmm.parseMillis(prveRq + "23:59");
62 List<DutyEmployee> des = dutyEmployeeRepository.findByTime(st, et); 62 List<DutyEmployee> des = dutyEmployeeRepository.findByTime(st, et);
@@ -101,6 +101,10 @@ public class WaybillRestService { @@ -101,6 +101,10 @@ public class WaybillRestService {
101 wb.setInsideCode(sch.getClZbh()); 101 wb.setInsideCode(sch.getClZbh());
102 //线路编码 102 //线路编码
103 wb.setLineCode(sch.getXlBm()); 103 wb.setLineCode(sch.getXlBm());
  104 + wb.setLineName(sch.getXlName());
  105 + wb.setCompanyCode(sch.getGsBm());
  106 + wb.setBranchCompanyCode(sch.getFgsBm());
  107 + System.out.println(sch.getFgsBm() + "_" + sch.getFgsName());
104 108
105 //按 驾驶员 分组班次,构造路单子项 109 //按 驾驶员 分组班次,构造路单子项
106 jGhListMap = new ConvertUtil<ScheduleRealInfo>().groupMultiList(list, "_", jGhField); 110 jGhListMap = new ConvertUtil<ScheduleRealInfo>().groupMultiList(list, "_", jGhField);
@@ -111,11 +115,11 @@ public class WaybillRestService { @@ -111,11 +115,11 @@ public class WaybillRestService {
111 //驾驶员工号 115 //驾驶员工号
112 wb.setDriverJno(list.get(0).getjGh()); 116 wb.setDriverJno(list.get(0).getjGh());
113 wb.setDriverName(list.get(0).getjName()); 117 wb.setDriverName(list.get(0).getjName());
114 - wb.setDriverId(list.get(0).getjId()); 118 + wb.setDriverId("");
115 //售票员工号 119 //售票员工号
116 wb.setConductorJno(list.get(0).getsGh()); 120 wb.setConductorJno(list.get(0).getsGh());
117 wb.setConductorName(list.get(0).getsName()); 121 wb.setConductorName(list.get(0).getsName());
118 - wb.setConductorId(list.get(0).getsId()); 122 + wb.setConductorId("");
119 for (ScheduleRealInfo sri : list) { 123 for (ScheduleRealInfo sri : list) {
120 if (StringUtils.isNotEmpty(sri.getsGh())) { 124 if (StringUtils.isNotEmpty(sri.getsGh())) {
121 wb.setConductorJno(sri.getsGh()); 125 wb.setConductorJno(sri.getsGh());
@@ -134,6 +138,8 @@ public class WaybillRestService { @@ -134,6 +138,8 @@ public class WaybillRestService {
134 private String date; 138 private String date;
135 // 公司代码 139 // 公司代码
136 private String companyCode; 140 private String companyCode;
  141 + // 分公司代码
  142 + private String branchCompanyCode;
137 // 线路名称 143 // 线路名称
138 private String lineName; 144 private String lineName;
139 // 线路代码 145 // 线路代码
@@ -171,6 +177,14 @@ public class WaybillRestService { @@ -171,6 +177,14 @@ public class WaybillRestService {
171 this.companyCode = companyCode; 177 this.companyCode = companyCode;
172 } 178 }
173 179
  180 + public String getBranchCompanyCode() {
  181 + return branchCompanyCode;
  182 + }
  183 +
  184 + public void setBranchCompanyCode(String branchCompanyCode) {
  185 + this.branchCompanyCode = branchCompanyCode;
  186 + }
  187 +
174 public String getLineName() { 188 public String getLineName() {
175 return lineName; 189 return lineName;
176 } 190 }