Commit 16b49f3bd2fae0c47ba2ff43e9f34a715bfffdb2

Authored by 潘钊
2 parents 932d3600 7dabbcc2

Merge branch 'minhang' into qingpu

# Conflicts:
#	src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
Showing 20 changed files with 1949 additions and 1285 deletions
src/main/java/com/bsth/controller/realcontrol/dto/LpData.java
@@ -17,9 +17,12 @@ public class LpData { @@ -17,9 +17,12 @@ public class LpData {
17 17
18 this.fcsj = sch.getFcsjActualTime(); 18 this.fcsj = sch.getFcsjActualTime();
19 this.zdsj = sch.getZdsjActualTime(); 19 this.zdsj = sch.getZdsjActualTime();
  20 +
  21 + this.qdName = sch.getQdzName();
  22 + this.zdzName = sch.getZdzName();
20 } 23 }
21 24
22 - public void appendTo(ScheduleRealInfo sch, int type) { 25 + public void appendTo(ScheduleRealInfo sch, int type, boolean changeRealTime) {
23 26
24 if (type == 0) { 27 if (type == 0) {
25 //只换人 28 //只换人
@@ -31,10 +34,10 @@ public class LpData { @@ -31,10 +34,10 @@ public class LpData {
31 //只换车 34 //只换车
32 sch.setClZbh(this.nbbm); 35 sch.setClZbh(this.nbbm);
33 36
34 - if (this.fcsj != null)  
35 - sch.setFcsjActualAll(this.fcsj);  
36 - if (this.zdsj != null)  
37 - sch.setZdsjActualAll(this.zdsj); 37 + //换实际时间
  38 + if(changeRealTime){
  39 + changeRealTime(sch);
  40 + }
38 41
39 } else if (type == 2) { 42 } else if (type == 2) {
40 //换人并换车 43 //换人并换车
@@ -44,13 +47,30 @@ public class LpData { @@ -44,13 +47,30 @@ public class LpData {
44 sch.setsName(this.sName); 47 sch.setsName(this.sName);
45 sch.setClZbh(this.nbbm); 48 sch.setClZbh(this.nbbm);
46 49
47 - if (this.fcsj != null)  
48 - sch.setFcsjActualAll(this.fcsj);  
49 - if (this.zdsj != null)  
50 - sch.setZdsjActualAll(this.zdsj); 50 + //换实际时间
  51 + if(changeRealTime){
  52 + changeRealTime(sch);
  53 + }
51 } 54 }
52 } 55 }
53 56
  57 + public void changeRealTime(ScheduleRealInfo sch){
  58 + if (this.fcsj != null && this.qdName.equals(sch.getQdzName()))
  59 + sch.setFcsjActualAll(this.fcsj);
  60 + if (this.zdsj != null && this.zdzName.equals(sch.getZdzName()))
  61 + sch.setZdsjActualAll(this.zdsj);
  62 + }
  63 +
  64 + /**
  65 + * 起点站名称
  66 + */
  67 + private String qdName;
  68 +
  69 + /**
  70 + * 终点站名称
  71 + */
  72 + private String zdzName;
  73 +
54 /** 74 /**
55 * 驾驶员 75 * 驾驶员
56 */ 76 */
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
@@ -87,6 +87,9 @@ public class ScheduleRealInfo { @@ -87,6 +87,9 @@ public class ScheduleRealInfo {
87 private Integer bcs; 87 private Integer bcs;
88 /** 计划里程 */ 88 /** 计划里程 */
89 private Double jhlc; 89 private Double jhlc;
  90 +
  91 + /** 实际里程 */
  92 + private Double realMileage;
90 93
91 /** 实际里程 */ 94 /** 实际里程 */
92 @Transient 95 @Transient
@@ -834,4 +837,12 @@ public class ScheduleRealInfo { @@ -834,4 +837,12 @@ public class ScheduleRealInfo {
834 public void setReissue(boolean reissue) { 837 public void setReissue(boolean reissue) {
835 this.reissue = reissue; 838 this.reissue = reissue;
836 } 839 }
  840 +
  841 + public Double getRealMileage() {
  842 + return realMileage;
  843 + }
  844 +
  845 + public void setRealMileage(Double realMileage) {
  846 + this.realMileage = realMileage;
  847 + }
837 } 848 }
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
@@ -58,6 +58,26 @@ public class CarConfigInfo extends BEntity implements Serializable { @@ -58,6 +58,26 @@ public class CarConfigInfo extends BEntity implements Serializable {
58 @Column(nullable = false) 58 @Column(nullable = false)
59 private Boolean isCancel = false; 59 private Boolean isCancel = false;
60 60
  61 + //-------------- 车辆配置的停车场及相关信息 ------------//
  62 + /** 车辆配置-CheLiangPeiZhi 字典,ZW(早晚),FS(复驶),BSY(不使用) */
  63 + private String pzType;
  64 + /** 上行出场里程 */
  65 + private Double upOutLc;
  66 + /** 上行出场时间 */
  67 + private Double upOutSj;
  68 + /** 下行出场里程 */
  69 + private Double downOutLc;
  70 + /** 下行出场时间 */
  71 + private Double downOutSj;
  72 + /** 上行进场里程 */
  73 + private Double upInLc;
  74 + /** 上行进场时间 */
  75 + private Double upInSj;
  76 + /** 下行进场里程 */
  77 + private Double downInLc;
  78 + /** 下行进场时间 */
  79 + private Double downInSj;
  80 +
61 public CarConfigInfo() {} 81 public CarConfigInfo() {}
62 public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) { 82 public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) {
63 if (id != null) { 83 if (id != null) {
@@ -156,4 +176,76 @@ public class CarConfigInfo extends BEntity implements Serializable { @@ -156,4 +176,76 @@ public class CarConfigInfo extends BEntity implements Serializable {
156 public void setIsCancel(Boolean isCancel) { 176 public void setIsCancel(Boolean isCancel) {
157 this.isCancel = isCancel; 177 this.isCancel = isCancel;
158 } 178 }
  179 +
  180 + public String getPzType() {
  181 + return pzType;
  182 + }
  183 +
  184 + public void setPzType(String pzType) {
  185 + this.pzType = pzType;
  186 + }
  187 +
  188 + public Double getUpOutLc() {
  189 + return upOutLc;
  190 + }
  191 +
  192 + public void setUpOutLc(Double upOutLc) {
  193 + this.upOutLc = upOutLc;
  194 + }
  195 +
  196 + public Double getUpOutSj() {
  197 + return upOutSj;
  198 + }
  199 +
  200 + public void setUpOutSj(Double upOutSj) {
  201 + this.upOutSj = upOutSj;
  202 + }
  203 +
  204 + public Double getDownOutLc() {
  205 + return downOutLc;
  206 + }
  207 +
  208 + public void setDownOutLc(Double downOutLc) {
  209 + this.downOutLc = downOutLc;
  210 + }
  211 +
  212 + public Double getDownOutSj() {
  213 + return downOutSj;
  214 + }
  215 +
  216 + public void setDownOutSj(Double downOutSj) {
  217 + this.downOutSj = downOutSj;
  218 + }
  219 +
  220 + public Double getUpInLc() {
  221 + return upInLc;
  222 + }
  223 +
  224 + public void setUpInLc(Double upInLc) {
  225 + this.upInLc = upInLc;
  226 + }
  227 +
  228 + public Double getUpInSj() {
  229 + return upInSj;
  230 + }
  231 +
  232 + public void setUpInSj(Double upInSj) {
  233 + this.upInSj = upInSj;
  234 + }
  235 +
  236 + public Double getDownInLc() {
  237 + return downInLc;
  238 + }
  239 +
  240 + public void setDownInLc(Double downInLc) {
  241 + this.downInLc = downInLc;
  242 + }
  243 +
  244 + public Double getDownInSj() {
  245 + return downInSj;
  246 + }
  247 +
  248 + public void setDownInSj(Double downInSj) {
  249 + this.downInSj = downInSj;
  250 + }
159 } 251 }
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -28,14 +28,8 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI @@ -28,14 +28,8 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI
28 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") 28 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)")
29 List<ScheduleRealInfo> queryUserInfo(String line,String date); 29 List<ScheduleRealInfo> queryUserInfo(String line,String date);
30 30
31 - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by (lpName+1)") 31 + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
32 List<ScheduleRealInfo> queryUserInfo2(String line,String date); 32 List<ScheduleRealInfo> queryUserInfo2(String line,String date);
33 -  
34 - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 desc")  
35 - List<ScheduleRealInfo> queryUserInfoPxDesc(String line,String date,String state);  
36 -  
37 - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by ?3 asc")  
38 - List<ScheduleRealInfo> queryUserInfoPxAsc(String line,String date,String state);  
39 33
40 @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ") 34 @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ")
41 List<ScheduleRealInfo> queryUserInfo3(String line,String date); 35 List<ScheduleRealInfo> queryUserInfo3(String line,String date);
src/main/java/com/bsth/service/impl/PersonnelServiceImpl.java
@@ -34,8 +34,9 @@ public class PersonnelServiceImpl extends BaseServiceImpl&lt;Personnel, Integer&gt; im @@ -34,8 +34,9 @@ public class PersonnelServiceImpl extends BaseServiceImpl&lt;Personnel, Integer&gt; im
34 per=perIterator.next(); 34 per=perIterator.next();
35 if(per.getJobCode().indexOf(jobCode)!=-1){ 35 if(per.getJobCode().indexOf(jobCode)!=-1){
36 Map<String, String> jobCodeMap= new HashMap<>(); 36 Map<String, String> jobCodeMap= new HashMap<>();
37 - jobCodeMap.put("id",per.getJobCode());  
38 - jobCodeMap.put("text", per.getJobCode()+"/"+per.getPersonnelName()); 37 + String jboCode=per.getJobCode().substring(per.getJobCode().indexOf("-")+1);
  38 + jobCodeMap.put("id",jboCode);
  39 + jobCodeMap.put("text", jboCode+"/"+per.getPersonnelName());
39 jobCodeMap.put("gs", per.getCompanyCode()); 40 jobCodeMap.put("gs", per.getCompanyCode());
40 list.add(jobCodeMap); 41 list.add(jobCodeMap);
41 } 42 }
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -173,9 +173,10 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -173,9 +173,10 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
173 List<Cyl> clyList=cylRepository.obtainCyl(); 173 List<Cyl> clyList=cylRepository.obtainCyl();
174 //从排班表中计算出行驶的总里程 174 //从排班表中计算出行驶的总里程
175 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq); 175 List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq);
176 - 176 + List<Ylb> addList=new ArrayList<Ylb>();
  177 + List<Ylb> updateList=new ArrayList<Ylb>();
177 for(int x=0;x<listpb.size();x++){ 178 for(int x=0;x<listpb.size();x++){
178 - 179 + String type="add";
179 Map<String, Object> map=listpb.get(x); 180 Map<String, Object> map=listpb.get(x);
180 181
181 //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) 182 //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断)
@@ -187,6 +188,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -187,6 +188,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
187 &&t1.getXlbm().equals(map.get("xlBm").toString())) 188 &&t1.getXlbm().equals(map.get("xlBm").toString()))
188 { 189 {
189 t=t1; 190 t=t1;
  191 + type="update";
190 } 192 }
191 } 193 }
192 try { 194 try {
@@ -228,6 +230,11 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -228,6 +230,11 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
228 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); 230 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
229 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); 231 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
230 t.setRq(sdf.parse(rq)); 232 t.setRq(sdf.parse(rq));
  233 + /*if(type.equals("add")){
  234 + addList.add(t);
  235 + }else{
  236 + updateList.add(t);
  237 + }*/
231 repository.save(t); 238 repository.save(t);
232 newMap.put("status", ResponseCode.SUCCESS); 239 newMap.put("status", ResponseCode.SUCCESS);
233 } catch (ParseException e) { 240 } catch (ParseException e) {
@@ -236,7 +243,20 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -236,7 +243,20 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
236 e.printStackTrace(); 243 e.printStackTrace();
237 } 244 }
238 } 245 }
239 - 246 + /* try {
  247 + if(addList.size()>0){
  248 + new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class);
  249 + }
  250 +
  251 + if(updateList.size()>0){
  252 +
  253 + }
  254 + newMap.put("status", ResponseCode.SUCCESS);
  255 + }
  256 + catch (Exception e) {
  257 + // TODO: handle exception
  258 + newMap.put("status", ResponseCode.ERROR);
  259 + }*/
240 return newMap; 260 return newMap;
241 } 261 }
242 262
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
@@ -156,7 +156,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -156,7 +156,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
156 156
157 Map<String,Object> lpChangeMulti(String leftIdx, String rightIdx, int type); 157 Map<String,Object> lpChangeMulti(String leftIdx, String rightIdx, int type);
158 158
159 - void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type); 159 + void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type, boolean changeRealTime);
160 160
161 Map<String,Object> revokeRealArrive(Long id); 161 Map<String,Object> revokeRealArrive(Long id);
162 } 162 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -74,8 +74,8 @@ import java.util.zip.ZipOutputStream; @@ -74,8 +74,8 @@ import java.util.zip.ZipOutputStream;
74 @Service 74 @Service
75 public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long> 75 public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long>
76 implements ScheduleRealInfoService { 76 implements ScheduleRealInfoService {
77 - @Autowired  
78 - JdbcTemplate jdbcTemplate; 77 + @Autowired
  78 + JdbcTemplate jdbcTemplate;
79 @Autowired 79 @Autowired
80 ScheduleRealInfoRepository scheduleRealInfoRepository; 80 ScheduleRealInfoRepository scheduleRealInfoRepository;
81 81
@@ -89,7 +89,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -89,7 +89,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
89 SectionRouteService sectionRouteService; 89 SectionRouteService sectionRouteService;
90 90
91 /*@Autowired 91 /*@Autowired
92 - BorrowCenter borrowCenter;*/ 92 + BorrowCenter borrowCenter;*/
93 93
94 @Autowired 94 @Autowired
95 LineRepository lineRepository; 95 LineRepository lineRepository;
@@ -111,13 +111,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -111,13 +111,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
111 111
112 @Autowired 112 @Autowired
113 LineConfigData lineConfigData; 113 LineConfigData lineConfigData;
114 - 114 +
115 @Autowired 115 @Autowired
116 DutyEmployeeService dutyEmployeeService; 116 DutyEmployeeService dutyEmployeeService;
117 - 117 +
118 @Autowired 118 @Autowired
119 YlxxbRepository ylxxbRepository; 119 YlxxbRepository ylxxbRepository;
120 - 120 +
121 @Autowired 121 @Autowired
122 YlbRepository ylbRepository; 122 YlbRepository ylbRepository;
123 123
@@ -141,8 +141,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -141,8 +141,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
141 141
142 private final static long DAY_TIME = 1000 * 60 * 60 * 24L; 142 private final static long DAY_TIME = 1000 * 60 * 60 * 24L;
143 143
144 - private static int BUF_SIZE = 1024;  
145 - 144 + private static int BUF_SIZE = 1024;
  145 +
146 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); 146 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
147 147
148 @Override 148 @Override
@@ -175,7 +175,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -175,7 +175,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
175 } 175 }
176 176
177 //调整班次类型 177 //调整班次类型
178 - if(StringUtils.isNotEmpty(bcType)){ 178 + if (StringUtils.isNotEmpty(bcType)) {
179 schedule.setBcType(bcType); 179 schedule.setBcType(bcType);
180 } 180 }
181 181
@@ -200,7 +200,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -200,7 +200,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
200 try { 200 try {
201 List<String> idList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(idsStr)); 201 List<String> idList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(idsStr));
202 202
203 - ScheduleRealInfo schedule = null; 203 + ScheduleRealInfo schedule = null, execSch, next;
204 for (String id : idList) { 204 for (String id : idList) {
205 schedule = dayOfSchedule.get(Long.parseLong(id)); 205 schedule = dayOfSchedule.get(Long.parseLong(id));
206 if (schedule.isDestroy()) { 206 if (schedule.isDestroy()) {
@@ -215,6 +215,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -215,6 +215,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
215 215
216 dayOfSchedule.save(schedule); 216 dayOfSchedule.save(schedule);
217 rsList.add(schedule); 217 rsList.add(schedule);
  218 +
  219 + //如果正在执行当前班次,跳下一个班次
  220 + execSch = dayOfSchedule.executeCurr(schedule.getClZbh());
  221 + if(execSch != null && execSch.getId().equals(schedule.getId())){
  222 + next = dayOfSchedule.next(schedule);
  223 + dayOfSchedule.addExecPlan(next);
  224 + }
218 } 225 }
219 226
220 map.put("status", ResponseCode.SUCCESS); 227 map.put("status", ResponseCode.SUCCESS);
@@ -457,207 +464,205 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -457,207 +464,205 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
457 } 464 }
458 465
459 } 466 }
460 - 467 +
461 @Override 468 @Override
462 - public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state,String type) { 469 + public List<ScheduleRealInfo> queryUserInfoPx(String line, String date, String state, String type) {
463 // List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>(); 470 // List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
464 - state=state+"";  
465 - String lpname=state;  
466 - String px=type;  
467 - if(state.equals("lpName")){  
468 - state =state+"+1";  
469 - type="asc";  
470 - }  
471 - String sqlPlan="select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh,"  
472 - + " s.lp_Name as lpName,s.j_Name as jName,s.s_Gh as sGh,s.s_Name as sName"  
473 - + " from bsth_c_s_sp_info_real s "  
474 - + " where s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"' "  
475 - + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name,s.s_Gh,"  
476 - + " s.s_Name order by ("+state+") "+type;  
477 - List<ScheduleRealInfo> list= jdbcTemplate.query(sqlPlan,  
478 - new RowMapper<ScheduleRealInfo>(){  
479 - @Override  
480 - public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {  
481 - ScheduleRealInfo t=new ScheduleRealInfo();  
482 - t.setId(rs.getLong("id"));  
483 - t.setjGh(rs.getString("jGh"));  
484 - t.setClZbh(rs.getString("clZbh"));  
485 - t.setLpName(rs.getString("lpName"));  
486 - t.setjName(rs.getString("jName"));  
487 - t.setsGh(rs.getString("sGh"));  
488 - t.setsName(rs.getString("sName"));  
489 - return t;  
490 - }  
491 - });  
492 - if(lpname.equals("lpName")){  
493 - List<ScheduleRealInfo> listNew=new ArrayList<ScheduleRealInfo>();  
494 - Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");  
495 - if(px.equals("desc")){  
496 - int zt=0;  
497 - for (int l = 0; l < 3; l++) {  
498 - for (int i = 0; i < list.size(); i++) {  
499 - ScheduleRealInfo t=list.get(i);  
500 - if(t.getLpName().indexOf("+")!=-1){  
501 - if(zt==0){  
502 - listNew.add(t);  
503 - }  
504 -  
505 - }else if(pattern.matcher(t.getLpName()).matches()){  
506 - if(zt==1){  
507 - listNew.add(t);  
508 - }  
509 - }else{  
510 - if(zt==2){  
511 - listNew.add(t);  
512 - }  
513 - }  
514 - }  
515 - zt++;  
516 - }  
517 - }else{  
518 - int zt=0;  
519 - for (int l = 0; l < 3; l++) {  
520 - for (int i = 0; i < list.size(); i++) {  
521 - ScheduleRealInfo t=list.get(i);  
522 - if(t.getLpName().indexOf("+")!=-1){  
523 - if(zt==2){  
524 - listNew.add(t);  
525 - }  
526 -  
527 - }else if(pattern.matcher(t.getLpName()).matches()){  
528 - if(zt==1){  
529 - listNew.add(t);  
530 - }  
531 - }else{  
532 - if(zt==0){  
533 - listNew.add(t);  
534 - }  
535 - }  
536 - }  
537 - zt++;  
538 - }  
539 -  
540 - }  
541 - return listNew;  
542 - }else{  
543 - return list;  
544 - }  
545 - 471 + state = state + "";
  472 + String lpname = state;
  473 + String px = type;
  474 + if (state.equals("lpName")) {
  475 + state = state + "+1";
  476 + type = "asc";
  477 + }
  478 + String sqlPlan = "select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh,"
  479 + + " s.lp_Name as lpName,s.j_Name as jName"
  480 + + " from bsth_c_s_sp_info_real s "
  481 + + " where s.xl_Bm = '" + line + "' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='" + date + "' "
  482 + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name"
  483 + + " order by (" + state + ") " + type;
  484 + List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan,
  485 + new RowMapper<ScheduleRealInfo>() {
  486 + @Override
  487 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  488 + ScheduleRealInfo t = new ScheduleRealInfo();
  489 + t.setId(rs.getLong("id"));
  490 + t.setjGh(rs.getString("jGh"));
  491 + t.setClZbh(rs.getString("clZbh"));
  492 + t.setLpName(rs.getString("lpName"));
  493 + t.setjName(rs.getString("jName"));
  494 + return t;
  495 + }
  496 + });
  497 + if (lpname.equals("lpName")) {
  498 + List<ScheduleRealInfo> listNew = new ArrayList<ScheduleRealInfo>();
  499 + Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
  500 + if (px.equals("desc")) {
  501 + int zt = 0;
  502 + for (int l = 0; l < 3; l++) {
  503 + for (int i = 0; i < list.size(); i++) {
  504 + ScheduleRealInfo t = list.get(i);
  505 + if (t.getLpName().indexOf("+") != -1) {
  506 + if (zt == 0) {
  507 + listNew.add(t);
  508 + }
  509 +
  510 + } else if (pattern.matcher(t.getLpName()).matches()) {
  511 + if (zt == 1) {
  512 + listNew.add(t);
  513 + }
  514 + } else {
  515 + if (zt == 2) {
  516 + listNew.add(t);
  517 + }
  518 + }
  519 + }
  520 + zt++;
  521 + }
  522 + } else {
  523 + int zt = 0;
  524 + for (int l = 0; l < 3; l++) {
  525 + for (int i = 0; i < list.size(); i++) {
  526 + ScheduleRealInfo t = list.get(i);
  527 + if (t.getLpName().indexOf("+") != -1) {
  528 + if (zt == 2) {
  529 + listNew.add(t);
  530 + }
  531 +
  532 + } else if (pattern.matcher(t.getLpName()).matches()) {
  533 + if (zt == 1) {
  534 + listNew.add(t);
  535 + }
  536 + } else {
  537 + if (zt == 0) {
  538 + listNew.add(t);
  539 + }
  540 + }
  541 + }
  542 + zt++;
  543 + }
  544 +
  545 + }
  546 + return listNew;
  547 + } else {
  548 + return list;
  549 + }
  550 +
