Commit f2f80edc377306aef62fe034bf4752ef10f0ec0e
1 parent
033a3f71
1.浦东路单rest接口
Showing
2 changed files
with
20 additions
and
26 deletions
src/main/java/com/bsth/entity/ScheduleRealInfo.java
| ... | ... | @@ -52,14 +52,10 @@ public class ScheduleRealInfo implements Serializable{ |
| 52 | 52 | private String jGh; |
| 53 | 53 | /** 驾驶员名字 */ |
| 54 | 54 | private String jName; |
| 55 | - /** 驾驶员身份证 */ | |
| 56 | - private String jId; | |
| 57 | 55 | /** 售票员工号 */ |
| 58 | 56 | private String sGh; |
| 59 | 57 | /** 售票员名字 */ |
| 60 | 58 | private String sName; |
| 61 | - /** 售票员身份证 */ | |
| 62 | - private String sId; | |
| 63 | 59 | |
| 64 | 60 | /** 线路方向 */ |
| 65 | 61 | private String xlDir; |
| ... | ... | @@ -275,14 +271,6 @@ public class ScheduleRealInfo implements Serializable{ |
| 275 | 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 | 274 | public String getsGh() { |
| 287 | 275 | return sGh; |
| 288 | 276 | } |
| ... | ... | @@ -299,14 +287,6 @@ public class ScheduleRealInfo implements Serializable{ |
| 299 | 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 | 290 | public String getXlDir() { |
| 311 | 291 | return xlDir; |
| 312 | 292 | } | ... | ... |
src/main/java/com/bsth/server_rs/waybill/WaybillRestService.java
| ... | ... | @@ -9,6 +9,7 @@ import java.util.Set; |
| 9 | 9 | |
| 10 | 10 | import javax.ws.rs.GET; |
| 11 | 11 | import javax.ws.rs.Path; |
| 12 | +import javax.ws.rs.PathParam; | |
| 12 | 13 | import javax.ws.rs.Produces; |
| 13 | 14 | import javax.ws.rs.core.MediaType; |
| 14 | 15 | |
| ... | ... | @@ -47,16 +48,15 @@ public class WaybillRestService { |
| 47 | 48 | fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); |
| 48 | 49 | |
| 49 | 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 | 53 | Map<String, Object> map = new HashMap<String, Object>(); |
| 53 | - String rq = (String)param.get("date"), companyId = (String)param.get("companyCode"); | |
| 54 | 54 | try { |
| 55 | 55 | //日期减一天,老接口是这样的 |
| 56 | 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 | 61 | long st = fmtyyyyMMddHHmm.parseMillis(prveRq + "00:00"), et = fmtyyyyMMddHHmm.parseMillis(prveRq + "23:59"); |
| 62 | 62 | List<DutyEmployee> des = dutyEmployeeRepository.findByTime(st, et); |
| ... | ... | @@ -101,6 +101,10 @@ public class WaybillRestService { |
| 101 | 101 | wb.setInsideCode(sch.getClZbh()); |
| 102 | 102 | //线路编码 |
| 103 | 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 | 110 | jGhListMap = new ConvertUtil<ScheduleRealInfo>().groupMultiList(list, "_", jGhField); |
| ... | ... | @@ -111,11 +115,11 @@ public class WaybillRestService { |
| 111 | 115 | //驾驶员工号 |
| 112 | 116 | wb.setDriverJno(list.get(0).getjGh()); |
| 113 | 117 | wb.setDriverName(list.get(0).getjName()); |
| 114 | - wb.setDriverId(list.get(0).getjId()); | |
| 118 | + wb.setDriverId(""); | |
| 115 | 119 | //售票员工号 |
| 116 | 120 | wb.setConductorJno(list.get(0).getsGh()); |
| 117 | 121 | wb.setConductorName(list.get(0).getsName()); |
| 118 | - wb.setConductorId(list.get(0).getsId()); | |
| 122 | + wb.setConductorId(""); | |
| 119 | 123 | for (ScheduleRealInfo sri : list) { |
| 120 | 124 | if (StringUtils.isNotEmpty(sri.getsGh())) { |
| 121 | 125 | wb.setConductorJno(sri.getsGh()); |
| ... | ... | @@ -134,6 +138,8 @@ public class WaybillRestService { |
| 134 | 138 | private String date; |
| 135 | 139 | // 公司代码 |
| 136 | 140 | private String companyCode; |
| 141 | + // 分公司代码 | |
| 142 | + private String branchCompanyCode; | |
| 137 | 143 | // 线路名称 |
| 138 | 144 | private String lineName; |
| 139 | 145 | // 线路代码 |
| ... | ... | @@ -171,6 +177,14 @@ public class WaybillRestService { |
| 171 | 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 | 188 | public String getLineName() { |
| 175 | 189 | return lineName; |
| 176 | 190 | } | ... | ... |