546 } 551 }
547 552
548 /** 553 /**
549 * 554 *
550 */ 555 */
551 @Override 556 @Override
552 - public List<ScheduleRealInfo> exportWaybill(String jName, String clZbh, String lpName,String date,String line) {  
553 - ReportUtils ee = new ReportUtils();  
554 - ReportRelatedUtils rru = new ReportRelatedUtils();  
555 - List<Iterator<?>> list = new ArrayList<Iterator<?>>();  
556 - List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName,date,line);  
557 - List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();  
558 -  
559 - DecimalFormat format = new DecimalFormat("0.00"); 557 + public List<ScheduleRealInfo> exportWaybill(String jName, String clZbh, String lpName, String date, String line) {
  558 + ReportUtils ee = new ReportUtils();
  559 + ReportRelatedUtils rru = new ReportRelatedUtils();
  560 + List<Iterator<?>> list = new ArrayList<Iterator<?>>();
  561 + List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
  562 + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
  563 +
  564 + DecimalFormat format = new DecimalFormat("0.00");
560 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 565 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
561 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 566 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
562 - int jhbc = 0,cjbc = 0,ljbc = 0;  
563 - double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;  
564 - float addMileage = 0l,remMileage = 0l;  
565 -  
566 - Map<String,Object> map;  
567 - for(ScheduleRealInfo scheduleRealInfo : scheduleRealInfos){  
568 - if(scheduleRealInfo != null){  
569 - //计算计划里程(主任务过滤掉临加班次),烂班里程,临加里程,计划班次,烂班班次,增加班次  
570 - if(scheduleRealInfo != null){  
571 - //计划里程(主任务过滤掉临加班次),  
572 - //烂班里程(主任务烂班),  
573 - //临加里程(主任务临加),  
574 - //计划班次,烂班班次,增加班次  
575 - tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();  
576 - if(scheduleRealInfo.isSflj()){  
577 - ljbc++;  
578 - }else{  
579 - jhlc += tempJhlc;  
580 - jhbc++;  
581 - if(scheduleRealInfo.getStatus() == -1){  
582 - remMileage += tempJhlc;  
583 - cjbc++;  
584 - }  
585 - }  
586 - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();  
587 - //计算营运里程,空驶里程  
588 - if(childTaskPlans.isEmpty()){  
589 - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")  
590 - ){  
591 - ksgl += tempJhlc;  
592 - }else{  
593 - yygl += tempJhlc;  
594 - }  
595 - }else{  
596 - Iterator<ChildTaskPlan> it = childTaskPlans.iterator();  
597 - while(it.hasNext()){  
598 - ChildTaskPlan childTaskPlan = it.next();  
599 - if(childTaskPlan.getMileageType().equals("empty")){  
600 - if(scheduleRealInfo.isSflj()){  
601 - addMileage += tempJhlc;  
602 - }  
603 - ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
604 - }else{  
605 - if(scheduleRealInfo.isSflj()){  
606 - addMileage += tempJhlc;  
607 - }  
608 - yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
609 - }  
610 - }  
611 - }  
612 - }  
613 -  
614 - map = new HashMap<String, Object>();  
615 - try {  
616 - scheduleRealInfo.setjName(scheduleRealInfo.getjGh()+scheduleRealInfo.getjName());  
617 - scheduleRealInfo.setsName(scheduleRealInfo.getsGh()+scheduleRealInfo.getsName());  
618 - map = rru.getMapValue(scheduleRealInfo);  
619 - String zdsj = scheduleRealInfo.getZdsj();  
620 - String zdsjActual = scheduleRealInfo.getZdsjActual();  
621 - if(zdsj != null && zdsjActual != null &&  
622 - !zdsj.equals(zdsjActual)){  
623 - if(zdsj.compareTo(zdsjActual) > 0){  
624 - map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
625 - map.put("slow", "");  
626 - } else {  
627 - map.put("fast", "");  
628 - map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
629 - }  
630 - } else {  
631 - map.put("fast", "");  
632 - map.put("slow", "");  
633 - }  
634 - listMap.add(map);  
635 - } catch (Exception e) {  
636 - e.printStackTrace();  
637 - }  
638 - }  
639 - }  
640 -  
641 - //计算里程和班次数,并放入Map里  
642 - map = new HashMap<String, Object>();  
643 - map.put("jhlc", format.format(jhlc));  
644 - map.put("remMileage", format.format(remMileage));  
645 - map.put("addMileage", format.format(addMileage));  
646 - map.put("yygl", format.format(yygl));  
647 - map.put("ksgl", format.format(ksgl));  
648 - map.put("realMileage", format.format(yygl+ksgl));  
649 - map.put("jhbc", jhbc);  
650 - map.put("cjbc", cjbc);  
651 - map.put("ljbc", ljbc);  
652 - map.put("sjbc", jhbc-cjbc+ljbc);  
653 -  
654 - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; 567 + int jhbc = 0, cjbc = 0, ljbc = 0;
  568 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0;
  569 + float addMileage = 0l, remMileage = 0l;
  570 +
  571 + Map<String, Object> map;
  572 + for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) {
  573 + if (scheduleRealInfo != null) {
  574 + //计算计划里程(主任务过滤掉临加班次),烂班里程,临加里程,计划班次,烂班班次,增加班次
  575 + if (scheduleRealInfo != null) {
  576 + //计划里程(主任务过滤掉临加班次),
  577 + //烂班里程(主任务烂班),
  578 + //临加里程(主任务临加),
  579 + //计划班次,烂班班次,增加班次
  580 + tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc();
  581 + if (scheduleRealInfo.isSflj()) {
  582 + ljbc++;
  583 + } else {
  584 + jhlc += tempJhlc;
  585 + jhbc++;
  586 + if (scheduleRealInfo.getStatus() == -1) {
  587 + remMileage += tempJhlc;
  588 + cjbc++;
  589 + }
  590 + }
  591 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  592 + //计算营运里程,空驶里程
  593 + if (childTaskPlans.isEmpty()) {
  594 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  595 + ) {
  596 + ksgl += tempJhlc;
  597 + } else {
  598 + yygl += tempJhlc;
  599 + }
  600 + } else {
  601 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  602 + while (it.hasNext()) {
  603 + ChildTaskPlan childTaskPlan = it.next();
  604 + if (childTaskPlan.getMileageType().equals("empty")) {
  605 + if (scheduleRealInfo.isSflj()) {
  606 + addMileage += tempJhlc;
  607 + }
  608 + ksgl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  609 + } else {
  610 + if (scheduleRealInfo.isSflj()) {
  611 + addMileage += tempJhlc;
  612 + }
  613 + yygl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  614 + }
  615 + }
  616 + }
  617 + }
  618 +
  619 + map = new HashMap<String, Object>();
  620 + try {
  621 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  622 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  623 + map = rru.getMapValue(scheduleRealInfo);
  624 + String zdsj = scheduleRealInfo.getZdsj();
  625 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  626 + if (zdsj != null && zdsjActual != null &&
  627 + !zdsj.equals(zdsjActual)) {
  628 + if (zdsj.compareTo(zdsjActual) > 0) {
  629 + map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  630 + map.put("slow", "");
  631 + } else {
  632 + map.put("fast", "");
  633 + map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  634 + }
  635 + } else {
  636 + map.put("fast", "");
  637 + map.put("slow", "");
  638 + }
  639 + listMap.add(map);
  640 + } catch (Exception e) {
  641 + e.printStackTrace();
  642 + }
  643 + }
  644 + }
  645 +
  646 + //计算里程和班次数,并放入Map里
  647 + map = new HashMap<String, Object>();
  648 + map.put("jhlc", format.format(jhlc));
  649 + map.put("remMileage", format.format(remMileage));
  650 + map.put("addMileage", format.format(addMileage));
  651 + map.put("yygl", format.format(yygl));
  652 + map.put("ksgl", format.format(ksgl));
  653 + map.put("realMileage", format.format(yygl + ksgl));
  654 + map.put("jhbc", jhbc);
  655 + map.put("cjbc", cjbc);
  656 + map.put("ljbc", ljbc);
  657 + map.put("sjbc", jhbc - cjbc + ljbc);
655 658
656 - list.add(listMap.iterator());  
657 - ee.excelReplace(list, new Object[] { scheduleRealInfos.get(0),map }, path+"mould/waybill_minhang.xls",  
658 - path+"export/" + date+"-"+jName+"-"+clZbh+"-"+lpName+"-行车路单.xls");  
659 - return scheduleRealInfos;  
660 - } 659 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  660 +
  661 + list.add(listMap.iterator());
  662 + ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0), map}, path + "mould/waybill_minhang.xls",
  663 + path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
  664 + return scheduleRealInfos;
  665 + }
661 666
662 @Override 667 @Override
663 public List<Map<String, Object>> dailyInfo(String line, String date, String type) { 668 public List<Map<String, Object>> dailyInfo(String line, String date, String type) {
@@ -967,6 +972,35 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -967,6 +972,35 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
967 String remarks = map.get("remarks"); 972 String remarks = map.get("remarks");
968 ScheduleRealInfo sch = dayOfSchedule.get(id); 973 ScheduleRealInfo sch = dayOfSchedule.get(id);
969 if (null != sch) { 974 if (null != sch) {
  975 +
  976 + String clZbh = map.get("clZbh");
  977 + if (StringUtils.isNotEmpty(clZbh)) {
  978 + //换车
  979 + BiMap<String, String> clMap = BasicData.deviceId2NbbmMap.inverse();
  980 + if (clMap.get(clZbh) == null) {
  981 + rs.put("status", ResponseCode.ERROR);
  982 + rs.put("msg", "车辆 " + clZbh + " 不存在!");
  983 + return rs;
  984 + } else {
  985 + dayOfSchedule.changeCar(sch, clZbh);
  986 + }
  987 + }
  988 + //换驾驶员
  989 + String jsy = map.get("jsy");
  990 + if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) {
  991 + persoChange(sch, jsy.split("/")[0]);
  992 + }
  993 + //换售票员
  994 + String spy = map.get("spy");
  995 + if (StringUtils.isNotEmpty(spy) && spy.indexOf("/") != -1 && !spy.equals("/")) {
  996 + persoChangeSPY(sch, spy.split("/")[0]);
  997 + }
  998 + else{
  999 + sch.setsGh("");
  1000 + sch.setsName("");
  1001 + }
  1002 +
  1003 +
970 if (StringUtils.isNotBlank(fcsjActual)) { 1004 if (StringUtils.isNotBlank(fcsjActual)) {
971 LineConfig config = lineConfigData.get(sch.getXlBm()); 1005 LineConfig config = lineConfigData.get(sch.getXlBm());
972 long t = 0L; 1006 long t = 0L;
@@ -1013,8 +1047,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1013,8 +1047,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1013 1047
1014 try { 1048 try {
1015 //烂班 1049 //烂班
1016 - if(map.get("status") != null  
1017 - && Integer.parseInt(map.get("status").toString()) == -1){ 1050 + if (map.get("status") != null
  1051 + && Integer.parseInt(map.get("status").toString()) == -1) {
1018 destroy(sch.getId() + "", "", map.get("adjustExps").toString()); 1052 destroy(sch.getId() + "", "", map.get("adjustExps").toString());
1019 } 1053 }
1020 } catch (NumberFormatException e) { 1054 } catch (NumberFormatException e) {
@@ -1023,14 +1057,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1023,14 +1057,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1023 1057
1024 //修改班次里程 1058 //修改班次里程
1025 String jhlc = map.get("jhlc"); 1059 String jhlc = map.get("jhlc");
1026 - if(StringUtils.isNotEmpty(jhlc)  
1027 - && Double.parseDouble(jhlc) != sch.getJhlc()){ 1060 + if (StringUtils.isNotEmpty(jhlc)
  1061 + && Double.parseDouble(jhlc) != sch.getJhlc()) {
1028 sch.setJhlc(Double.parseDouble(jhlc)); 1062 sch.setJhlc(Double.parseDouble(jhlc));
1029 } 1063 }
1030 } 1064 }
1031 1065
1032 String bcType = map.get("bcType"); 1066 String bcType = map.get("bcType");
1033 - if(StringUtils.isNotEmpty(bcType)){ 1067 + if (StringUtils.isNotEmpty(bcType)) {
1034 sch.setBcType(bcType); 1068 sch.setBcType(bcType);
1035 } 1069 }
1036 //班次状态 1070 //班次状态
@@ -1247,11 +1281,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1247,11 +1281,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1247 } 1281 }
1248 1282
1249 1283
1250 -  
1251 @Override 1284 @Override
1252 public Map<String, Object> findKMBC(String jName, String clZbh, 1285 public Map<String, Object> findKMBC(String jName, String clZbh,
1253 - String lpName, String date,String line) {  
1254 - List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date,line); 1286 + String lpName, String date, String line) {
  1287 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
1255 DecimalFormat format = new DecimalFormat("0.00"); 1288 DecimalFormat format = new DecimalFormat("0.00");
1256 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 1289 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
1257 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 1290 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
@@ -1286,10 +1319,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1286,10 +1319,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1286 if (childTaskPlans.isEmpty()) { 1319 if (childTaskPlans.isEmpty()) {
1287 if (scheduleRealInfo.getBcType().equals("in") || 1320 if (scheduleRealInfo.getBcType().equals("in") ||
1288 scheduleRealInfo.getBcType().equals("out")) { 1321 scheduleRealInfo.getBcType().equals("out")) {
1289 - if(scheduleRealInfo.getStatus() != -1){  
1290 - jcclc += tempJhlc;  
1291 - }  
1292 - 1322 + if (scheduleRealInfo.getStatus() != -1) {
  1323 + jcclc += tempJhlc;
  1324 + }
  1325 +
1293 } 1326 }
1294 //主任务 放空班次属于营运 1327 //主任务 放空班次属于营运
1295 // else if(scheduleRealInfo.getBcType().equals("venting")){ 1328 // else if(scheduleRealInfo.getBcType().equals("venting")){
@@ -1451,60 +1484,60 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1451,60 +1484,60 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1451 1484
1452 @Override 1485 @Override
1453 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh, 1486 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh,
1454 - String lpName, String date,String line) {  
1455 - List<ScheduleRealInfo> listSchedule=new ArrayList<ScheduleRealInfo>(); 1487 + String lpName, String date, String line) {
  1488 + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
1456 List<ScheduleRealInfo> list = null; 1489 List<ScheduleRealInfo> list = null;
1457 - list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date,line); 1490 + list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
1458 for (int i = 0; i < list.size(); i++) { 1491 for (int i = 0; i < list.size(); i++) {
1459 ScheduleRealInfo s = list.get(i); 1492 ScheduleRealInfo s = list.get(i);
1460 - s.setAdjustExps(i+1+""); 1493 + s.setAdjustExps(i + 1 + "");
1461 String remarks = ""; 1494 String remarks = "";
1462 if (s.getRemarks() != null) { 1495 if (s.getRemarks() != null) {
1463 remarks += s.getRemarks(); 1496 remarks += s.getRemarks();
1464 } 1497 }
1465 - 1498 +
1466 Set<ChildTaskPlan> childTaskPlans = s.getcTasks(); 1499 Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
1467 if (!childTaskPlans.isEmpty()) { 1500 if (!childTaskPlans.isEmpty()) {
1468 - s.setFcsjActual("");  
1469 - s.setZdsjActual(""); 1501 + s.setFcsjActual("");
  1502 + s.setZdsjActual("");
1470 } 1503 }
1471 -  
1472 - if(s.isDestroy()){  
1473 - s.setFcsjActual("");  
1474 - s.setZdsjActual("");  
1475 - s.setJhlc(0.0);  
1476 - remarks +="(烂班)";  
1477 - s.setRemarks(remarks); 1504 +
  1505 + if (s.isDestroy()) {
  1506 + s.setFcsjActual("");
  1507 + s.setZdsjActual("");
  1508 + s.setJhlc(0.0);
  1509 + remarks += "(烂班)";
  1510 + s.setRemarks(remarks);
1478 } 1511 }
1479 listSchedule.add(s); 1512 listSchedule.add(s);
1480 //计算营运里程,空驶里程 1513 //计算营运里程,空驶里程
1481 if (!childTaskPlans.isEmpty()) { 1514 if (!childTaskPlans.isEmpty()) {
1482 - String sqlPc="select * from bsth_c_s_child_task where schedule="+s.getId() +" order by start_date ";  
1483 - List<ScheduleRealInfo> lists= jdbcTemplate.query(sqlPc,  
1484 - new RowMapper<ScheduleRealInfo>(){  
1485 - @Override  
1486 - public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {  
1487 - ScheduleRealInfo t=new ScheduleRealInfo();  
1488 - if(rs.getInt("destroy")==0){  
1489 - t.setFcsjActual(rs.getString("start_date"));  
1490 - t.setZdsjActual(rs.getString("end_date"));  
1491 - t.setJhlc(rs.getDouble("mileage"));  
1492 - }else{  
1493 - t.setFcsjActual("");  
1494 - t.setZdsjActual("");  
1495 - t.setJhlc(0.0);  
1496 - }  
1497 - t.setQdzName(rs.getString("start_station_name"));  
1498 - t.setZdzName(rs.getString("end_station_name"));  
1499 - t.setRemarks(rs.getString("remarks"));  
1500 - t.setAdjustExps("子");  
1501 - return t;  
1502 - }  
1503 - });  
1504 - for (int j = 0; j < lists.size(); j++) {  
1505 - ScheduleRealInfo t=lists.get(j);  
1506 - listSchedule.add(t);  
1507 - } 1515 + String sqlPc = "select * from bsth_c_s_child_task where schedule=" + s.getId() + " order by start_date ";
  1516 + List<ScheduleRealInfo> lists = jdbcTemplate.query(sqlPc,
  1517 + new RowMapper<ScheduleRealInfo>() {
  1518 + @Override
  1519 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  1520 + ScheduleRealInfo t = new ScheduleRealInfo();
  1521 + if (rs.getInt("destroy") == 0) {
  1522 + t.setFcsjActual(rs.getString("start_date"));
  1523 + t.setZdsjActual(rs.getString("end_date"));
  1524 + t.setJhlc(rs.getDouble("mileage"));
  1525 + } else {
  1526 + t.setFcsjActual("");
  1527 + t.setZdsjActual("");
  1528 + t.setJhlc(0.0);
  1529 + }
  1530 + t.setQdzName(rs.getString("start_station_name"));
  1531 + t.setZdzName(rs.getString("end_station_name"));
  1532 + t.setRemarks(rs.getString("remarks"));
  1533 + t.setAdjustExps("子");
  1534 + return t;
  1535 + }
  1536 + });
  1537 + for (int j = 0; j < lists.size(); j++) {
  1538 + ScheduleRealInfo t = lists.get(j);
  1539 + listSchedule.add(t);
  1540 + }
1508 } 1541 }
1509 } 1542 }
1510 1543
@@ -1532,12 +1565,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1532,12 +1565,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1532 @Override 1565 @Override
1533 public List<Map<String, Object>> statisticsDaily(String line, String date, 1566 public List<Map<String, Object>> statisticsDaily(String line, String date,
1534 String xlName, String type) { 1567 String xlName, String type) {
1535 - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();  
1536 - if(date.length() == 10)  
1537 - list = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);  
1538 - else if(date.length() == 7)  
1539 - list = scheduleRealInfoRepository.scheduleByDateAndLine3(line, date);  
1540 - 1568 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  1569 + if (date.length() == 10)
  1570 + list = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  1571 + else if (date.length() == 7)
  1572 + list = scheduleRealInfoRepository.scheduleByDateAndLine3(line, date);
  1573 +
1541 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); 1574 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
1542 DecimalFormat format = new DecimalFormat("0.00"); 1575 DecimalFormat format = new DecimalFormat("0.00");
1543 double jhlc = 0, tempJhlc = 0, childMileage = 0; 1576 double jhlc = 0, tempJhlc = 0, childMileage = 0;
@@ -1551,11 +1584,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1551,11 +1584,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1551 int fzbc = 0, fzbc_m = 0, fzbc_a = 0; 1584 int fzbc = 0, fzbc_m = 0, fzbc_a = 0;
1552 int dtbc = 0, dtbc_m = 0, dtbc_a = 0; 1585 int dtbc = 0, dtbc_m = 0, dtbc_a = 0;
1553 int djg = 0, djg_m = 0, djg_a = 0, djg_time = 0; 1586 int djg = 0, djg_m = 0, djg_a = 0, djg_time = 0;
1554 - 1587 +
1555 double jhlcZ = 0, tempJhlcZ = 0, childMileageZ = 0; 1588 double jhlcZ = 0, tempJhlcZ = 0, childMileageZ = 0;
1556 - float sjglZ = 0f, ssglZ = 0f, ssgl_lzZ = 0f, ssgl_dmZ = 0f,  
1557 - ssgl_gzZ = 0f, ssgl_jfZ = 0f, ssgl_zsZ = 0f, ssgl_qrZ = 0f, ssgl_qcZ = 0f,  
1558 - ssgl_kxZ = 0f, ssgl_qhZ = 0f, ssgl_ywZ = 0f, ssgl_otherZ = 0f, ljglZ = 0f; 1589 + float sjglZ = 0f, ssglZ = 0f, ssgl_lzZ = 0f, ssgl_dmZ = 0f,
  1590 + ssgl_gzZ = 0f, ssgl_jfZ = 0f, ssgl_zsZ = 0f, ssgl_qrZ = 0f, ssgl_qcZ = 0f,
  1591 + ssgl_kxZ = 0f, ssgl_qhZ = 0f, ssgl_ywZ = 0f, ssgl_otherZ = 0f, ljglZ = 0f;
1559 //班次 1592 //班次
1560 int ssbcZ = 0, ssbc_lzZ = 0, ssbc_dmZ = 0, ssbc_gzZ = 0, ssbc_jfZ = 0, ssbc_zsZ = 0, ssbc_qrZ = 0, ssbc_qcZ = 0, ssbc_kxZ = 0, ssbc_qhZ = 0, ssbc_ywZ = 0, ssbc_otherZ = 0; 1593 int ssbcZ = 0, ssbc_lzZ = 0, ssbc_dmZ = 0, ssbc_gzZ = 0, ssbc_jfZ = 0, ssbc_zsZ = 0, ssbc_qrZ = 0, ssbc_qcZ = 0, ssbc_kxZ = 0, ssbc_qhZ = 0, ssbc_ywZ = 0, ssbc_otherZ = 0;
1561 int jhbcZ = 0, jhbc_mZ = 0, jhbc_aZ = 0; 1594 int jhbcZ = 0, jhbc_mZ = 0, jhbc_aZ = 0;
@@ -1564,9 +1597,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1564,9 +1597,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1564 int fzbcZ = 0, fzbc_mZ = 0, fzbc_aZ = 0; 1597 int fzbcZ = 0, fzbc_mZ = 0, fzbc_aZ = 0;
1565 int dtbcZ = 0, dtbc_mZ = 0, dtbc_aZ = 0; 1598 int dtbcZ = 0, dtbc_mZ = 0, dtbc_aZ = 0;
1566 int djgZ = 0, djg_mZ = 0, djg_aZ = 0, djg_timeZ = 0; 1599 int djgZ = 0, djg_mZ = 0, djg_aZ = 0, djg_timeZ = 0;
1567 - Map<String, Object> map =null;  
1568 - for (int i=0; i<list.size();i++) {  
1569 - ScheduleRealInfo scheduleRealInfo=list.get(i); 1600 + Map<String, Object> map = null;
  1601 + for (int i = 0; i < list.size(); i++) {
  1602 + ScheduleRealInfo scheduleRealInfo = list.get(i);
1570 if (scheduleRealInfo != null) { 1603 if (scheduleRealInfo != null) {
1571 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 1604 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1572 //计算实际里程,少驶里程,计划里程=实际里程+少驶里程 1605 //计算实际里程,少驶里程,计划里程=实际里程+少驶里程
@@ -1580,7 +1613,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1580,7 +1613,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1580 jhlc += tempJhlc; 1613 jhlc += tempJhlc;
1581 jhlcZ += tempJhlc; 1614 jhlcZ += tempJhlc;
1582 } 1615 }
1583 - if (scheduleRealInfo.getStatus() == -1) { 1616 + if (scheduleRealInfo.getStatus() == -1) {
1584 ssgl += tempJhlc; 1617 ssgl += tempJhlc;
1585 ssglZ += tempJhlc; 1618 ssglZ += tempJhlc;
1586 ssbc++; 1619 ssbc++;
@@ -1641,7 +1674,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1641,7 +1674,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1641 ssbc_other++; 1674 ssbc_other++;
1642 ssbc_otherZ++; 1675 ssbc_otherZ++;
1643 } 1676 }
1644 - }else { 1677 + } else {
1645 sjgl += tempJhlc; 1678 sjgl += tempJhlc;
1646 sjglZ += tempJhlc; 1679 sjglZ += tempJhlc;
1647 } 1680 }
@@ -1765,12 +1798,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1765,12 +1798,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1765 fzbc_aZ++; 1798 fzbc_aZ++;
1766 } 1799 }
1767 } 1800 }
1768 -  
1769 - if(i<list.size()-1){  
1770 - if(!scheduleRealInfo.getXlBm().equals(list.get(i+1).getXlBm()))  
1771 - {  
1772 - map= new HashMap<String, Object>();  
1773 - map.put("xlName", scheduleRealInfo.getXlName()); 1801 +
  1802 + if (i < list.size() - 1) {
  1803 + if (!scheduleRealInfo.getXlBm().equals(list.get(i + 1).getXlBm())) {
  1804 + map = new HashMap<String, Object>();
  1805 + map.put("xlName", scheduleRealInfo.getXlName());
1774 map.put("jhlc", format.format(jhlc)); 1806 map.put("jhlc", format.format(jhlc));
1775 map.put("sjgl", format.format(sjgl)); 1807 map.put("sjgl", format.format(sjgl));
1776 map.put("ssgl", format.format(ssgl)); 1808 map.put("ssgl", format.format(ssgl));
@@ -1818,21 +1850,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1818,21 +1850,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1818 map.put("djg_a", djg_a); 1850 map.put("djg_a", djg_a);
1819 map.put("djg_time", djg_time); 1851 map.put("djg_time", djg_time);
1820 lMap.add(map); 1852 lMap.add(map);
1821 - jhlc = 0; tempJhlc = 0; childMileage = 0;  
1822 - sjgl = 0f; ssgl = 0f; ssgl_lz = 0f; ssgl_dm = 0f; ssgl_gz = 0f; ssgl_jf = 0f; ssgl_zs = 0f;  
1823 - ssgl_qr = 0f; ssgl_qc = 0f; ssgl_kx = 0f; ssgl_qh = 0f; ssgl_yw = 0f;ssgl_other = 0f;  
1824 - ljgl = 0f; 1853 + jhlc = 0;
  1854 + tempJhlc = 0;
  1855 + childMileage = 0;
  1856 + sjgl = 0f;
  1857 + ssgl = 0f;
  1858 + ssgl_lz = 0f;
  1859 + ssgl_dm = 0f;
  1860 + ssgl_gz = 0f;
  1861 + ssgl_jf = 0f;
  1862 + ssgl_zs = 0f;
  1863 + ssgl_qr = 0f;
  1864 + ssgl_qc = 0f;
  1865 + ssgl_kx = 0f;
  1866 + ssgl_qh = 0f;
  1867 + ssgl_yw = 0f;
  1868 + ssgl_other = 0f;
  1869 + ljgl = 0f;
1825 //班次 1870 //班次
1826 - jhbc = 0; jhbc_m = 0; jhbc_a = 0;  
1827 - sjbc = 0; sjbc_m = 0; sjbc_a = 0;  
1828 - ljbc = 0; ljbc_m = 0; ljbc_a = 0;  
1829 - fzbc = 0; fzbc_m = 0; fzbc_a = 0;  
1830 - dtbc = 0; dtbc_m = 0; dtbc_a = 0;  
1831 - djg = 0; djg_m = 0; djg_a = 0; djg_time = 0;  
1832 - }  
1833 - }else{  
1834 - map= new HashMap<String, Object>();  
1835 - map.put("xlName", scheduleRealInfo.getXlName()); 1871 + jhbc = 0;
  1872 + jhbc_m = 0;
  1873 + jhbc_a = 0;
  1874 + sjbc = 0;
  1875 + sjbc_m = 0;
  1876 + sjbc_a = 0;
  1877 + ljbc = 0;
  1878 + ljbc_m = 0;
  1879 + ljbc_a = 0;
  1880 + fzbc = 0;
  1881 + fzbc_m = 0;
  1882 + fzbc_a = 0;
  1883 + dtbc = 0;
  1884 + dtbc_m = 0;
  1885 + dtbc_a = 0;
  1886 + djg = 0;
  1887 + djg_m = 0;
  1888 + djg_a = 0;
  1889 + djg_time = 0;
  1890 + }
  1891 + } else {
  1892 + map = new HashMap<String, Object>();
  1893 + map.put("xlName", scheduleRealInfo.getXlName());
1836 map.put("jhlc", format.format(jhlc)); 1894 map.put("jhlc", format.format(jhlc));
1837 map.put("sjgl", format.format(sjgl)); 1895 map.put("sjgl", format.format(sjgl));
1838 map.put("ssgl", format.format(ssgl)); 1896 map.put("ssgl", format.format(ssgl));
@@ -1880,22 +1938,48 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1880,22 +1938,48 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1880 map.put("djg_a", djg_a); 1938 map.put("djg_a", djg_a);
1881 map.put("djg_time", djg_time); 1939 map.put("djg_time", djg_time);
1882 lMap.add(map); 1940 lMap.add(map);
1883 - jhlc = 0; tempJhlc = 0; childMileage = 0;  
1884 - sjgl = 0f; ssgl = 0f; ssgl_lz = 0f; ssgl_dm = 0f; ssgl_gz = 0f; ssgl_jf = 0f; ssgl_zs = 0f;  
1885 - ssgl_qr = 0f; ssgl_qc = 0f; ssgl_kx = 0f; ssgl_qh = 0f; ssgl_yw = 0f;ssgl_other = 0f; 1941 + jhlc = 0;
  1942 + tempJhlc = 0;
  1943 + childMileage = 0;
  1944 + sjgl = 0f;
  1945 + ssgl = 0f;
  1946 + ssgl_lz = 0f;
  1947 + ssgl_dm = 0f;
  1948 + ssgl_gz = 0f;
  1949 + ssgl_jf = 0f;
  1950 + ssgl_zs = 0f;
  1951 + ssgl_qr = 0f;
  1952 + ssgl_qc = 0f;
  1953 + ssgl_kx = 0f;
  1954 + ssgl_qh = 0f;
  1955 + ssgl_yw = 0f;
  1956 + ssgl_other = 0f;
1886 ljgl = 0f; 1957 ljgl = 0f;
1887 - //班次  
1888 - jhbc = 0; jhbc_m = 0; jhbc_a = 0;  
1889 - sjbc = 0; sjbc_m = 0; sjbc_a = 0;  
1890 - ljbc = 0; ljbc_m = 0; ljbc_a = 0;  
1891 - fzbc = 0; fzbc_m = 0; fzbc_a = 0;  
1892 - dtbc = 0; dtbc_m = 0; dtbc_a = 0;  
1893 - djg = 0; djg_m = 0; djg_a = 0; djg_time = 0; 1958 + //班次
  1959 + jhbc = 0;
  1960 + jhbc_m = 0;
  1961 + jhbc_a = 0;
  1962 + sjbc = 0;
  1963 + sjbc_m = 0;
  1964 + sjbc_a = 0;
  1965 + ljbc = 0;
  1966 + ljbc_m = 0;
  1967 + ljbc_a = 0;
  1968 + fzbc = 0;
  1969 + fzbc_m = 0;
  1970 + fzbc_a = 0;
  1971 + dtbc = 0;
  1972 + dtbc_m = 0;
  1973 + dtbc_a = 0;
  1974 + djg = 0;
  1975 + djg_m = 0;
  1976 + djg_a = 0;
  1977 + djg_time = 0;
1894 } 1978 }
1895 } 1979 }
1896 } 1980 }
1897 - map= new HashMap<String, Object>();  
1898 - map.put("xlName", "合计"); 1981 + map = new HashMap<String, Object>();
  1982 + map.put("xlName", "合计");
1899 map.put("jhlc", format.format(jhlcZ)); 1983 map.put("jhlc", format.format(jhlcZ));
1900 map.put("sjgl", format.format(sjglZ)); 1984 map.put("sjgl", format.format(sjglZ));
1901 map.put("ssgl", format.format(ssglZ)); 1985 map.put("ssgl", format.format(ssglZ));
@@ -1981,24 +2065,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1981,24 +2065,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1981 m.get("djg_a", djg_a); 2065 m.get("djg_a", djg_a);
1982 m.get("djg_time", djg_time); 2066 m.get("djg_time", djg_time);
1983 }*/ 2067 }*/
1984 -  
1985 - if(type != null && type.length() != 0 && type.equals("export")){  
1986 - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),  
1987 - sdfSimple = new SimpleDateFormat("yyyyMMdd");  
1988 - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();  
1989 - Map<String,Object> m = new HashMap<String, Object>();  
1990 - ReportUtils ee = new ReportUtils();  
1991 - try {  
1992 - listI.add(lMap.iterator());  
1993 - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";  
1994 - ee.excelReplace(listI, new Object[] { m }, path+"mould/statisticsDaily_.xls",  
1995 - path+"export/统计日报" + sdfSimple.format(sdfMonth.parse(date))+".xls");  
1996 - } catch (Exception e) {  
1997 - // TODO: handle exception  
1998 - e.printStackTrace();  
1999 - } 2068 +
  2069 + if (type != null && type.length() != 0 && type.equals("export")) {
  2070 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  2071 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  2072 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  2073 + Map<String, Object> m = new HashMap<String, Object>();
  2074 + ReportUtils ee = new ReportUtils();
  2075 + try {
  2076 + listI.add(lMap.iterator());
  2077 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2078 + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
  2079 + path + "export/统计日报" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  2080 + } catch (Exception e) {
  2081 + // TODO: handle exception
  2082 + e.printStackTrace();
  2083 + }
2000 } 2084 }
2001 - 2085 +
2002 return lMap; 2086 return lMap;
2003 } 2087 }
2004 2088
@@ -2110,84 +2194,88 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2110,84 +2194,88 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2110 } 2194 }
2111 } 2195 }
2112 }*/ 2196 }*/
2113 - List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();  
2114 - String lpName="lpName";  
2115 - String zdsj="";  
2116 - String zdsjActual="";  
2117 - String zdsj1="";  
2118 - String zdsjActual1="";  
2119 - List<ScheduleRealInfo> listInfo=scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);  
2120 - for (int i = 0; i < listInfo.size(); i++) {  
2121 - ScheduleRealInfo t=listInfo.get(i);  
2122 - if(!lpName.equals(t.getLpName())){  
2123 - zdsjActual=t.getZdsjActual();  
2124 - zdsj=t.getZdsj();  
2125 - t.setZdsjActual("");  
2126 - t.setZdsj("");  
2127 - }else{  
2128 - zdsj1=t.getZdsj();  
2129 - zdsjActual1=t.getZdsjActual();  
2130 - t.setZdsjActual(zdsjActual);  
2131 - t.setZdsj(zdsj);  
2132 - zdsj=zdsj1;  
2133 - zdsjActual=zdsjActual1;  
2134 - }  
2135 - lpName=t.getLpName();  
2136 - list.add(t);  
2137 - }  
2138 -  
2139 - List<ScheduleRealInfo> listInfo2=scheduleRealInfoRepository.scheduleByDateAndLine(line, date);  
2140 - List<ScheduleRealInfo> xList=new ArrayList<ScheduleRealInfo>();  
2141 - List<ScheduleRealInfo> yList=new ArrayList<ScheduleRealInfo>();  
2142 - List<ScheduleRealInfo> zList=new ArrayList<ScheduleRealInfo>();  
2143 - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();  
2144 - if(listInfo2.size()>0){  
2145 - int a=listInfo2.size()%3;  
2146 - int b=listInfo2.size()/3;  
2147 - int x = 0,y=0;  
2148 - if(a==2){  
2149 - x=b+1;y=x*2;;  
2150 - }else if(b==1){  
2151 - x=b+1;y=x*2-1;;  
2152 - }else{  
2153 - x=b;  
2154 - y=2*x;  
2155 -  
2156 - }  
2157 - for (int i = 0; i < listInfo2.size(); i++) {  
2158 - ScheduleRealInfo s=listInfo2.get(i);  
2159 - if(i+1<=x){  
2160 - xList.add(s);  
2161 - }else if((i+1)>x&&(i+1)<=y){  
2162 - yList.add(s);  
2163 - }else{  
2164 - zList.add(s);  
2165 - }  
2166 - }  
2167 - for (int i = 0; i < x; i++) {  
2168 - newList.add(xList.get(i));  
2169 - if(yList.size()>i){  
2170 - newList.add(yList.get(i));  
2171 - }else{  
2172 - newList.add(new ScheduleRealInfo());  
2173 - }  
2174 - if(zList.size()>i){  
2175 - newList.add(zList.get(i));  
2176 - }else{  
2177 - newList.add(new ScheduleRealInfo());  
2178 - }  
2179 -  
2180 - }  
2181 - }  
2182 - for (int i = 0; i < newList.size(); i++) {  
2183 - ScheduleRealInfo t1=newList.get(i);  
2184 - for (int j = 0; j < list.size(); j++) {  
2185 - ScheduleRealInfo t2=list.get(j);  
2186 - if(t1.getId()==t2.getId()){  
2187 - t1=t2;  
2188 - }  
2189 - }  
2190 - } 2197 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2198 + String lpName = "lpName";
  2199 + String zdsj = "";
  2200 + String zdsjActual = "";
  2201 + String zdsj1 = "";
  2202 + String zdsjActual1 = "";
  2203 + List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);
  2204 + for (int i = 0; i < listInfo.size(); i++) {
  2205 + ScheduleRealInfo t = listInfo.get(i);
  2206 + if (!lpName.equals(t.getLpName())) {
  2207 + zdsjActual = t.getZdsjActual();
  2208 + zdsj = t.getZdsj();
  2209 + t.setZdsjActual("");
  2210 + t.setZdsj("");
  2211 + } else {
  2212 + zdsj1 = t.getZdsj();
  2213 + zdsjActual1 = t.getZdsjActual();
  2214 + t.setZdsjActual(zdsjActual);
  2215 + t.setZdsj(zdsj);
  2216 + zdsj = zdsj1;
  2217 + zdsjActual = zdsjActual1;
  2218 + }
  2219 + lpName = t.getLpName();
  2220 + list.add(t);
  2221 + }
  2222 +
  2223 + List<ScheduleRealInfo> listInfo2 = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
  2224 + List<ScheduleRealInfo> xList = new ArrayList<ScheduleRealInfo>();
  2225 + List<ScheduleRealInfo> yList = new ArrayList<ScheduleRealInfo>();
  2226 + List<ScheduleRealInfo> zList = new ArrayList<ScheduleRealInfo>();
  2227 + List<ScheduleRealInfo> newList = new ArrayList<ScheduleRealInfo>();
  2228 + if (listInfo2.size() > 0) {
  2229 + int a = listInfo2.size() % 3;
  2230 + int b = listInfo2.size() / 3;
  2231 + int x = 0, y = 0;
  2232 + if (a == 2) {
  2233 + x = b + 1;
  2234 + y = x * 2;
  2235 + ;
  2236 + } else if (b == 1) {
  2237 + x = b + 1;
  2238 + y = x * 2 - 1;
  2239 + ;
  2240 + } else {
  2241 + x = b;
  2242 + y = 2 * x;
  2243 +
  2244 + }
  2245 + for (int i = 0; i < listInfo2.size(); i++) {
  2246 + ScheduleRealInfo s = listInfo2.get(i);
  2247 + if (i + 1 <= x) {
  2248 + xList.add(s);
  2249 + } else if ((i + 1) > x && (i + 1) <= y) {
  2250 + yList.add(s);
  2251 + } else {
  2252 + zList.add(s);
  2253 + }
  2254 + }
  2255 + for (int i = 0; i < x; i++) {
  2256 + newList.add(xList.get(i));
  2257 + if (yList.size() > i) {
  2258 + newList.add(yList.get(i));
  2259 + } else {
  2260 + newList.add(new ScheduleRealInfo());
  2261 + }
  2262 + if (zList.size() > i) {
  2263 + newList.add(zList.get(i));
  2264 + } else {
  2265 + newList.add(new ScheduleRealInfo());
  2266 + }
  2267 +
  2268 + }
  2269 + }
  2270 + for (int i = 0; i < newList.size(); i++) {
  2271 + ScheduleRealInfo t1 = newList.get(i);
  2272 + for (int j = 0; j < list.size(); j++) {
  2273 + ScheduleRealInfo t2 = list.get(j);
  2274 + if (t1.getId() == t2.getId()) {
  2275 + t1 = t2;
  2276 + }
  2277 + }
  2278 + }
2191 return newList; 2279 return newList;
2192 } 2280 }
2193 2281
@@ -2202,28 +2290,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2202,28 +2290,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2202 } 2290 }
2203 } 2291 }
2204 }*/ 2292 }*/
2205 - List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();  
2206 - String lpName="lpName";  
2207 - String zdsj="";  
2208 - String zdsjActual="";  
2209 - String zdsj1="";  
2210 - String zdsjActual1="";  
2211 - List<ScheduleRealInfo> listInfo=scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);  
2212 - for (int i = 0; i < listInfo.size(); i++) {  
2213 - ScheduleRealInfo t=listInfo.get(i);  
2214 - if(!lpName.equals(t.getLpName())){  
2215 - zdsjActual=t.getZdsjActual();  
2216 - zdsj=t.getZdsj();  
2217 - t.setZdsjActual("");  
2218 - t.setZdsj("");  
2219 - }else{  
2220 - zdsj1=t.getZdsj();  
2221 - zdsjActual1=t.getZdsjActual();  
2222 - t.setZdsjActual(zdsjActual);  
2223 - t.setZdsj(zdsj);  
2224 - zdsj=zdsj1;  
2225 - zdsjActual=zdsjActual1;  
2226 - } 2293 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2294 + String lpName = "lpName";
  2295 + String zdsj = "";
  2296 + String zdsjActual = "";
  2297 + String zdsj1 = "";
  2298 + String zdsjActual1 = "";
  2299 + List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);
  2300 + for (int i = 0; i < listInfo.size(); i++) {
  2301 + ScheduleRealInfo t = listInfo.get(i);
  2302 + if (!lpName.equals(t.getLpName())) {
  2303 + zdsjActual = t.getZdsjActual();
  2304 + zdsj = t.getZdsj();
  2305 + t.setZdsjActual("");
  2306 + t.setZdsj("");
  2307 + } else {
  2308 + zdsj1 = t.getZdsj();
  2309 + zdsjActual1 = t.getZdsjActual();
  2310 + t.setZdsjActual(zdsjActual);
  2311 + t.setZdsj(zdsj);
  2312 + zdsj = zdsj1;
  2313 + zdsjActual = zdsjActual1;
  2314 + }
2227 /*if(i<listInfo.size()-1){ 2315 /*if(i<listInfo.size()-1){
2228 if(s.getLpName().equals(listInfo.get(i+1).getLpName())){ 2316 if(s.getLpName().equals(listInfo.get(i+1).getLpName())){
2229 zdsj=s.getZdsj(); 2317 zdsj=s.getZdsj();
@@ -2236,10 +2324,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2236,10 +2324,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2236 zdsj=s.getZdsj(); 2324 zdsj=s.getZdsj();
2237 zdsjActual=s.getZdsjActual(); 2325 zdsjActual=s.getZdsjActual();
2238 }*/ 2326 }*/
2239 -  
2240 - lpName=t.getLpName();  
2241 - list.add(t);  
2242 - } 2327 +
  2328 + lpName = t.getLpName();
  2329 + list.add(t);
  2330 + }
2243 return list; 2331 return list;
2244 } 2332 }
2245 2333
@@ -2426,7 +2514,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2426,7 +2514,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2426 String jName = BasicData.allPerson.get(jGh); 2514 String jName = BasicData.allPerson.get(jGh);
2427 if (StringUtils.isNotEmpty(jName)) { 2515 if (StringUtils.isNotEmpty(jName)) {
2428 2516
2429 - if(jGh.indexOf("-") != -1) 2517 + if (jGh.indexOf("-") != -1)
2430 sch.setjGh(jGh.substring(jGh.indexOf("-") + 1)); 2518 sch.setjGh(jGh.substring(jGh.indexOf("-") + 1));
2431 else 2519 else
2432 sch.setjGh(jGh); 2520 sch.setjGh(jGh);
@@ -2444,7 +2532,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2444,7 +2532,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2444 return; 2532 return;
2445 String sName = BasicData.allPerson.get(sGh); 2533 String sName = BasicData.allPerson.get(sGh);
2446 if (StringUtils.isNotEmpty(sName)) { 2534 if (StringUtils.isNotEmpty(sName)) {
2447 - sch.setsGh(sGh); 2535 + if (sGh.indexOf("-") != -1)
  2536 + sch.setsGh(sGh.substring(sGh.indexOf("-") + 1));
  2537 + else
  2538 + sch.setsGh(sGh);
2448 sch.setsName(sName); 2539 sch.setsName(sName);
2449 } 2540 }
2450 } 2541 }
@@ -2686,600 +2777,601 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2686,600 +2777,601 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2686 return null; 2777 return null;
2687 } 2778 }
2688 2779
2689 - @Override  
2690 - public List<ScheduleRealInfo> exportWaybillQp(String clZbh, String date, String line) {  
2691 - // TODO Auto-generated method stub  
2692 - ReportUtils ee = new ReportUtils();  
2693 - ReportRelatedUtils rru = new ReportRelatedUtils();  
2694 - List<Iterator<?>> list = new ArrayList<Iterator<?>>();  
2695 - List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill2( clZbh,date,line);  
2696 - List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();  
2697 -  
2698 - DecimalFormat format = new DecimalFormat("0.00"); 2780 + @Override
  2781 + public List<ScheduleRealInfo> exportWaybillQp(String clZbh, String date, String line) {
  2782 + // TODO Auto-generated method stub
  2783 + ReportUtils ee = new ReportUtils();
  2784 + ReportRelatedUtils rru = new ReportRelatedUtils();
  2785 + List<Iterator<?>> list = new ArrayList<Iterator<?>>();
  2786 + List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill2(clZbh, date, line);
  2787 + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
  2788 +
  2789 + DecimalFormat format = new DecimalFormat("0.00");
2699 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 2790 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
2700 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 2791 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
2701 - int jhbc = 0,cjbc = 0,ljbc = 0;  
2702 - double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0,jcclc=0;  
2703 - float addMileage = 0l,remMileage = 0l, addgl = 0, remgl = 0;  
2704 - int xyz=1;  
2705 - Map<String,Object> map;  
2706 - for(ScheduleRealInfo scheduleRealInfo : scheduleRealInfos){  
2707 - if(scheduleRealInfo != null){  
2708 - //计算计划里程(主任务过滤掉临加班次),烂班里程,临加里程,计划班次,烂班班次,增加班次  
2709 - //计划里程(主任务过滤掉临加班次),  
2710 - //烂班里程(主任务烂班),  
2711 - //临加里程(主任务临加),  
2712 - //计划班次,烂班班次,增加班次  
2713 - double jh = 0, sj = 0;  
2714 - tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();  
2715 - if(scheduleRealInfo.isSflj()){  
2716 - ljbc++;  
2717 - }else{  
2718 - if( !(scheduleRealInfo.getBcType().equals("in")  
2719 - ||scheduleRealInfo.getBcType().equals("out")) ){  
2720 - jhbc++;  
2721 - jh += tempJhlc;  
2722 - }  
2723 - if(scheduleRealInfo.getStatus() == -1){  
2724 - remMileage += tempJhlc;  
2725 - cjbc++;  
2726 - }  
2727 - }  
2728 - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();  
2729 - //计算营运里程,空驶里程  
2730 - if(childTaskPlans.isEmpty()){  
2731 - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")  
2732 - ){  
2733 - jcclc +=tempJhlc;  
2734 - }  
2735 - //主任务 放空班次属于营运 2792 + int jhbc = 0, cjbc = 0, ljbc = 0;
  2793 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0;
  2794 + float addMileage = 0l, remMileage = 0l, addgl = 0, remgl = 0;
  2795 + int xyz = 1;
  2796 + Map<String, Object> map;
  2797 + for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) {
  2798 + if (scheduleRealInfo != null) {
  2799 + //计算计划里程(主任务过滤掉临加班次),烂班里程,临加里程,计划班次,烂班班次,增加班次
  2800 + //计划里程(主任务过滤掉临加班次),
  2801 + //烂班里程(主任务烂班),
  2802 + //临加里程(主任务临加),
  2803 + //计划班次,烂班班次,增加班次
  2804 + double jh = 0, sj = 0;
  2805 + tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc();
  2806 + if (scheduleRealInfo.isSflj()) {
  2807 + ljbc++;
  2808 + } else {
  2809 + if (!(scheduleRealInfo.getBcType().equals("in")
  2810 + || scheduleRealInfo.getBcType().equals("out"))) {
  2811 + jhbc++;
  2812 + jh += tempJhlc;
  2813 + }
  2814 + if (scheduleRealInfo.getStatus() == -1) {
  2815 + remMileage += tempJhlc;
  2816 + cjbc++;
  2817 + }
  2818 + }
  2819 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  2820 + //计算营运里程,空驶里程
  2821 + if (childTaskPlans.isEmpty()) {
  2822 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  2823 + ) {
  2824 + jcclc += tempJhlc;
  2825 + }
  2826 + //主任务 放空班次属于营运
2736 // else if(scheduleRealInfo.getBcType().equals("venting")){ 2827 // else if(scheduleRealInfo.getBcType().equals("venting")){
2737 // ksgl += tempJhlc; 2828 // ksgl += tempJhlc;
2738 // } 2829 // }
2739 - else{  
2740 - if(scheduleRealInfo.getStatus() != -1){  
2741 - if(scheduleRealInfo.isSflj()){  
2742 - addMileage += tempJhlc;  
2743 - }  
2744 - sj += tempJhlc;  
2745 - }  
2746 - }  
2747 - }else{  
2748 - Iterator<ChildTaskPlan> it = childTaskPlans.iterator();  
2749 - while(it.hasNext()){  
2750 - ChildTaskPlan childTaskPlan = it.next();  
2751 - if(childTaskPlan.getMileageType().equals("empty")){  
2752 - if(childTaskPlan.isDestroy()){  
2753 - remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
2754 - }else{  
2755 - if(scheduleRealInfo.isSflj()){  
2756 - addMileage += tempJhlc;  
2757 - }  
2758 - ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
2759 - }  
2760 - }else{  
2761 - if(childTaskPlan.isDestroy()){  
2762 - remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
2763 -// cjbc++;  
2764 - }else{  
2765 - if(scheduleRealInfo.isSflj()){  
2766 - addMileage += tempJhlc;  
2767 - }  
2768 - sj += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
2769 - }  
2770 - }  
2771 - }  
2772 - }  
2773 -  
2774 - if(!(scheduleRealInfo.getBcType().equals("in")||scheduleRealInfo.getBcType().equals("out"))){  
2775 - map = new HashMap<String, Object>();  
2776 - try {  
2777 - scheduleRealInfo.setBcs(xyz);  
2778 - xyz++;  
2779 - Set<ChildTaskPlan> cs = scheduleRealInfo.getcTasks();  
2780 - Double sjlc=0.0;  
2781 - if(!cs.isEmpty()){  
2782 - Iterator<ChildTaskPlan> it = cs.iterator();  
2783 - while(it.hasNext()){  
2784 - ChildTaskPlan c = it.next();  
2785 - if(!c.isDestroy()){  
2786 - sjlc += c.getMileage()==null?0:c.getMileage();  
2787 - }  
2788 -  
2789 - }  
2790 - }else{  
2791 - if(scheduleRealInfo.getStatus() != -1){  
2792 - sjlc =scheduleRealInfo.getJhlc();  
2793 - }  
2794 - }  
2795 - scheduleRealInfo.setjName(scheduleRealInfo.getjGh()+scheduleRealInfo.getjName());  
2796 - scheduleRealInfo.setsName(scheduleRealInfo.getsGh()+scheduleRealInfo.getsName());  
2797 - scheduleRealInfo.setSjlc(format.format(sjlc));  
2798 - map = rru.getMapValue(scheduleRealInfo);  
2799 - String zdsj = scheduleRealInfo.getZdsj();  
2800 - String zdsjActual = scheduleRealInfo.getZdsjActual();  
2801 - if(zdsj != null && zdsjActual != null &&  
2802 - !zdsj.equals(zdsjActual)){  
2803 - if(zdsj.compareTo(zdsjActual) > 0){  
2804 - map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
2805 - map.put("slow", "");  
2806 - } else {  
2807 - map.put("fast", "");  
2808 - map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
2809 - }  
2810 - } else {  
2811 - map.put("fast", "");  
2812 - map.put("slow", "");  
2813 - }  
2814 - System.out.println(map);  
2815 - listMap.add(map);  
2816 - } catch (Exception e) {  
2817 - e.printStackTrace();  
2818 - }  
2819 - }  
2820 - jhlc += jh;  
2821 - yygl += sj;  
2822 - if(jh > sj){  
2823 - remgl += jh - sj;  
2824 - } else {  
2825 - addgl += sj - jh;  
2826 - }  
2827 - }  
2828 - }  
2829 -  
2830 -  
2831 - List<Ylxxb> listYlxxb=ylxxbRepository.queryListYlxxb( clZbh, date);  
2832 - Double jzl=0.0;  
2833 - for(int t=0;t<listYlxxb.size();t++){  
2834 - Ylxxb y=listYlxxb.get(t);  
2835 - jzl += y.getJzl();  
2836 - }  
2837 -  
2838 - //计算里程和班次数,并放入Map里  
2839 - map = new HashMap<String, Object>();  
2840 - map.put("jzl", jzl);  
2841 - map.put("jhlc", format.format(jhlc+jcclc));  
2842 - map.put("yygljh", format.format(jhlc));  
2843 - map.put("ssgl", format.format(remMileage));  
2844 - map.put("ksgl", format.format(ksgl));  
2845 - map.put("yyglsj", format.format(yygl));  
2846 - map.put("jhbc", jhbc);  
2847 - map.put("jcclc", jcclc);  
2848 -  
2849 - map.put("ljgl", format.format(addMileage));  
2850 - map.put("ssbc", cjbc);  
2851 - map.put("ysgl", format.format(yygl));  
2852 - map.put("sjbc", jhbc-cjbc+ljbc);  
2853 - map.put("zgl", format.format(yygl+ksgl+jcclc));  
2854 - map.put("ljbc", ljbc);  
2855 - String zdp="",zwdp="",wdp="";  
2856 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");  
2857 - List<DutyEmployee> listDtuy= dutyEmployeeService.getDutyEmployee(line, date+"00:00", date+"23:59");  
2858 - try {  
2859 - Long fcsj1=sdf.parse(date+" 03:00").getTime();  
2860 - Long fcsj2=sdf.parse(date+" 11:00").getTime();  
2861 - Long fcsj3=sdf.parse(date+" 22:00").getTime();  
2862 - for(int i=0;i<listDtuy.size();i++){  
2863 - DutyEmployee t=listDtuy.get(i);  
2864 - Long ts=t.getTs();  
2865 - if(ts>fcsj1&&ts<fcsj2){  
2866 - if(zdp.indexOf(t.getuName())==-1){  
2867 - zdp +=t.getuName()+",";  
2868 -  
2869 - }  
2870 - }else if(ts>fcsj2 && ts<fcsj3){  
2871 - if(zwdp.indexOf(t.getuName())==-1){  
2872 - zwdp +=t.getuName()+",";  
2873 - }  
2874 - }else{  
2875 - if(wdp.indexOf(t.getuName())==-1){  
2876 - wdp +=t.getuName()+",";  
2877 - }  
2878 - }  
2879 - }  
2880 - }catch (ParseException e) {  
2881 - // TODO Auto-generated catch block  
2882 - e.printStackTrace();  
2883 - }  
2884 - map.put("zdp", zdp);  
2885 - map.put("zwdp", zwdp);  
2886 - map.put("wdp", wdp);  
2887 - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";  
2888 - list.add(listMap.iterator());  
2889 - ee.excelReplace(list, new Object[] { scheduleRealInfos.get(0),map }, path+"mould/waybill_qingpu.xls",  
2890 - path+"export/" + date+"-"+clZbh+"-行车路单.xls");  
2891 -  
2892 - return scheduleRealInfos;  
2893 - }  
2894 -  
2895 - @Override  
2896 - public Map<String, Object> findKMBCQp(String clZbh, String date, String line) {  
2897 - // TODO Auto-generated method stub  
2898 - List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill2( clZbh,date,line);  
2899 - DecimalFormat format = new DecimalFormat("0.00"); 2830 + else {
  2831 + if (scheduleRealInfo.getStatus() != -1) {
  2832 + if (scheduleRealInfo.isSflj()) {
  2833 + addMileage += tempJhlc;
  2834 + }
  2835 + sj += tempJhlc;
  2836 + }
  2837 + }
  2838 + } else {
  2839 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  2840 + while (it.hasNext()) {
  2841 + ChildTaskPlan childTaskPlan = it.next();
  2842 + if (childTaskPlan.getMileageType().equals("empty")) {
  2843 + if (childTaskPlan.isDestroy()) {
  2844 + remMileage += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  2845 + } else {
  2846 + if (scheduleRealInfo.isSflj()) {
  2847 + addMileage += tempJhlc;
  2848 + }
  2849 + ksgl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  2850 + }
  2851 + } else {
  2852 + if (childTaskPlan.isDestroy()) {
  2853 + remMileage += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  2854 +// cjbc++;
  2855 + } else {
  2856 + if (scheduleRealInfo.isSflj()) {
  2857 + addMileage += tempJhlc;
  2858 + }
  2859 + sj += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  2860 + }
  2861 + }
  2862 + }
  2863 + }
  2864 +
  2865 + if (!(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out"))) {
  2866 + map = new HashMap<String, Object>();
  2867 + try {
  2868 + scheduleRealInfo.setBcs(xyz);
  2869 + xyz++;
  2870 + Set<ChildTaskPlan> cs = scheduleRealInfo.getcTasks();
  2871 + Double sjlc = 0.0;
  2872 + if (!cs.isEmpty()) {
  2873 + Iterator<ChildTaskPlan> it = cs.iterator();
  2874 + while (it.hasNext()) {
  2875 + ChildTaskPlan c = it.next();
  2876 + if (!c.isDestroy()) {
  2877 + sjlc += c.getMileage() == null ? 0 : c.getMileage();
  2878 + }
  2879 +
  2880 + }
  2881 + } else {
  2882 + if (scheduleRealInfo.getStatus() != -1) {
  2883 + sjlc = scheduleRealInfo.getJhlc();
  2884 + }
  2885 + }
  2886 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  2887 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  2888 + scheduleRealInfo.setSjlc(format.format(sjlc));
  2889 + map = rru.getMapValue(scheduleRealInfo);
  2890 + String zdsj = scheduleRealInfo.getZdsj();
  2891 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  2892 + if (zdsj != null && zdsjActual != null &&
  2893 + !zdsj.equals(zdsjActual)) {
  2894 + if (zdsj.compareTo(zdsjActual) > 0) {
  2895 + map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  2896 + map.put("slow", "");
  2897 + } else {
  2898 + map.put("fast", "");
  2899 + map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  2900 + }
  2901 + } else {
  2902 + map.put("fast", "");
  2903 + map.put("slow", "");
  2904 + }
  2905 + System.out.println(map);
  2906 + listMap.add(map);
  2907 + } catch (Exception e) {
  2908 + e.printStackTrace();
  2909 + }
  2910 + }
  2911 + jhlc += jh;
  2912 + yygl += sj;
  2913 + if (jh > sj) {
  2914 + remgl += jh - sj;
  2915 + } else {
  2916 + addgl += sj - jh;
  2917 + }
  2918 + }
  2919 + }
  2920 +
  2921 +
  2922 + List<Ylxxb> listYlxxb = ylxxbRepository.queryListYlxxb(clZbh, date);
  2923 + Double jzl = 0.0;
  2924 + for (int t = 0; t < listYlxxb.size(); t++) {
  2925 + Ylxxb y = listYlxxb.get(t);
  2926 + jzl += y.getJzl();
  2927 + }
  2928 +
  2929 + //计算里程和班次数,并放入Map里
  2930 + map = new HashMap<String, Object>();
  2931 + map.put("jzl", jzl);
  2932 + map.put("jhlc", format.format(jhlc + jcclc));
  2933 + map.put("yygljh", format.format(jhlc));
  2934 + map.put("ssgl", format.format(remMileage));
  2935 + map.put("ksgl", format.format(ksgl));
  2936 + map.put("yyglsj", format.format(yygl));
  2937 + map.put("jhbc", jhbc);
  2938 + map.put("jcclc", jcclc);
  2939 +
  2940 + map.put("ljgl", format.format(addMileage));
  2941 + map.put("ssbc", cjbc);
  2942 + map.put("ysgl", format.format(yygl));
  2943 + map.put("sjbc", jhbc - cjbc + ljbc);
  2944 + map.put("zgl", format.format(yygl + ksgl + jcclc));
  2945 + map.put("ljbc", ljbc);
  2946 + String zdp = "", zwdp = "", wdp = "";
  2947 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2948 + List<DutyEmployee> listDtuy = dutyEmployeeService.getDutyEmployee(line, date + "00:00", date + "23:59");
  2949 + try {
  2950 + Long fcsj1 = sdf.parse(date + " 03:00").getTime();
  2951 + Long fcsj2 = sdf.parse(date + " 11:00").getTime();
  2952 + Long fcsj3 = sdf.parse(date + " 22:00").getTime();
  2953 + for (int i = 0; i < listDtuy.size(); i++) {
  2954 + DutyEmployee t = listDtuy.get(i);
  2955 + Long ts = t.getTs();
  2956 + if (ts > fcsj1 && ts < fcsj2) {
  2957 + if (zdp.indexOf(t.getuName()) == -1) {
  2958 + zdp += t.getuName() + ",";
  2959 +
  2960 + }
  2961 + } else if (ts > fcsj2 && ts < fcsj3) {
  2962 + if (zwdp.indexOf(t.getuName()) == -1) {
  2963 + zwdp += t.getuName() + ",";
  2964 + }
  2965 + } else {
  2966 + if (wdp.indexOf(t.getuName()) == -1) {
  2967 + wdp += t.getuName() + ",";
  2968 + }
  2969 + }
  2970 + }
  2971 + } catch (ParseException e) {
  2972 + // TODO Auto-generated catch block
  2973 + e.printStackTrace();
  2974 + }
  2975 + map.put("zdp", zdp);
  2976 + map.put("zwdp", zwdp);
  2977 + map.put("wdp", wdp);
  2978 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2979 + list.add(listMap.iterator());
  2980 + ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0), map}, path + "mould/waybill_qingpu.xls",
  2981 + path + "export/" + date + "-" + clZbh + "-行车路单.xls");
  2982 +
  2983 + return scheduleRealInfos;
  2984 + }
  2985 +
  2986 + @Override
  2987 + public Map<String, Object> findKMBCQp(String clZbh, String date, String line) {
  2988 + // TODO Auto-generated method stub
  2989 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill2(clZbh, date, line);
  2990 + DecimalFormat format = new DecimalFormat("0.00");
2900 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 2991 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
2901 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 2992 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
2902 - int jhbc = 0,cjbc = 0,ljbc = 0;  
2903 - double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0,jcclc=0;  
2904 - float addMileage = 0l,remMileage = 0l, addgl = 0, remgl = 0;  
2905 - Map<String,Object> map = new HashMap<String, Object>();  
2906 - for(ScheduleRealInfo scheduleRealInfo : list){  
2907 - if(scheduleRealInfo != null){  
2908 - //计划里程(主任务过滤掉临加班次),  
2909 - //烂班里程(主任务烂班),  
2910 - //临加里程(主任务临加),  
2911 - //计划班次,烂班班次,增加班次  
2912 - double jh = 0, sj = 0;  
2913 - tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();  
2914 - if(scheduleRealInfo.isSflj()){  
2915 - ljbc++;  
2916 - }else{  
2917 - if( !(scheduleRealInfo.getBcType().equals("in")  
2918 - ||scheduleRealInfo.getBcType().equals("out")) ){  
2919 - jhbc++;  
2920 - jh += tempJhlc;  
2921 - }  
2922 -  
2923 - if(scheduleRealInfo.getStatus() == -1){  
2924 - remMileage += tempJhlc;  
2925 - cjbc++;  
2926 - }  
2927 - }  
2928 - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();  
2929 - //计算营运里程,空驶里程  
2930 - if(childTaskPlans.isEmpty()){  
2931 - if(scheduleRealInfo.getBcType().equals("in") ||  
2932 - scheduleRealInfo.getBcType().equals("out")){  
2933 - jcclc +=tempJhlc;  
2934 - }  
2935 -  
2936 - //主任务 放空班次属于营运 2993 + int jhbc = 0, cjbc = 0, ljbc = 0;
  2994 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0;
  2995 + float addMileage = 0l, remMileage = 0l, addgl = 0, remgl = 0;
  2996 + Map<String, Object> map = new HashMap<String, Object>();
  2997 + for (ScheduleRealInfo scheduleRealInfo : list) {
  2998 + if (scheduleRealInfo != null) {
  2999 + //计划里程(主任务过滤掉临加班次),
  3000 + //烂班里程(主任务烂班),
  3001 + //临加里程(主任务临加),
  3002 + //计划班次,烂班班次,增加班次
  3003 + double jh = 0, sj = 0;
  3004 + tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc();
  3005 + if (scheduleRealInfo.isSflj()) {
  3006 + ljbc++;
  3007 + } else {
  3008 + if (!(scheduleRealInfo.getBcType().equals("in")
  3009 + || scheduleRealInfo.getBcType().equals("out"))) {
  3010 + jhbc++;
  3011 + jh += tempJhlc;
  3012 + }
  3013 +
  3014 + if (scheduleRealInfo.getStatus() == -1) {
  3015 + remMileage += tempJhlc;
  3016 + cjbc++;
  3017 + }
  3018 + }
  3019 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  3020 + //计算营运里程,空驶里程
  3021 + if (childTaskPlans.isEmpty()) {
  3022 + if (scheduleRealInfo.getBcType().equals("in") ||
  3023 + scheduleRealInfo.getBcType().equals("out")) {
  3024 + jcclc += tempJhlc;
  3025 + }
  3026 +
  3027 + //主任务 放空班次属于营运
2937 // else if(scheduleRealInfo.getBcType().equals("venting")){ 3028 // else if(scheduleRealInfo.getBcType().equals("venting")){
2938 // ksgl += tempJhlc; 3029 // ksgl += tempJhlc;
2939 // } 3030 // }
2940 - else{  
2941 - if(scheduleRealInfo.getStatus() != -1){  
2942 - if(scheduleRealInfo.isSflj()){  
2943 - addMileage += tempJhlc;  
2944 - }  
2945 - sj += tempJhlc;  
2946 - }  
2947 - }  
2948 - }else{  
2949 - Iterator<ChildTaskPlan> it = childTaskPlans.iterator();  
2950 - while(it.hasNext()){  
2951 - ChildTaskPlan childTaskPlan = it.next();  
2952 - if(childTaskPlan.getMileageType().equals("empty")){  
2953 - if(childTaskPlan.isDestroy()){  
2954 - remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
2955 - }else{  
2956 - if(scheduleRealInfo.isSflj()){  
2957 - addMileage += tempJhlc;  
2958 - }  
2959 - ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
2960 - }  
2961 - }else{  
2962 - if(childTaskPlan.isDestroy()){  
2963 - remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); 3031 + else {
  3032 + if (scheduleRealInfo.getStatus() != -1) {
  3033 + if (scheduleRealInfo.isSflj()) {
  3034 + addMileage += tempJhlc;
  3035 + }
  3036 + sj += tempJhlc;
  3037 + }
  3038 + }
  3039 + } else {
  3040 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  3041 + while (it.hasNext()) {
  3042 + ChildTaskPlan childTaskPlan = it.next();
  3043 + if (childTaskPlan.getMileageType().equals("empty")) {
  3044 + if (childTaskPlan.isDestroy()) {
  3045 + remMileage += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  3046 + } else {
  3047 + if (scheduleRealInfo.isSflj()) {
  3048 + addMileage += tempJhlc;
  3049 + }
  3050 + ksgl += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  3051 + }
  3052 + } else {
  3053 + if (childTaskPlan.isDestroy()) {
  3054 + remMileage += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
2964 // cjbc++; 3055 // cjbc++;
2965 - }else{  
2966 - if(scheduleRealInfo.isSflj()){  
2967 - addMileage += tempJhlc;  
2968 - }  
2969 - sj += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();  
2970 - }  
2971 - }  
2972 - }  
2973 - }  
2974 - jhlc += jh;  
2975 - yygl += sj;  
2976 - if(jh > sj){  
2977 - remgl += jh - sj;  
2978 - } else if(sj > jh){  
2979 - addgl += sj - jh;  
2980 - }  
2981 - }  
2982 - }  
2983 - map.put("jhlc", format.format(jhlc+jcclc));  
2984 - map.put("yygljh", format.format(jhlc));  
2985 - map.put("ssgl", format.format(remMileage));  
2986 - map.put("ksgl", format.format(ksgl));  
2987 - map.put("yyglsj", format.format(yygl));  
2988 - map.put("jhbc", jhbc);  
2989 - map.put("jcclc", jcclc);  
2990 -  
2991 - map.put("ljgl", format.format(addMileage));  
2992 - map.put("ssbc", cjbc);  
2993 - map.put("ysgl", format.format(yygl));  
2994 - map.put("sjbc", jhbc-cjbc+ljbc);  
2995 - map.put("zgl", format.format(yygl+ksgl+jcclc));  
2996 - map.put("ljbc", ljbc);  
2997 -  
2998 - return map;  
2999 - }  
3000 -  
3001 - @Override  
3002 - public List<ScheduleRealInfo> queryListWaybillQp(String clZbh, String date, String line) {  
3003 - // TODO Auto-generated method stub  
3004 - DecimalFormat format = new DecimalFormat("0.00");  
3005 - List <ScheduleRealInfo> list=null;  
3006 - list= scheduleRealInfoRepository.queryListWaybill2(clZbh,date,line);  
3007 - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();  
3008 - for (int i = 0; i < list.size(); i++) {  
3009 - ScheduleRealInfo s=list.get(i);  
3010 - if(!(s.getBcType().equals("in")||s.getBcType().equals("out"))){  
3011 - String remarks="";  
3012 - Double sjlc=0.0;  
3013 - if(s.getRemarks()!=null){  
3014 - remarks +=s.getRemarks();  
3015 - }  
3016 - Set<ChildTaskPlan> childTaskPlans = s.getcTasks();  
3017 - if(!childTaskPlans.isEmpty()){  
3018 - Iterator<ChildTaskPlan> it = childTaskPlans.iterator();  
3019 - while(it.hasNext()){  
3020 - ChildTaskPlan c = it.next();  
3021 - if(c.getRemarks()!=null && c.getRemarks().length()>0){  
3022 - if(remarks.indexOf(c.getRemarks())==-1){  
3023 - remarks += c.getRemarks();  
3024 - }  
3025 - }  
3026 -  
3027 - if(!c.isDestroy()){  
3028 - sjlc += c.getMileage()==null?0:c.getMileage();  
3029 - }  
3030 -  
3031 - }  
3032 - }else{  
3033 - if(s.getStatus() != -1){  
3034 - sjlc =s.getJhlc();  
3035 - }  
3036 - }  
3037 - s.setSjlc(format.format(sjlc));  
3038 - s.setRemarks(remarks);  
3039 - newList.add(s);  
3040 - }  
3041 -  
3042 - }  
3043 -  
3044 - return newList;  
3045 - }  
3046 -  
3047 - @Override  
3048 - public Map<String, Object> MapById(Long id) {  
3049 - // TODO Auto-generated method stub  
3050 - Map<String, Object> map=new HashMap<String, Object>();  
3051 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");  
3052 - ScheduleRealInfo s=scheduleRealInfoRepository.findOne(id);  
3053 - String xlbm=s.getXlBm();  
3054 - String fcrq=s.getScheduleDateStr();  
3055 -  
3056 - List<Ylxxb> listYlxxb=ylxxbRepository.queryListYlxxb( s.getClZbh(), fcrq);  
3057 - Double jzl=0.0;  
3058 - for(int t=0;t<listYlxxb.size();t++){  
3059 - Ylxxb y=listYlxxb.get(t);  
3060 - jzl += y.getJzl();  
3061 - }  
3062 -  
3063 - List<Ylb> listYlb=ylbRepository.queryListYlb( fcrq,s.getClZbh(),s.getjGh());  
3064 - Double ccyl=0.0;  
3065 - Double jcyl=0.0;  
3066 - Double yh=0.0;  
3067 - for (int i = 0; i < listYlb.size(); i++) {  
3068 - Ylb y=listYlb.get(i);  
3069 - ccyl +=y.getCzyl();  
3070 - jcyl+= y.getJzyl();  
3071 - yh+=y.getYh();  
3072 -  
3073 - }  
3074 - map.put("jzl", jzl);  
3075 - map.put("yh", yh);  
3076 - map.put("ccyl", ccyl);  
3077 - map.put("jcyl", jcyl);  
3078 - map.put("xlName", s.getXlName());  
3079 - map.put("clZbh", s.getClZbh());  
3080 - map.put("fcsjActual", s.getFcsjActual());  
3081 - map.put("zdzName", s.getZdzName());  
3082 - map.put("scheduleDate", s.getScheduleDateStr());  
3083 - String zdp="",zwdp="",wdp="";  
3084 - String zdpT="",zwdpT="",wdpT="";  
3085 -  
3086 - List<DutyEmployee> list= dutyEmployeeService.getDutyEmployee(xlbm, fcrq+"00:00", fcrq+"23:59");  
3087 - try {  
3088 - Long fcsj1=sdf.parse(fcrq+" 03:00").getTime();  
3089 - Long fcsj2=sdf.parse(fcrq+" 11:00").getTime();  
3090 - Long fcsj3=sdf.parse(fcrq+" 22:00").getTime();  
3091 - for(int i=0;i<list.size();i++){  
3092 - DutyEmployee t=list.get(i);  
3093 - Long ts=t.getTs();  
3094 - if(ts>fcsj1&&ts<fcsj2){  
3095 - if(zdp.indexOf(t.getuName())==-1){  
3096 - if(!(zdp.length()>0)){  
3097 - zdpT =t.getuName()+"...";  
3098 - }  
3099 - zdp +=t.getuName()+",";  
3100 -  
3101 - }  
3102 - }else if(ts>fcsj2 && ts<fcsj3){  
3103 - if(zwdp.indexOf(t.getuName())==-1){  
3104 - if(!(zwdp.length()>0)){  
3105 - zwdpT =t.getuName()+"...";  
3106 - }  
3107 - zwdp +=t.getuName()+",";  
3108 - }  
3109 - }else{  
3110 - if(wdp.indexOf(t.getuName())==-1){  
3111 - if(!(wdp.length()>0)){  
3112 - wdpT =t.getuName()+"...";  
3113 - }  
3114 - wdp +=t.getuName()+",";  
3115 - }  
3116 - }  
3117 - }  
3118 - } catch (ParseException e) {  
3119 - // TODO Auto-generated catch block  
3120 - e.printStackTrace();  
3121 - }  
3122 - map.put("zdp", zdp);  
3123 - map.put("zwdp", zwdp);  
3124 - map.put("wdp", wdp);  
3125 - map.put("zdpT", zdpT);  
3126 - map.put("zwdpT", zwdpT);  
3127 - map.put("wdpT", wdpT);  
3128 - return map;  
3129 - }  
3130 -  
3131 - @Override  
3132 - public List<Map<String, Object>> scheduleDailyQp(String line, String date) {  
3133 - // TODO Auto-generated method stub  
3134 - List<Map<String, Object>> list=new ArrayList<Map<String, Object>>();  
3135 - List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.scheduleDailyQp(line, date);  
3136 - Map<String, Object> map=null;  
3137 - String lp="lp";  
3138 - String jgh="jgh";  
3139 - String clzbh="clzbh";  
3140 - int bcs=0;  
3141 - String thclzbh="";  
3142 - String sgh="sgh";  
3143 - for(int i=0;i<scheduleRealInfos.size();i++){  
3144 - ScheduleRealInfo scheduleRealInfo=scheduleRealInfos.get(i);  
3145 - if(scheduleRealInfo.getLpName().equals(lp)){  
3146 - bcs++;  
3147 - String fcsj=scheduleRealInfo.getFcsj();  
3148 -  
3149 - if(!clzbh.equals(scheduleRealInfo.getClZbh())){  
3150 - clzbh=scheduleRealInfo.getClZbh();  
3151 - if(thclzbh==""){  
3152 - thclzbh +=scheduleRealInfo.getClZbh()+",";  
3153 - }else{  
3154 - thclzbh +=scheduleRealInfo.getClZbh();  
3155 - }  
3156 - map.put("thclzbh", thclzbh);  
3157 - }  
3158 -  
3159 - if(!jgh.equals(scheduleRealInfo.getjGh())){  
3160 - jgh=scheduleRealInfo.getjGh();  
3161 - if(map.get("jjb2")!=null){  
3162 - map.put("jjb3", scheduleRealInfo.getjGh()+"/"+  
3163 - scheduleRealInfo.getFcsjActual());  
3164 -  
3165 - }else{  
3166 - map.put("jjb2", scheduleRealInfo.getjGh()+"/"+  
3167 - scheduleRealInfo.getFcsjActual());  
3168 - }  
3169 -  
3170 - }  
3171 -  
3172 - if(scheduleRealInfo.getsGh()!=null){  
3173 - if(!scheduleRealInfo.getsGh().equals(sgh)){  
3174 - sgh=scheduleRealInfo.getsGh();  
3175 - if(map.get("sjb1")!=null){  
3176 - if(map.get("sjb2")!=null){  
3177 - map.put("sjb3", scheduleRealInfo.getsGh()+"/"+  
3178 - scheduleRealInfo.getFcsjActual());  
3179 - }else{  
3180 - map.put("sjb2", scheduleRealInfo.getsGh()+"/"+  
3181 - scheduleRealInfo.getFcsjActual());  
3182 - }  
3183 - }else{  
3184 - map.put("sjb1", scheduleRealInfo.getsGh()+"/"+  
3185 - scheduleRealInfo.getFcsjActual());  
3186 - }  
3187 - }  
3188 - }  
3189 - if(scheduleRealInfo.getFcsjActual()!=null){  
3190 - String fcsjs[]=fcsj.split(":");  
3191 - String fcsjActuals[]=scheduleRealInfo.getFcsjActual().split(":");  
3192 - int a=Integer.parseInt(fcsjActuals[0])*60+Integer.parseInt(fcsjActuals[1]);  
3193 - int b=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]);  
3194 - map.put("cz"+bcs, b-a);  
3195 - }else{  
3196 - map.put("cz"+bcs, "无");  
3197 - }  
3198 - map.put("lp", scheduleRealInfo.getLpName());  
3199 - map.put("dd"+bcs, scheduleRealInfo.getZdsjActual());  
3200 - map.put("kc"+bcs, scheduleRealInfo.getFcsjActual());  
3201 -  
3202 - if(i<scheduleRealInfos.size()-1){  
3203 - if(!scheduleRealInfos.get(i+1).getLpName().equals  
3204 - (scheduleRealInfos.get(i).getLpName())){  
3205 - list.add(map);  
3206 - lp="lp";  
3207 - jgh="jgh";  
3208 - clzbh="clzbh";  
3209 - bcs=0;  
3210 - thclzbh="";  
3211 - sgh="sgh";  
3212 - }  
3213 - }else{  
3214 - list.add(map);  
3215 - }  
3216 - }else{  
3217 - bcs=1;  
3218 - map=new HashMap<String,Object>();  
3219 - lp=scheduleRealInfo.getLpName();  
3220 - jgh=scheduleRealInfo.getjGh();  
3221 - clzbh=scheduleRealInfo.getClZbh();  
3222 - if(scheduleRealInfo.getsGh()!=null){  
3223 - sgh=scheduleRealInfo.getsGh();  
3224 - map.put("sjb1",scheduleRealInfo.getsGh()+"/"+  
3225 - scheduleRealInfo.getFcsjActual());  
3226 - }  
3227 - String fcsj=scheduleRealInfo.getFcsj();  
3228 - scheduleRealInfo.getFcsjActual();  
3229 - map.put("jjb1", jgh+"/"+scheduleRealInfo.getFcsjActual());  
3230 - map.put("cccl", clzbh);  
3231 -  
3232 - if(scheduleRealInfo.getFcsjActual()!=null){  
3233 - String fcsjs[]=fcsj.split(":");  
3234 - String fcsjActuals[]=scheduleRealInfo.getFcsjActual().split(":");  
3235 - int a=Integer.parseInt(fcsjActuals[0])*60+Integer.parseInt(fcsjActuals[1]);  
3236 - int b=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]);  
3237 - map.put("cz"+bcs, b-a);  
3238 - }else{  
3239 - map.put("cz"+bcs, "无");  
3240 - }  
3241 -  
3242 -  
3243 - map.put("lp", scheduleRealInfo.getLpName());  
3244 - map.put("dd"+bcs, scheduleRealInfo.getZdsjActual());  
3245 - map.put("kc"+bcs, scheduleRealInfo.getFcsjActual());  
3246 -  
3247 - if(i<scheduleRealInfos.size()-1){  
3248 - if(!scheduleRealInfos.get(i+1).getLpName().equals  
3249 - (scheduleRealInfos.get(i).getLpName())){  
3250 - list.add(map);  
3251 - lp="lp";  
3252 - jgh="jgh";  
3253 - clzbh="clzbh";  
3254 - bcs=0;  
3255 - thclzbh="";  
3256 - sgh="sgh";  
3257 - }  
3258 - }else{  
3259 - list.add(map);  
3260 - }  
3261 - }  
3262 -  
3263 - }  
3264 - return list;  
3265 - }  
3266 -  
3267 -  
3268 - @Override  
3269 - public List<Map<String, Object>> scheduleDailyExport(Map<String, Object> map){  
3270 - String line = map.get("line").toString();  
3271 - String date = map.get("date").toString();  
3272 - String xlName = map.get("xlName").toString();  
3273 - String state = map.get("state").toString();  
3274 - String type = map.get("type").toString();  
3275 -  
3276 - List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>();  
3277 - List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>();  
3278 - List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null);  
3279 - List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state);  
3280 - List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);  
3281 -  
3282 - for(Map<String, Object> m : list1){ 3056 + } else {
  3057 + if (scheduleRealInfo.isSflj()) {
  3058 + addMileage += tempJhlc;
  3059 + }
  3060 + sj += childTaskPlan.getMileage() == null ? 0 : childTaskPlan.getMileage();
  3061 + }
  3062 + }
  3063 + }
  3064 + }
  3065 + jhlc += jh;
  3066 + yygl += sj;
  3067 + if (jh > sj) {
  3068 + remgl += jh - sj;
  3069 + } else if (sj > jh) {
  3070 + addgl += sj - jh;
  3071 + }
  3072 + }
  3073 + }
  3074 + map.put("jhlc", format.format(jhlc + jcclc));
  3075 + map.put("yygljh", format.format(jhlc));
  3076 + map.put("ssgl", format.format(remMileage));
  3077 + map.put("ksgl", format.format(ksgl));
  3078 + map.put("yyglsj", format.format(yygl));
  3079 + map.put("jhbc", jhbc);
  3080 + map.put("jcclc", jcclc);
  3081 +
  3082 + map.put("ljgl", format.format(addMileage));
  3083 + map.put("ssbc", cjbc);
  3084 + map.put("ysgl", format.format(yygl));
  3085 + map.put("sjbc", jhbc - cjbc + ljbc);
  3086 + map.put("zgl", format.format(yygl + ksgl + jcclc));
  3087 + map.put("ljbc", ljbc);
  3088 +
  3089 + return map;
  3090 + }
  3091 +
  3092 + @Override
  3093 + public List<ScheduleRealInfo> queryListWaybillQp(String clZbh, String date, String line) {
  3094 + // TODO Auto-generated method stub
  3095 + DecimalFormat format = new DecimalFormat("0.00");
  3096 + List<ScheduleRealInfo> list = null;
  3097 + list = scheduleRealInfoRepository.queryListWaybill2(clZbh, date, line);
  3098 + List<ScheduleRealInfo> newList = new ArrayList<ScheduleRealInfo>();
  3099 + for (int i = 0; i < list.size(); i++) {
  3100 + ScheduleRealInfo s = list.get(i);
  3101 + if (!(s.getBcType().equals("in") || s.getBcType().equals("out"))) {
  3102 + String remarks = "";
  3103 + Double sjlc = 0.0;
  3104 + if (s.getRemarks() != null) {
  3105 + remarks += s.getRemarks();
  3106 + }
  3107 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  3108 + if (!childTaskPlans.isEmpty()) {
  3109 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  3110 + while (it.hasNext()) {
  3111 + ChildTaskPlan c = it.next();
  3112 + if (c.getRemarks() != null && c.getRemarks().length() > 0) {
  3113 + if (remarks.indexOf(c.getRemarks()) == -1) {
  3114 + remarks += c.getRemarks();
  3115 + }
  3116 + }
  3117 +
  3118 + if (!c.isDestroy()) {
  3119 + sjlc += c.getMileage() == null ? 0 : c.getMileage();
  3120 + }
  3121 +
  3122 + }
  3123 + } else {
  3124 + if (s.getStatus() != -1) {
  3125 + sjlc = s.getJhlc();
  3126 + }
  3127 + }
  3128 + s.setSjlc(format.format(sjlc));
  3129 + s.setRemarks(remarks);
  3130 + newList.add(s);
  3131 + }
  3132 +
  3133 + }
  3134 +
  3135 + return newList;
  3136 + }
  3137 +
  3138 + @Override
  3139 + public Map<String, Object> MapById(Long id) {
  3140 + // TODO Auto-generated method stub
  3141 + Map<String, Object> map = new HashMap<String, Object>();
  3142 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3143 + ScheduleRealInfo s = scheduleRealInfoRepository.findOne(id);
  3144 + String xlbm = s.getXlBm();
  3145 + String fcrq = s.getScheduleDateStr();
  3146 +
  3147 + List<Ylxxb> listYlxxb = ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq);
  3148 + Double jzl = 0.0;
  3149 + for (int t = 0; t < listYlxxb.size(); t++) {
  3150 + Ylxxb y = listYlxxb.get(t);
  3151 + jzl += y.getJzl();
  3152 + }
  3153 +
  3154 + List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh());
  3155 + Double ccyl = 0.0;
  3156 + Double jcyl = 0.0;
  3157 + Double yh = 0.0;
  3158 + for (int i = 0; i < listYlb.size(); i++) {
  3159 + Ylb y = listYlb.get(i);
  3160 + ccyl += y.getCzyl();
  3161 + jcyl += y.getJzyl();
  3162 + yh += y.getYh();
  3163 +
  3164 + }
  3165 + map.put("jzl", jzl);
  3166 + map.put("yh", yh);
  3167 + map.put("ccyl", ccyl);
  3168 + map.put("jcyl", jcyl);
  3169 + map.put("xlName", s.getXlName());
  3170 + map.put("clZbh", s.getClZbh());
  3171 + map.put("fcsjActual", s.getFcsjActual());
  3172 + map.put("zdzName", s.getZdzName());
  3173 + map.put("scheduleDate", s.getScheduleDateStr());
  3174 + map.put("lpName", s.getLpName());
  3175 + String zdp = "", zwdp = "", wdp = "";
  3176 + String zdpT = "", zwdpT = "", wdpT = "";
  3177 +
  3178 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:00", fcrq + "23:59");
  3179 + try {
  3180 + Long fcsj1 = sdf.parse(fcrq + " 03:00").getTime();
  3181 + Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
  3182 + Long fcsj3 = sdf.parse(fcrq + " 22:00").getTime();
  3183 + for (int i = 0; i < list.size(); i++) {
  3184 + DutyEmployee t = list.get(i);
  3185 + Long ts = t.getTs();
  3186 + if (ts > fcsj1 && ts < fcsj2) {
  3187 + if (zdp.indexOf(t.getuName()) == -1) {
  3188 + if (!(zdp.length() > 0)) {
  3189 + zdpT = t.getuName() + "...";
  3190 + }
  3191 + zdp += t.getuName() + ",";
  3192 +
  3193 + }
  3194 + } else if (ts > fcsj2 && ts < fcsj3) {
  3195 + if (zwdp.indexOf(t.getuName()) == -1) {
  3196 + if (!(zwdp.length() > 0)) {
  3197 + zwdpT = t.getuName() + "...";
  3198 + }
  3199 + zwdp += t.getuName() + ",";
  3200 + }
  3201 + } else {
  3202 + if (wdp.indexOf(t.getuName()) == -1) {
  3203 + if (!(wdp.length() > 0)) {
  3204 + wdpT = t.getuName() + "...";
  3205 + }
  3206 + wdp += t.getuName() + ",";
  3207 + }
  3208 + }
  3209 + }
  3210 + } catch (ParseException e) {
  3211 + // TODO Auto-generated catch block
  3212 + e.printStackTrace();
  3213 + }
  3214 + map.put("zdp", zdp);
  3215 + map.put("zwdp", zwdp);
  3216 + map.put("wdp", wdp);
  3217 + map.put("zdpT", zdpT);
  3218 + map.put("zwdpT", zwdpT);
  3219 + map.put("wdpT", wdpT);
  3220 + return map;
  3221 + }
  3222 +
  3223 + @Override
  3224 + public List<Map<String, Object>> scheduleDailyQp(String line, String date) {
  3225 + // TODO Auto-generated method stub
  3226 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  3227 + List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.scheduleDailyQp(line, date);
  3228 + Map<String, Object> map = null;
  3229 + String lp = "lp";
  3230 + String jgh = "jgh";
  3231 + String clzbh = "clzbh";
  3232 + int bcs = 0;
  3233 + String thclzbh = "";
  3234 + String sgh = "sgh";
  3235 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  3236 + ScheduleRealInfo scheduleRealInfo = scheduleRealInfos.get(i);
  3237 + if (scheduleRealInfo.getLpName().equals(lp)) {
  3238 + bcs++;
  3239 + String fcsj = scheduleRealInfo.getFcsj();
  3240 +
  3241 + if (!clzbh.equals(scheduleRealInfo.getClZbh())) {
  3242 + clzbh = scheduleRealInfo.getClZbh();
  3243 + if (thclzbh == "") {
  3244 + thclzbh += scheduleRealInfo.getClZbh() + ",";
  3245 + } else {
  3246 + thclzbh += scheduleRealInfo.getClZbh();
  3247 + }
  3248 + map.put("thclzbh", thclzbh);
  3249 + }
  3250 +
  3251 + if (!jgh.equals(scheduleRealInfo.getjGh())) {
  3252 + jgh = scheduleRealInfo.getjGh();
  3253 + if (map.get("jjb2") != null) {
  3254 + map.put("jjb3", scheduleRealInfo.getjGh() + "/" +
  3255 + scheduleRealInfo.getFcsjActual());
  3256 +
  3257 + } else {
  3258 + map.put("jjb2", scheduleRealInfo.getjGh() + "/" +
  3259 + scheduleRealInfo.getFcsjActual());
  3260 + }
  3261 +
  3262 + }
  3263 +
  3264 + if (scheduleRealInfo.getsGh() != null) {
  3265 + if (!scheduleRealInfo.getsGh().equals(sgh)) {
  3266 + sgh = scheduleRealInfo.getsGh();
  3267 + if (map.get("sjb1") != null) {
  3268 + if (map.get("sjb2") != null) {
  3269 + map.put("sjb3", scheduleRealInfo.getsGh() + "/" +
  3270 + scheduleRealInfo.getFcsjActual());
  3271 + } else {
  3272 + map.put("sjb2", scheduleRealInfo.getsGh() + "/" +
  3273 + scheduleRealInfo.getFcsjActual());
  3274 + }
  3275 + } else {
  3276 + map.put("sjb1", scheduleRealInfo.getsGh() + "/" +
  3277 + scheduleRealInfo.getFcsjActual());
  3278 + }
  3279 + }
  3280 + }
  3281 + if (scheduleRealInfo.getFcsjActual() != null) {
  3282 + String fcsjs[] = fcsj.split(":");
  3283 + String fcsjActuals[] = scheduleRealInfo.getFcsjActual().split(":");
  3284 + int a = Integer.parseInt(fcsjActuals[0]) * 60 + Integer.parseInt(fcsjActuals[1]);
  3285 + int b = Integer.parseInt(fcsjs[0]) * 60 + Integer.parseInt(fcsjs[1]);
  3286 + map.put("cz" + bcs, b - a);
  3287 + } else {
  3288 + map.put("cz" + bcs, "无");
  3289 + }
  3290 + map.put("lp", scheduleRealInfo.getLpName());
  3291 + map.put("dd" + bcs, scheduleRealInfo.getZdsjActual());
  3292 + map.put("kc" + bcs, scheduleRealInfo.getFcsjActual());
  3293 +
  3294 + if (i < scheduleRealInfos.size() - 1) {
  3295 + if (!scheduleRealInfos.get(i + 1).getLpName().equals
  3296 + (scheduleRealInfos.get(i).getLpName())) {
  3297 + list.add(map);
  3298 + lp = "lp";
  3299 + jgh = "jgh";
  3300 + clzbh = "clzbh";
  3301 + bcs = 0;
  3302 + thclzbh = "";
  3303 + sgh = "sgh";
  3304 + }
  3305 + } else {
  3306 + list.add(map);
  3307 + }
  3308 + } else {
  3309 + bcs = 1;
  3310 + map = new HashMap<String, Object>();
  3311 + lp = scheduleRealInfo.getLpName();
  3312 + jgh = scheduleRealInfo.getjGh();
  3313 + clzbh = scheduleRealInfo.getClZbh();
  3314 + if (scheduleRealInfo.getsGh() != null) {
  3315 + sgh = scheduleRealInfo.getsGh();
  3316 + map.put("sjb1", scheduleRealInfo.getsGh() + "/" +
  3317 + scheduleRealInfo.getFcsjActual());
  3318 + }
  3319 + String fcsj = scheduleRealInfo.getFcsj();
  3320 + scheduleRealInfo.getFcsjActual();
  3321 + map.put("jjb1", jgh + "/" + scheduleRealInfo.getFcsjActual());
  3322 + map.put("cccl", clzbh);
  3323 +
  3324 + if (scheduleRealInfo.getFcsjActual() != null) {
  3325 + String fcsjs[] = fcsj.split(":");
  3326 + String fcsjActuals[] = scheduleRealInfo.getFcsjActual().split(":");
  3327 + int a = Integer.parseInt(fcsjActuals[0]) * 60 + Integer.parseInt(fcsjActuals[1]);
  3328 + int b = Integer.parseInt(fcsjs[0]) * 60 + Integer.parseInt(fcsjs[1]);
  3329 + map.put("cz" + bcs, b - a);
  3330 + } else {
  3331 + map.put("cz" + bcs, "无");
  3332 + }
  3333 +
  3334 +
  3335 + map.put("lp", scheduleRealInfo.getLpName());
  3336 + map.put("dd" + bcs, scheduleRealInfo.getZdsjActual());
  3337 + map.put("kc" + bcs, scheduleRealInfo.getFcsjActual());
  3338 +
  3339 + if (i < scheduleRealInfos.size() - 1) {
  3340 + if (!scheduleRealInfos.get(i + 1).getLpName().equals
  3341 + (scheduleRealInfos.get(i).getLpName())) {
  3342 + list.add(map);
  3343 + lp = "lp";
  3344 + jgh = "jgh";
  3345 + clzbh = "clzbh";
  3346 + bcs = 0;
  3347 + thclzbh = "";
  3348 + sgh = "sgh";
  3349 + }
  3350 + } else {
  3351 + list.add(map);
  3352 + }
  3353 + }
  3354 +
  3355 + }
  3356 + return list;
  3357 + }
  3358 +
  3359 +
  3360 + @Override
  3361 + public List<Map<String, Object>> scheduleDailyExport(Map<String, Object> map) {
  3362 + String line = map.get("line").toString();
  3363 + String date = map.get("date").toString();
  3364 + String xlName = map.get("xlName").toString();
  3365 + String state = map.get("state").toString();
  3366 + String type = map.get("type").toString();
  3367 +
  3368 + List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>();
  3369 + List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>();
  3370 + List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null);
  3371 + List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state);
  3372 + List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);
  3373 +
  3374 + for (Map<String, Object> m : list1) {
3283 // m.put("ssgl", m.get("ssgl")); 3375 // m.put("ssgl", m.get("ssgl"));
3284 // m.put("ssbc", m.get("ssbc")); 3376 // m.put("ssbc", m.get("ssbc"));
3285 // m.put("ssgl_lz", m.get("ssgl_lz") + " / " + m.get("ssbc_lz")); 3377 // m.put("ssgl_lz", m.get("ssgl_lz") + " / " + m.get("ssbc_lz"));
@@ -3293,181 +3385,182 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3293,181 +3385,182 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3293 // m.put("ssgl_qh", m.get("ssgl_qh") + " / " + m.get("ssbc_qh")); 3385 // m.put("ssgl_qh", m.get("ssgl_qh") + " / " + m.get("ssbc_qh"));
3294 // m.put("ssgl_yw", m.get("ssgl_yw") + " / " + m.get("ssbc_yw")); 3386 // m.put("ssgl_yw", m.get("ssgl_yw") + " / " + m.get("ssbc_yw"));
3295 // m.put("ssgl_other", m.get("ssgl_other") + " / " + m.get("ssbc_other")); 3387 // m.put("ssgl_other", m.get("ssgl_other") + " / " + m.get("ssbc_other"));
3296 - }  
3297 -  
3298 - int size = 0;  
3299 - Map<String, Object> tempMap = new HashMap<String, Object>();  
3300 - for(int i = 0; i < list2.size(); i++){  
3301 - Object obj = (Object)list2.get(i);  
3302 - Object[] objs = (Object[])obj;  
3303 - if(size == 5){  
3304 - size = 0;  
3305 - dataList2.add(tempMap);  
3306 - tempMap = new HashMap<String, Object>();  
3307 - }  
3308 - tempMap.put("lp" + size, objs[3]);  
3309 - tempMap.put("ch" + size, objs[2]);  
3310 - tempMap.put("jz" + size, objs[1] + "/" + objs[4]);  
3311 - tempMap.put("sz" + size, "");  
3312 - tempMap.put("jw" + size, "");  
3313 - tempMap.put("sw" + size, "");  
3314 -  
3315 - size++;  
3316 - }  
3317 - if(size < 5){  
3318 - for(;size < 5; size++){  
3319 - tempMap.put("lp" + size, "");  
3320 - tempMap.put("ch" + size, "");  
3321 - tempMap.put("jz" + size, "");  
3322 - tempMap.put("sz" + size, "");  
3323 - tempMap.put("jw" + size, "");  
3324 - tempMap.put("sw" + size, "");  
3325 - }  
3326 - }  
3327 -  
3328 - dataList2.add(tempMap);  
3329 -  
3330 - size = 0;  
3331 - tempMap = new HashMap<String, Object>();  
3332 - for(ScheduleRealInfo schedule : list3){  
3333 - if(size == 3){  
3334 - size = 0;  
3335 - dataList3.add(tempMap);  
3336 - tempMap = new HashMap<String, Object>();  
3337 - }  
3338 - tempMap.put("lpName" + size, schedule.getLpName());  
3339 - tempMap.put("qdzName" + size, schedule.getQdzName());  
3340 - tempMap.put("zdsj" + size, schedule.getZdsj());  
3341 - tempMap.put("zdsjActual" + size, schedule.getZdsjActual()!=null?schedule.getZdsjActual():"");  
3342 - tempMap.put("zdsjk" + size, "");  
3343 - tempMap.put("zdsjm" + size, "");  
3344 - tempMap.put("fcsj" + size, schedule.getFcsj());  
3345 - tempMap.put("fcsjActual" + size, schedule.getFcsjActual()!=null?schedule.getFcsjActual():"");  
3346 - tempMap.put("fcsjk" + size, "");  
3347 - tempMap.put("fcsjm" + size, "");  
3348 - tempMap.put("remarks" + size, schedule.getRemarks()!=null?schedule.getRemarks():"");  
3349 -  
3350 - size++;  
3351 - }  
3352 - if(size < 3){  
3353 - for(; size < 3; size++){  
3354 - tempMap.put("lpName" + size, "");  
3355 - tempMap.put("qdzName" + size, "");  
3356 - tempMap.put("zdsj" + size, "");  
3357 - tempMap.put("zdsjActual" + size, "");  
3358 - tempMap.put("zdsjk" + size, "");  
3359 - tempMap.put("zdsjm" + size, "");  
3360 - tempMap.put("fcsj" + size, "");  
3361 - tempMap.put("fcsjActual" + size, "");  
3362 - tempMap.put("fcsjk" + size, "");  
3363 - tempMap.put("fcsjm" + size, "");  
3364 - tempMap.put("remarks" + size, "");  
3365 - }  
3366 - }  
3367 -  
3368 - dataList3.add(tempMap); 3388 + }
  3389 +
  3390 + int size = 0;
  3391 + Map<String, Object> tempMap = new HashMap<String, Object>();
  3392 + for (int i = 0; i < list2.size(); i++) {
  3393 + Object obj = (Object) list2.get(i);
  3394 + Object[] objs = (Object[]) obj;
  3395 + if (size == 5) {
  3396 + size = 0;
  3397 + dataList2.add(tempMap);
  3398 + tempMap = new HashMap<String, Object>();
  3399 + }
  3400 + tempMap.put("lp" + size, objs[3]);
  3401 + tempMap.put("ch" + size, objs[2]);
  3402 + tempMap.put("jz" + size, objs[1] + "/" + objs[4]);
  3403 + tempMap.put("sz" + size, "");
  3404 + tempMap.put("jw" + size, "");
  3405 + tempMap.put("sw" + size, "");
  3406 +
  3407 + size++;
  3408 + }
  3409 + if (size < 5) {
  3410 + for (; size < 5; size++) {
  3411 + tempMap.put("lp" + size, "");
  3412 + tempMap.put("ch" + size, "");
  3413 + tempMap.put("jz" + size, "");
  3414 + tempMap.put("sz" + size, "");
  3415 + tempMap.put("jw" + size, "");
  3416 + tempMap.put("sw" + size, "");
  3417 + }
  3418 + }
  3419 +
  3420 + dataList2.add(tempMap);
  3421 +
  3422 + size = 0;
  3423 + tempMap = new HashMap<String, Object>();
  3424 + for (ScheduleRealInfo schedule : list3) {
  3425 + if (size == 3) {
  3426 + size = 0;
  3427 + dataList3.add(tempMap);
  3428 + tempMap = new HashMap<String, Object>();
  3429 + }
  3430 + tempMap.put("lpName" + size, schedule.getLpName());
  3431 + tempMap.put("qdzName" + size, schedule.getQdzName());
  3432 + tempMap.put("zdsj" + size, schedule.getZdsj());
  3433 + tempMap.put("zdsjActual" + size, schedule.getZdsjActual() != null ? schedule.getZdsjActual() : "");
  3434 + tempMap.put("zdsjk" + size, "");
  3435 + tempMap.put("zdsjm" + size, "");
  3436 + tempMap.put("fcsj" + size, schedule.getFcsj());
  3437 + tempMap.put("fcsjActual" + size, schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "");
  3438 + tempMap.put("fcsjk" + size, "");
  3439 + tempMap.put("fcsjm" + size, "");
  3440 + tempMap.put("remarks" + size, schedule.getRemarks() != null ? schedule.getRemarks() : "");
  3441 +
  3442 + size++;
  3443 + }
  3444 + if (size < 3) {
  3445 + for (; size < 3; size++) {
  3446 + tempMap.put("lpName" + size, "");
  3447 + tempMap.put("qdzName" + size, "");
  3448 + tempMap.put("zdsj" + size, "");
  3449 + tempMap.put("zdsjActual" + size, "");
  3450 + tempMap.put("zdsjk" + size, "");
  3451 + tempMap.put("zdsjm" + size, "");
  3452 + tempMap.put("fcsj" + size, "");
  3453 + tempMap.put("fcsjActual" + size, "");
  3454 + tempMap.put("fcsjk" + size, "");
  3455 + tempMap.put("fcsjm" + size, "");
  3456 + tempMap.put("remarks" + size, "");
  3457 + }
  3458 + }
  3459 +
  3460 + dataList3.add(tempMap);
3369 3461
3370 if (type.equals("export")) { 3462 if (type.equals("export")) {
3371 - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),  
3372 - sdfSimple = new SimpleDateFormat("yyyyMMdd");  
3373 - Map<String, Object> m = new HashMap<String, Object>();  
3374 - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();  
3375 - ReportUtils ee = new ReportUtils();  
3376 - try {  
3377 - listI.add(list1.iterator());  
3378 - listI.add(dataList2.iterator());  
3379 - listI.add(dataList3.iterator());  
3380 - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";  
3381 - String sourcePath = path+"mould/scheduleDaily.xls";  
3382 - if(date.length() == 7){  
3383 - sdfMonth = new SimpleDateFormat("yyyy-MM");  
3384 - sdfSimple = new SimpleDateFormat("yyyyMM");  
3385 - sourcePath = path+"mould/scheduleDaily_m.xls";  
3386 - }  
3387 - ee.excelReplace(listI, new Object[] { m }, sourcePath,  
3388 - path+"export/调度日报" + sdfSimple.format(sdfMonth.parse(date))+".xls");  
3389 - } catch (Exception e) {  
3390 - // TODO: handle exception  
3391 - e.printStackTrace();  
3392 - } 3463 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  3464 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  3465 + Map<String, Object> m = new HashMap<String, Object>();
  3466 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3467 + ReportUtils ee = new ReportUtils();
  3468 + try {
  3469 + listI.add(list1.iterator());
  3470 + listI.add(dataList2.iterator());
  3471 + listI.add(dataList3.iterator());
  3472 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  3473 + String sourcePath = path + "mould/scheduleDaily.xls";
  3474 + if (date.length() == 7) {
  3475 + sdfMonth = new SimpleDateFormat("yyyy-MM");
  3476 + sdfSimple = new SimpleDateFormat("yyyyMM");
  3477 + sourcePath = path + "mould/scheduleDaily_m.xls";
  3478 + }
  3479 + ee.excelReplace(listI, new Object[]{m}, sourcePath,
  3480 + path + "export/调度日报" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  3481 + } catch (Exception e) {
  3482 + // TODO: handle exception
  3483 + e.printStackTrace();
  3484 + }
3393 } 3485 }
3394 -  
3395 - return new ArrayList<Map<String, Object>>();  
3396 - }  
3397 -  
3398 - @Override  
3399 - public Map<String, Object> exportWaybillMore(Map<String, Object> map) {  
3400 - String date = map.get("date").toString();  
3401 - String line = map.get("line").toString();  
3402 - List<List> lists = JSON.parseArray(map.get("strs").toString(), List.class);  
3403 - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/export/";  
3404 - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),  
3405 - sdfSimple = new SimpleDateFormat("yyyyMMdd");  
3406 - int num = 0;  
3407 - File file = null;  
3408 - try {  
3409 - while (true) {  
3410 - String fileUrl = path+"行车路单"+sdfSimple.format(sdfMonth.parse(date));  
3411 - file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/"));  
3412 - if(file.exists()){  
3413 - num++;  
3414 - } else {  
3415 - break;  
3416 - }  
3417 - }  
3418 - file.mkdirs();  
3419 -  
3420 - for(List<String> list : lists){  
3421 - String jName = list.get(0);  
3422 - String clZbh = list.get(1);  
3423 - String lpName = list.get(2);  
3424 - this.exportWaybill(jName, clZbh, lpName, date, line);  
3425 - File temp = new File(path+date+"-"+jName+"-"+clZbh+"-"+lpName+"-行车路单.xls");  
3426 - String fileName = file.getName();  
3427 - temp.renameTo(new File(path + fileName + "/" + temp.getName()));  
3428 -  
3429 - File[] listFiles = file.listFiles();  
3430 - ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(path+file.getName()+".zip"))); 3486 +
  3487 + return new ArrayList<Map<String, Object>>();
  3488 + }
  3489 +
  3490 + @Override
  3491 + public Map<String, Object> exportWaybillMore(Map<String, Object> map) {
  3492 + String date = map.get("date").toString();
  3493 + String line = map.get("line").toString();
  3494 + List<List> lists = JSON.parseArray(map.get("strs").toString(), List.class);
  3495 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/export/";
  3496 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  3497 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  3498 + int num = 0;
  3499 + File file = null;
  3500 + try {
  3501 + while (true) {
  3502 + String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date));
  3503 + file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/"));
  3504 + if (file.exists()) {
  3505 + num++;
  3506 + } else {
  3507 + break;
  3508 + }
  3509 + }
  3510 + file.mkdirs();
  3511 +
  3512 + for (List<String> list : lists) {
  3513 + String jName = list.get(0);
  3514 + String clZbh = list.get(1);
  3515 + String lpName = list.get(2);
  3516 + this.exportWaybill(jName, clZbh, lpName, date, line);
  3517 + File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
  3518 + String fileName = file.getName();
  3519 + temp.renameTo(new File(path + fileName + "/" + temp.getName()));
  3520 +
  3521 + File[] listFiles = file.listFiles();
  3522 + ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(path + file.getName() + ".zip")));
3431 // zos.setEncoding("gbk"); 3523 // zos.setEncoding("gbk");
3432 // zos.putNextEntry(new ZipEntry(fileName + "/")); 3524 // zos.putNextEntry(new ZipEntry(fileName + "/"));
3433 - for(int i = 0; i < listFiles.length; i++){  
3434 - zos.putNextEntry(new ZipEntry(fileName+"/"+listFiles[i].getName()));  
3435 - BufferedInputStream bis = new BufferedInputStream(new FileInputStream(listFiles[i]));  
3436 - BufferedOutputStream bos = new BufferedOutputStream(zos);  
3437 - int bytesRead = 0;  
3438 - for(byte[] buffer = new byte[BUF_SIZE]; ((bytesRead = bis.read(buffer, 0, BUF_SIZE)) != -1);){ 3525 + for (int i = 0; i < listFiles.length; i++) {
  3526 + zos.putNextEntry(new ZipEntry(fileName + "/" + listFiles[i].getName()));
  3527 + BufferedInputStream bis = new BufferedInputStream(new FileInputStream(listFiles[i]));
  3528 + BufferedOutputStream bos = new BufferedOutputStream(zos);
  3529 + int bytesRead = 0;
  3530 + for (byte[] buffer = new byte[BUF_SIZE]; ((bytesRead = bis.read(buffer, 0, BUF_SIZE)) != -1); ) {
3439 // zos.write(buffer, 0, bytesRead); 3531 // zos.write(buffer, 0, bytesRead);
3440 // zos.flush(); 3532 // zos.flush();
3441 - bos.write(buffer, 0, bytesRead);  
3442 - bos.flush();  
3443 - }  
3444 - }  
3445 - zos.close();  
3446 - }  
3447 -  
3448 - } catch (Exception e) {  
3449 - // TODO: handle exception  
3450 - e.printStackTrace();  
3451 - }  
3452 -  
3453 - map.put("fileName", file.getName());  
3454 - return map;  
3455 - } 3533 + bos.write(buffer, 0, bytesRead);
  3534 + bos.flush();
  3535 + }
  3536 + }
  3537 + zos.close();
  3538 + }
  3539 +
  3540 + } catch (Exception e) {
  3541 + // TODO: handle exception
  3542 + e.printStackTrace();
  3543 + }
  3544 +
  3545 + map.put("fileName", file.getName());
  3546 + return map;
  3547 + }
3456 3548
3457 @Autowired 3549 @Autowired
3458 SchedulePlanInfoService schPlanService; 3550 SchedulePlanInfoService schPlanService;
  3551 +
3459 @Override 3552 @Override
3460 public List<SchedulePlanInfo> currentSchedulePlan(String lineCode) { 3553 public List<SchedulePlanInfo> currentSchedulePlan(String lineCode) {
3461 List<SchedulePlanInfo> rs = dayOfSchedule.schedulePlanMap.get(lineCode); 3554 List<SchedulePlanInfo> rs = dayOfSchedule.schedulePlanMap.get(lineCode);
3462 3555
3463 - if(rs==null || rs.size()==0){ 3556 + if (rs == null || rs.size() == 0) {
3464 //尝试刷新内存 3557 //尝试刷新内存
3465 Map<String, Object> data = new HashMap<>(); 3558 Map<String, Object> data = new HashMap<>();
3466 data.put("scheduleDate_eq", dayOfSchedule.currSchDateMap.get(lineCode)); 3559 data.put("scheduleDate_eq", dayOfSchedule.currSchDateMap.get(lineCode));
3467 data.put("xlBm_eq", lineCode); 3560 data.put("xlBm_eq", lineCode);
3468 List<SchedulePlanInfo> planItr = dayOfSchedule.cleanSchPlanItr(schPlanService.list(data).iterator()); 3561 List<SchedulePlanInfo> planItr = dayOfSchedule.cleanSchPlanItr(schPlanService.list(data).iterator());
3469 3562
3470 - if(planItr.size() > 0){ 3563 + if (planItr.size() > 0) {
3471 dayOfSchedule.schedulePlanMap.put(lineCode, planItr); 3564 dayOfSchedule.schedulePlanMap.put(lineCode, planItr);
3472 return planItr; 3565 return planItr;
3473 } 3566 }
@@ -3479,34 +3572,53 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3479,34 +3572,53 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3479 @Override 3572 @Override
3480 public Map<String, Object> lpChangeMulti(String leftIdx, String rightIdx, int type) { 3573 public Map<String, Object> lpChangeMulti(String leftIdx, String rightIdx, int type) {
3481 Map<String, Object> rs = new HashMap<>(); 3574 Map<String, Object> rs = new HashMap<>();
3482 - List<ScheduleRealInfo> ts = new ArrayList<>(); 3575 + Set<ScheduleRealInfo> ts = new HashSet<>();
3483 try { 3576 try {
3484 List<String> leftList = Splitter.on(",").splitToList(leftIdx); 3577 List<String> leftList = Splitter.on(",").splitToList(leftIdx);
3485 List<String> rightList = Splitter.on(",").splitToList(rightIdx); 3578 List<String> rightList = Splitter.on(",").splitToList(rightIdx);
3486 - if(leftList.size() != rightList.size()){  
3487 - rs.put("status", ResponseCode.ERROR);  
3488 - rs.put("msg", "不对称的对调!");  
3489 - return rs; 3579 +
  3580 + //有班次变更的车辆
  3581 + Set<String> cars = new HashSet<>();
  3582 +
  3583 + List<ScheduleRealInfo> largeList, smallList;
  3584 + if (leftList.size() > rightList.size()) {
  3585 + largeList = getByIdx(leftList);
  3586 + smallList = getByIdx(rightList);
  3587 + } else {
  3588 + largeList = getByIdx(rightList);
  3589 + smallList = getByIdx(leftList);
3490 } 3590 }
3491 3591
3492 - ScheduleRealInfo leftSch, rightSch;  
3493 - for(int i = 0; i < leftList.size(); i ++){  
3494 - leftSch = dayOfSchedule.get(Long.parseLong(leftList.get(i)));  
3495 - rightSch = dayOfSchedule.get(Long.parseLong(rightList.get(i))); 3592 + ScheduleRealInfo leftSch, rightSch = null;
  3593 + boolean changeRealTime = true;
  3594 + for (int i = 0; i < largeList.size(); i++) {
  3595 + leftSch = largeList.get(i);
  3596 + if (i < smallList.size()) {
  3597 + rightSch = smallList.get(i);
  3598 + ts.add(rightSch);
  3599 + } else
  3600 + changeRealTime = false;
3496 3601
3497 //调换路牌 3602 //调换路牌
3498 - lpChange(leftSch, rightSch, type);  
3499 - 3603 + lpChange(leftSch, rightSch, type, changeRealTime);
3500 ts.add(leftSch); 3604 ts.add(leftSch);
3501 - ts.add(rightSch);  
3502 3605
3503 - dayOfSchedule.save(leftSch);  
3504 - dayOfSchedule.save(rightSch); 3606 + cars.add(leftSch.getClZbh());
  3607 + cars.add(rightSch.getClZbh());
  3608 + }
  3609 +
  3610 + //重新计算起点应到时间
  3611 + for(String nbbm : cars){
  3612 + ts.addAll(dayOfSchedule.updateQdzTimePlan(nbbm));
  3613 + }
  3614 +
  3615 + for (ScheduleRealInfo sch : ts) {
  3616 + dayOfSchedule.save(sch);
3505 } 3617 }
3506 3618
3507 rs.put("status", ResponseCode.SUCCESS); 3619 rs.put("status", ResponseCode.SUCCESS);
3508 rs.put("ts", ts); 3620 rs.put("ts", ts);
3509 - }catch(Exception e){ 3621 + } catch (Exception e) {
3510 logger.error("", e); 3622 logger.error("", e);
3511 rs.put("status", ResponseCode.ERROR); 3623 rs.put("status", ResponseCode.ERROR);
3512 rs.put("msg", e.getMessage()); 3624 rs.put("msg", e.getMessage());
@@ -3515,13 +3627,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3515,13 +3627,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3515 return rs; 3627 return rs;
3516 } 3628 }
3517 3629
  3630 + private List<ScheduleRealInfo> getByIdx(List<String> idList) {
  3631 + List<ScheduleRealInfo> list = new ArrayList<>();
  3632 + for (String id : idList) {
  3633 + list.add(dayOfSchedule.get(Long.parseLong(id)));
  3634 + }
  3635 + return list;
  3636 + }
  3637 +
3518 @Override 3638 @Override
3519 - public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { 3639 + public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type, boolean changeRealTime) {
3520 LpData leftData = new LpData(leftSch); 3640 LpData leftData = new LpData(leftSch);
3521 LpData rightData = new LpData(rightSch); 3641 LpData rightData = new LpData(rightSch);
3522 3642
3523 - leftData.appendTo(rightSch, type);  
3524 - rightData.appendTo(leftSch, type); 3643 + leftData.appendTo(rightSch, type, changeRealTime);
  3644 + rightData.appendTo(leftSch, type, changeRealTime);
  3645 +
  3646 + //更新车辆和班次映射信息
  3647 + dayOfSchedule.removeNbbm2SchMapp(leftSch, leftData.getNbbm());
  3648 + dayOfSchedule.removeNbbm2SchMapp(rightSch, rightData.getNbbm());
  3649 +
  3650 + dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm());
  3651 + dayOfSchedule.addNbbm2SchMapp(rightSch, leftData.getNbbm());
3525 } 3652 }
3526 3653
3527 @Override 3654 @Override
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
1 package com.bsth.websocket.handler; 1 package com.bsth.websocket.handler;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.HashMap;  
5 -import java.util.Iterator;  
6 -import java.util.List;  
7 -import java.util.Map;  
8 -import java.util.Set;  
9 - 3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.bsth.data.BasicData;
  5 +import com.google.common.base.Splitter;
  6 +import com.google.common.collect.ArrayListMultimap;
10 import org.slf4j.Logger; 7 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
12 import org.springframework.context.annotation.Scope; 9 import org.springframework.context.annotation.Scope;
13 import org.springframework.stereotype.Component; 10 import org.springframework.stereotype.Component;
14 -import org.springframework.web.socket.CloseStatus;  
15 -import org.springframework.web.socket.TextMessage;  
16 -import org.springframework.web.socket.WebSocketHandler;  
17 -import org.springframework.web.socket.WebSocketMessage;  
18 -import org.springframework.web.socket.WebSocketSession; 11 +import org.springframework.web.socket.*;
19 12
20 -import com.alibaba.fastjson.JSONObject;  
21 -import com.bsth.data.BasicData;  
22 -import com.google.common.base.Splitter;  
23 -import com.google.common.collect.ArrayListMultimap; 13 +import java.util.*;
24 14
25 /** 15 /**
26 * @author PanZhao 16 * @author PanZhao
@@ -99,43 +89,6 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -99,43 +89,6 @@ public class RealControlSocketHandler implements WebSocketHandler {
99 return false; 89 return false;
100 } 90 }
101 91
102 - /**  
103 - * 给所有在线用户发送消息  
104 - *  
105 - * @param message  
106 -  
107 - public synchronized void sendMessageToUsers(TextMessage message) {  
108 - for (WebSocketSession user : users) {  
109 - try {  
110 - if (user.isOpen()) {  
111 - user.sendMessage(message);  
112 - }  
113 - } catch (IOException e) {  
114 - e.printStackTrace();  
115 - }  
116 - }  
117 - }*/  
118 -  
119 - /**  
120 - * 给某些用户发送消息  
121 - *  
122 - * @param userId  
123 - * @param message  
124 -  
125 - public synchronized void sendMessageToUser(Set<String> uids, String msg) {  
126 - TextMessage message = new TextMessage(msg.getBytes());  
127 - for (WebSocketSession user : users) {  
128 - if (uids.contains(user.getAttributes().get(Constants.SESSION_USERNAME))) {  
129 - try {  
130 - if (user.isOpen()) {  
131 - user.sendMessage(message);  
132 - }  
133 - } catch (IOException e) {  
134 - e.printStackTrace();  
135 - }  
136 - }  
137 - }  
138 - }*/  
139 92
140 /** 93 /**
141 * 根据线路推送消息 94 * 根据线路推送消息
src/main/resources/static/pages/oil/list_ph.html
@@ -82,7 +82,8 @@ @@ -82,7 +82,8 @@
82 线路: 82 线路:
83 </td> 83 </td>
84 <td colspan="3"> 84 <td colspan="3">
85 - <select class="form-control" name="xlbm_like" id="xlbm" style="width: 120px;"></select> 85 + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>
  86 + <input type="hidden" name="xlbm_like" value=""/>
86 &nbsp; 87 &nbsp;
87 </td> 88 </td>
88 <td > 89 <td >
@@ -234,7 +235,7 @@ @@ -234,7 +235,7 @@
234 var i = layer.load(2); 235 var i = layer.load(2);
235 $get('/ylb/checkYl', params, function () { 236 $get('/ylb/checkYl', params, function () {
236 layer.close(i); 237 layer.close(i);
237 - jsDoQuery(null, true); 238 + jsDoQuery(params, true);
238 }); 239 });
239 } else { 240 } else {
240 layer.msg('请选择日期.'); 241 layer.msg('请选择日期.');
@@ -260,7 +261,7 @@ @@ -260,7 +261,7 @@
260 var i = layer.load(2); 261 var i = layer.load(2);
261 $get('/ylb/outAndIn', params, function () { 262 $get('/ylb/outAndIn', params, function () {
262 layer.close(i); 263 layer.close(i);
263 - jsDoQuery(null, true); 264 + jsDoQuery(params, true);
264 }); 265 });
265 } else { 266 } else {
266 layer.msg('请选择日期.'); 267 layer.msg('请选择日期.');
@@ -283,7 +284,19 @@ @@ -283,7 +284,19 @@
283 var i = layer.load(2); 284 var i = layer.load(2);
284 $get('/ylb/sort', params, function () { 285 $get('/ylb/sort', params, function () {
285 layer.close(i); 286 layer.close(i);
286 - jsDoQuery(null, true); 287 + var cells = $('tr.filter')[0].cells
  288 + , params1 = {}
  289 + , name;
  290 + $.each(cells, function (i, cell) {
  291 + var items = $('input,select', cell);
  292 + for (var j = 0, item; item = items[j++];) {
  293 + name = $(item).attr('name');
  294 + if (name) {
  295 + params1[name] = $(item).val();
  296 + }
  297 + }
  298 + });
  299 + jsDoQuery(params1, true);
287 }); 300 });
288 301
289 } 302 }
@@ -537,7 +550,7 @@ @@ -537,7 +550,7 @@
537 //搜索线路 550 //搜索线路
538 $.get('/basic/lineCode2Name',function(result){ 551 $.get('/basic/lineCode2Name',function(result){
539 var data=[]; 552 var data=[];
540 - data.push({id: " ", text: "全部线路"}); 553 +// data.push({id: " ", text: "全部线路"});
541 for(var code in result){ 554 for(var code in result){
542 data.push({id: code, text: result[code]}); 555 data.push({id: code, text: result[code]});
543 } 556 }
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html
@@ -61,7 +61,7 @@ @@ -61,7 +61,7 @@
61 <div class="col-md-3"> 61 <div class="col-md-3">
62 <sa-Select5 name="cl" 62 <sa-Select5 name="cl"
63 model="ctrl.deviceInfoForSave" 63 model="ctrl.deviceInfoForSave"
64 - cmaps="{'cl': 'id', 'clZbh': 'insideCode'}" 64 + cmaps="{'cl': 'id', 'clZbh': 'insideCode', 'oldDeviceNo': 'equipmentCode'}"
65 dcname="cl" 65 dcname="cl"
66 icname="id" 66 icname="id"
67 dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}" 67 dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}"
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
@@ -61,7 +61,7 @@ @@ -61,7 +61,7 @@
61 <div class="col-md-3"> 61 <div class="col-md-3">
62 <sa-Select5 name="cl" 62 <sa-Select5 name="cl"
63 model="ctrl.deviceInfoForSave" 63 model="ctrl.deviceInfoForSave"
64 - cmaps="{'cl': 'id', 'clZbh': 'insideCode'}" 64 + cmaps="{'cl': 'id', 'clZbh': 'insideCode', 'oldDeviceNo': 'equipmentCode'}"
65 dcname="cl" 65 dcname="cl"
66 icname="id" 66 icname="id"
67 dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}" 67 dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}"
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
@@ -154,6 +154,149 @@ @@ -154,6 +154,149 @@
154 </div> 154 </div>
155 </div> 155 </div>
156 156
  157 + <div class="form-group has-success has-feedback">
  158 + <label class="col-md-2 control-label">配置类型*:</label>
  159 + <div class="col-md-3">
  160 + <sa-Radiogroup model="ctrl.busConfigForSave.pzType" dicgroup="CheLiangPeiZhi" name="pzType"></sa-Radiogroup>
  161 + </div>
  162 + </div>
  163 +
  164 + <div class="form-group has-success has-feedback"
  165 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  166 + <label class="col-md-2 control-label">上行出场里程*:</label>
  167 + <div class="col-md-3">
  168 + <input type="text" class="form-control" name="upOutLc"
  169 + ng-model="ctrl.busConfigForSave.upOutLc" required ng-pattern="ctrl.float_regex"
  170 + />
  171 + </div>
  172 + <!-- 隐藏块,显示验证信息 -->
  173 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutLc.$error.required">
  174 + 上行出场里程必须填写
  175 + </div>
  176 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutLc.$error.pattern">
  177 + 输入数字
  178 + </div>
  179 + </div>
  180 +
  181 + <div class="form-group has-success has-feedback"
  182 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  183 + <label class="col-md-2 control-label">上行出场时间*:</label>
  184 + <div class="col-md-3">
  185 + <input type="text" class="form-control" name="upOutSj"
  186 + ng-model="ctrl.busConfigForSave.upOutSj" required ng-pattern="ctrl.number_regex"
  187 + />
  188 + </div>
  189 + <!-- 隐藏块,显示验证信息 -->
  190 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutSj.$error.required">
  191 + 上行出场时间必须填写
  192 + </div>
  193 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutSj.$error.pattern">
  194 + 输入整数
  195 + </div>
  196 + </div>
  197 +
  198 + <div class="form-group has-success has-feedback"
  199 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  200 + <label class="col-md-2 control-label">下行出场里程*:</label>
  201 + <div class="col-md-3">
  202 + <input type="text" class="form-control" name="downOutLc"
  203 + ng-model="ctrl.busConfigForSave.downOutLc" required ng-pattern="ctrl.float_regex"
  204 + />
  205 + </div>
  206 + <!-- 隐藏块,显示验证信息 -->
  207 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutLc.$error.required">
  208 + 下行出场里程必须填写
  209 + </div>
  210 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutLc.$error.pattern">
  211 + 输入数字
  212 + </div>
  213 + </div>
  214 +
  215 + <div class="form-group has-success has-feedback"
  216 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  217 + <label class="col-md-2 control-label">下行出场时间*:</label>
  218 + <div class="col-md-3">
  219 + <input type="text" class="form-control" name="downOutSj"
  220 + ng-model="ctrl.busConfigForSave.downOutSj" required ng-pattern="ctrl.number_regex"
  221 + />
  222 + </div>
  223 + <!-- 隐藏块,显示验证信息 -->
  224 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutSj.$error.required">
  225 + 下行出场时间必须填写
  226 + </div>
  227 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutSj.$error.pattern">
  228 + 输入整数
  229 + </div>
  230 + </div>
  231 +
  232 + <div class="form-group has-success has-feedback"
  233 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  234 + <label class="col-md-2 control-label">上行进场里程*:</label>
  235 + <div class="col-md-3">
  236 + <input type="text" class="form-control" name="upInLc"
  237 + ng-model="ctrl.busConfigForSave.upInLc" required ng-pattern="ctrl.float_regex"
  238 + />
  239 + </div>
  240 + <!-- 隐藏块,显示验证信息 -->
  241 + <div class="alert alert-danger well-sm" ng-show="myForm.upInLc.$error.required">
  242 + 上行进场里程必须填写
  243 + </div>
  244 + <div class="alert alert-danger well-sm" ng-show="myForm.upInLc.$error.pattern">
  245 + 输入数字
  246 + </div>
  247 + </div>
  248 +
  249 + <div class="form-group has-success has-feedback"
  250 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  251 + <label class="col-md-2 control-label">上行进场时间*:</label>
  252 + <div class="col-md-3">
  253 + <input type="text" class="form-control" name="upInSj"
  254 + ng-model="ctrl.busConfigForSave.upInSj" required ng-pattern="ctrl.number_regex"
  255 + />
  256 + </div>
  257 + <!-- 隐藏块,显示验证信息 -->
  258 + <div class="alert alert-danger well-sm" ng-show="myForm.upInSj.$error.required">
  259 + 上行进场时间必须填写
  260 + </div>
  261 + <div class="alert alert-danger well-sm" ng-show="myForm.upInSj.$error.pattern">
  262 + 输入整数
  263 + </div>
  264 + </div>
  265 +
  266 + <div class="form-group has-success has-feedback"
  267 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  268 + <label class="col-md-2 control-label">下行进场里程*:</label>
  269 + <div class="col-md-3">
  270 + <input type="text" class="form-control" name="downInLc"
  271 + ng-model="ctrl.busConfigForSave.downInLc" required ng-pattern="ctrl.float_regex"
  272 + />
  273 + </div>
  274 + <!-- 隐藏块,显示验证信息 -->
  275 + <div class="alert alert-danger well-sm" ng-show="myForm.downInLc.$error.required">
  276 + 下行进场里程必须填写
  277 + </div>
  278 + <div class="alert alert-danger well-sm" ng-show="myForm.downInLc.$error.pattern">
  279 + 输入数字
  280 + </div>
  281 + </div>
  282 +
  283 + <div class="form-group has-success has-feedback"
  284 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  285 + <label class="col-md-2 control-label">下行进场时间*:</label>
  286 + <div class="col-md-3">
  287 + <input type="text" class="form-control" name="downInSj"
  288 + ng-model="ctrl.busConfigForSave.downInSj" required ng-pattern="ctrl.number_regex"
  289 + />
  290 + </div>
  291 + <!-- 隐藏块,显示验证信息 -->
  292 + <div class="alert alert-danger well-sm" ng-show="myForm.downInSj.$error.required">
  293 + 下行进场时间必须填写
  294 + </div>
  295 + <div class="alert alert-danger well-sm" ng-show="myForm.downInSj.$error.pattern">
  296 + 输入整数
  297 + </div>
  298 + </div>
  299 +
157 300
158 <!-- 其他form-group --> 301 <!-- 其他form-group -->
159 302
src/main/resources/static/pages/scheduleApp/module/core/busConfig/form.html
@@ -154,6 +154,149 @@ @@ -154,6 +154,149 @@
154 </div> 154 </div>
155 </div> 155 </div>
156 156
  157 + <div class="form-group has-success has-feedback">
  158 + <label class="col-md-2 control-label">配置类型*:</label>
  159 + <div class="col-md-3">
  160 + <sa-Radiogroup model="ctrl.busConfigForSave.pzType" dicgroup="CheLiangPeiZhi" name="pzType"></sa-Radiogroup>
  161 + </div>
  162 + </div>
  163 +
  164 + <div class="form-group has-success has-feedback"
  165 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  166 + <label class="col-md-2 control-label">上行出场里程*:</label>
  167 + <div class="col-md-3">
  168 + <input type="text" class="form-control" name="upOutLc"
  169 + ng-model="ctrl.busConfigForSave.upOutLc" required ng-pattern="ctrl.float_regex"
  170 + />
  171 + </div>
  172 + <!-- 隐藏块,显示验证信息 -->
  173 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutLc.$error.required">
  174 + 上行出场里程必须填写
  175 + </div>
  176 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutLc.$error.pattern">
  177 + 输入数字
  178 + </div>
  179 + </div>
  180 +
  181 + <div class="form-group has-success has-feedback"
  182 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  183 + <label class="col-md-2 control-label">上行出场时间*:</label>
  184 + <div class="col-md-3">
  185 + <input type="text" class="form-control" name="upOutSj"
  186 + ng-model="ctrl.busConfigForSave.upOutSj" required ng-pattern="ctrl.number_regex"
  187 + />
  188 + </div>
  189 + <!-- 隐藏块,显示验证信息 -->
  190 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutSj.$error.required">
  191 + 上行出场时间必须填写
  192 + </div>
  193 + <div class="alert alert-danger well-sm" ng-show="myForm.upOutSj.$error.pattern">
  194 + 输入整数
  195 + </div>
  196 + </div>
  197 +
  198 + <div class="form-group has-success has-feedback"
  199 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  200 + <label class="col-md-2 control-label">下行出场里程*:</label>
  201 + <div class="col-md-3">
  202 + <input type="text" class="form-control" name="downOutLc"
  203 + ng-model="ctrl.busConfigForSave.downOutLc" required ng-pattern="ctrl.float_regex"
  204 + />
  205 + </div>
  206 + <!-- 隐藏块,显示验证信息 -->
  207 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutLc.$error.required">
  208 + 下行出场里程必须填写
  209 + </div>
  210 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutLc.$error.pattern">
  211 + 输入数字
  212 + </div>
  213 + </div>
  214 +
  215 + <div class="form-group has-success has-feedback"
  216 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  217 + <label class="col-md-2 control-label">下行出场时间*:</label>
  218 + <div class="col-md-3">
  219 + <input type="text" class="form-control" name="downOutSj"
  220 + ng-model="ctrl.busConfigForSave.downOutSj" required ng-pattern="ctrl.number_regex"
  221 + />
  222 + </div>
  223 + <!-- 隐藏块,显示验证信息 -->
  224 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutSj.$error.required">
  225 + 下行出场时间必须填写
  226 + </div>
  227 + <div class="alert alert-danger well-sm" ng-show="myForm.downOutSj.$error.pattern">
  228 + 输入整数
  229 + </div>
  230 + </div>
  231 +
  232 + <div class="form-group has-success has-feedback"
  233 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  234 + <label class="col-md-2 control-label">上行进场里程*:</label>
  235 + <div class="col-md-3">
  236 + <input type="text" class="form-control" name="upInLc"
  237 + ng-model="ctrl.busConfigForSave.upInLc" required ng-pattern="ctrl.float_regex"
  238 + />
  239 + </div>
  240 + <!-- 隐藏块,显示验证信息 -->
  241 + <div class="alert alert-danger well-sm" ng-show="myForm.upInLc.$error.required">
  242 + 上行进场里程必须填写
  243 + </div>
  244 + <div class="alert alert-danger well-sm" ng-show="myForm.upInLc.$error.pattern">
  245 + 输入数字
  246 + </div>
  247 + </div>
  248 +
  249 + <div class="form-group has-success has-feedback"
  250 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  251 + <label class="col-md-2 control-label">上行进场时间*:</label>
  252 + <div class="col-md-3">
  253 + <input type="text" class="form-control" name="upInSj"
  254 + ng-model="ctrl.busConfigForSave.upInSj" required ng-pattern="ctrl.number_regex"
  255 + />
  256 + </div>
  257 + <!-- 隐藏块,显示验证信息 -->
  258 + <div class="alert alert-danger well-sm" ng-show="myForm.upInSj.$error.required">
  259 + 上行进场时间必须填写
  260 + </div>
  261 + <div class="alert alert-danger well-sm" ng-show="myForm.upInSj.$error.pattern">
  262 + 输入整数
  263 + </div>
  264 + </div>
  265 +
  266 + <div class="form-group has-success has-feedback"
  267 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  268 + <label class="col-md-2 control-label">下行进场里程*:</label>
  269 + <div class="col-md-3">
  270 + <input type="text" class="form-control" name="downInLc"
  271 + ng-model="ctrl.busConfigForSave.downInLc" required ng-pattern="ctrl.float_regex"
  272 + />
  273 + </div>
  274 + <!-- 隐藏块,显示验证信息 -->
  275 + <div class="alert alert-danger well-sm" ng-show="myForm.downInLc.$error.required">
  276 + 下行进场里程必须填写
  277 + </div>
  278 + <div class="alert alert-danger well-sm" ng-show="myForm.downInLc.$error.pattern">
  279 + 输入数字
  280 + </div>
  281 + </div>
  282 +
  283 + <div class="form-group has-success has-feedback"
  284 + ng-if="ctrl.busConfigForSave.pzType == 'ZW' || ctrl.busConfigForSave.pzType == 'FS'">
  285 + <label class="col-md-2 control-label">下行进场时间*:</label>
  286 + <div class="col-md-3">
  287 + <input type="text" class="form-control" name="downInSj"
  288 + ng-model="ctrl.busConfigForSave.downInSj" required ng-pattern="ctrl.number_regex"
  289 + />
  290 + </div>
  291 + <!-- 隐藏块,显示验证信息 -->
  292 + <div class="alert alert-danger well-sm" ng-show="myForm.downInSj.$error.required">
  293 + 下行进场时间必须填写
  294 + </div>
  295 + <div class="alert alert-danger well-sm" ng-show="myForm.downInSj.$error.pattern">
  296 + 输入整数
  297 + </div>
  298 + </div>
  299 +
157 300
158 <!-- 其他form-group --> 301 <!-- 其他form-group -->
159 302
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
@@ -228,6 +228,11 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -228,6 +228,11 @@ angular.module(&#39;ScheduleApp&#39;).controller(
228 self.zzrqOpen = true; 228 self.zzrqOpen = true;
229 }; 229 };
230 230
  231 + // 整数正则表达式
  232 + self.number_regex = /^-?\d+$/;
  233 + // 小数正则表达式
  234 + self.float_regex = /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/;
  235 +
231 // 欲保存的busInfo信息,绑定 236 // 欲保存的busInfo信息,绑定
232 self.busConfigForSave = new BusConfig; 237 self.busConfigForSave = new BusConfig;
233 self.busConfigForSave.xl = {}; 238 self.busConfigForSave.xl = {};
src/main/resources/static/real_control_v2/css/main.css
@@ -850,8 +850,17 @@ svg rect.offline{ @@ -850,8 +850,17 @@ svg rect.offline{
850 850
851 .operation-real-text{ 851 .operation-real-text{
852 position: absolute; 852 position: absolute;
853 - top: 10px; 853 + top: 9px;
854 width: 100%; 854 width: 100%;
855 left: 0; 855 left: 0;
856 text-align: center; 856 text-align: center;
  857 + pointer-events: none;
  858 +}
  859 +
  860 +.operation-real-text span{
  861 + padding: 15px;
  862 + background: #ff4f4f;
  863 + color: white;
  864 + box-shadow: 0px 4px 6px 0 rgba(0, 0, 0, 0.2), 0px 4px 10px 0 rgba(0, 0, 0, 0.19);
  865 + border-radius: 1px 1px 4px 4px;
857 } 866 }
858 \ No newline at end of file 867 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
@@ -33,7 +33,9 @@ @@ -33,7 +33,9 @@
33 <div class="uk-form-row"> 33 <div class="uk-form-row">
34 <label class="uk-form-label" >车辆编码</label> 34 <label class="uk-form-label" >车辆编码</label>
35 <div class="uk-form-controls"> 35 <div class="uk-form-controls">
36 - <input type="text" value="{{sch.clZbh}}" disabled> 36 + <div class="uk-autocomplete uk-form car-autocom">
  37 + <input type="text" value="{{sch.clZbh}}" name="clZbh" required>
  38 + </div>
37 </div> 39 </div>
38 </div> 40 </div>
39 </div> 41 </div>
@@ -52,7 +54,9 @@ @@ -52,7 +54,9 @@
52 <div class="uk-form-row"> 54 <div class="uk-form-row">
53 <label class="uk-form-label" >驾驶员</label> 55 <label class="uk-form-label" >驾驶员</label>
54 <div class="uk-form-controls"> 56 <div class="uk-form-controls">
55 - <input type="text" value="{{sch.jGh}}/{{sch.jName}}" disabled> 57 + <div class="uk-autocomplete uk-form jsy-autocom">
  58 + <input type="text" value="{{sch.jGh}}/{{sch.jName}}" name="jsy" required>
  59 + </div>
56 </div> 60 </div>
57 </div> 61 </div>
58 </div> 62 </div>
@@ -60,7 +64,9 @@ @@ -60,7 +64,9 @@
60 <div class="uk-form-row"> 64 <div class="uk-form-row">
61 <label class="uk-form-label" >售票员</label> 65 <label class="uk-form-label" >售票员</label>
62 <div class="uk-form-controls"> 66 <div class="uk-form-controls">
63 - <input type="text" value="{{sch.sGh}}/{{sch.sName}}" disabled> 67 + <div class="uk-autocomplete uk-form spy-autocom">
  68 + <input type="text" value="{{sch.sGh}}/{{sch.sName}}" name="spy">
  69 + </div>
64 </div> 70 </div>
65 </div> 71 </div>
66 </div> 72 </div>
@@ -170,6 +176,15 @@ @@ -170,6 +176,15 @@
170 //字典转换 176 //字典转换
171 dictionaryUtils.transformDom($('.nt-dictionary', modal)); 177 dictionaryUtils.transformDom($('.nt-dictionary', modal));
172 178
  179 + //车辆自动补全
  180 + $.get('/basic/cars', function (rs) {
  181 + gb_common.carAutocomplete($('.car-autocom', modal), rs);
  182 + });
  183 + //驾驶员自动补全
  184 + gb_common.personAutocomplete($('.jsy-autocom', modal));
  185 + //售票员
  186 + gb_common.personAutocomplete($('.spy-autocom', modal));
  187 +
173 //submit 188 //submit
174 var f = $('form', modal).formValidation(gb_form_validation_opts); 189 var f = $('form', modal).formValidation(gb_form_validation_opts);
175 f.on('success.form.fv', function(e) { 190 f.on('success.form.fv', function(e) {
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lp_change.html
@@ -4,11 +4,9 @@ @@ -4,11 +4,9 @@
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
5 <h2>路牌对调</h2></div> 5 <h2>路牌对调</h2></div>
6 6
7 - <!--<div class="operation-real-text">  
8 - <span>  
9 - 不同路牌才能对调  
10 - </span>  
11 - </div>--> 7 + <div class="operation-real-text">
  8 + <span></span>
  9 + </div>
12 <div class="uk-grid uk-grid-divider"> 10 <div class="uk-grid uk-grid-divider">
13 <div class="uk-width-1-2"> 11 <div class="uk-width-1-2">
14 <form class="uk-form uk-form-horizontal"> 12 <form class="uk-form uk-form-horizontal">
@@ -72,7 +70,7 @@ @@ -72,7 +70,7 @@
72 </div> 70 </div>
73 <button type="button" class="uk-button uk-modal-close">取消</button> 71 <button type="button" class="uk-button uk-modal-close">取消</button>
74 <button type="submit" data-type="0" class="uk-button uk-button-success"><i class="uk-icon-user"></i> &nbsp;只调人</button> 72 <button type="submit" data-type="0" class="uk-button uk-button-success"><i class="uk-icon-user"></i> &nbsp;只调人</button>
75 - <button type="submit" data-type="1" class="uk-button uk-button-success"><i class="uk-icon-bus"></i> &nbsp;只调车</button> 73 + <button title="如起点站相同,则实发时间跟随车辆对调!" data-uk-tooltip type="submit" data-type="1" class="uk-button uk-button-success"><i class="uk-icon-bus"></i> &nbsp;只调车</button>
76 <button type="submit" data-type="2" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;调人并调车</button> 74 <button type="submit" data-type="2" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;调人并调车</button>
77 </div> 75 </div>
78 </div> 76 </div>
@@ -80,7 +78,7 @@ @@ -80,7 +78,7 @@
80 <script id="schedule-lp_change-list-temp" type="text/html"> 78 <script id="schedule-lp_change-list-temp" type="text/html">
81 {{if order == 0}} 79 {{if order == 0}}
82 {{each array as sch i}} 80 {{each array as sch i}}
83 - <dl data-id="{{sch.id}}"> 81 + <dl data-id="{{sch.id}}" data-jsy="{{sch.jGh}}/{{sch.jName}}" data-nbbm="{{sch.clZbh}}">
84 <dd><input type="checkbox"></dd> 82 <dd><input type="checkbox"></dd>
85 <dd>{{sch.jGh}}/{{sch.jName}}</dd> 83 <dd>{{sch.jGh}}/{{sch.jName}}</dd>
86 <dd>{{sch.clZbh}}</dd> 84 <dd>{{sch.clZbh}}</dd>
@@ -102,7 +100,7 @@ @@ -102,7 +100,7 @@
102 {{/each}} 100 {{/each}}
103 {{else if order == 1}} 101 {{else if order == 1}}
104 {{each array as sch i}} 102 {{each array as sch i}}
105 - <dl data-id="{{sch.id}}"> 103 + <dl data-id="{{sch.id}}" data-jsy="{{sch.jGh}}/{{sch.jName}}" data-nbbm="{{sch.clZbh}}">
106 <dd><input type="checkbox"></dd> 104 <dd><input type="checkbox"></dd>
107 <dd>{{sch.dfsj}}{{if sch.bcType == "out"}} 105 <dd>{{sch.dfsj}}{{if sch.bcType == "out"}}
108 <span class="uk-badge uk-badge-success">出</span> 106 <span class="uk-badge uk-badge-success">出</span>
@@ -128,6 +126,9 @@ @@ -128,6 +126,9 @@
128 (function () { 126 (function () {
129 var modal = '#schedule-lp_change-modal' 127 var modal = '#schedule-lp_change-modal'
130 , sch, list = [{}, {}]; 128 , sch, list = [{}, {}];
  129 +
  130 + var opTextPanel = $('.operation-real-text span');
  131 +
131 $(modal).on('init', function (e, data) { 132 $(modal).on('init', function (e, data) {
132 e.stopPropagation(); 133 e.stopPropagation();
133 sch = data.sch; 134 sch = data.sch;
@@ -213,26 +214,137 @@ @@ -213,26 +214,137 @@
213 dl.removeClass('active'); 214 dl.removeClass('active');
214 dl.find('input[type=checkbox]')[0].checked = false; 215 dl.find('input[type=checkbox]')[0].checked = false;
215 } 216 }
216 - 217 +
  218 + /**
  219 + * 校验左右数据是否可对调
  220 + **/
217 function disabledSubmitBtn() { 221 function disabledSubmitBtn() {
218 - //同一个路牌不能对调  
219 - var leftLP = $('[name=lineSelect]:eq(0)', modal).val() + '_' + $('[name=lpName]:eq(0)', modal).val();  
220 - var rightLP = $('[name=lineSelect]:eq(1)', modal).val() + '_' + $('[name=lpName]:eq(1)', modal).val(); 222 + opTextPanel.text('').show();
221 var $submitBtn = $('button[type=submit]', modal); 223 var $submitBtn = $('button[type=submit]', modal);
222 - if(leftLP == rightLP) 224 +
  225 + var leftArray = $('.sch-list:eq(0) .ct_table_body dl.active', modal);
  226 + var rightArray = $('.sch-list:eq(1) .ct_table_body dl.active', modal);
  227 + if(leftArray.length == 0 && rightArray.length==0){
  228 + opTextPanel.text('请勾选班次');
  229 + $submitBtn.attr('disabled', 'disabled');
  230 + return;
  231 + }
  232 +
  233 + if(leftArray.length == 0){
  234 + opTextPanel.text('请勾选左侧班次');
  235 + $submitBtn.attr('disabled', 'disabled');
  236 + return;
  237 + }
  238 +
  239 + if(rightArray.length == 0){
  240 + opTextPanel.text('请勾选右侧班次');
223 $submitBtn.attr('disabled', 'disabled'); 241 $submitBtn.attr('disabled', 'disabled');
  242 + return;
  243 + }
  244 +
  245 +
  246 + //是否可调人
  247 + var $perSubmit = $('button[type=submit][data-type=0]', modal);
  248 + if(!isTransferPerson(leftArray, rightArray)){
  249 + $perSubmit.attr('disabled', 'disabled');
  250 + }
  251 + else
  252 + $perSubmit.removeAttr('disabled');
  253 +
  254 + //是否可调车
  255 + var $carSubmit = $('button[type=submit][data-type=1]', modal);
  256 + if(!isTransferCar(leftArray, rightArray)){
  257 + $carSubmit.attr('disabled', 'disabled');
  258 + }
  259 + else
  260 + $carSubmit.removeAttr('disabled');
  261 +
  262 +
  263 + //人车都可以调
  264 + var $threeSubmitBtn = $('button[type=submit][data-type=2]', modal);
  265 + if(!$perSubmit.attr('disabled') && !$carSubmit.attr('disabled')){
  266 + $threeSubmitBtn.removeAttr('disabled');
  267 + opTextPanel.hide();
  268 + }
  269 + else
  270 + $threeSubmitBtn.attr('disabled', 'disabled');
  271 + }
  272 +
  273 + function appendText(text) {
  274 + opTextPanel.text(opTextPanel.text() + text);
  275 + }
  276 +
  277 + function isTransferPerson(leftArray, rightArray) {
  278 + if(extractPerson(leftArray).toString() == extractPerson(rightArray).toString()){
  279 + appendText('(无法调人)同一个驾驶员');
  280 + return false;
  281 + }
  282 +
  283 + if(leftArray.length != rightArray.length){
  284 + if(extractPerson(leftArray).length > 1){
  285 + appendText('(无法调人)不对称时,左侧勾选班次只能有一个驾驶员');
  286 + return false;
  287 + }
  288 + if(extractPerson(rightArray).length > 1){
  289 + appendText('(无法调人)不对称时,右侧勾选班次只能有一个驾驶员');
  290 + return false;
  291 + }
  292 +
  293 + return true;
  294 + }
224 else{ 295 else{
  296 + return true;
  297 + }
  298 + }
  299 +
  300 + function isTransferCar(leftArray, rightArray) {
  301 + if(extractCar(leftArray).toString() == extractCar(rightArray).toString()){
  302 + appendText('(无法调车)同一辆车');
  303 + return false;
  304 + }
225 305
226 - var leftSize = $('.sch-list:eq(0) dl.active', modal).length;  
227 - var rightSize = $('.sch-list:eq(1) dl.active', modal).length;  
228 - if(leftSize != rightSize)  
229 - $submitBtn.attr('disabled', 'disabled');  
230 - else if(leftSize != 0)  
231 - $submitBtn.removeAttr('disabled'); 306 + if(leftArray.length != rightArray.length){
  307 + if(extractCar(leftArray).length > 1){
  308 + appendText('(无法调车)不对称时,左侧勾选班次只能有一辆车');
  309 + return false;
  310 + }
  311 + if(extractCar(rightArray).length > 1){
  312 + appendText('(无法调车)不对称时,右侧勾选班次只能有一辆车');
  313 + return false;
  314 + }
  315 +
  316 + return true;
  317 + }
  318 + else{
  319 + return true;
232 } 320 }
233 } 321 }
234 322
235 323
  324 + /**
  325 + * 从dl 里提取出所有的驾驶员
  326 + * @param list
  327 + */
  328 + function extractPerson(list){
  329 + var jsyMap = {};
  330 + $.each(list, function () {
  331 + jsyMap[$(this).data('jsy')] = 1;
  332 + });
  333 + return gb_common.get_keys(jsyMap);
  334 + }
  335 +
  336 + /**
  337 + *从dl 里提取出所有的车辆
  338 + * @param list
  339 + */
  340 + function extractCar(list) {
  341 + var carMap = {};
  342 + $.each(list, function () {
  343 + carMap[$(this).data('nbbm')] = 1;
  344 + });
  345 + return gb_common.get_keys(carMap);
  346 + }
  347 +
236 //全选 348 //全选
237 $('.global_box', modal).on('click', function () { 349 $('.global_box', modal).on('click', function () {
238 var $table = $(this).parents('.ct_table.sch-list'); 350 var $table = $(this).parents('.ct_table.sch-list');
@@ -261,10 +373,10 @@ @@ -261,10 +373,10 @@
261 var leftList = $('.sch-list:eq(0) .ct_table_body dl.active', modal); 373 var leftList = $('.sch-list:eq(0) .ct_table_body dl.active', modal);
262 var rightList = $('.sch-list:eq(1) .ct_table_body dl.active', modal); 374 var rightList = $('.sch-list:eq(1) .ct_table_body dl.active', modal);
263 375
264 - if(leftList.length != rightList.length){ 376 + /*if(leftList.length != rightList.length){
265 alert('左右不对称,无法提交!!'); 377 alert('左右不对称,无法提交!!');
266 return; 378 return;
267 - } 379 + }*/
268 380
269 var leftIdx = '', rightIdx = ''; 381 var leftIdx = '', rightIdx = '';
270 $.each(leftList, function () { 382 $.each(leftList, function () {
@@ -301,6 +413,7 @@ @@ -301,6 +413,7 @@
301 this.checked = false; 413 this.checked = false;
302 }); 414 });
303 } 415 }
  416 +
304 })(); 417 })();
305 </script> 418 </script>
306 </div> 419 </div>
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config.html
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 <li><a data-href="#in_park_source_panel" >原线路回场</a></li> 28 <li><a data-href="#in_park_source_panel" >原线路回场</a></li>
29 <li><a>到站缓冲区设置</a></li> 29 <li><a>到站缓冲区设置</a></li>
30 <li><a>应急停靠</a></li> 30 <li><a>应急停靠</a></li>
  31 + <li><a>社会加油站</a></li>
31 <li><a class="disabled">漂移判定</a></li> 32 <li><a class="disabled">漂移判定</a></li>
32 <li><a class="disabled">到离站预测</a></li> 33 <li><a class="disabled">到离站预测</a></li>
33 <li><a class="disabled">挂牌时刻表</a></li> 34 <li><a class="disabled">挂牌时刻表</a></li>
src/main/resources/static/real_control_v2/js/forms/wrap.html
@@ -62,6 +62,10 @@ @@ -62,6 +62,10 @@
62 $('.form-page-content').load(pageUrl, function () { 62 $('.form-page-content').load(pageUrl, function () {
63 //时间默认当天 63 //时间默认当天
64 $('#date', '.form-page-content').val(moment().format('YYYY-MM-DD')); 64 $('#date', '.form-page-content').val(moment().format('YYYY-MM-DD'));
  65 +
  66 + if($("#ddrbBody").length > 0){
  67 + $("#ddrbBody").height("620px");
  68 + }
65 }); 69 });
66 70
67 //iframe 自适应高度 71 //iframe 自适应高度