Commit 53a780620315eb4638559d34925295db11644b83

Authored by panzhaov5
1 parent 6a8bf1c0

update...

src/main/java/com/bsth/data/directive/DirectivesPstThread.java
... ... @@ -142,7 +142,7 @@ public class DirectivesPstThread extends Thread {
142 142  
143 143 tran.commit(status);
144 144  
145   - logger.info("64 入库成功: " + d64s.size());
  145 + //logger.info("64 入库成功: " + d64s.size());
146 146 }catch (Exception e){
147 147 tran.rollback(status);
148 148 logger.error("", e);
... ... @@ -192,7 +192,7 @@ public class DirectivesPstThread extends Thread {
192 192  
193 193 tran.commit(status);
194 194  
195   - logger.info("60 更新成功: " + d60s.size());
  195 + //logger.info("60 更新成功: " + d60s.size());
196 196 }catch (Exception e){
197 197 tran.rollback(status);
198 198 logger.error("", e);
... ... @@ -266,7 +266,7 @@ public class DirectivesPstThread extends Thread {
266 266  
267 267 tran.commit(status);
268 268  
269   - logger.info("60 入库成功: " + d60s.size());
  269 + //logger.info("60 入库成功: " + d60s.size());
270 270 }catch (Exception e){
271 271 tran.rollback(status);
272 272 logger.error("", e);
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -141,7 +141,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
141 141  
142 142 @Autowired
143 143 YlbRepository ylbRepository;
144   -
  144 +
145 145 @Autowired
146 146 DlbRepository dlbRepository;
147 147  
... ... @@ -156,7 +156,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
156 156  
157 157 @Autowired
158 158 DirectiveService directiveService;
159   -
  159 +
160 160 @Autowired
161 161 CarDeviceRepository carDeviceRepository;
162 162  
... ... @@ -170,19 +170,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
170 170  
171 171 /**
172 172 * 校验人车 和 班次的公司和分公司归属
  173 + *
173 174 * @param schId
174 175 * @param jsy
175 176 * @param spy
176 177 * @param nbbm
177   - * @return
178   - * -2 跨营运公司,校验不过
  178 + * @return -2 跨营运公司,校验不过
179 179 * -1 跨分公司,二次确认
180 180 * 1 校验通过
181 181 */
182 182 @Override
183 183 public Map<String, Object> checkPCFgsAscription(Long schId, String jGh, String sGh, String nbbm) {
184 184 Map<String, Object> rs = new HashMap<>();
185   - try{
  185 + try {
186 186 rs.put("status", ResponseCode.SUCCESS);
187 187 rs.put("checkStatus", -2);
188 188  
... ... @@ -192,27 +192,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
192 192  
193 193 //校验运营公司
194 194 Personnel jsy = BasicData.perMap.get(gsbm + "-" + jGh);
195   - if(null == jsy){
196   - msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【"+jGh+"】的人员";
  195 + if (null == jsy) {
  196 + msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【" + jGh + "】的人员";
197 197 rs.put("msg", msg);
198 198 return rs;
199 199 }
200   - if(!carExist(gsbm, nbbm)){
201   - msg = sch.getGsName() + "没有自编号为" + "["+nbbm+"]的车辆";
  200 + if (!carExist(gsbm, nbbm)) {
  201 + msg = sch.getGsName() + "没有自编号为" + "[" + nbbm + "]的车辆";
202 202 rs.put("msg", msg);
203 203 return rs;
204 204 }
205 205  
206   - if(!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(nbbm))){
  206 + if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(nbbm))) {
207 207 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + nbbm + "】的车辆");
208 208 return rs;
209 209 }
210 210  
211 211 Personnel spy = null;
212   - if(StringUtils.isNotEmpty(sGh)){
  212 + if (StringUtils.isNotEmpty(sGh)) {
213 213 spy = BasicData.perMap.get(gsbm + "-" + sGh);
214   - if(null == spy){
215   - msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【"+sGh+"】的人员";
  214 + if (null == spy) {
  215 + msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【" + sGh + "】的人员";
216 216 rs.put("msg", msg);
217 217 return rs;
218 218 }
... ... @@ -220,15 +220,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
220 220  
221 221  
222 222 //校验分公司
223   - if(null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())){
  223 + if (null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())) {
224 224 msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员");
225 225 rs.put("msg", msg);
226 226 rs.put("checkStatus", -1);
227 227 return rs;
228 228 }
229 229  
230   - if(StringUtils.isNotEmpty(sGh)){
231   - if(null != spy && !fgsbm.equals(spy.getBrancheCompanyCode())){
  230 + if (StringUtils.isNotEmpty(sGh)) {
  231 + if (null != spy && !fgsbm.equals(spy.getBrancheCompanyCode())) {
232 232 msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员");
233 233 rs.put("msg", msg);
234 234 rs.put("checkStatus", -1);
... ... @@ -236,7 +236,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
236 236 }
237 237 }
238 238  
239   - if(!(fgsbm + "_" + gsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))){
  239 + if (!(fgsbm + "_" + gsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))) {
240 240  
241 241 String clFgsName = BasicData.businessFgsCodeNameMap.get(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm));
242 242  
... ... @@ -247,7 +247,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
247 247 }
248 248  
249 249 rs.put("checkStatus", 1);
250   - }catch (Exception e){
  250 + } catch (Exception e) {
251 251 logger.error("", e);
252 252 rs.put("status", ResponseCode.ERROR);
253 253 }
... ... @@ -257,21 +257,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
257 257  
258 258 /**
259 259 * 车辆是否存在
  260 + *
260 261 * @param gsbm 公司编码
261 262 * @param nbbm 车辆自编号
262 263 * @return
263 264 */
264   - private boolean carExist(String gsbm, String nbbm){
265   - return BasicData.deviceId2NbbmMap.inverse().containsKey(nbbm);
  265 + private boolean carExist(String gsbm, String nbbm) {
  266 + return BasicData.nbbm2CompanyCodeMap.containsKey(nbbm);
266 267 }
267 268  
268 269 /**
269 270 * 获取人员姓名
  271 + *
270 272 * @param gsbm 公司编码
271   - * @param gh 人员工号
  273 + * @param gh 人员工号
272 274 * @return
273 275 */
274   - private String getPersonName(String gsbm, String gh){
  276 + private String getPersonName(String gsbm, String gh) {
275 277 return BasicData.allPerson.get(gsbm + '-' + gh);
276 278 }
277 279  
... ... @@ -283,12 +285,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
283 285 DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
284 286 //计算时间戳
285 287 ScheduleRealInfo sch;
286   - while(iterator.hasNext()){
  288 + while (iterator.hasNext()) {
287 289 sch = iterator.next();
288 290 //待发时间戳
289 291 sch.setDfsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getDfsj()));
290 292 //实发时间戳
291   - if(StringUtils.isNotEmpty(sch.getFcsjActual())){
  293 + if (StringUtils.isNotEmpty(sch.getFcsjActual())) {
292 294 sch.setFcsjActualTime(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsjActual()));
293 295 }
294 296 set.add(sch);
... ... @@ -322,7 +324,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
322 324  
323 325 ScheduleRealInfo schedule = dayOfSchedule.get(id);
324 326  
325   - if(schedule.getStatus() > 0){
  327 + if (schedule.getStatus() > 0) {
326 328 map.put("status", ResponseCode.SUCCESS);
327 329 map.put("flag", "4008");
328 330 map.put("t", schedule);
... ... @@ -338,11 +340,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
338 340 }
339 341  
340 342 //记录日志
341   - ScheduleModifyLogger.dftz(schedule,opType, schedule.getDfsj(),dfsj,remarks, userId);
  343 + ScheduleModifyLogger.dftz(schedule, opType, schedule.getDfsj(), dfsj, remarks, userId);
342 344  
343 345 schedule.setDfsjAll(dfsj);
344 346 schedule.setDfAuto(false);
345   - if("1".equals(opType))
  347 + if ("1".equals(opType))
346 348 schedule.setRemarks(remarks);
347 349  
348 350 List<ScheduleRealInfo> ts = new ArrayList<>();
... ... @@ -357,9 +359,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
357 359  
358 360 //调整班次类型
359 361 if (StringUtils.isNotEmpty(bcType) && !bcType.equals(schedule.getBcType())) {
360   - if((schedule.getBcType().equals("major")
  362 + if ((schedule.getBcType().equals("major")
361 363 || schedule.getBcType().equals("venting"))
362   - && bcType.equals("normal")){
  364 + && bcType.equals("normal")) {
363 365 //清空备注
364 366 schedule.setRemarks("");
365 367 }
... ... @@ -369,8 +371,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
369 371 //如果正在执行该班次
370 372 //ScheduleRealInfo exec = dayOfSchedule.executeCurr(schedule.getClZbh());
371 373 //if(exec != null && exec == schedule){
372   - //重新计算正在执行班次
373   - dayOfSchedule.reCalcExecPlan(schedule.getClZbh());
  374 + //重新计算正在执行班次
  375 + dayOfSchedule.reCalcExecPlan(schedule.getClZbh());
374 376 //}
375 377  
376 378 //重新计算是否误点
... ... @@ -382,11 +384,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
382 384 //}
383 385  
384 386 try {
385   - if(!schedule.getDirectiveState().equals(-1) && schedule.getStatus()==0){
  387 + if (!schedule.getDirectiveState().equals(-1) && schedule.getStatus() == 0) {
386 388 //重新下发调度指令
387 389 directiveService.send60Dispatch(schedule.getId(), "待发@系统");
388 390 }
389   - }catch (Exception e){
  391 + } catch (Exception e) {
390 392 logger.error("", e);
391 393 }
392 394  
... ... @@ -512,6 +514,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
512 514  
513 515 /**
514 516 * 添加到历史库
  517 + *
515 518 * @param t
516 519 * @return
517 520 */
... ... @@ -540,28 +543,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
540 543 t.setjGh(t.getjGh().split("-")[1]);
541 544 }
542 545 //检查驾驶员工号
543   - String jName = getPersonName(t.getGsBm() ,t.getjGh());
544   - if(StringUtils.isEmpty(jName)){
  546 + String jName = getPersonName(t.getGsBm(), t.getjGh());
  547 + if (StringUtils.isEmpty(jName)) {
545 548 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员");
546 549 rs.put("status", ResponseCode.ERROR);
547 550 return rs;
548   - }
549   - else if(StringUtils.isEmpty(t.getjName())){
  551 + } else if (StringUtils.isEmpty(t.getjName())) {
550 552 t.setjName(jName);//补上驾驶员名称
551 553 }
552 554  
553 555 //有售票员
554   - if(StringUtils.isNotEmpty(t.getsGh())){
555   - String sName = getPersonName(t.getGsBm() , t.getsGh());
556   - if(StringUtils.isEmpty(sName)){
  556 + if (StringUtils.isNotEmpty(t.getsGh())) {
  557 + String sName = getPersonName(t.getGsBm(), t.getsGh());
  558 + if (StringUtils.isEmpty(sName)) {
557 559 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员");
558 560 rs.put("status", ResponseCode.ERROR);
559 561 return rs;
560   - }else if(StringUtils.isEmpty(t.getsName())){
  562 + } else if (StringUtils.isEmpty(t.getsName())) {
561 563 t.setsName(sName);//补上售票员名称
562 564 }
563   - }
564   - else{
  565 + } else {
565 566 t.setsGh("");
566 567 t.setsName("");
567 568 }
... ... @@ -635,28 +636,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
635 636 t.setjGh(t.getjGh().split("-")[1]);
636 637 }
637 638 //检查驾驶员工号
638   - String jName = getPersonName(t.getGsBm() ,t.getjGh());
639   - if(StringUtils.isEmpty(jName)){
  639 + String jName = getPersonName(t.getGsBm(), t.getjGh());
  640 + if (StringUtils.isEmpty(jName)) {
640 641 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员");
641 642 rs.put("status", ResponseCode.ERROR);
642 643 return rs;
643   - }
644   - else if(StringUtils.isEmpty(t.getjName())){
  644 + } else if (StringUtils.isEmpty(t.getjName())) {
645 645 t.setjName(jName);//补上驾驶员名称
646 646 }
647 647  
648 648 //有售票员
649   - if(StringUtils.isNotEmpty(t.getsGh())){
650   - String sName = getPersonName(t.getGsBm() , t.getsGh());
651   - if(StringUtils.isEmpty(sName)){
  649 + if (StringUtils.isNotEmpty(t.getsGh())) {
  650 + String sName = getPersonName(t.getGsBm(), t.getsGh());
  651 + if (StringUtils.isEmpty(sName)) {
652 652 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员");
653 653 rs.put("status", ResponseCode.ERROR);
654 654 return rs;
655   - }else if(StringUtils.isEmpty(t.getsName())){
  655 + } else if (StringUtils.isEmpty(t.getsName())) {
656 656 t.setsName(sName);//补上售票员名称
657 657 }
658   - }
659   - else{
  658 + } else {
660 659 t.setsGh("");
661 660 t.setsName("");
662 661 }
... ... @@ -688,7 +687,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
688 687  
689 688 //处理计达跨24点
690 689 LineConfig conf = lineConfigData.get(t.getXlBm());
691   - if(t.getZdsj().compareTo(conf.getStartOpt()) < 0){
  690 + if (t.getZdsj().compareTo(conf.getStartOpt()) < 0) {
692 691 t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime() + (1000 * 60 * 60 * 24));
693 692 }
694 693  
... ... @@ -727,6 +726,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
727 726  
728 727 /**
729 728 * 删除历史表临加班次
  729 + *
730 730 * @param id
731 731 * @return
732 732 */
... ... @@ -752,7 +752,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
752 752  
753 753 //数据库删除
754 754 rs = super.delete(id);
755   - }catch (Exception e){
  755 + } catch (Exception e) {
756 756 logger.error("", e);
757 757 rs.put("msg", e.getMessage());
758 758 }
... ... @@ -784,16 +784,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
784 784  
785 785 //数据库删除
786 786 rs = super.delete(id);
787   - if(rs.get("status").equals(ResponseCode.SUCCESS)){
  787 + if (rs.get("status").equals(ResponseCode.SUCCESS)) {
788 788 dayOfSchedule.delete(sch);
789 789 //更新起点应到时间
790 790 List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch);
791 791 rs.put("ts", ts);
792 792 rs.put("delete", sch);
793   - }
794   - else
  793 + } else
795 794 sch.setDeleted(false);
796   - }catch (Exception e){
  795 + } catch (Exception e) {
797 796 logger.error("", e);
798 797 rs.put("msg", e.getMessage());
799 798 sch.setDeleted(false);
... ... @@ -874,28 +873,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
874 873 state = state + "+1";
875 874 type = "ASC";
876 875 }
877   - String minfcsj="02:00";
878   - List<Line> lineList=lineRepository.findLineByCode(line);
879   - if(lineList.size()>0){
880   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
881   - + " id = ("
882   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
883   - + ")";
884   - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
885   - }
886   - String sqlPlan ="select * from (select * from ("
887   - + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
888   - + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ,"
889   - + " min(s.fcsj) as fcsj,1 as px from bsth_c_s_sp_info_real s where "
890   - + " s.xl_Bm = '"+line+"' and s.schedule_date_str ='"+date+"'"
891   - + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name ) x where x.fcsj >'"+minfcsj+"'"
892   - + " UNION "
893   - + " select * from ( select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
894   - + " s.lp_Name as lpName,s.j_Name as jName, max(s.schedule_date_str) as dateStr,"
895   - + " min(s.fcsj) as fcsj,2 as px from bsth_c_s_sp_info_real s "
896   - + " where s.xl_Bm = '"+line+"' and s.schedule_date_str ='"+date+"'"
897   - + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name "
898   - + " ) y where y.fcsj <='"+minfcsj+"') z order by (" + state + "),dateStr,px,fcsj " + type;
  876 + String minfcsj = "02:00";
  877 + List<Line> lineList = lineRepository.findLineByCode(line);
  878 + if (lineList.size() > 0) {
  879 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  880 + + " id = ("
  881 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  882 + + ")";
  883 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  884 + }
  885 + String sqlPlan = "select * from (select * from ("
  886 + + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
  887 + + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ,"
  888 + + " min(s.fcsj) as fcsj,1 as px from bsth_c_s_sp_info_real s where "
  889 + + " s.xl_Bm = '" + line + "' and s.schedule_date_str ='" + date + "'"
  890 + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name ) x where x.fcsj >'" + minfcsj + "'"
  891 + + " UNION "
  892 + + " select * from ( select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
  893 + + " s.lp_Name as lpName,s.j_Name as jName, max(s.schedule_date_str) as dateStr,"
  894 + + " min(s.fcsj) as fcsj,2 as px from bsth_c_s_sp_info_real s "
  895 + + " where s.xl_Bm = '" + line + "' and s.schedule_date_str ='" + date + "'"
  896 + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name "
  897 + + " ) y where y.fcsj <='" + minfcsj + "') z order by (" + state + "),dateStr,px,fcsj " + type;
899 898 List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan,
900 899 new RowMapper<ScheduleRealInfo>() {
901 900 @Override
... ... @@ -963,78 +962,79 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
963 962 List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
964 963 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
965 964 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
966   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  965 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
967 966 for (int i = 0; i < scheduleRealInfos.size(); i++) {
968   - ScheduleRealInfo s=scheduleRealInfos.get(i);
  967 + ScheduleRealInfo s = scheduleRealInfos.get(i);
969 968 Set<ChildTaskPlan> cts = s.getcTasks();
970   - if(cts != null && cts.size() > 0){
971   - lists.add(s);
972   - }else{
973   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
974   - lists.add(s);
975   - }
  969 + if (cts != null && cts.size() > 0) {
  970 + lists.add(s);
  971 + } else {
  972 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  973 + lists.add(s);
  974 + }
976 975 }
977 976 }
978 977 DecimalFormat format = new DecimalFormat("0.00");
979 978 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
980 979 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
981 980 //计算里程和班次数,并放入Map里
982   - Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
  981 + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
983 982  
984   - map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
985   - map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos));
  983 + map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos), culateMieageService.culateJhJccgl(scheduleRealInfos)));
  984 + map.put("remMileage", culateMieageService.culateLbgl(scheduleRealInfos));
986 985 map.put("addMileage", culateMieageService.culateLjgl(lists));
987   - double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));
  986 + double yygl = Arith.add(culateMieageService.culateSjgl(lists), culateMieageService.culateLjgl(lists));
988 987 map.put("yygl", yygl);
989   - double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists));
990   - map.put("ksgl",ksgl);
991   - map.put("realMileage", Arith.add(yygl ,ksgl));
992   - map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,""));
  988 + double ksgl = Arith.add(culateMieageService.culateKsgl(scheduleRealInfos), culateMieageService.culateJccgl(lists));
  989 + map.put("ksgl", ksgl);
  990 + map.put("realMileage", Arith.add(yygl, ksgl));
  991 + map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos, ""));
993 992 map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
994 993 map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
995   - int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");
  994 + int sjbc = culateMieageService.culateLjbc(lists, "") + culateMieageService.culateSjbc(lists, "");
996 995 map.put("sjbc", sjbc);
997 996 // map=new HashMap<String,Object>();
998   -
999   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
1000   - String minfcsj="02:00";
1001   - List<Line> lineList=lineRepository.findLineByCode(line);
1002   - if(lineList.size()>0){
1003   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
1004   - + " id = ("
1005   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
1006   - + ")";
1007   - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
1008   - }
1009   - String[] minSjs = minfcsj.split(":");
1010   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
1011   -
1012   -
  997 +
  998 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  999 + String minfcsj = "02:00";
  1000 + List<Line> lineList = lineRepository.findLineByCode(line);
  1001 + if (lineList.size() > 0) {
  1002 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  1003 + + " id = ("
  1004 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  1005 + + ")";
  1006 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  1007 + }
  1008 + String[] minSjs = minfcsj.split(":");
  1009 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  1010 +
  1011 +
1013 1012 for (int i = 0; i < scheduleRealInfos.size(); i++) {
1014   - ScheduleRealInfo s=scheduleRealInfos.get(i);
1015   - String[] fcsj= s.getFcsj().split(":");
1016   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  1013 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  1014 + String[] fcsj = s.getFcsj().split(":");
  1015 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
1017 1016  
1018   - Long fscjT=0L;
1019   - if(fcsjL<minSj){
1020   - Calendar calendar = new GregorianCalendar();
  1017 + Long fscjT = 0L;
  1018 + if (fcsjL < minSj) {
  1019 + Calendar calendar = new GregorianCalendar();
1021 1020 calendar.setTime(s.getScheduleDate());
1022   - calendar.add(calendar.DATE,1);
  1021 + calendar.add(calendar.DATE, 1);
1023 1022 s.setScheduleDate(calendar.getTime());
1024 1023 try {
1025   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  1024 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
1026 1025 } catch (ParseException e) {
1027 1026 // TODO Auto-generated catch block
1028 1027 e.printStackTrace();
1029 1028 }
1030 1029  
1031   - }else{
  1030 + } else {
1032 1031 try {
1033   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  1032 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
1034 1033 } catch (ParseException e) {
1035 1034 // TODO Auto-generated catch block
1036 1035 e.printStackTrace();
1037   - };
  1036 + }
  1037 + ;
1038 1038 }
1039 1039 s.setFcsjT(fscjT);
1040 1040 }
... ... @@ -1067,7 +1067,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1067 1067 //计算营运里程,空驶里程
1068 1068 if (!childTaskPlans.isEmpty()) {
1069 1069 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1070   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  1070 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
1071 1071 Collections.sort(listit, new ComparableChild());
1072 1072 for (int j = 0; j < listit.size(); j++) {
1073 1073 ScheduleRealInfo t = new ScheduleRealInfo();
... ... @@ -1104,27 +1104,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1104 1104 String zdsj = scheduleRealInfo.getZdsj();
1105 1105 String zdsjActual = scheduleRealInfo.getZdsjActual();
1106 1106 if (zdsj != null && zdsjActual != null &&
1107   - !zdsj.equals(zdsjActual) &&
1108   - !zdsj.equals("")&&
  1107 + !zdsj.equals(zdsjActual) &&
  1108 + !zdsj.equals("") &&
1109 1109 !zdsjActual.equals("")) {
1110   - int zdsjT = Integer.valueOf(zdsj.split(":")[0])*60 + Integer.valueOf(zdsj.split(":")[1]);
1111   - int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0])*60 + Integer.valueOf(zdsjActual.split(":")[1]);
  1110 + int zdsjT = Integer.valueOf(zdsj.split(":")[0]) * 60 + Integer.valueOf(zdsj.split(":")[1]);
  1111 + int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0]) * 60 + Integer.valueOf(zdsjActual.split(":")[1]);
1112 1112 if (zdsj.compareTo(zdsjActual) > 0) {
1113   - if(zdsjT - zdsjAT > 1000){
1114   - maps.put("fast", "");
1115   - maps.put("slow", zdsjAT - zdsjT + 1440);
1116   - } else {
1117   - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
1118   - maps.put("slow", "");
1119   - }
  1113 + if (zdsjT - zdsjAT > 1000) {
  1114 + maps.put("fast", "");
  1115 + maps.put("slow", zdsjAT - zdsjT + 1440);
  1116 + } else {
  1117 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  1118 + maps.put("slow", "");
  1119 + }
1120 1120 } else {
1121   - if(zdsjAT - zdsjT > 1000){
1122   - maps.put("fast", zdsjT - zdsjAT + 1440);
1123   - maps.put("slow", "");
1124   - } else {
1125   - maps.put("fast", "");
1126   - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
1127   - }
  1121 + if (zdsjAT - zdsjT > 1000) {
  1122 + maps.put("fast", zdsjT - zdsjAT + 1440);
  1123 + maps.put("slow", "");
  1124 + } else {
  1125 + maps.put("fast", "");
  1126 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  1127 + }
1128 1128 }
1129 1129 } else {
1130 1130 maps.put("fast", "");
... ... @@ -1136,18 +1136,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1136 1136 }
1137 1137 }
1138 1138  
1139   - String xls="";
1140   - if(map.get("type").toString().equals("0")){
1141   - xls="waybill_minhang.xls";
1142   - }else{
1143   - xls="waybill_minhang_dl.xls";
  1139 + String xls = "";
  1140 + if (map.get("type").toString().equals("0")) {
  1141 + xls = "waybill_minhang.xls";
  1142 + } else {
  1143 + xls = "waybill_minhang_dl.xls";
1144 1144 }
1145 1145  
1146 1146  
1147 1147 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
1148 1148  
1149 1149 list.add(listMap.iterator());
1150   - ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0),map}, path + "mould/"+xls,
  1150 + ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0), map}, path + "mould/" + xls,
1151 1151 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
1152 1152 return scheduleRealInfos;
1153 1153 }
... ... @@ -1197,7 +1197,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1197 1197 @Override
1198 1198 public List<Object[]> historyMessage(String line, String date, String code, String type) {
1199 1199 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1200   -
  1200 +
1201 1201 long d = 0;
1202 1202 long t = 0;
1203 1203 if (date.length() > 0) {
... ... @@ -1210,37 +1210,37 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1210 1210 }
1211 1211  
1212 1212 }
1213   - String device="";
1214   - if(!code.equals("")){
1215   - device=BasicData.deviceId2NbbmMap.inverse().get(code);
  1213 + String device = "";
  1214 + if (!code.equals("")) {
  1215 + device = BasicData.deviceId2NbbmMap.inverse().get(code);
1216 1216 }
1217 1217 List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, d, t, device);
1218 1218 for (Object[] obj : list) {
1219 1219 if (obj != null) {
1220   -
1221   - if(BasicData.deviceId2NbbmMap.get(obj[0].toString())==null){
1222   - List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
1223   - try {
1224   - carDeviceList = carDeviceRepository.findCarDevice(obj[0].toString(), new Date(Long.parseLong(obj[3].toString())));
1225   - } catch (Exception e) {
1226   - // TODO Auto-generated catch block
1227   - e.printStackTrace();
1228   - }
1229   - if(carDeviceList.size()>0){
1230   - obj[0] =carDeviceList.get(0).getClZbh();
1231   - }else{
1232   - obj[0] =BasicData.deviceId2NbbmMap.get(obj[0].toString());
1233   - }
1234   - }else{
1235   - obj[0] =BasicData.deviceId2NbbmMap.get(obj[0].toString());
1236   - }
  1220 +
  1221 + if (BasicData.deviceId2NbbmMap.get(obj[0].toString()) == null) {
  1222 + List<CarDevice> carDeviceList = new ArrayList<CarDevice>();
  1223 + try {
  1224 + carDeviceList = carDeviceRepository.findCarDevice(obj[0].toString(), new Date(Long.parseLong(obj[3].toString())));
  1225 + } catch (Exception e) {
  1226 + // TODO Auto-generated catch block
  1227 + e.printStackTrace();
  1228 + }
  1229 + if (carDeviceList.size() > 0) {
  1230 + obj[0] = carDeviceList.get(0).getClZbh();
  1231 + } else {
  1232 + obj[0] = BasicData.deviceId2NbbmMap.get(obj[0].toString());
  1233 + }
  1234 + } else {
  1235 + obj[0] = BasicData.deviceId2NbbmMap.get(obj[0].toString());
  1236 + }
1237 1237 obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString())));
1238 1238 obj[4] = BasicData.lineCode2NameMap.get(line);
1239 1239 }
1240 1240 }
1241 1241  
1242 1242 if (type != null && type.length() != 0 && type.equals("export")) {
1243   - String lineName = BasicData.lineCode2NameMap.get(line);
  1243 + String lineName = BasicData.lineCode2NameMap.get(line);
1244 1244 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
1245 1245 sdfSimple = new SimpleDateFormat("yyyyMMdd");
1246 1246 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -1263,7 +1263,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1263 1263 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
1264 1264 ee.excelReplace(listI, new Object[]{m}, path + "mould/historyMessage.xls",
1265 1265 path + "export/" + sdfSimple.format(sdfMonth.parse(date))
1266   - + "-" + lineName + "-调度历史消息.xls");
  1266 + + "-" + lineName + "-调度历史消息.xls");
1267 1267 } catch (Exception e) {
1268 1268 // TODO: handle exception
1269 1269 e.printStackTrace();
... ... @@ -1331,8 +1331,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1331 1331 sch.setRemarks(remarks);
1332 1332 sch.calcStatus();
1333 1333 //if(sch.isLate2()){
1334   - //取消应发未到标记
1335   - // sch.setLate2(false);
  1334 + //取消应发未到标记
  1335 + // sch.setLate2(false);
1336 1336 LateAdjustHandle.remove(sch);
1337 1337 //}
1338 1338  
... ... @@ -1445,7 +1445,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1445 1445 //调整待发
1446 1446 tempRs = outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "3", null);
1447 1447  
1448   - if(null != tempRs && tempRs.get("ts") != null)
  1448 + if (null != tempRs && tempRs.get("ts") != null)
1449 1449 tempTs = (List<ScheduleRealInfo>) tempRs.get("ts");
1450 1450  
1451 1451 ts.addAll(tempTs);
... ... @@ -1475,7 +1475,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1475 1475  
1476 1476 ScheduleRealInfo sch = dayOfSchedule.get(id);
1477 1477  
1478   - if(null == sch){
  1478 + if (null == sch) {
1479 1479 rs.put("status", ResponseCode.ERROR);
1480 1480 rs.put("msg", "不存在的班次!");
1481 1481 return rs;
... ... @@ -1486,19 +1486,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1486 1486  
1487 1487 String clZbh = map.get("clZbh");
1488 1488 String jsy = map.get("jsy");
1489   - if(!clZbh.equals(sch.getClZbh())
  1489 + if (!clZbh.equals(sch.getClZbh())
1490 1490 || !jsy.equals(sch.getjGh() + "/" + sch.getjName()))
1491 1491 schModifyLog.saveChangetochange(sch, clZbh, jsy);//为换人换车情况表写入数据
1492 1492 /**
1493 1493 * 换车
1494 1494 */
1495   - if (StringUtils.isNotEmpty(clZbh)) {
  1495 + if (StringUtils.isNotEmpty(clZbh) && !clZbh.equals(sch.getClZbh())) {
1496 1496 //换车
1497 1497 if (!carExist(sch.getGsBm(), clZbh)) {
1498 1498 rs.put("status", ResponseCode.ERROR);
1499 1499 rs.put("msg", "车辆 " + clZbh + " 不存在!");
1500 1500 return rs;
1501   - } else if(!clZbh.equals(sch.getClZbh())){
  1501 + } else if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(clZbh))) {
  1502 + rs.put("status", ResponseCode.ERROR);
  1503 + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + clZbh + "】的车辆");
  1504 + return rs;
  1505 + } else {
1502 1506 fLog.log("换车", sch.getClZbh(), clZbh);
1503 1507 dayOfSchedule.changeCar(sch, clZbh);
1504 1508 }
... ... @@ -1510,12 +1514,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1510 1514 if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) {
1511 1515 String jGh = jsy.split("/")[0];
1512 1516 String jName = getPersonName(sch.getGsBm(), jGh);
1513   - if(StringUtils.isEmpty(jName)){
  1517 + if (StringUtils.isEmpty(jName)) {
1514 1518 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员");
1515 1519 rs.put("status", ResponseCode.ERROR);
1516 1520 return rs;
1517   - }
1518   - else if(!jGh.equals(sch.getjGh())){
  1521 + } else if (!jGh.equals(sch.getjGh())) {
1519 1522 fLog.log("换驾驶员", sch.getjGh() + "/" + sch.getjName(), jsy);
1520 1523 persoChange(sch, jGh);
1521 1524 }
... ... @@ -1528,17 +1531,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1528 1531 if (StringUtils.isNotEmpty(spy) && spy.indexOf("/") != -1 && !spy.equals("/")) {
1529 1532 String sGh = spy.split("/")[0];
1530 1533 String sName = getPersonName(sch.getGsBm(), sGh);
1531   - if(StringUtils.isEmpty(sName)){
  1534 + if (StringUtils.isEmpty(sName)) {
1532 1535 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员");
1533 1536 rs.put("status", ResponseCode.ERROR);
1534 1537 return rs;
1535   - }
1536   - else if(!sGh.equals(sch.getsGh())){
  1538 + } else if (!sGh.equals(sch.getsGh())) {
1537 1539 fLog.log("换售票员", sch.getsGh() + "/" + sch.getsName(), spy);
1538 1540 persoChangeSPY(sch, sGh);
1539 1541 }
1540   - }
1541   - else if(StringUtils.isNotEmpty(sch.getsGh())){
  1542 + } else if (StringUtils.isNotEmpty(sch.getsGh())) {
1542 1543 fLog.log("撤销售票员");
1543 1544 sch.setsGh("");
1544 1545 sch.setsName("");
... ... @@ -1565,9 +1566,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1565 1566 //取消应发未到标记
1566 1567 //if(sch.isLate2()){
1567 1568 // sch.setLate2(false);
1568   - LateAdjustHandle.remove(sch);
  1569 + LateAdjustHandle.remove(sch);
1569 1570 //}
1570   - } else if (StringUtils.isNotEmpty(sch.getFcsjActual()) && StringUtils.isEmpty(fcsjActual)){
  1571 + } else if (StringUtils.isNotEmpty(sch.getFcsjActual()) && StringUtils.isEmpty(fcsjActual)) {
1571 1572 fLog.log("撤销实发时间", sch.getFcsjActual(), "");
1572 1573 //撤销实发
1573 1574 revokeRealOutgo(sch.getId());
... ... @@ -1597,7 +1598,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1597 1598 dayOfSchedule.reCalcExecPlan(sch.getClZbh());
1598 1599 //取消应发未到标记
1599 1600 LateAdjustHandle.remove(sch);
1600   - } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){
  1601 + } else if (StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)) {
1601 1602 //清除实达时间
1602 1603 fLog.log("撤销实达时间", sch.getZdsjActual(), "");
1603 1604 sch.clearZdsjActual();
... ... @@ -1632,15 +1633,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1632 1633 if (StringUtils.isNotEmpty(jhlc)) {
1633 1634 double jhlcNum = Double.parseDouble(jhlc);
1634 1635 //烂班
1635   - if(jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch._isInout() && !sch.isDestroy()){
  1636 + if (jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch._isInout() && !sch.isDestroy()) {
1636 1637 destroy(sch.getId() + "", "", map.get("adjustExps").toString(), null);
1637 1638 fLog.log("里程设置为0,自动烂班");
1638   - }
1639   - else if(jhlcNum != sch.getJhlc()){
  1639 + } else if (jhlcNum != sch.getJhlc()) {
1640 1640 fLog.log("设置里程", sch.getJhlc(), jhlcNum);
1641 1641 sch.setJhlc(jhlcNum);
1642 1642 //临加班次,实际计划一起改
1643   - if(sch.isSflj())
  1643 + if (sch.isSflj())
1644 1644 sch.setJhlcOrig(jhlcNum);
1645 1645 }
1646 1646 }
... ... @@ -1688,7 +1688,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1688 1688 id = jsonObj.getLong("id");
1689 1689 schedule = dayOfSchedule.get(id);
1690 1690  
1691   - if(schedule != null)
  1691 + if (schedule != null)
1692 1692 outgoAdjust(id, null, dfsj, null, "2", null);
1693 1693 }
1694 1694  
... ... @@ -1806,7 +1806,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1806 1806  
1807 1807 @Override
1808 1808 public Map<String, Object> findKMBC2(String jName, String clZbh, String date) {
1809   - List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh, date,"","");
  1809 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh, date, "", "");
1810 1810  
1811 1811 DecimalFormat format = new DecimalFormat("0.00");
1812 1812 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
... ... @@ -1875,47 +1875,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1875 1875 public Map<String, Object> findKMBC(String jGh, String clZbh,
1876 1876 String lpName, String date, String line) {
1877 1877 Map<String, Object> map = new HashMap<String, Object>();
1878   - List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
1879   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  1878 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
  1879 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1880 1880 for (int i = 0; i < list.size(); i++) {
1881   - ScheduleRealInfo s=list.get(i);
  1881 + ScheduleRealInfo s = list.get(i);
1882 1882 Set<ChildTaskPlan> cts = s.getcTasks();
1883   - if(cts != null && cts.size() > 0){
1884   - lists.add(s);
1885   - }else{
1886   - if(s.getFcsjActual() !=null&&s.getZdsjActual()!=null){
1887   - lists.add(s);
1888   - }
  1883 + if (cts != null && cts.size() > 0) {
  1884 + lists.add(s);
  1885 + } else {
  1886 + if (s.getFcsjActual() != null && s.getZdsjActual() != null) {
  1887 + lists.add(s);
  1888 + }
1889 1889 }
1890 1890 }
1891   - map.put("jhbc", culateService.culateJhbc(list,""));//计划班次
  1891 + map.put("jhbc", culateService.culateJhbc(list, ""));//计划班次
1892 1892 map.put("jhlc", Arith.add(culateService.culateJhgl(list),
1893   - culateService.culateJhJccgl(list))); //计划总里程
  1893 + culateService.culateJhJccgl(list))); //计划总里程
1894 1894 map.put("cjbc", culateService.culateLbbc(list));//烂班班次
1895 1895 map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
1896   - map.put("ljbc", culateService.culateLjbc(lists,""));//临加班次
1897   - double ljgl=culateService.culateLjgl(lists);
  1896 + map.put("ljbc", culateService.culateLjbc(lists, ""));//临加班次
  1897 + double ljgl = culateService.culateLjgl(lists);
1898 1898 map.put("addMileage", ljgl); //临加公里
1899   - map.put("sjbc", culateService.culateSjbc(lists,"") + culateService.culateLjbc(lists,""));
1900   - double ksgl=culateService.culateKsgl(list);//子任务空驶公里
1901   - double jccgl=culateService.culateJccgl(lists);//空驶班次公里
  1899 + map.put("sjbc", culateService.culateSjbc(lists, "") + culateService.culateLjbc(lists, ""));
  1900 + double ksgl = culateService.culateKsgl(list);//子任务空驶公里
  1901 + double jccgl = culateService.culateJccgl(lists);//空驶班次公里
1902 1902 map.put("ksgl", ksgl);//空驶公里
1903   - double sjgl=culateService.culateSjgl(lists);//实际营运公里
1904   - map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl)));//总公里
1905   - map.put("zkslc", Arith.add(ksgl,jccgl));
  1903 + double sjgl = culateService.culateSjgl(lists);//实际营运公里
  1904 + map.put("realMileage", Arith.add(Arith.add(ksgl, jccgl), Arith.add(sjgl, ljgl)));//总公里
  1905 + map.put("zkslc", Arith.add(ksgl, jccgl));
1906 1906 map.put("jcclc", jccgl);
1907   - map.put("yygl",Arith.add(sjgl,ljgl)); //总营运公里
  1907 + map.put("yygl", Arith.add(sjgl, ljgl)); //总营运公里
1908 1908 return map;
1909 1909 }
1910 1910  
1911 1911 public Map<String, Object> findKMBC_mh_2(String jGh, String clZbh,
1912   - String lpName, String date, String line) {
  1912 + String lpName, String date, String line) {
1913 1913 Map<String, Object> map = new HashMap<String, Object>();
1914   - List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
1915   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  1914 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
  1915 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1916 1916 for (int i = 0; i < list.size(); i++) {
1917   - ScheduleRealInfo s=list.get(i);
1918   - if(s.isDestroy() && s.isReissue()){
  1917 + ScheduleRealInfo s = list.get(i);
  1918 + if (s.isDestroy() && s.isReissue()) {
1919 1919 s.setRemark("");
1920 1920 s.setFcsjActual(s.getDfsj());
1921 1921 s.setZdsjActual(s.getZdsj());
... ... @@ -1924,32 +1924,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1924 1924 }
1925 1925  
1926 1926 Set<ChildTaskPlan> cts = s.getcTasks();
1927   - if(cts != null && cts.size() > 0){
  1927 + if (cts != null && cts.size() > 0) {
1928 1928 lists.add(s);
1929   - }else{
1930   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  1929 + } else {
  1930 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
1931 1931 lists.add(s);
1932 1932 }
1933 1933 }
1934 1934 }
1935   - double ksgl=culateService.culateKsgl(list);
1936   - double sjgl=culateService.culateSjgl(lists);
1937   - double jccgl=culateService.culateJccgl(lists);
1938   - double ljgl=culateService.culateLjgl(lists);
  1935 + double ksgl = culateService.culateKsgl(list);
  1936 + double sjgl = culateService.culateSjgl(lists);
  1937 + double jccgl = culateService.culateJccgl(lists);
  1938 + double ljgl = culateService.culateLjgl(lists);
1939 1939  
1940   - map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程
  1940 + map.put("jhlc", Arith.add(culateService.culateJhgl(list), culateService.culateJhJccgl(list))); //计划里程
1941 1941 map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
1942 1942 map.put("addMileage", ljgl); //临加公里
1943   - map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里
  1943 + map.put("yygl", Arith.add(sjgl, ljgl)); //实际公里
1944 1944 map.put("ksgl", ksgl);//空驶公里
1945   - map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl)));
  1945 + map.put("realMileage", Arith.add(Arith.add(ksgl, jccgl), Arith.add(sjgl, ljgl)));
1946 1946 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage));
1947   - map.put("jhbc", culateService.culateJhbc(list,""));
  1947 + map.put("jhbc", culateService.culateJhbc(list, ""));
1948 1948 map.put("cjbc", culateService.culateLbbc(list));
1949   - map.put("ljbc", culateService.culateLjbc(lists,""));
1950   - map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,""));
  1949 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  1950 + map.put("sjbc", culateService.culateJhbc(lists, "") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists, ""));
1951 1951 map.put("jcclc", jccgl);
1952   - map.put("zkslc", Arith.add(ksgl,jccgl));
  1952 + map.put("zkslc", Arith.add(ksgl, jccgl));
1953 1953 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc));
1954 1954 return map;
1955 1955 }
... ... @@ -1957,86 +1957,87 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1957 1957  
1958 1958 @Override
1959 1959 public List<Map<String, Object>> accountPx(String line, String date,
1960   - String code, String xlName, String px) {
  1960 + String code, String xlName, String px) {
1961 1961 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px);
1962 1962 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1963   - if(!code.trim().equals("")){
1964   - code=BasicData.deviceId2NbbmMap.inverse().get(code);
1965   - }
1966   - String fgs="";
1967   - List<Line> lineList= lineRepository.findLineByCode(line);
1968   - if(lineList.size()>0){
1969   - Line l=lineList.get(0);
1970   - fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
1971   - }
  1963 + if (!code.trim().equals("")) {
  1964 + code = BasicData.deviceId2NbbmMap.inverse().get(code);
  1965 + }
  1966 + String fgs = "";
  1967 + List<Line> lineList = lineRepository.findLineByCode(line);
  1968 + if (lineList.size() > 0) {
  1969 + Line l = lineList.get(0);
  1970 + fgs = BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany() + "_" + l.getCompany());
  1971 + }
1972 1972 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1973   - String sql= "SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,"
1974   - + " device_id FROM bsth_v_report_80 WHERE "
1975   - + " FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = '"+date+"' AND"
1976   - + " line_id = '"+line+"' and device_id like '%"+code+"%'";
  1973 + String sql = "SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,"
  1974 + + " device_id FROM bsth_v_report_80 WHERE "
  1975 + + " FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = '" + date + "' AND"
  1976 + + " line_id = '" + line + "' and device_id like '%" + code + "%'";
1977 1977 Map<String, Object> map;
1978 1978 List<Object[]> lsitObj = jdbcTemplate.query(sql,
1979 1979 new RowMapper<Object[]>() {
1980 1980 @Override
1981 1981 public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException {
1982   - Object[] t = new Object[3];
1983   - t[0]=rs.getString("request_code");
1984   - t[1]=rs.getString("TIMESTAMP");
1985   - t[2]=rs.getString("device_id");
  1982 + Object[] t = new Object[3];
  1983 + t[0] = rs.getString("request_code");
  1984 + t[1] = rs.getString("TIMESTAMP");
  1985 + t[2] = rs.getString("device_id");
1986 1986 return t;
1987 1987 }
1988 1988 });
1989 1989 int i = 1;
1990 1990 for (Object[] obj : lsitObj) {
1991 1991 if (obj != null) {
1992   - map = new HashMap<String, Object>();
1993   - map.put("num", i++);
1994   - map.put("xlName", xlName);
1995   - if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
1996   - List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
1997   - try {
1998   - carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
1999   - } catch (Exception e) {
2000   - // TODO Auto-generated catch block
2001   - e.printStackTrace();
2002   - }
2003   - if(carDeviceList.size()>0){
2004   - map.put("clZbh", carDeviceList.get(0).getClZbh());
2005   -
2006   - }else{
2007   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
2008   - }
2009   - }else{
2010   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
2011   -
2012   - }
2013   - map.put("company",fgs);
2014   - map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
2015   - map.put("requestTime", obj[1]);
2016   - listMap.add(map);
2017   - }
2018   - }
2019   - if(listMap.size()>1){
2020   - if(px.equals("asc")){
2021   - Collections.sort(listMap,new AccountMap());
2022   - }else{
2023   - Collections.sort(listMap,new AccountMap2());
2024   - }
  1992 + map = new HashMap<String, Object>();
  1993 + map.put("num", i++);
  1994 + map.put("xlName", xlName);
  1995 + if (BasicData.deviceId2NbbmMap.get(obj[2]) == null) {
  1996 + List<CarDevice> carDeviceList = new ArrayList<CarDevice>();
  1997 + try {
  1998 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
  1999 + } catch (Exception e) {
  2000 + // TODO Auto-generated catch block
  2001 + e.printStackTrace();
  2002 + }
  2003 + if (carDeviceList.size() > 0) {
  2004 + map.put("clZbh", carDeviceList.get(0).getClZbh());
  2005 +
  2006 + } else {
  2007 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  2008 + }
  2009 + } else {
  2010 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  2011 +
  2012 + }
  2013 + map.put("company", fgs);
  2014 + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
  2015 + map.put("requestTime", obj[1]);
  2016 + listMap.add(map);
  2017 + }
  2018 + }
  2019 + if (listMap.size() > 1) {
  2020 + if (px.equals("asc")) {
  2021 + Collections.sort(listMap, new AccountMap());
  2022 + } else {
  2023 + Collections.sort(listMap, new AccountMap2());
  2024 + }
2025 2025 }
2026 2026 return listMap;
2027 2027 }
  2028 +
2028 2029 @Override
2029 2030 public List<Map<String, Object>> account(String line, String date,
2030 2031 String code, String xlName, String type) {
2031   - if(!code.trim().equals("")){
2032   - code=BasicData.deviceId2NbbmMap.inverse().get(code);
2033   - }
2034   - String fgs="";
2035   - List<Line> lineList= lineRepository.findLineByCode(line);
2036   - if(lineList.size()>0){
2037   - Line l=lineList.get(0);
2038   - fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
2039   - }
  2032 + if (!code.trim().equals("")) {
  2033 + code = BasicData.deviceId2NbbmMap.inverse().get(code);
  2034 + }
  2035 + String fgs = "";
  2036 + List<Line> lineList = lineRepository.findLineByCode(line);
  2037 + if (lineList.size() > 0) {
  2038 + Line l = lineList.get(0);
  2039 + fgs = BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany() + "_" + l.getCompany());
  2040 + }
2040 2041 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2041 2042 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code);
2042 2043 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
... ... @@ -2047,25 +2048,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2047 2048 map = new HashMap<String, Object>();
2048 2049 map.put("num", i++);
2049 2050 map.put("xlName", xlName);
2050   - if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
2051   - List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
2052   - try {
2053   - carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
2054   - } catch (Exception e) {
2055   - // TODO Auto-generated catch block
2056   - e.printStackTrace();
2057   - }
2058   - if(carDeviceList.size()>0){
  2051 + if (BasicData.deviceId2NbbmMap.get(obj[2]) == null) {
  2052 + List<CarDevice> carDeviceList = new ArrayList<CarDevice>();
  2053 + try {
  2054 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
  2055 + } catch (Exception e) {
  2056 + // TODO Auto-generated catch block
  2057 + e.printStackTrace();
  2058 + }
  2059 + if (carDeviceList.size() > 0) {
2059 2060 map.put("clZbh", carDeviceList.get(0).getClZbh());
2060 2061  
2061   - }else{
  2062 + } else {
2062 2063 map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
2063   - }
2064   - }else{
  2064 + }
  2065 + } else {
2065 2066 map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
2066 2067  
2067   - }
2068   - map.put("company",fgs);
  2068 + }
  2069 + map.put("company", fgs);
2069 2070 map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
2070 2071 map.put("requestTime", obj[1]);
2071 2072 listMap.add(map);
... ... @@ -2097,7 +2098,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2097 2098 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2098 2099 ee.excelReplace(listI, new Object[]{m}, path + "mould/account.xls",
2099 2100 path + "export/" + sdfSimple.format(sdfMonth.parse(date))
2100   - + "-" + xlName + "-驾驶员请求台账.xls");
  2101 + + "-" + xlName + "-驾驶员请求台账.xls");
2101 2102 } catch (Exception e) {
2102 2103 // TODO: handle exception
2103 2104 e.printStackTrace();
... ... @@ -2106,191 +2107,193 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2106 2107  
2107 2108 return listMap;
2108 2109 }
2109   -
  2110 +
2110 2111 @Override
2111   - public List<SchEditInfoDto> correctForm(String line,String date,String endDate,
2112   - String lpName,String code, String type,String changType) {
2113   -
  2112 + public List<SchEditInfoDto> correctForm(String line, String date, String endDate,
  2113 + String lpName, String code, String type, String changType) {
  2114 +
2114 2115 // var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班',
2115 2116 // 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车'};
2116   - Map<String, Object> map=new HashMap<String,Object>();
2117   - map.put("DFTZ", "待发调整");
2118   - map.put("FCXXWT", "发车信息微调");
2119   - map.put("JHLB", "计划烂班");
2120   - map.put("CXLB", "撤销烂班");
2121   - map.put("CXZX","撤销执行");
2122   - map.put("CXSF", "撤销实发");
2123   - map.put("SFTZ", "实发调整");
2124   - map.put("TZRC", "调整人车");
2125   -
2126   - SimpleDateFormat sdf1=new SimpleDateFormat("HH:mm");
2127   - SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd HH:mm");
2128   - String cont = "";
2129   - cont = " and xl_bm ='"+line +"'";
2130   - if(!lpName.equals("")){
2131   - cont +=" and lp_name = '"+lpName+"'";
2132   - }
2133   - if(!code.equals("")){
2134   - cont +=" and cl_zbh ='"+code+"'";
2135   - }
2136   - String sql = "select t1.*, t2.real_exec_date,"
2137   - + "t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,"
2138   - + "t2.xl_dir,t2.real_exec_date from (select * from "
2139   - + "logger_sch_modify where rq BETWEEN ? and ? and line_code=? )"
2140   - + " t1 INNER JOIN bsth_c_s_sp_info_real t2 on "
2141   - + "t1.sch_id=t2.id where 1=1 " + cont;
2142   -
2143   - List<SchEditInfoDto> list = jdbcTemplate.query(sql,
2144   - new BeanPropertyRowMapper(SchEditInfoDto.class),date,endDate, line);
2145   - List<SchEditInfoDto> lists=new ArrayList<SchEditInfoDto>();
2146   - for (int i = 0; i < list.size(); i++) {
2147   - Long fcsjs=0l;
2148   - Long updsj=0l;
2149   - SchEditInfoDto t=list.get(i);
2150   - if(map.get(t.getType())!=null){
2151   -
2152   - if(changType.equals("")){
2153   - t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";");
2154   - }else{
2155   - String fcsj="";
2156   - String updtime="";
2157   - try {
2158   - fcsj= sdf1.format(sdf1.parse(t.getFcsj()));
2159   - updtime=sdf1.format(sdf1.parse(t.getTimeStr()));
2160   - fcsjs=sdf2.parse(t.getRealExecDate()+" "+fcsj).getTime();
2161   - updsj=sdf2.parse(t.getRq()+" "+updtime).getTime();
2162   - } catch (ParseException e) {
2163   - // TODO Auto-generated catch block
2164   - e.printStackTrace();
2165   - }
2166   - if(changType.equals("1")){
2167   - if(fcsjs>updsj){
2168   - t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";");
2169   - }else{
2170   - t.setType2("");
2171   - }
2172   - }else if(changType.equals("2")){
2173   - if(fcsjs<updsj){
2174   - t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";");
2175   - }else{
2176   - t.setType2("");
2177   - }
2178   - }
2179   - }
2180   - }else{
2181   - t.setType2("");
2182   - }
2183   - boolean fage=true;
2184   - for (int j = 0; j < lists.size(); j++) {
2185   - SchEditInfoDto s=lists.get(j);
2186   - if(s.getSchId()==t.getSchId()){
2187   - s.setType2(s.getType2()+" "+t.getType2());
2188   - fage=false;
2189   - }
2190   - }
2191   -
2192   - if(fage){
2193   - if(changType.equals("")){
2194   - lists.add(t);
2195   - } else {
2196   - if (changType.equals("1")) {
2197   - if (fcsjs > updsj) {
2198   - lists.add(t);
2199   - }
2200   - } else if (changType.equals("2")) {
2201   - if (fcsjs < updsj) {
2202   - lists.add(t);
2203   - }
2204   - }
2205   - }
2206   - }
2207   - }
2208   -
2209   - if (type != null && type.length() != 0 && type.equals("export")) {
2210   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
2211   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
2212   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2213   - Map<String, Object> m = new HashMap<String, Object>();
2214   - m.put("dates",date);
2215   - ReportUtils ee = new ReportUtils();
2216   - List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
2217   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2218   - for (SchEditInfoDto d : lists) {
2219   - Map<String, Object> tempMap = new HashMap<String, Object>();
2220   - tempMap.put("lpName", d.getLpName());
2221   - tempMap.put("rq", d.getRq());
2222   - tempMap.put("clZbh", d.getClZbh());
2223   - tempMap.put("jName", d.getjName()+"/"+d.getjGh());
2224   - tempMap.put("fcsj", d.getFcsj());
2225   - tempMap.put("type", d.getType2());
2226   - tempList.add(tempMap);
2227   - }
2228   - try {
2229   - String dateTime = sdfSimple.format(sdfMonth.parse(date));
2230   - String lineName = BasicData.lineCode2NameMap.get(line);
2231   - listI.add(tempList.iterator());
2232   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2233   - ee.excelReplace(listI, new Object[]{m}, path + "mould/correctForm.xls",
2234   - path + "export/" + dateTime + "-" + lineName + "-修正报表.xls");
2235   - } catch (Exception e) {
2236   - // TODO: handle exception
2237   - e.printStackTrace();
2238   - }
  2117 + Map<String, Object> map = new HashMap<String, Object>();
  2118 + map.put("DFTZ", "待发调整");
  2119 + map.put("FCXXWT", "发车信息微调");
  2120 + map.put("JHLB", "计划烂班");
  2121 + map.put("CXLB", "撤销烂班");
  2122 + map.put("CXZX", "撤销执行");
  2123 + map.put("CXSF", "撤销实发");
  2124 + map.put("SFTZ", "实发调整");
  2125 + map.put("TZRC", "调整人车");
  2126 +
  2127 + SimpleDateFormat sdf1 = new SimpleDateFormat("HH:mm");
  2128 + SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2129 + String cont = "";
  2130 + cont = " and xl_bm ='" + line + "'";
  2131 + if (!lpName.equals("")) {
  2132 + cont += " and lp_name = '" + lpName + "'";
  2133 + }
  2134 + if (!code.equals("")) {
  2135 + cont += " and cl_zbh ='" + code + "'";
  2136 + }
  2137 + String sql = "select t1.*, t2.real_exec_date,"
  2138 + + "t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,"
  2139 + + "t2.xl_dir,t2.real_exec_date from (select * from "
  2140 + + "logger_sch_modify where rq BETWEEN ? and ? and line_code=? )"
  2141 + + " t1 INNER JOIN bsth_c_s_sp_info_real t2 on "
  2142 + + "t1.sch_id=t2.id where 1=1 " + cont;
  2143 +
  2144 + List<SchEditInfoDto> list = jdbcTemplate.query(sql,
  2145 + new BeanPropertyRowMapper(SchEditInfoDto.class), date, endDate, line);
  2146 + List<SchEditInfoDto> lists = new ArrayList<SchEditInfoDto>();
  2147 + for (int i = 0; i < list.size(); i++) {
  2148 + Long fcsjs = 0l;
  2149 + Long updsj = 0l;
  2150 + SchEditInfoDto t = list.get(i);
  2151 + if (map.get(t.getType()) != null) {
  2152 +
  2153 + if (changType.equals("")) {
  2154 + t.setType2(t.getUser() + "于" + t.getTimeStr() + "进行" + map.get(t.getType()).toString() + ";");
  2155 + } else {
  2156 + String fcsj = "";
  2157 + String updtime = "";
  2158 + try {
  2159 + fcsj = sdf1.format(sdf1.parse(t.getFcsj()));
  2160 + updtime = sdf1.format(sdf1.parse(t.getTimeStr()));
  2161 + fcsjs = sdf2.parse(t.getRealExecDate() + " " + fcsj).getTime();
  2162 + updsj = sdf2.parse(t.getRq() + " " + updtime).getTime();
  2163 + } catch (ParseException e) {
  2164 + // TODO Auto-generated catch block
  2165 + e.printStackTrace();
  2166 + }
  2167 + if (changType.equals("1")) {
  2168 + if (fcsjs > updsj) {
  2169 + t.setType2(t.getUser() + "于" + t.getTimeStr() + "进行" + map.get(t.getType()).toString() + ";");
  2170 + } else {
  2171 + t.setType2("");
  2172 + }
  2173 + } else if (changType.equals("2")) {
  2174 + if (fcsjs < updsj) {
  2175 + t.setType2(t.getUser() + "于" + t.getTimeStr() + "进行" + map.get(t.getType()).toString() + ";");
  2176 + } else {
  2177 + t.setType2("");
  2178 + }
  2179 + }
  2180 + }
  2181 + } else {
  2182 + t.setType2("");
  2183 + }
  2184 + boolean fage = true;
  2185 + for (int j = 0; j < lists.size(); j++) {
  2186 + SchEditInfoDto s = lists.get(j);
  2187 + if (s.getSchId() == t.getSchId()) {
  2188 + s.setType2(s.getType2() + " " + t.getType2());
  2189 + fage = false;
  2190 + }
  2191 + }
  2192 +
  2193 + if (fage) {
  2194 + if (changType.equals("")) {
  2195 + lists.add(t);
  2196 + } else {
  2197 + if (changType.equals("1")) {
  2198 + if (fcsjs > updsj) {
  2199 + lists.add(t);
  2200 + }
  2201 + } else if (changType.equals("2")) {
  2202 + if (fcsjs < updsj) {
  2203 + lists.add(t);
  2204 + }
  2205 + }
  2206 + }
  2207 + }
  2208 + }
  2209 +
  2210 + if (type != null && type.length() != 0 && type.equals("export")) {
  2211 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  2212 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  2213 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  2214 + Map<String, Object> m = new HashMap<String, Object>();
  2215 + m.put("dates", date);
  2216 + ReportUtils ee = new ReportUtils();
  2217 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  2218 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2219 + for (SchEditInfoDto d : lists) {
  2220 + Map<String, Object> tempMap = new HashMap<String, Object>();
  2221 + tempMap.put("lpName", d.getLpName());
  2222 + tempMap.put("rq", d.getRq());
  2223 + tempMap.put("clZbh", d.getClZbh());
  2224 + tempMap.put("jName", d.getjName() + "/" + d.getjGh());
  2225 + tempMap.put("fcsj", d.getFcsj());
  2226 + tempMap.put("type", d.getType2());
  2227 + tempList.add(tempMap);
  2228 + }
  2229 + try {
  2230 + String dateTime = sdfSimple.format(sdfMonth.parse(date));
  2231 + String lineName = BasicData.lineCode2NameMap.get(line);
  2232 + listI.add(tempList.iterator());
  2233 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2234 + ee.excelReplace(listI, new Object[]{m}, path + "mould/correctForm.xls",
  2235 + path + "export/" + dateTime + "-" + lineName + "-修正报表.xls");
  2236 + } catch (Exception e) {
  2237 + // TODO: handle exception
  2238 + e.printStackTrace();
  2239 + }
2239 2240 // Map<String, Object> maps = tempList.get(tempList.size() - 1);
2240   - }
  2241 + }
2241 2242 return lists;
2242 2243 }
  2244 +
2243 2245 @Override
2244 2246 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh,
2245 2247 String lpName, String date, String line) {
2246 2248 List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
2247 2249 List<ScheduleRealInfo> list = null;
2248 2250 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
2249   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
2250   - String minfcsj="02:00";
2251   - List<Line> lineList=lineRepository.findLineByCode(line);
2252   - if(lineList.size()>0){
2253   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
2254   - + " id = ("
2255   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
2256   - + ")";
2257   - minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
2258   - }
2259   - String[] minSjs = minfcsj.split(":");
2260   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
2261   -
  2251 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2252 + String minfcsj = "02:00";
  2253 + List<Line> lineList = lineRepository.findLineByCode(line);
  2254 + if (lineList.size() > 0) {
  2255 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  2256 + + " id = ("
  2257 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  2258 + + ")";
  2259 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  2260 + }
  2261 + String[] minSjs = minfcsj.split(":");
  2262 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  2263 +
2262 2264 for (int i = 0; i < list.size(); i++) {
2263   - ScheduleRealInfo s=list.get(i);
2264   - if(s.getBcType().equals("out")){
2265   - s.setRemark("1");
2266   - }else if(s.getBcType().equals("in")){
2267   - s.setRemark("3");
2268   - }else{
2269   - s.setRemark("2");
2270   - }
2271   - String[] fcsj= s.getFcsj().split(":");
2272   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
2273   -
2274   - Long fscjT=0L;
2275   - if(fcsjL<minSj){
2276   - Calendar calendar = new GregorianCalendar();
  2265 + ScheduleRealInfo s = list.get(i);
  2266 + if (s.getBcType().equals("out")) {
  2267 + s.setRemark("1");
  2268 + } else if (s.getBcType().equals("in")) {
  2269 + s.setRemark("3");
  2270 + } else {
  2271 + s.setRemark("2");
  2272 + }
  2273 + String[] fcsj = s.getFcsj().split(":");
  2274 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  2275 +
  2276 + Long fscjT = 0L;
  2277 + if (fcsjL < minSj) {
  2278 + Calendar calendar = new GregorianCalendar();
2277 2279 calendar.setTime(s.getScheduleDate());
2278   - calendar.add(calendar.DATE,1);
  2280 + calendar.add(calendar.DATE, 1);
2279 2281 s.setScheduleDate(calendar.getTime());
2280 2282 try {
2281   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  2283 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
2282 2284 } catch (ParseException e) {
2283 2285 // TODO Auto-generated catch block
2284 2286 e.printStackTrace();
2285 2287 }
2286 2288  
2287   - }else{
  2289 + } else {
2288 2290 try {
2289   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  2291 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
2290 2292 } catch (ParseException e) {
2291 2293 // TODO Auto-generated catch block
2292 2294 e.printStackTrace();
2293   - };
  2295 + }
  2296 + ;
2294 2297 }
2295 2298 s.setFcsjT(fscjT);
2296 2299 }
... ... @@ -2322,28 +2325,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2322 2325 //计算营运里程,空驶里程
2323 2326 if (!childTaskPlans.isEmpty()) {
2324 2327 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
2325   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  2328 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
2326 2329 Collections.sort(listit, new ComparableChild());
2327 2330 for (int j = 0; j < listit.size(); j++) {
2328 2331 ScheduleRealInfo t = new ScheduleRealInfo();
2329 2332 ChildTaskPlan childTaskPlan = listit.get(j);
2330   - if(childTaskPlan.getCcId()==null){
2331   - if (childTaskPlan.isDestroy()) {
2332   - t.setFcsjActual("");
2333   - t.setZdsjActual("");
2334   - t.setJhlc(0.0);
2335   - } else {
2336   - t.setFcsjActual(childTaskPlan.getStartDate());
2337   - t.setZdsjActual(childTaskPlan.getEndDate());
2338   - t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
2339   - }
2340   - t.setFcsj(childTaskPlan.getStartDate());
2341   - t.setZdsj(childTaskPlan.getEndDate());
2342   - t.setQdzName(childTaskPlan.getStartStationName());
2343   - t.setZdzName(childTaskPlan.getEndStationName());
2344   - t.setRemarks(childTaskPlan.getRemarks());
2345   - t.setAdjustExps("子");
2346   - listSchedule.add(t);
  2333 + if (childTaskPlan.getCcId() == null) {
  2334 + if (childTaskPlan.isDestroy()) {
  2335 + t.setFcsjActual("");
  2336 + t.setZdsjActual("");
  2337 + t.setJhlc(0.0);
  2338 + } else {
  2339 + t.setFcsjActual(childTaskPlan.getStartDate());
  2340 + t.setZdsjActual(childTaskPlan.getEndDate());
  2341 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  2342 + }
  2343 + t.setFcsj(childTaskPlan.getStartDate());
  2344 + t.setZdsj(childTaskPlan.getEndDate());
  2345 + t.setQdzName(childTaskPlan.getStartStationName());
  2346 + t.setZdzName(childTaskPlan.getEndStationName());
  2347 + t.setRemarks(childTaskPlan.getRemarks());
  2348 + t.setAdjustExps("子");
  2349 + listSchedule.add(t);
2347 2350 }
2348 2351 }
2349 2352 }
... ... @@ -2354,48 +2357,49 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2354 2357  
2355 2358 @Override
2356 2359 public List<ScheduleRealInfo> queryListWaybill2(String jName, String clZbh,
2357   - String lpName, String date, String line) {
  2360 + String lpName, String date, String line) {
2358 2361 List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
2359 2362 List<ScheduleRealInfo> list = null;
2360 2363 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
2361   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
2362   - String minfcsj="02:00";
2363   - List<Line> lineList=lineRepository.findLineByCode(line);
2364   - if(lineList.size()>0){
2365   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
2366   - + " id = ("
2367   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
2368   - + ")";
2369   - minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  2364 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2365 + String minfcsj = "02:00";
  2366 + List<Line> lineList = lineRepository.findLineByCode(line);
  2367 + if (lineList.size() > 0) {
  2368 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  2369 + + " id = ("
  2370 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  2371 + + ")";
  2372 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
2370 2373 }
2371 2374 String[] minSjs = minfcsj.split(":");
2372   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  2375 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
2373 2376  
2374 2377 for (int i = 0; i < list.size(); i++) {
2375   - ScheduleRealInfo s=list.get(i);
2376   - String[] fcsj= s.getFcsj().split(":");
2377   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  2378 + ScheduleRealInfo s = list.get(i);
  2379 + String[] fcsj = s.getFcsj().split(":");
  2380 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
2378 2381  
2379   - Long fscjT=0L;
2380   - if(fcsjL<minSj){
2381   - Calendar calendar = new GregorianCalendar();
  2382 + Long fscjT = 0L;
  2383 + if (fcsjL < minSj) {
  2384 + Calendar calendar = new GregorianCalendar();
2382 2385 calendar.setTime(s.getScheduleDate());
2383   - calendar.add(calendar.DATE,1);
  2386 + calendar.add(calendar.DATE, 1);
2384 2387 s.setScheduleDate(calendar.getTime());
2385 2388 try {
2386   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  2389 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
2387 2390 } catch (ParseException e) {
2388 2391 // TODO Auto-generated catch block
2389 2392 e.printStackTrace();
2390 2393 }
2391 2394  
2392   - }else{
  2395 + } else {
2393 2396 try {
2394   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  2397 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
2395 2398 } catch (ParseException e) {
2396 2399 // TODO Auto-generated catch block
2397 2400 e.printStackTrace();
2398   - };
  2401 + }
  2402 + ;
2399 2403 }
2400 2404 s.setFcsjT(fscjT);
2401 2405 }
... ... @@ -2416,14 +2420,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2416 2420 }
2417 2421  
2418 2422 if (s.isDestroy()) {
2419   - if(s.isReissue()){
  2423 + if (s.isReissue()) {
2420 2424 s.setFcsjActual(s.getDfsj());
2421 2425 s.setZdsjActual(s.getZdsj());
2422 2426 s.setRemarks("");
2423 2427 s.setStatus(2);
2424 2428 s.setJhlc(s.getJhlcOrig());
2425   - }
2426   - else{
  2429 + } else {
2427 2430 s.setFcsjActual("");
2428 2431 s.setZdsjActual("");
2429 2432 s.setJhlc(0.0);
... ... @@ -2436,7 +2439,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2436 2439 //计算营运里程,空驶里程
2437 2440 if (!childTaskPlans.isEmpty()) {
2438 2441 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
2439   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  2442 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
2440 2443 Collections.sort(listit, new ComparableChild());
2441 2444 for (int j = 0; j < listit.size(); j++) {
2442 2445 ScheduleRealInfo t = new ScheduleRealInfo();
... ... @@ -2479,29 +2482,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2479 2482 }
2480 2483 return rs;
2481 2484 }
  2485 +
2482 2486 @Override
2483 2487 public List<Map<String, Object>> statisticsDaily(String line, String date,
2484 2488 String xlName, String type) {
2485   - List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();
2486   - List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
2487   - List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();
  2489 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2490 + List<ScheduleRealInfo> list_s = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  2491 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2488 2492 for (int i = 0; i < list_s.size(); i++) {
2489   - ScheduleRealInfo s=list_s.get(i);
  2493 + ScheduleRealInfo s = list_s.get(i);
2490 2494 Set<ChildTaskPlan> cts = s.getcTasks();
2491   - if(cts != null && cts.size() > 0){
2492   - lists.add(s);
2493   - }else{
2494   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
2495   - lists.add(s);
2496   - }
  2495 + if (cts != null && cts.size() > 0) {
  2496 + lists.add(s);
  2497 + } else {
  2498 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  2499 + lists.add(s);
  2500 + }
2497 2501 }
2498 2502 }
2499 2503 Map<String, Object> map = new HashMap<String, Object>();
2500 2504 map.put("xlName", xlName);
2501   - double jhlc=culateService.culateJhgl(list_s);
2502   - map.put("jhlc",jhlc);
2503   - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
2504   - double lbgl=culateService.culateLbgl(list_s);
  2505 + double jhlc = culateService.culateJhgl(list_s);
  2506 + map.put("jhlc", jhlc);
  2507 + map.put("sjgl", Arith.add(culateService.culateSjgl(lists), culateService.culateLjgl(lists)));
  2508 + double lbgl = culateService.culateLbgl(list_s);
2505 2509 map.put("ssgl", lbgl);
2506 2510 map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));
2507 2511 map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));
... ... @@ -2513,70 +2517,70 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2513 2517 map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));
2514 2518 map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));
2515 2519 map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));
2516   - double ssgl_pc=culateService.culateCJLC(list_s, "配车");
2517   - double ssgl_by=culateService.culateCJLC(list_s, "保养");
2518   - double ssgl_cj=culateService.culateCJLC(list_s, "抽减");
2519   - double ssgl_qt=culateService.culateCJLC(list_s, "其他");
2520   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
  2520 + double ssgl_pc = culateService.culateCJLC(list_s, "配车");
  2521 + double ssgl_by = culateService.culateCJLC(list_s, "保养");
  2522 + double ssgl_cj = culateService.culateCJLC(list_s, "抽减");
  2523 + double ssgl_qt = culateService.culateCJLC(list_s, "其他");
  2524 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
2521 2525 map.put("ssbc", culateService.culateLbbc(list_s));
2522   - double ljgl=culateService.culateLjgl(lists);
  2526 + double ljgl = culateService.culateLjgl(lists);
2523 2527 map.put("ljgl", ljgl);
2524   - map.put("jhbc", culateService.culateJhbc(list_s,""));
  2528 + map.put("jhbc", culateService.culateJhbc(list_s, ""));
2525 2529 map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));
2526 2530 map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));
2527   - map.put("sjbc", culateService.culateSjbc(lists,""));
2528   - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
2529   - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
2530   - map.put("ljbc", culateService.culateLjbc(lists,""));
2531   - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
2532   - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
  2531 + map.put("sjbc", culateService.culateSjbc(lists, ""));
  2532 + map.put("sjbc_m", culateService.culateSjbc(lists, "zgf"));
  2533 + map.put("sjbc_a", culateService.culateSjbc(lists, "wgf"));
  2534 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  2535 + map.put("ljbc_m", culateService.culateLjbc(lists, "zgf"));
  2536 + map.put("ljbc_a", culateService.culateLjbc(lists, "wgf"));
2533 2537 map.put("fzbc", culateService.culateFzbc(lists, ""));
2534 2538 map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
2535   - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  2539 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
2536 2540 map.put("dtbc", 0);
2537 2541 map.put("dtbc_m", 0);
2538 2542 map.put("dtbc_a", 0);
2539   - Map<String, Object> m=culateService.culateDjg(list_s, line);
  2543 + Map<String, Object> m = culateService.culateDjg(list_s, line);
2540 2544 map.put("djg", m.get("djgcsq"));
2541 2545 map.put("djg_m", m.get("djgcsz"));
2542 2546 map.put("djg_a", m.get("djgcsw"));
2543 2547 map.put("djg_time", m.get("djgsj"));
2544 2548 map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));
2545 2549 lMap.add(map);
2546   -
2547   - if(date.length() == 10){
2548   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
2549   - String dbdp = "";
2550   - try {
2551   - for (int i = 0; i < list.size(); i++) {
2552   - DutyEmployee t = list.get(i);
2553   - if(dbdp.indexOf(t.getuName()) == -1){
2554   - if(!(dbdp.length()>0)){
2555   - dbdp =t.getuName();
2556   - }else{
2557   - dbdp +=","+t.getuName();
2558   - }
2559   - }
2560   - }
2561   - } catch (Exception e) {
2562   - // TODO: handle exception
2563   - e.printStackTrace();
2564   - }
2565   - map.put("dbdp", dbdp);
2566   - }
2567   -
  2550 +
  2551 + if (date.length() == 10) {
  2552 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
  2553 + String dbdp = "";
  2554 + try {
  2555 + for (int i = 0; i < list.size(); i++) {
  2556 + DutyEmployee t = list.get(i);
  2557 + if (dbdp.indexOf(t.getuName()) == -1) {
  2558 + if (!(dbdp.length() > 0)) {
  2559 + dbdp = t.getuName();
  2560 + } else {
  2561 + dbdp += "," + t.getuName();
  2562 + }
  2563 + }
  2564 + }
  2565 + } catch (Exception e) {
  2566 + // TODO: handle exception
  2567 + e.printStackTrace();
  2568 + }
  2569 + map.put("dbdp", dbdp);
  2570 + }
  2571 +
2568 2572 return lMap;
2569 2573 }
2570 2574  
2571 2575 @Override
2572 2576 public List<Map<String, Object>> statisticsDaily_mh_2(String line, String date,
2573   - String xlName, String type) {
2574   - List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();
2575   - List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
2576   - List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();
  2577 + String xlName, String type) {
  2578 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2579 + List<ScheduleRealInfo> list_s = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  2580 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2577 2581 for (int i = 0; i < list_s.size(); i++) {
2578   - ScheduleRealInfo s=list_s.get(i);
2579   - if(s.isDestroy() && s.isReissue()){
  2582 + ScheduleRealInfo s = list_s.get(i);
  2583 + if (s.isDestroy() && s.isReissue()) {
2580 2584 s.setRemark("");
2581 2585 s.setFcsjActual(s.getDfsj());
2582 2586 s.setZdsjActual(s.getZdsj());
... ... @@ -2585,20 +2589,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2585 2589 }
2586 2590  
2587 2591 Set<ChildTaskPlan> cts = s.getcTasks();
2588   - if(cts != null && cts.size() > 0){
  2592 + if (cts != null && cts.size() > 0) {
2589 2593 lists.add(s);
2590   - }else{
2591   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  2594 + } else {
  2595 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
2592 2596 lists.add(s);
2593 2597 }
2594 2598 }
2595 2599 }
2596 2600 Map<String, Object> map = new HashMap<String, Object>();
2597 2601 map.put("xlName", xlName);
2598   - double jhlc=culateService.culateJhgl(list_s);
2599   - map.put("jhlc",jhlc);
2600   - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
2601   - double lbgl=culateService.culateLbgl(list_s);
  2602 + double jhlc = culateService.culateJhgl(list_s);
  2603 + map.put("jhlc", jhlc);
  2604 + map.put("sjgl", Arith.add(culateService.culateSjgl(lists), culateService.culateLjgl(lists)));
  2605 + double lbgl = culateService.culateLbgl(list_s);
2602 2606 map.put("ssgl", lbgl);
2603 2607 map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));
2604 2608 map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));
... ... @@ -2610,26 +2614,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2610 2614 map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));
2611 2615 map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));
2612 2616 map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));
2613   - double ssgl_pc=culateService.culateCJLC(list_s, "配车");
2614   - double ssgl_by=culateService.culateCJLC(list_s, "保养");
2615   - double ssgl_cj=culateService.culateCJLC(list_s, "抽减");
2616   - double ssgl_qt=culateService.culateCJLC(list_s, "其他");
2617   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
  2617 + double ssgl_pc = culateService.culateCJLC(list_s, "配车");
  2618 + double ssgl_by = culateService.culateCJLC(list_s, "保养");
  2619 + double ssgl_cj = culateService.culateCJLC(list_s, "抽减");
  2620 + double ssgl_qt = culateService.culateCJLC(list_s, "其他");
  2621 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
2618 2622 map.put("ssbc", culateService.culateLbbc(list_s));
2619   - double ljgl=culateService.culateLjgl(lists);
  2623 + double ljgl = culateService.culateLjgl(lists);
2620 2624 map.put("ljgl", ljgl);
2621   - map.put("jhbc", culateService.culateJhbc(list_s,""));
  2625 + map.put("jhbc", culateService.culateJhbc(list_s, ""));
2622 2626 map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));
2623 2627 map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));
2624   - map.put("sjbc", culateService.culateSjbc(lists,""));
2625   - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
2626   - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
2627   - map.put("ljbc", culateService.culateLjbc(lists,""));
2628   - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
2629   - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
  2628 + map.put("sjbc", culateService.culateSjbc(lists, ""));
  2629 + map.put("sjbc_m", culateService.culateSjbc(lists, "zgf"));
  2630 + map.put("sjbc_a", culateService.culateSjbc(lists, "wgf"));
  2631 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  2632 + map.put("ljbc_m", culateService.culateLjbc(lists, "zgf"));
  2633 + map.put("ljbc_a", culateService.culateLjbc(lists, "wgf"));
2630 2634 map.put("fzbc", culateService.culateFzbc(lists, ""));
2631 2635 map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
2632   - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  2636 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
2633 2637 map.put("dtbc", 0);
2634 2638 map.put("dtbc_m", 0);
2635 2639 map.put("dtbc_a", 0);
... ... @@ -2642,175 +2646,175 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2642 2646 return lMap;
2643 2647 }
2644 2648  
2645   - public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){
2646   -
2647   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
2648   - for(int i=0;i<list.size();i++){
2649   - ScheduleRealInfo s=list.get(i);
  2649 + public final Map<String, Object> staticTj(List<ScheduleRealInfo> list) {
  2650 +
  2651 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  2652 + for (int i = 0; i < list.size(); i++) {
  2653 + ScheduleRealInfo s = list.get(i);
2650 2654 Set<ChildTaskPlan> cts = s.getcTasks();
2651   - if(cts != null && cts.size() > 0){
2652   - lists.add(s);
2653   - }else{
2654   - if(s.getZdsjActual()!=null&& s.getFcsjActual()!=null){
2655   - lists.add(s);
2656   - }
  2655 + if (cts != null && cts.size() > 0) {
  2656 + lists.add(s);
  2657 + } else {
  2658 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  2659 + lists.add(s);
  2660 + }
2657 2661 }
2658 2662 }
2659 2663 Map<String, Object> map = new HashMap<String, Object>();
2660   - if(list.size()>0){
2661   - map.put("xlName", list.get(0).getXlName());
2662   - try {
2663   - map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getXlName(), "" , PinyinFormat.WITHOUT_TONE));
2664   - } catch (PinyinException e) {
2665   - // TODO Auto-generated catch block
2666   - e.printStackTrace();
2667   - }
2668   - double jhyygl=culateService.culateJhgl(list);//计划营运公里
2669   - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2670   - map.put("jhlc", jhyygl);
2671   - map.put("jcclc", jhjcclc);
2672   - map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2673   -
2674   - double ljgl= culateService.culateLjgl(lists);
2675   - double sjyygl= culateService.culateSjgl(lists);
2676   - double zyygl= Arith.add(sjyygl,ljgl);
2677   -
2678   - double sjjccgl=culateService.culateJccgl(lists);
2679   - double sjksgl=culateService.culateKsgl(lists);
2680   - double zksgl=Arith.add(sjjccgl, sjksgl);
2681   - map.put("sjzgl", Arith.add(zyygl, zksgl));
2682   - map.put("sjgl",zyygl);
2683   - map.put("sjksgl", zksgl);
2684   - double ssgl= culateService.culateLbgl(list);
2685   - map.put("ssgl", ssgl);
2686   -
2687   - //计划+临加-少驶=实驶
2688   - double jl=Arith.sub(Arith.add(jhyygl, ljgl),ssgl);
2689   - if(jl==zyygl){
2690   - map.put("zt", 0);
2691   - }else{
2692   - map.put("zt", 1);
2693   - }
2694   -
2695   - map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
2696   - map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
2697   - map.put("ssgl_gz", culateService.culateCJLC(list, "故障"));
2698   - map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷"));
2699   - map.put("ssgl_zs", culateService.culateCJLC(list, "肇事"));
2700   - map.put("ssgl_qr", culateService.culateCJLC(list, "缺人"));
2701   - map.put("ssgl_qc", culateService.culateCJLC(list, "缺车"));
2702   - map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
2703   - map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
2704   - map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
2705   - double ssgl_pc=culateService.culateCJLC(list, "配车");
2706   - double ssgl_by=culateService.culateCJLC(list, "保养");
2707   - double ssgl_cj=culateService.culateCJLC(list, "抽减");
2708   - double ssgl_qt=culateService.culateCJLC(list, "其他");
2709   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
2710   - map.put("ssbc", culateService.culateLbbc(list));
2711   - map.put("ljgl", ljgl);
2712   - map.put("jhbc", culateService.culateJhbc(list,""));
2713   - map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
2714   - map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
2715   - map.put("sjbc", culateService.culateSjbc(lists,""));
2716   - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
2717   - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
2718   - map.put("ljbc", culateService.culateLjbc(lists,""));
2719   - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
2720   - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
2721   - map.put("fzbc", culateService.culateFzbc(lists, ""));
2722   - map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
2723   - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
2724   - map.put("dtbc", 0);
2725   - map.put("dtbc_m", 0);
2726   - map.put("dtbc_a", 0);
2727   - Map<String, Object> m_=culateService.culateDjg(lists, list.get(0).getXlBm());
2728   - map.put("djg", m_.get("djgcsq"));
2729   - map.put("djg_m", m_.get("djgcsz"));
2730   - map.put("djg_a", m_.get("djgcsw"));
2731   - map.put("djg_time", m_.get("djgsj"));
2732   - }
  2664 + if (list.size() > 0) {
  2665 + map.put("xlName", list.get(0).getXlName());
  2666 + try {
  2667 + map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getXlName(), "", PinyinFormat.WITHOUT_TONE));
  2668 + } catch (PinyinException e) {
  2669 + // TODO Auto-generated catch block
  2670 + e.printStackTrace();
  2671 + }
  2672 + double jhyygl = culateService.culateJhgl(list);//计划营运公里
  2673 + double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2674 + map.put("jhlc", jhyygl);
  2675 + map.put("jcclc", jhjcclc);
  2676 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
  2677 +
  2678 + double ljgl = culateService.culateLjgl(lists);
  2679 + double sjyygl = culateService.culateSjgl(lists);
  2680 + double zyygl = Arith.add(sjyygl, ljgl);
  2681 +
  2682 + double sjjccgl = culateService.culateJccgl(lists);
  2683 + double sjksgl = culateService.culateKsgl(lists);
  2684 + double zksgl = Arith.add(sjjccgl, sjksgl);
  2685 + map.put("sjzgl", Arith.add(zyygl, zksgl));
  2686 + map.put("sjgl", zyygl);
  2687 + map.put("sjksgl", zksgl);
  2688 + double ssgl = culateService.culateLbgl(list);
  2689 + map.put("ssgl", ssgl);
  2690 +
  2691 + //计划+临加-少驶=实驶
  2692 + double jl = Arith.sub(Arith.add(jhyygl, ljgl), ssgl);
  2693 + if (jl == zyygl) {
  2694 + map.put("zt", 0);
  2695 + } else {
  2696 + map.put("zt", 1);
  2697 + }
  2698 +
  2699 + map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
  2700 + map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
  2701 + map.put("ssgl_gz", culateService.culateCJLC(list, "故障"));
  2702 + map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷"));
  2703 + map.put("ssgl_zs", culateService.culateCJLC(list, "肇事"));
  2704 + map.put("ssgl_qr", culateService.culateCJLC(list, "缺人"));
  2705 + map.put("ssgl_qc", culateService.culateCJLC(list, "缺车"));
  2706 + map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
  2707 + map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
  2708 + map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
  2709 + double ssgl_pc = culateService.culateCJLC(list, "配车");
  2710 + double ssgl_by = culateService.culateCJLC(list, "保养");
  2711 + double ssgl_cj = culateService.culateCJLC(list, "抽减");
  2712 + double ssgl_qt = culateService.culateCJLC(list, "其他");
  2713 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
  2714 + map.put("ssbc", culateService.culateLbbc(list));
  2715 + map.put("ljgl", ljgl);
  2716 + map.put("jhbc", culateService.culateJhbc(list, ""));
  2717 + map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
  2718 + map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
  2719 + map.put("sjbc", culateService.culateSjbc(lists, ""));
  2720 + map.put("sjbc_m", culateService.culateSjbc(lists, "zgf"));
  2721 + map.put("sjbc_a", culateService.culateSjbc(lists, "wgf"));
  2722 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  2723 + map.put("ljbc_m", culateService.culateLjbc(lists, "zgf"));
  2724 + map.put("ljbc_a", culateService.culateLjbc(lists, "wgf"));
  2725 + map.put("fzbc", culateService.culateFzbc(lists, ""));
  2726 + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
  2727 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  2728 + map.put("dtbc", 0);
  2729 + map.put("dtbc_m", 0);
  2730 + map.put("dtbc_a", 0);
  2731 + Map<String, Object> m_ = culateService.culateDjg(lists, list.get(0).getXlBm());
  2732 + map.put("djg", m_.get("djgcsq"));
  2733 + map.put("djg_m", m_.get("djgcsz"));
  2734 + map.put("djg_a", m_.get("djgcsw"));
  2735 + map.put("djg_time", m_.get("djgsj"));
  2736 + }
2733 2737 return map;
2734 2738 }
2735 2739  
2736 2740 @Override
2737   - public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2,
  2741 + public List<Map<String, Object>> statisticsDailyTj(String gsdm, String fgsdm, String line, String date, String date2,
2738 2742 String xlName, String type) {
2739 2743 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2740 2744 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2741 2745 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2742   - line =line.trim();
2743   - if(line.equals("")){
  2746 + line = line.trim();
  2747 + if (line.equals("")) {
2744 2748 //查询所有线路
2745   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
2746   - }else{
  2749 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  2750 + } else {
2747 2751 //查询单条线路
2748   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
  2752 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
2749 2753 }
2750 2754 for (int i = 0; i < list.size(); i++) {
2751   - ScheduleRealInfo s=list.get(i);
  2755 + ScheduleRealInfo s = list.get(i);
2752 2756 Set<ChildTaskPlan> cts = s.getcTasks();
2753   - if(cts != null && cts.size() > 0){
2754   - list_s.add(s);
2755   - }else{
2756   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
2757   - list_s.add(s);
2758   - }
  2757 + if (cts != null && cts.size() > 0) {
  2758 + list_s.add(s);
  2759 + } else {
  2760 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  2761 + list_s.add(s);
  2762 + }
2759 2763 }
2760 2764 }
2761 2765 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2762 2766 for (int i = 0; i < list.size(); i++) {
2763   - if(i<list.size()-1){
2764   - if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){
  2767 + if (i < list.size() - 1) {
  2768 + if (list.get(i + 1).getXlBm().equals(list.get(i).getXlBm())) {
2765 2769 lists.add(list.get(i));
2766   - }else{
  2770 + } else {
2767 2771 lists.add(list.get(i));
2768   - Map<String, Object> map=staticTj(lists);
  2772 + Map<String, Object> map = staticTj(lists);
2769 2773 lMap.add(map);
2770   - lists=new ArrayList<ScheduleRealInfo>();
  2774 + lists = new ArrayList<ScheduleRealInfo>();
2771 2775 }
2772   - }else{
2773   - if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){
  2776 + } else {
  2777 + if (list.get(i).getXlBm().equals(list.get(i - 1).getXlBm())) {
2774 2778 lists.add(list.get(i));
2775   - Map<String, Object> map=staticTj(lists);
  2779 + Map<String, Object> map = staticTj(lists);
2776 2780 lMap.add(map);
2777   - }else{
2778   - lists=new ArrayList<ScheduleRealInfo>();
  2781 + } else {
  2782 + lists = new ArrayList<ScheduleRealInfo>();
2779 2783 lists.add(list.get(i));
2780   - Map<String, Object> map=staticTj(lists);
  2784 + Map<String, Object> map = staticTj(lists);
2781 2785 lMap.add(map);
2782 2786 }
2783 2787 }
2784 2788 }
2785   -
2786   - Collections.sort(lMap,new AccountXlbm());
  2789 +
  2790 + Collections.sort(lMap, new AccountXlbm());
2787 2791 Map<String, Object> map = new HashMap<String, Object>();
2788 2792 map.put("xlName", "合计");
2789   - double jhyygl=culateService.culateJhgl(list);//计划营运公里
2790   - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2793 + double jhyygl = culateService.culateJhgl(list);//计划营运公里
  2794 + double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2791 2795 map.put("jhlc", jhyygl);
2792 2796 map.put("jcclc", jhjcclc);
2793 2797 map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2794 2798  
2795   - double ljgl= culateService.culateLjgl(list_s);
2796   - double sjyygl= culateService.culateSjgl(list_s);
2797   - double zyygl= Arith.add(sjyygl,ljgl);
  2799 + double ljgl = culateService.culateLjgl(list_s);
  2800 + double sjyygl = culateService.culateSjgl(list_s);
  2801 + double zyygl = Arith.add(sjyygl, ljgl);
2798 2802  
2799   - double sjjccgl=culateService.culateJccgl(list_s);
2800   - double sjksgl=culateService.culateKsgl(list_s);
2801   - double zksgl=Arith.add(sjjccgl, sjksgl);
  2803 + double sjjccgl = culateService.culateJccgl(list_s);
  2804 + double sjksgl = culateService.culateKsgl(list_s);
  2805 + double zksgl = Arith.add(sjjccgl, sjksgl);
2802 2806 map.put("sjzgl", Arith.add(zyygl, zksgl));
2803   - map.put("sjgl",zyygl);
  2807 + map.put("sjgl", zyygl);
2804 2808 map.put("sjksgl", zksgl);
2805   -
2806   - double ssgl= culateService.culateLbgl(list);
  2809 +
  2810 + double ssgl = culateService.culateLbgl(list);
2807 2811 map.put("ssgl", ssgl);
2808 2812 //计划+临加-少驶=实驶
2809   - double jl=Arith.sub(Arith.add(jhyygl, ljgl),ssgl);
2810   - if(jl==zyygl){
2811   - map.put("zt", 0);
2812   - }else{
2813   - map.put("zt", 1);
  2813 + double jl = Arith.sub(Arith.add(jhyygl, ljgl), ssgl);
  2814 + if (jl == zyygl) {
  2815 + map.put("zt", 0);
  2816 + } else {
  2817 + map.put("zt", 1);
2814 2818 }
2815 2819 map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
2816 2820 map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
... ... @@ -2822,58 +2826,58 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2822 2826 map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
2823 2827 map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
2824 2828 map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
2825   - double ssgl_pc=culateService.culateCJLC(list, "配车");
2826   - double ssgl_by=culateService.culateCJLC(list, "保养");
2827   - double ssgl_cj=culateService.culateCJLC(list, "抽减");
2828   - double ssgl_qt=culateService.culateCJLC(list, "其他");
2829   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
2830   -
  2829 + double ssgl_pc = culateService.culateCJLC(list, "配车");
  2830 + double ssgl_by = culateService.culateCJLC(list, "保养");
  2831 + double ssgl_cj = culateService.culateCJLC(list, "抽减");
  2832 + double ssgl_qt = culateService.culateCJLC(list, "其他");
  2833 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
  2834 +
2831 2835 map.put("ssbc", culateService.culateLbbc(list));
2832 2836 map.put("ljgl", ljgl);
2833   - map.put("jhbc", culateService.culateJhbc(list,""));
  2837 + map.put("jhbc", culateService.culateJhbc(list, ""));
2834 2838 map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
2835 2839 map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
2836   - map.put("sjbc", culateService.culateSjbc(list_s,""));
2837   - map.put("sjbc_m", culateService.culateSjbc(list_s,"zgf"));
2838   - map.put("sjbc_a", culateService.culateSjbc(list_s,"wgf"));
2839   - map.put("ljbc", culateService.culateLjbc(list_s,""));
2840   - map.put("ljbc_m", culateService.culateLjbc(list_s,"zgf"));
2841   - map.put("ljbc_a", culateService.culateLjbc(list_s,"wgf"));
  2840 + map.put("sjbc", culateService.culateSjbc(list_s, ""));
  2841 + map.put("sjbc_m", culateService.culateSjbc(list_s, "zgf"));
  2842 + map.put("sjbc_a", culateService.culateSjbc(list_s, "wgf"));
  2843 + map.put("ljbc", culateService.culateLjbc(list_s, ""));
  2844 + map.put("ljbc_m", culateService.culateLjbc(list_s, "zgf"));
  2845 + map.put("ljbc_a", culateService.culateLjbc(list_s, "wgf"));
2842 2846 map.put("fzbc", culateService.culateFzbc(list_s, ""));
2843 2847 map.put("fzbc_m", culateService.culateFzbc(list_s, "zgf"));
2844   - map.put("fzbc_a", culateService.culateFzbc(list_s, "wgf"));
  2848 + map.put("fzbc_a", culateService.culateFzbc(list_s, "wgf"));
2845 2849 map.put("dtbc", 0);
2846 2850 map.put("dtbc_m", 0);
2847 2851 map.put("dtbc_a", 0);
2848   - if(list.size()>0){
2849   - int djg = 0, djg_m = 0, djg_a = 0, djg_time = 0;
2850   - for(Map<String, Object> m : lMap){
2851   - if(m.containsKey("djg") && m.get("djg") != null)
2852   - djg += Integer.valueOf(m.get("djg").toString());
2853   - if(m.containsKey("djg_m") && m.get("djg_m") != null)
2854   - djg_m += Integer.valueOf(m.get("djg_m").toString());
2855   - if(m.containsKey("djg_a") && m.get("djg_a") != null)
2856   - djg_a += Integer.valueOf(m.get("djg_a").toString());
2857   - if(m.containsKey("djg_time") && m.get("djg_time") != null){
2858   - int t = Integer.valueOf(m.get("djg_time").toString());
2859   - if(t > djg_time)
2860   - djg_time = t;
2861   - }
2862   - }
2863   - map.put("djg", djg);
2864   - map.put("djg_m", djg_m);
2865   - map.put("djg_a", djg_a);
2866   - map.put("djg_time", djg_time);
  2852 + if (list.size() > 0) {
  2853 + int djg = 0, djg_m = 0, djg_a = 0, djg_time = 0;
  2854 + for (Map<String, Object> m : lMap) {
  2855 + if (m.containsKey("djg") && m.get("djg") != null)
  2856 + djg += Integer.valueOf(m.get("djg").toString());
  2857 + if (m.containsKey("djg_m") && m.get("djg_m") != null)
  2858 + djg_m += Integer.valueOf(m.get("djg_m").toString());
  2859 + if (m.containsKey("djg_a") && m.get("djg_a") != null)
  2860 + djg_a += Integer.valueOf(m.get("djg_a").toString());
  2861 + if (m.containsKey("djg_time") && m.get("djg_time") != null) {
  2862 + int t = Integer.valueOf(m.get("djg_time").toString());
  2863 + if (t > djg_time)
  2864 + djg_time = t;
  2865 + }
  2866 + }
  2867 + map.put("djg", djg);
  2868 + map.put("djg_m", djg_m);
  2869 + map.put("djg_a", djg_a);
  2870 + map.put("djg_time", djg_time);
2867 2871 // Map<String, Object> m_=culateService.culateDjg(list_s, list.get(0).getXlBm());
2868 2872 // map.put("djg", m_.get("djgcsq"));
2869 2873 // map.put("djg_m", m_.get("djgcsz"));
2870 2874 // map.put("djg_a", m_.get("djgcsw"));
2871 2875 // map.put("djg_time", m_.get("djgsj"));
2872   - }else{
2873   - map.put("djg", "0");
2874   - map.put("djg_m", "0");
2875   - map.put("djg_a", "0");
2876   - map.put("djg_time", "0");
  2876 + } else {
  2877 + map.put("djg", "0");
  2878 + map.put("djg_m", "0");
  2879 + map.put("djg_a", "0");
  2880 + map.put("djg_time", "0");
2877 2881 }
2878 2882 lMap.add(map);
2879 2883 if (type != null && type.length() != 0 && type.equals("export")) {
... ... @@ -2881,16 +2885,16 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2881 2885 sdfSimple = new SimpleDateFormat("yyyyMMdd");
2882 2886 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2883 2887 Map<String, Object> m = new HashMap<String, Object>();
2884   - m.put("date", date+"至"+date2);
  2888 + m.put("date", date + "至" + date2);
2885 2889 ReportUtils ee = new ReportUtils();
2886 2890 try {
2887   - String dateTime = "";
2888   - if(date.equals(date2)){
2889   - dateTime = sdfSimple.format(sdfMonth.parse(date));
2890   - } else {
2891   - dateTime = sdfSimple.format(sdfMonth.parse(date))
2892   - +"-"+sdfSimple.format(sdfMonth.parse(date2));
2893   - }
  2891 + String dateTime = "";
  2892 + if (date.equals(date2)) {
  2893 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  2894 + } else {
  2895 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  2896 + + "-" + sdfSimple.format(sdfMonth.parse(date2));
  2897 + }
2894 2898 listI.add(lMap.iterator());
2895 2899 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2896 2900 ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
... ... @@ -2898,7 +2902,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2898 2902 } catch (Exception e) {
2899 2903 // TODO: handle exception
2900 2904 //e.printStackTrace();
2901   - logger.info("" , e);
  2905 + logger.info("", e);
2902 2906 }
2903 2907 }
2904 2908  
... ... @@ -3084,17 +3088,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3084 3088 }
3085 3089 }
3086 3090 }
3087   -
  3091 +
3088 3092 for (int i = 0; i < newList.size(); i++) {
3089   - ScheduleRealInfo t1=newList.get(i);
3090   - String reamrks1=t1.getRemarks()==null?"":t1.getRemarks();
3091   - if(reamrks1.length()>4){
3092   - t1.setRemarks(reamrks1.substring(0,4));
3093   - t1.setRemark(reamrks1);
3094   - }else{
3095   - t1.setRemark(reamrks1);
3096   - }
3097   - }
  3093 + ScheduleRealInfo t1 = newList.get(i);
  3094 + String reamrks1 = t1.getRemarks() == null ? "" : t1.getRemarks();
  3095 + if (reamrks1.length() > 4) {
  3096 + t1.setRemarks(reamrks1.substring(0, 4));
  3097 + t1.setRemark(reamrks1);
  3098 + } else {
  3099 + t1.setRemark(reamrks1);
  3100 + }
  3101 + }
3098 3102 return newList;
3099 3103 }
3100 3104  
... ... @@ -3108,8 +3112,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3108 3112 String zdsjActual1 = "";
3109 3113 List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);
3110 3114  
3111   - for(ScheduleRealInfo s : listInfo){
3112   - if(s.isDestroy() && s.isReissue()){
  3115 + for (ScheduleRealInfo s : listInfo) {
  3116 + if (s.isDestroy() && s.isReissue()) {
3113 3117 s.setRemark("");
3114 3118 s.setFcsjActual(s.getDfsj());
3115 3119 s.setZdsjActual(s.getZdsj());
... ... @@ -3225,66 +3229,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3225 3229 return list;
3226 3230 }
3227 3231  
3228   - public List<Map<String, Object>> yesterdayDataList(String line, String date,String gsbm,String fgsbm,String jGh,String nbbm) {
  3232 + public List<Map<String, Object>> yesterdayDataList(String line, String date, String gsbm, String fgsbm, String jGh, String nbbm) {
3229 3233 List<Map<String, Object>> yesterdayDataList = new ArrayList<Map<String, Object>>();
3230   - if(line.equals("")){
3231   - yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList(line, date,gsbm,fgsbm,nbbm);
3232   - }else{
3233   - yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList_eq(line, date,gsbm,fgsbm,nbbm);
  3234 + if (line.equals("")) {
  3235 + yesterdayDataList = scheduleRealInfoRepository.yesterdayDataList(line, date, gsbm, fgsbm, nbbm);
  3236 + } else {
  3237 + yesterdayDataList = scheduleRealInfoRepository.yesterdayDataList_eq(line, date, gsbm, fgsbm, nbbm);
3234 3238 }
3235   - List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
  3239 + List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date, gsbm, fgsbm);
3236 3240 for (int x = 0; x < yesterdayDataList.size(); x++) {
3237 3241 String jName = yesterdayDataList.get(x).get("jGh").toString();
3238 3242 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
3239   - String xlbm = yesterdayDataList.get(x).get("xlBm").toString();
3240   - String lp =yesterdayDataList.get(x).get("lpName").toString();
  3243 + String xlbm = yesterdayDataList.get(x).get("xlBm").toString();
  3244 + String lp = yesterdayDataList.get(x).get("lpName").toString();
3241 3245 Map<String, Object> map = new HashMap<String, Object>();
3242 3246 boolean fage = true;
3243   - String company="";
3244   - String bCompany="";
3245   - List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>();
  3247 + String company = "";
  3248 + String bCompany = "";
  3249 + List<ScheduleRealInfo> listS = new ArrayList<ScheduleRealInfo>();
3246 3250 for (ScheduleRealInfo scheduleRealInfo : lists) {
3247   - if(scheduleRealInfo.getjGh().equals(jName)
3248   - && scheduleRealInfo.getClZbh().equals(clZbh)
3249   - && scheduleRealInfo.getXlBm().equals(xlbm)
3250   - && scheduleRealInfo.getLpName().equals(lp)){
  3251 + if (scheduleRealInfo.getjGh().equals(jName)
  3252 + && scheduleRealInfo.getClZbh().equals(clZbh)
  3253 + && scheduleRealInfo.getXlBm().equals(xlbm)
  3254 + && scheduleRealInfo.getLpName().equals(lp)) {
3251 3255 if (fage) {
3252 3256 //根据线路代码获取公司
3253   - company=scheduleRealInfo.getGsBm();
3254   - bCompany=scheduleRealInfo.getFgsBm();
  3257 + company = scheduleRealInfo.getGsBm();
  3258 + bCompany = scheduleRealInfo.getFgsBm();
3255 3259 fage = false;
3256 3260 }
3257   - Set<ChildTaskPlan> cts = scheduleRealInfo.getcTasks();
3258   - if(cts != null && cts.size() > 0){
3259   - listS.add(scheduleRealInfo);
3260   - }else{
3261   - if(scheduleRealInfo.getZdsjActual()!=null && scheduleRealInfo.getFcsjActual()!=null){
3262   - listS.add(scheduleRealInfo);
3263   - }
  3261 + Set<ChildTaskPlan> cts = scheduleRealInfo.getcTasks();
  3262 + if (cts != null && cts.size() > 0) {
  3263 + listS.add(scheduleRealInfo);
  3264 + } else {
  3265 + if (scheduleRealInfo.getZdsjActual() != null && scheduleRealInfo.getFcsjActual() != null) {
  3266 + listS.add(scheduleRealInfo);
  3267 + }
3264 3268 }
3265 3269 }
3266 3270 }
3267 3271 yesterdayDataList.get(x).put("company", company);
3268 3272 yesterdayDataList.get(x).put("bCompany", bCompany);
3269   - Double ljgl=culateMieageService.culateLjgl(listS);
3270   - Double sjgl=culateMieageService.culateSjgl(listS);
3271   - Double ksgl=culateMieageService.culateKsgl(listS);
3272   - Double jccgl=culateMieageService.culateJccgl(listS);
3273   - Double zyygl=Arith.add(sjgl, ljgl);
3274   - Double zksgl=Arith.add(ksgl, jccgl);
3275   - Double zlc=Arith.add(zyygl, zksgl);
  3273 + Double ljgl = culateMieageService.culateLjgl(listS);
  3274 + Double sjgl = culateMieageService.culateSjgl(listS);
  3275 + Double ksgl = culateMieageService.culateKsgl(listS);
  3276 + Double jccgl = culateMieageService.culateJccgl(listS);
  3277 + Double zyygl = Arith.add(sjgl, ljgl);
  3278 + Double zksgl = Arith.add(ksgl, jccgl);
  3279 + Double zlc = Arith.add(zyygl, zksgl);
3276 3280 yesterdayDataList.get(x).put("totalKilometers", zlc);
3277 3281  
3278 3282 }
3279 3283 //增加顺序号
3280 3284 for (int i = 0; i < yesterdayDataList.size(); i++) {
3281 3285 if (i == 0) {
3282   - yesterdayDataList.get(i).put("seqNumber", 1);
  3286 + yesterdayDataList.get(i).put("seqNumber", 1);
3283 3287 } else {
3284 3288 if (yesterdayDataList.get(i - 1).get("clZbh").equals(yesterdayDataList.get(i).get("clZbh"))) {
3285   - yesterdayDataList.get(i).put("seqNumber", 1 + (int) yesterdayDataList.get(i - 1).get("seqNumber"));
  3289 + yesterdayDataList.get(i).put("seqNumber", 1 + (int) yesterdayDataList.get(i - 1).get("seqNumber"));
3286 3290 } else {
3287   - yesterdayDataList.get(i).put("seqNumber", 1);
  3291 + yesterdayDataList.get(i).put("seqNumber", 1);
3288 3292 }
3289 3293 }
3290 3294 }
... ... @@ -3303,7 +3307,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3303 3307 ScheduleRealInfo sch;
3304 3308 //StringBuilder sb = new StringBuilder();
3305 3309  
3306   - String jGh = null,jName,sGh,sName;
  3310 + String jGh = null, jName, sGh, sName;
3307 3311 for (ChangePersonCar cpc : cpcs) {
3308 3312 //sb = new StringBuilder();
3309 3313  
... ... @@ -3312,12 +3316,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3312 3316 continue;
3313 3317  
3314 3318 if (cpc.getClZbh() != null) {
3315   - if(!carExist(sch.getGsBm(), cpc.getClZbh())) {
  3319 + if (!carExist(sch.getGsBm(), cpc.getClZbh())) {
3316 3320 rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!");
3317 3321 rs.put("status", ResponseCode.ERROR);
3318 3322 return rs;
3319   - }
3320   - else if(!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(cpc.getClZbh()))){
  3323 + } else if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(cpc.getClZbh()))) {
3321 3324 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + cpc.getClZbh() + "】的车辆");
3322 3325 rs.put("status", ResponseCode.ERROR);
3323 3326 return rs;
... ... @@ -3327,7 +3330,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3327 3330 if (StringUtils.isNotEmpty(cpc.getJsy())) {
3328 3331 jGh = cpc.getJsy().split("/")[0];
3329 3332 jName = getPersonName(sch.getGsBm(), jGh);
3330   - if(StringUtils.isEmpty(jName)){
  3333 + if (StringUtils.isEmpty(jName)) {
3331 3334 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员");
3332 3335 rs.put("status", ResponseCode.ERROR);
3333 3336 return rs;
... ... @@ -3344,17 +3347,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3344 3347 /*if(!jGh.equals(sch.getjGh()))
3345 3348 sb.append(sch.getjGh() + " 换 " + jGh + ";");*/
3346 3349 //换驾驶员
3347   - if(persoChange(sch, jGh))
  3350 + if (persoChange(sch, jGh))
3348 3351 set.add(sch);
3349 3352 }
3350 3353  
3351 3354 //换售票员
3352 3355 if (StringUtils.isNotEmpty(cpc.getSpy())
3353   - && cpc.getSpy().indexOf("/")!=-1
  3356 + && cpc.getSpy().indexOf("/") != -1
3354 3357 && cpc.getSpy().length() > 1) {
3355 3358 sGh = cpc.getSpy().split("/")[0];
3356 3359 sName = getPersonName(sch.getGsBm(), sGh);
3357   - if(StringUtils.isEmpty(sName)){
  3360 + if (StringUtils.isEmpty(sName)) {
3358 3361 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员");
3359 3362 rs.put("status", ResponseCode.ERROR);
3360 3363 return rs;
... ... @@ -3362,10 +3365,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3362 3365  
3363 3366 /*if(!sGh.equals(sch.getsGh()))
3364 3367 sb.append(sch.getsGh() + " 换 " + sGh + ";");*/
3365   - if(persoChangeSPY(sch, sGh))
  3368 + if (persoChangeSPY(sch, sGh))
3366 3369 set.add(sch);
3367   - }
3368   - else if(StringUtils.isNotEmpty(sch.getsGh())){
  3370 + } else if (StringUtils.isNotEmpty(sch.getsGh())) {
3369 3371 sch.setsGh("");
3370 3372 sch.setsName("");
3371 3373 }
... ... @@ -3396,7 +3398,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3396 3398 public boolean persoChange(ScheduleRealInfo sch, String jGh) {
3397 3399 if (sch.getjGh().equals(jGh))
3398 3400 return false;
3399   - String jName = getPersonName(sch.getGsBm() , jGh);
  3401 + String jName = getPersonName(sch.getGsBm(), jGh);
3400 3402 if (StringUtils.isNotEmpty(jName)) {
3401 3403  
3402 3404 if (jGh.indexOf("-") != -1)
... ... @@ -3417,7 +3419,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3417 3419 public boolean persoChangeSPY(ScheduleRealInfo sch, String sGh) {
3418 3420 if (sch.getsGh().equals(sGh))
3419 3421 return false;
3420   - String sName = getPersonName(sch.getGsBm() , sGh);
  3422 + String sName = getPersonName(sch.getGsBm(), sGh);
3421 3423 if (StringUtils.isNotEmpty(sName)) {
3422 3424 if (sGh.indexOf("-") != -1)
3423 3425 sch.setsGh(sGh.substring(sGh.indexOf("-") + 1));
... ... @@ -3538,7 +3540,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3538 3540 rs.put("status", ResponseCode.SUCCESS);
3539 3541 rs.put("t", sch);
3540 3542  
3541   - if("major".equals(bcType)){
  3543 + if ("major".equals(bcType)) {
3542 3544 sch.setMajorStationName(majorStationName);
3543 3545 }
3544 3546  
... ... @@ -3563,10 +3565,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3563 3565  
3564 3566 //换车
3565 3567 if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) {
3566   - if (!carExist(oldSch.getGsBm(),sch.getClZbh())) {
  3568 + if (!carExist(oldSch.getGsBm(), sch.getClZbh())) {
3567 3569 rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!");
3568 3570 return rs;
3569   - } else{
  3571 + } else {
3570 3572 aflog.log("换车", oldSch.getClZbh(), sch.getClZbh());
3571 3573 oldSch.setClZbh(sch.getClZbh());
3572 3574 }
... ... @@ -3575,22 +3577,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3575 3577 //换驾驶员
3576 3578 if (StringUtils.isNotEmpty(sch.getjGh()) && !oldSch.getjGh().equals(sch.getjGh())) {
3577 3579 String jName = getPersonName(oldSch.getGsBm(), sch.getjGh());
3578   - if(StringUtils.isEmpty(jName)){
  3580 + if (StringUtils.isEmpty(jName)) {
3579 3581 rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员");
3580 3582 return rs;
3581 3583 }
3582   - aflog.log("换驾驶员", oldSch.getjGh()+"/"+ oldSch.getjName(), sch.getjGh()+"/"+ sch.getjName());
  3584 + aflog.log("换驾驶员", oldSch.getjGh() + "/" + oldSch.getjName(), sch.getjGh() + "/" + sch.getjName());
3583 3585 persoChange(oldSch, sch.getjGh());
3584 3586 }
3585 3587  
3586 3588 //换售票员
3587 3589 if (StringUtils.isNotEmpty(sch.getsGh()) && !oldSch.getsGh().equals(sch.getsGh())) {
3588 3590 String sName = getPersonName(oldSch.getGsBm(), sch.getsGh());
3589   - if(StringUtils.isEmpty(sName)){
  3591 + if (StringUtils.isEmpty(sName)) {
3590 3592 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员");
3591 3593 return rs;
3592 3594 }
3593   - aflog.log("换售票员", oldSch.getsGh()+"/"+ oldSch.getsName(), sch.getsGh()+"/"+ sch.getsName());
  3595 + aflog.log("换售票员", oldSch.getsGh() + "/" + oldSch.getsName(), sch.getsGh() + "/" + sch.getsName());
3594 3596 persoChangeSPY(oldSch, sch.getsGh());
3595 3597 }
3596 3598  
... ... @@ -3600,8 +3602,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3600 3602 if (!dest1 && dest2) {
3601 3603 oldSch.destroy();
3602 3604 aflog.log("烂班");
3603   - }
3604   - else if(dest1 && !dest2){
  3605 + } else if (dest1 && !dest2) {
3605 3606 //撤销烂班
3606 3607 oldSch.setJhlc(oldSch.getJhlcOrig());
3607 3608 oldSch.setStatus(0);
... ... @@ -3619,34 +3620,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3619 3620 double jhlcNum = sch.getJhlc();
3620 3621 aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum);
3621 3622 //烂班
3622   - if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0)
  3623 + if (jhlcNum == 0 && oldSch.getJhlcOrig() != 0)
3623 3624 oldSch.destroy();
3624 3625 else {
3625 3626 oldSch.setJhlc(jhlcNum);
3626 3627 //临加班次,实际计划一起改
3627   - if(oldSch.isSflj())
  3628 + if (oldSch.isSflj())
3628 3629 oldSch.setJhlcOrig(jhlcNum);
3629 3630 }
3630 3631 }
3631 3632  
3632 3633 //待发时间
3633   - if(!CustomStringUtils.equals(oldSch.getDfsj(), sch.getDfsj())){
  3634 + if (!CustomStringUtils.equals(oldSch.getDfsj(), sch.getDfsj())) {
3634 3635 aflog.log("修改待发时间", oldSch.getDfsj(), sch.getDfsj());
3635 3636 oldSch.setDfsj(sch.getDfsj());
3636 3637 }
3637 3638 //实发时间
3638   - if(!CustomStringUtils.equals(oldSch.getFcsjActual(), sch.getFcsjActual())){
  3639 + if (!CustomStringUtils.equals(oldSch.getFcsjActual(), sch.getFcsjActual())) {
3639 3640 aflog.log("修改实发时间", oldSch.getFcsjActual(), sch.getFcsjActual());
3640 3641 oldSch.setFcsjActual(sch.getFcsjActual());
3641 3642 }
3642 3643 //实际终点
3643   - if(!CustomStringUtils.equals(oldSch.getZdsjActual(), sch.getZdsjActual())){
  3644 + if (!CustomStringUtils.equals(oldSch.getZdsjActual(), sch.getZdsjActual())) {
3644 3645 aflog.log("修改实达时间", oldSch.getZdsjActual(), sch.getZdsjActual());
3645 3646 oldSch.setZdsjActual(sch.getZdsjActual());
3646 3647 }
3647 3648  
3648 3649 //备注
3649   - if(!CustomStringUtils.equals(oldSch.getRemarks(), sch.getRemarks())){
  3650 + if (!CustomStringUtils.equals(oldSch.getRemarks(), sch.getRemarks())) {
3650 3651 aflog.log("修改备注", oldSch.getRemarks(), sch.getRemarks());
3651 3652 oldSch.setRemarks(sch.getRemarks());
3652 3653 }
... ... @@ -3766,8 +3767,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3766 3767 if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
3767 3768 ) {
3768 3769 jcclc += tempJhlc;
3769   - }
3770   - else {
  3770 + } else {
3771 3771 if (scheduleRealInfo.getStatus() != -1) {
3772 3772 if (scheduleRealInfo.isSflj()) {
3773 3773 addMileage += tempJhlc;
... ... @@ -3831,24 +3831,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3831 3831 String zdsjActual = scheduleRealInfo.getZdsjActual();
3832 3832 if (zdsj != null && zdsjActual != null &&
3833 3833 !zdsj.equals(zdsjActual)) {
3834   - int zdsjT = Integer.valueOf(zdsj.split(":")[0])*60 + Integer.valueOf(zdsj.split(":")[1]);
3835   - int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0])*60 + Integer.valueOf(zdsjActual.split(":")[1]);
  3834 + int zdsjT = Integer.valueOf(zdsj.split(":")[0]) * 60 + Integer.valueOf(zdsj.split(":")[1]);
  3835 + int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0]) * 60 + Integer.valueOf(zdsjActual.split(":")[1]);
3836 3836 if (zdsj.compareTo(zdsjActual) > 0) {
3837   - if(zdsjT - zdsjAT > 1000){
3838   - map.put("fast", "");
3839   - map.put("slow", zdsjAT - zdsjT + 1440);
3840   - } else {
3841   - map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
3842   - map.put("slow", "");
3843   - }
  3837 + if (zdsjT - zdsjAT > 1000) {
  3838 + map.put("fast", "");
  3839 + map.put("slow", zdsjAT - zdsjT + 1440);
  3840 + } else {
  3841 + map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  3842 + map.put("slow", "");
  3843 + }
3844 3844 } else {
3845   - if(zdsjAT - zdsjT > 1000){
3846   - map.put("fast", zdsjT - zdsjAT + 1440);
3847   - map.put("slow", "");
3848   - } else {
3849   - map.put("fast", "");
3850   - map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
3851   - }
  3845 + if (zdsjAT - zdsjT > 1000) {
  3846 + map.put("fast", zdsjT - zdsjAT + 1440);
  3847 + map.put("slow", "");
  3848 + } else {
  3849 + map.put("fast", "");
  3850 + map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  3851 + }
3852 3852 }
3853 3853 } else {
3854 3854 map.put("fast", "");
... ... @@ -3894,7 +3894,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3894 3894 // map.put("sjbc", jhbc - cjbc + ljbc);
3895 3895 // map.put("zgl", format.format(yygl + ksgl + jcclc));
3896 3896 // map.put("ljbc", ljbc);
3897   -
  3897 +
3898 3898 String zdp = "", zwdp = "", wdp = "";
3899 3899 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
3900 3900 List<DutyEmployee> listDtuy = dutyEmployeeService.getDutyEmployee(line, date + "00:00", date + "23:59");
... ... @@ -3942,34 +3942,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3942 3942 DecimalFormat format = new DecimalFormat("0.00");
3943 3943 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
3944 3944 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
3945   - int jhbc = 0, cjbc = 0, ljbc = 0,sjbc=0;
3946   - double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0,ljjcclc=0,jhjcclc=0;
  3945 + int jhbc = 0, cjbc = 0, ljbc = 0, sjbc = 0;
  3946 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0, ljjcclc = 0, jhjcclc = 0;
3947 3947 double addMileage = 0, remMileage = 0, addgl = 0, remgl = 0;
3948 3948 Map<String, Object> map = new HashMap<String, Object>();
3949   - jhlc=culateMieageService.culateJhgl(lists);
3950   - jcclc=culateMieageService.culateJccgl(lists);
3951   - jhjcclc=culateMieageService.culateJhJccgl(lists);
3952   - remMileage=culateMieageService.culateLbgl(lists);
3953   - ksgl=culateMieageService.culateKsgl(lists);
3954   - yygl=culateMieageService.culateSjgl(lists);
3955   - jhbc=culateMieageService.culateJhbc(lists, "");
3956   - addMileage=culateMieageService.culateLjgl(lists);
3957   - cjbc=culateMieageService.culateLbbc(lists);
3958   - sjbc=culateMieageService.culateSjbc(lists, "");
3959   - ljbc=culateMieageService.culateLjbc(lists, "");
3960   - double zyygl=Arith.add(yygl,addMileage);
3961   - double zksgl=Arith.add(ksgl, jcclc);
3962   - map.put("jhlc", Arith.add(jhlc , jhjcclc));
  3949 + jhlc = culateMieageService.culateJhgl(lists);
  3950 + jcclc = culateMieageService.culateJccgl(lists);
  3951 + jhjcclc = culateMieageService.culateJhJccgl(lists);
  3952 + remMileage = culateMieageService.culateLbgl(lists);
  3953 + ksgl = culateMieageService.culateKsgl(lists);
  3954 + yygl = culateMieageService.culateSjgl(lists);
  3955 + jhbc = culateMieageService.culateJhbc(lists, "");
  3956 + addMileage = culateMieageService.culateLjgl(lists);
  3957 + cjbc = culateMieageService.culateLbbc(lists);
  3958 + sjbc = culateMieageService.culateSjbc(lists, "");
  3959 + ljbc = culateMieageService.culateLjbc(lists, "");
  3960 + double zyygl = Arith.add(yygl, addMileage);
  3961 + double zksgl = Arith.add(ksgl, jcclc);
  3962 + map.put("jhlc", Arith.add(jhlc, jhjcclc));
3963 3963 map.put("yygljh", jhlc);
3964 3964 map.put("ssgl", remMileage);
3965 3965 map.put("ksgl", ksgl);
3966   - map.put("yyglsj", Arith.add(yygl,addMileage));
  3966 + map.put("yyglsj", Arith.add(yygl, addMileage));
3967 3967 map.put("jcclc", jcclc);
3968 3968 map.put("jhbc", jhbc);
3969   - map.put("ljgl",addMileage);
  3969 + map.put("ljgl", addMileage);
3970 3970 map.put("ssbc", cjbc);
3971   - map.put("ysgl", Arith.add(yygl,addMileage));
3972   - map.put("sjbc",sjbc);
  3971 + map.put("ysgl", Arith.add(yygl, addMileage));
  3972 + map.put("sjbc", sjbc);
3973 3973 map.put("zgl", Arith.add(zyygl, zksgl));
3974 3974 map.put("ljbc", ljbc);
3975 3975  
... ... @@ -4003,7 +4003,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4003 4003 }
4004 4004  
4005 4005 if (!c.isDestroy()) {
4006   - if(c.getMileageType().equals("service")){
  4006 + if (c.getMileageType().equals("service")) {
4007 4007 sjlc += c.getMileage() == null ? 0 : c.getMileage();
4008 4008 }
4009 4009 }
... ... @@ -4025,141 +4025,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4025 4025 }
4026 4026  
4027 4027 @Override
4028   - public Map<String, Object> MapById(Long id) {
4029   - // TODO Auto-generated method stub
4030   - Map<String, Object> map = new HashMap<String, Object>();
4031   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
4032   - ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);
4033   - String xlbm = s.getXlBm();
4034   - String fcrq = s.getScheduleDateStr();
4035   -
4036   - int type = 2;
4037   - Double ccyl = 0.0;
4038   - Double jcyl = 0.0;
4039   - Double yh = 0.0;
4040   - Double jzl = 0.0;
4041   - Double zlc = 0.0;
4042   - List<Cars> listCars = carsRepository.findCarsByCode(s.getClZbh());
4043   - if (listCars.size() > 0) {
4044   - if(listCars.get(0).getSfdc()!=null){
4045   - if (listCars.get(0).getSfdc()) {
4046   - List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
4047   - type = 1;
4048   - for (int i = 0; i < listDlb.size(); i++) {
4049   - Dlb d = listDlb.get(i);
4050   - if (d.getLp() == null) {
4051   - ccyl = Arith.add(ccyl, d.getCzcd());
4052   - jcyl = Arith.add(jcyl, d.getJzcd());
4053   - yh = Arith.add(yh, d.getHd());
4054   - jzl = Arith.add(jzl, d.getCdl());
4055   - zlc = Arith.add(zlc, d.getZlc());
4056   - } else {
4057   - if (d.getLp().equals(s.getLpName())) {
4058   - ccyl = Arith.add(ccyl, d.getCzcd());
4059   - jcyl = Arith.add(jcyl, d.getJzcd());
4060   - yh = Arith.add(yh, d.getHd());
4061   - jzl = Arith.add(jzl, d.getCdl());
4062   - zlc = Arith.add(zlc, d.getZlc());
4063   - }
4064   - }
4065   -
4066   - }
4067   - } else {
4068   - List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
4069   - type = 0;
4070   - for (int i = 0; i < listYlb.size(); i++) {
4071   - Ylb y = listYlb.get(i);
4072   - if (y.getLp() == null) {
4073   - ccyl = Arith.add(ccyl, y.getCzyl());
4074   - jcyl = Arith.add(jcyl, y.getJzyl());
4075   - yh = Arith.add(yh, y.getYh());
4076   - jzl = Arith.add(jzl, y.getJzl());
4077   - zlc = Arith.add(zlc, y.getZlc());
4078   - } else {
4079   - if (y.getLp().equals(s.getLpName())) {
4080   - ccyl = Arith.add(ccyl, y.getCzyl());
4081   - jcyl = Arith.add(jcyl, y.getJzyl());
4082   - yh = Arith.add(yh, y.getYh());
4083   - jzl = Arith.add(jzl, y.getJzl());
4084   - zlc = Arith.add(zlc, y.getZlc());
4085   - }
4086   - }
4087   - }
4088   - }
4089   - }
4090   - }
4091   -
4092   - map.put("jzl", jzl);
4093   - map.put("yh", yh);
4094   - map.put("ccyl", ccyl);
4095   - map.put("jcyl", jcyl);
4096   - map.put("type", type);
4097   - map.put("zlc", zlc);
4098   - map.put("xlName", s.getXlName());
4099   - map.put("clZbh", s.getClZbh());
4100   - map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
4101   - map.put("fcsjActual", s.getFcsjActual());
4102   - map.put("zdzName", s.getZdzName());
4103   - map.put("scheduleDate", s.getScheduleDateStr());
4104   - map.put("lpName", s.getLpName());
4105   - String zdp = "", zwdp = "", wdp = "";
4106   - String zdpT = "", zwdpT = "", wdpT = "";
4107   - String dbdp = "";
4108   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
4109   - try {
4110   - Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
4111   - Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
4112   - Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
4113   - for (int i = 0; i < list.size(); i++) {
4114   - DutyEmployee t = list.get(i);
4115   - if (dbdp.indexOf(t.getuName()) == -1) {
4116   - if (!(dbdp.length() > 0)) {
4117   - dbdp = t.getuName();
4118   - } else {
4119   - dbdp += "," + t.getuName();
4120   - }
4121   - }
4122   - Long ts = t.getTs();
4123   - if (ts > fcsj1 && ts < fcsj2) {
4124   - if (zdp.indexOf(t.getuName()) == -1) {
4125   - if (!(zdp.length() > 0)) {
4126   - zdpT = t.getuName() + "...";
4127   - }
4128   - zdp += t.getuName() + ",";
4129   -
4130   - }
4131   - } else if (ts > fcsj2 && ts < fcsj3) {
4132   - if (zwdp.indexOf(t.getuName()) == -1) {
4133   - if (!(zwdp.length() > 0)) {
4134   - zwdpT = t.getuName() + "...";
4135   - }
4136   - zwdp += t.getuName() + ",";
4137   - }
4138   - } else {
4139   - if (wdp.indexOf(t.getuName()) == -1) {
4140   - if (!(wdp.length() > 0)) {
4141   - wdpT = t.getuName() + "...";
4142   - }
4143   - wdp += t.getuName() + ",";
4144   - }
4145   - }
4146   - }
4147   - } catch (ParseException e) {
4148   - // TODO Auto-generated catch block
4149   - e.printStackTrace();
4150   - }
4151   - map.put("zdp", zdp);
4152   - map.put("zwdp", zwdp);
4153   - map.put("wdp", wdp);
4154   - map.put("zdpT", zdpT);
4155   - map.put("zwdpT", zwdpT);
4156   - map.put("wdpT", wdpT);
4157   - map.put("dbdp", dbdp);
4158   - return map;
4159   - }
4160   -
4161   - @Override
4162   - public Map<String, Object> MapByIdQp(Long id) {
  4028 + public Map<String, Object> MapById(Long id) {
4163 4029 // TODO Auto-generated method stub
4164 4030 Map<String, Object> map = new HashMap<String, Object>();
4165 4031 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
... ... @@ -4167,16 +4033,150 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4167 4033 String xlbm = s.getXlBm();
4168 4034 String fcrq = s.getScheduleDateStr();
4169 4035  
4170   - int type=0;
  4036 + int type = 2;
4171 4037 Double ccyl = 0.0;
4172 4038 Double jcyl = 0.0;
4173 4039 Double yh = 0.0;
4174 4040 Double jzl = 0.0;
4175   - Double zlc=0.0;
4176   -// List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
4177   -// List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
4178   -// if(listYlb.size()>0){
4179   -// type=0;
  4041 + Double zlc = 0.0;
  4042 + List<Cars> listCars = carsRepository.findCarsByCode(s.getClZbh());
  4043 + if (listCars.size() > 0) {
  4044 + if (listCars.get(0).getSfdc() != null) {
  4045 + if (listCars.get(0).getSfdc()) {
  4046 + List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  4047 + type = 1;
  4048 + for (int i = 0; i < listDlb.size(); i++) {
  4049 + Dlb d = listDlb.get(i);
  4050 + if (d.getLp() == null) {
  4051 + ccyl = Arith.add(ccyl, d.getCzcd());
  4052 + jcyl = Arith.add(jcyl, d.getJzcd());
  4053 + yh = Arith.add(yh, d.getHd());
  4054 + jzl = Arith.add(jzl, d.getCdl());
  4055 + zlc = Arith.add(zlc, d.getZlc());
  4056 + } else {
  4057 + if (d.getLp().equals(s.getLpName())) {
  4058 + ccyl = Arith.add(ccyl, d.getCzcd());
  4059 + jcyl = Arith.add(jcyl, d.getJzcd());
  4060 + yh = Arith.add(yh, d.getHd());
  4061 + jzl = Arith.add(jzl, d.getCdl());
  4062 + zlc = Arith.add(zlc, d.getZlc());
  4063 + }
  4064 + }
  4065 +
  4066 + }
  4067 + } else {
  4068 + List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  4069 + type = 0;
  4070 + for (int i = 0; i < listYlb.size(); i++) {
  4071 + Ylb y = listYlb.get(i);
  4072 + if (y.getLp() == null) {
  4073 + ccyl = Arith.add(ccyl, y.getCzyl());
  4074 + jcyl = Arith.add(jcyl, y.getJzyl());
  4075 + yh = Arith.add(yh, y.getYh());
  4076 + jzl = Arith.add(jzl, y.getJzl());
  4077 + zlc = Arith.add(zlc, y.getZlc());
  4078 + } else {
  4079 + if (y.getLp().equals(s.getLpName())) {
  4080 + ccyl = Arith.add(ccyl, y.getCzyl());
  4081 + jcyl = Arith.add(jcyl, y.getJzyl());
  4082 + yh = Arith.add(yh, y.getYh());
  4083 + jzl = Arith.add(jzl, y.getJzl());
  4084 + zlc = Arith.add(zlc, y.getZlc());
  4085 + }
  4086 + }
  4087 + }
  4088 + }
  4089 + }
  4090 + }
  4091 +
  4092 + map.put("jzl", jzl);
  4093 + map.put("yh", yh);
  4094 + map.put("ccyl", ccyl);
  4095 + map.put("jcyl", jcyl);
  4096 + map.put("type", type);
  4097 + map.put("zlc", zlc);
  4098 + map.put("xlName", s.getXlName());
  4099 + map.put("clZbh", s.getClZbh());
  4100 + map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
  4101 + map.put("fcsjActual", s.getFcsjActual());
  4102 + map.put("zdzName", s.getZdzName());
  4103 + map.put("scheduleDate", s.getScheduleDateStr());
  4104 + map.put("lpName", s.getLpName());
  4105 + String zdp = "", zwdp = "", wdp = "";
  4106 + String zdpT = "", zwdpT = "", wdpT = "";
  4107 + String dbdp = "";
  4108 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
  4109 + try {
  4110 + Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
  4111 + Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
  4112 + Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
  4113 + for (int i = 0; i < list.size(); i++) {
  4114 + DutyEmployee t = list.get(i);
  4115 + if (dbdp.indexOf(t.getuName()) == -1) {
  4116 + if (!(dbdp.length() > 0)) {
  4117 + dbdp = t.getuName();
  4118 + } else {
  4119 + dbdp += "," + t.getuName();
  4120 + }
  4121 + }
  4122 + Long ts = t.getTs();
  4123 + if (ts > fcsj1 && ts < fcsj2) {
  4124 + if (zdp.indexOf(t.getuName()) == -1) {
  4125 + if (!(zdp.length() > 0)) {
  4126 + zdpT = t.getuName() + "...";
  4127 + }
  4128 + zdp += t.getuName() + ",";
  4129 +
  4130 + }
  4131 + } else if (ts > fcsj2 && ts < fcsj3) {
  4132 + if (zwdp.indexOf(t.getuName()) == -1) {
  4133 + if (!(zwdp.length() > 0)) {
  4134 + zwdpT = t.getuName() + "...";
  4135 + }
  4136 + zwdp += t.getuName() + ",";
  4137 + }
  4138 + } else {
  4139 + if (wdp.indexOf(t.getuName()) == -1) {
  4140 + if (!(wdp.length() > 0)) {
  4141 + wdpT = t.getuName() + "...";
  4142 + }
  4143 + wdp += t.getuName() + ",";
  4144 + }
  4145 + }
  4146 + }
  4147 + } catch (ParseException e) {
  4148 + // TODO Auto-generated catch block
  4149 + e.printStackTrace();
  4150 + }
  4151 + map.put("zdp", zdp);
  4152 + map.put("zwdp", zwdp);
  4153 + map.put("wdp", wdp);
  4154 + map.put("zdpT", zdpT);
  4155 + map.put("zwdpT", zwdpT);
  4156 + map.put("wdpT", wdpT);
  4157 + map.put("dbdp", dbdp);
  4158 + return map;
  4159 + }
  4160 +
  4161 + @Override
  4162 + public Map<String, Object> MapByIdQp(Long id) {
  4163 + // TODO Auto-generated method stub
  4164 + Map<String, Object> map = new HashMap<String, Object>();
  4165 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  4166 + ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);
  4167 + String xlbm = s.getXlBm();
  4168 + String fcrq = s.getScheduleDateStr();
  4169 +
  4170 + int type = 0;
  4171 + Double ccyl = 0.0;
  4172 + Double jcyl = 0.0;
  4173 + Double yh = 0.0;
  4174 + Double jzl = 0.0;
  4175 + Double zlc = 0.0;
  4176 +// List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
  4177 +// List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
  4178 +// if(listYlb.size()>0){
  4179 +// type=0;
4180 4180 // for (int i = 0; i < listYlb.size(); i++) {
4181 4181 // Ylb y = listYlb.get(i);
4182 4182 // if(y.getLp()==null){
... ... @@ -4218,12 +4218,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4218 4218 //
4219 4219 // }
4220 4220 // }
4221   -
4222   - List<Ylxxb> listylxxb=ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq);
  4221 +
  4222 + List<Ylxxb> listylxxb = ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq);
4223 4223 for (int i = 0; i < listylxxb.size(); i++) {
4224   - Ylxxb t=listylxxb.get(i);
4225   - jzl =Arith.add(jzl, t.getJzl());
4226   - }
  4224 + Ylxxb t = listylxxb.get(i);
  4225 + jzl = Arith.add(jzl, t.getJzl());
  4226 + }
4227 4227 map.put("jzl", jzl);
4228 4228 map.put("yh", yh);
4229 4229 map.put("ccyl", ccyl);
... ... @@ -4239,7 +4239,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4239 4239 map.put("lpName", s.getLpName());
4240 4240 String zdp = "", zwdp = "", wdp = "";
4241 4241 String zdpT = "", zwdpT = "", wdpT = "";
4242   - String dbdp="";
  4242 + String dbdp = "";
4243 4243 List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
4244 4244 try {
4245 4245 Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
... ... @@ -4247,11 +4247,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4247 4247 Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
4248 4248 for (int i = 0; i < list.size(); i++) {
4249 4249 DutyEmployee t = list.get(i);
4250   - if(dbdp.indexOf(t.getuName()) == -1){
4251   - if(!(dbdp.length()>0)){
4252   - dbdp =t.getuName();
4253   - }else{
4254   - dbdp +=","+t.getuName();
  4250 + if (dbdp.indexOf(t.getuName()) == -1) {
  4251 + if (!(dbdp.length() > 0)) {
  4252 + dbdp = t.getuName();
  4253 + } else {
  4254 + dbdp += "," + t.getuName();
4255 4255 }
4256 4256 }
4257 4257 Long ts = t.getTs();
... ... @@ -4336,8 +4336,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4336 4336  
4337 4337 if (scheduleRealInfo.getsGh() != null) {
4338 4338 if (!scheduleRealInfo.getsGh().equals(sgh)) {
4339   - sgh = scheduleRealInfo.getsGh()==null?"":scheduleRealInfo.getsGh();
4340   - if(!sgh.equals("")){
  4339 + sgh = scheduleRealInfo.getsGh() == null ? "" : scheduleRealInfo.getsGh();
  4340 + if (!sgh.equals("")) {
4341 4341 if (map.get("sjb1") != null) {
4342 4342 if (map.get("sjb2") != null) {
4343 4343 map.put("sjb3", scheduleRealInfo.getsGh() + "/" +
... ... @@ -4446,8 +4446,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4446 4446 List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state);
4447 4447 List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);
4448 4448  
4449   - Map<String, Object> nMap=new HashMap<String, Object>();
4450   - nMap.put("date", xlName+date);
  4449 + Map<String, Object> nMap = new HashMap<String, Object>();
  4450 + nMap.put("date", xlName + date);
4451 4451 nMap.put("jls", list1.get(0).get("jls"));
4452 4452 nMap.put("sjgl", list1.get(0).get("sjgl"));
4453 4453 for (Map<String, Object> m : list1) {
... ... @@ -4544,72 +4544,72 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4544 4544 }
4545 4545 }
4546 4546 */
4547   -
  4547 +
4548 4548 size = 0;
4549 4549 tempMap = new HashMap<String, Object>();
4550 4550 for (ScheduleRealInfo schedule : list3) {
4551   - int x=size%3;
4552   - if(x==0 && size>0){
4553   - dataList3.add(tempMap);
4554   - tempMap = new HashMap<String, Object>();
4555   - }
4556   - tempMap.put("lpName" + x, schedule.getLpName());
4557   - tempMap.put("qdzName" + x, schedule.getQdzName());
4558   - tempMap.put("zdsj" + x, schedule.getZdsj());
4559   - String zdsjActual=schedule.getZdsjActual() != null ? schedule.getZdsjActual() : "";
4560   - tempMap.put("zdsjActual" + x, zdsjActual);
4561   -
4562   - String zdsjk="";
4563   - String zdsjm="";
4564   - if(!zdsjActual.equals("")){
4565   - String[] zdsj_s=schedule.getZdsj().split(":");
4566   - String[] zdsjActual_s=zdsjActual.split(":");
4567   - Long zdsj_=Long.parseLong(zdsj_s[0])*60+Long.parseLong(zdsj_s[1]);
4568   - Long zdsjActual_=Long.parseLong(zdsjActual_s[0])*60+Long.parseLong(zdsjActual_s[1]);
4569   - if((zdsj_-zdsjActual_)>0){
4570   - zdsjk =String.valueOf(zdsj_-zdsjActual_);
4571   - }else{
4572   - zdsjm =String.valueOf(zdsjActual_-zdsj_);
4573   - }
4574   - }
4575   - tempMap.put("zdsjk" + x, zdsjk);
4576   - tempMap.put("zdsjm" + x, zdsjm);
4577   - tempMap.put("fcsj" + x, schedule.getFcsj());
4578   - String fcsjActural=schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "";
4579   - String bcType=schedule.getBcType()!=null?schedule.getBcType():"";
4580   - String fcsjActuralstr="";
4581   - if(bcType.equals("in")){
4582   - fcsjActuralstr=fcsjActural+"(进)";
4583   - }else if(bcType.equals("out")){
4584   - fcsjActuralstr=fcsjActural+"(出)";
4585   - }else{
4586   - fcsjActuralstr=fcsjActural;
4587   - }
4588   - tempMap.put("fcsjActual" + x, fcsjActuralstr);
4589   - String fcsjk="";
4590   - String fcsjm="";
4591   - if(!fcsjActural.equals("")){
4592   - String[] zdsj_s=schedule.getFcsj().split(":");
4593   - String[] fcsjActural_s=fcsjActural.split(":");
4594   - Long zdsj_=Long.parseLong(zdsj_s[0])*60+Long.parseLong(zdsj_s[1]);
4595   - Long fcsjActural_=Long.parseLong(fcsjActural_s[0])*60+Long.parseLong(fcsjActural_s[1]);
4596   - if((zdsj_-fcsjActural_)>0){
4597   - fcsjk =String.valueOf(zdsj_-fcsjActural_);
4598   - }else{
4599   - fcsjm =String.valueOf(fcsjActural_-zdsj_);
4600   - }
4601   - }
4602   - tempMap.put("fcsjk" + x, fcsjk);
4603   - tempMap.put("fcsjm" + x, fcsjm);
4604   - tempMap.put("remarks" + x, schedule.getRemark() != null ? schedule.getRemark() : "");
4605   -
4606   - size++;
4607   - }
4608   - if(tempMap.get("lpName0")!=null){
4609   - if(tempMap.get("lpName1")==null){
4610   - tempMap.put("lpName1" , "");
4611   - tempMap.put("qdzName1" , "");
4612   - tempMap.put("zdsj1" , "");
  4551 + int x = size % 3;
  4552 + if (x == 0 && size > 0) {
  4553 + dataList3.add(tempMap);
  4554 + tempMap = new HashMap<String, Object>();
  4555 + }
  4556 + tempMap.put("lpName" + x, schedule.getLpName());
  4557 + tempMap.put("qdzName" + x, schedule.getQdzName());
  4558 + tempMap.put("zdsj" + x, schedule.getZdsj());
  4559 + String zdsjActual = schedule.getZdsjActual() != null ? schedule.getZdsjActual() : "";
  4560 + tempMap.put("zdsjActual" + x, zdsjActual);
  4561 +
  4562 + String zdsjk = "";
  4563 + String zdsjm = "";
  4564 + if (!zdsjActual.equals("")) {
  4565 + String[] zdsj_s = schedule.getZdsj().split(":");
  4566 + String[] zdsjActual_s = zdsjActual.split(":");
  4567 + Long zdsj_ = Long.parseLong(zdsj_s[0]) * 60 + Long.parseLong(zdsj_s[1]);
  4568 + Long zdsjActual_ = Long.parseLong(zdsjActual_s[0]) * 60 + Long.parseLong(zdsjActual_s[1]);
  4569 + if ((zdsj_ - zdsjActual_) > 0) {
  4570 + zdsjk = String.valueOf(zdsj_ - zdsjActual_);
  4571 + } else {
  4572 + zdsjm = String.valueOf(zdsjActual_ - zdsj_);
  4573 + }
  4574 + }
  4575 + tempMap.put("zdsjk" + x, zdsjk);
  4576 + tempMap.put("zdsjm" + x, zdsjm);
  4577 + tempMap.put("fcsj" + x, schedule.getFcsj());
  4578 + String fcsjActural = schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "";
  4579 + String bcType = schedule.getBcType() != null ? schedule.getBcType() : "";
  4580 + String fcsjActuralstr = "";
  4581 + if (bcType.equals("in")) {
  4582 + fcsjActuralstr = fcsjActural + "(进)";
  4583 + } else if (bcType.equals("out")) {
  4584 + fcsjActuralstr = fcsjActural + "(出)";
  4585 + } else {
  4586 + fcsjActuralstr = fcsjActural;
  4587 + }
  4588 + tempMap.put("fcsjActual" + x, fcsjActuralstr);
  4589 + String fcsjk = "";
  4590 + String fcsjm = "";
  4591 + if (!fcsjActural.equals("")) {
  4592 + String[] zdsj_s = schedule.getFcsj().split(":");
  4593 + String[] fcsjActural_s = fcsjActural.split(":");
  4594 + Long zdsj_ = Long.parseLong(zdsj_s[0]) * 60 + Long.parseLong(zdsj_s[1]);
  4595 + Long fcsjActural_ = Long.parseLong(fcsjActural_s[0]) * 60 + Long.parseLong(fcsjActural_s[1]);
  4596 + if ((zdsj_ - fcsjActural_) > 0) {
  4597 + fcsjk = String.valueOf(zdsj_ - fcsjActural_);
  4598 + } else {
  4599 + fcsjm = String.valueOf(fcsjActural_ - zdsj_);
  4600 + }
  4601 + }
  4602 + tempMap.put("fcsjk" + x, fcsjk);
  4603 + tempMap.put("fcsjm" + x, fcsjm);
  4604 + tempMap.put("remarks" + x, schedule.getRemark() != null ? schedule.getRemark() : "");
  4605 +
  4606 + size++;
  4607 + }
  4608 + if (tempMap.get("lpName0") != null) {
  4609 + if (tempMap.get("lpName1") == null) {
  4610 + tempMap.put("lpName1", "");
  4611 + tempMap.put("qdzName1", "");
  4612 + tempMap.put("zdsj1", "");
4613 4613 tempMap.put("zdsjActual1", "");
4614 4614 tempMap.put("zdsjk1", "");
4615 4615 tempMap.put("zdsjm1", "");
... ... @@ -4618,9 +4618,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4618 4618 tempMap.put("fcsjk1", "");
4619 4619 tempMap.put("fcsjm1", "");
4620 4620 tempMap.put("remarks1", "");
4621   - }
4622   - if(tempMap.get("lpName2")==null){
4623   - tempMap.put("lpName2", "");
  4621 + }
  4622 + if (tempMap.get("lpName2") == null) {
  4623 + tempMap.put("lpName2", "");
4624 4624 tempMap.put("qdzName2", "");
4625 4625 tempMap.put("zdsj2", "");
4626 4626 tempMap.put("zdsjActual2", "");
... ... @@ -4631,35 +4631,35 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4631 4631 tempMap.put("fcsjk2", "");
4632 4632 tempMap.put("fcsjm2", "");
4633 4633 tempMap.put("remarks2", "");
4634   - }
4635   - dataList3.add(tempMap);
4636   - }
4637   -
4638   - if(date.length() == 10){
4639   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
4640   - String dbdp = "";
4641   - try {
4642   - for (int i = 0; i < list.size(); i++) {
4643   - DutyEmployee t = list.get(i);
4644   - if(dbdp.indexOf(t.getuName()) == -1){
4645   - if(!(dbdp.length()>0)){
4646   - dbdp =t.getuName();
4647   - }else{
4648   - dbdp +=","+t.getuName();
4649   - }
4650   - }
4651   - }
4652   - } catch (Exception e) {
4653   - // TODO: handle exception
4654   - e.printStackTrace();
4655   - }
4656   - nMap.put("dbdp", dbdp);
  4634 + }
  4635 + dataList3.add(tempMap);
  4636 + }
  4637 +
  4638 + if (date.length() == 10) {
  4639 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
  4640 + String dbdp = "";
  4641 + try {
  4642 + for (int i = 0; i < list.size(); i++) {
  4643 + DutyEmployee t = list.get(i);
  4644 + if (dbdp.indexOf(t.getuName()) == -1) {
  4645 + if (!(dbdp.length() > 0)) {
  4646 + dbdp = t.getuName();
  4647 + } else {
  4648 + dbdp += "," + t.getuName();
  4649 + }
  4650 + }
  4651 + }
  4652 + } catch (Exception e) {
  4653 + // TODO: handle exception
  4654 + e.printStackTrace();
  4655 + }
  4656 + nMap.put("dbdp", dbdp);
4657 4657 }
4658 4658  
4659 4659 if (type.equals("export")) {
4660   - String lineName = "";
4661   - if(map.containsKey("lineName"))
4662   - lineName = "-" + map.get("lineName").toString() + "-";
  4660 + String lineName = "";
  4661 + if (map.containsKey("lineName"))
  4662 + lineName = "-" + map.get("lineName").toString() + "-";
4663 4663 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
4664 4664 sdfSimple = new SimpleDateFormat("yyyyMMdd");
4665 4665 Map<String, Object> m = new HashMap<String, Object>();
... ... @@ -4688,197 +4688,198 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4688 4688 }
4689 4689  
4690 4690 public void exportWaybill_pl(List<ScheduleRealInfo> listpl,
4691   - String date, String jName, String clZbh, String lpName) {
  4691 + String date, String jName, String clZbh, String lpName) {
4692 4692 ReportUtils ee = new ReportUtils();
4693 4693 ReportRelatedUtils rru = new ReportRelatedUtils();
4694 4694 List<Iterator<?>> list = new ArrayList<Iterator<?>>();
4695 4695 List<ScheduleRealInfo> scheduleRealInfos = listpl;
4696 4696 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
4697 4697 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
4698   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
4699   - for (int i = 0; i < scheduleRealInfos.size(); i++) {
4700   - ScheduleRealInfo s=scheduleRealInfos.get(i);
4701   - Set<ChildTaskPlan> cts = s.getcTasks();
4702   - if(cts != null && cts.size() > 0){
4703   - lists.add(s);
4704   - }else{
4705   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
4706   - lists.add(s);
4707   - }
4708   - }
4709   - }
4710   - DecimalFormat format = new DecimalFormat("0.00");
  4698 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  4699 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4700 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  4701 + Set<ChildTaskPlan> cts = s.getcTasks();
  4702 + if (cts != null && cts.size() > 0) {
  4703 + lists.add(s);
  4704 + } else {
  4705 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  4706 + lists.add(s);
  4707 + }
  4708 + }
  4709 + }
  4710 + DecimalFormat format = new DecimalFormat("0.00");
4711 4711 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
4712 4712 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
4713   - //计算里程和班次数,并放入Map里
4714   - Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
4715   -
4716   - map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
4717   - map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos));
4718   - map.put("addMileage", culateMieageService.culateLjgl(lists));
4719   - double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));
4720   - map.put("yygl", yygl);
4721   - double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists));
4722   - map.put("ksgl",ksgl);
4723   - map.put("realMileage", Arith.add(yygl ,ksgl));
4724   - map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,""));
4725   - map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
4726   - map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
4727   - int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");
4728   - map.put("sjbc", sjbc);
  4713 + //计算里程和班次数,并放入Map里
  4714 + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
  4715 +
  4716 + map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos), culateMieageService.culateJhJccgl(scheduleRealInfos)));
  4717 + map.put("remMileage", culateMieageService.culateLbgl(scheduleRealInfos));
  4718 + map.put("addMileage", culateMieageService.culateLjgl(lists));
  4719 + double yygl = Arith.add(culateMieageService.culateSjgl(lists), culateMieageService.culateLjgl(lists));
  4720 + map.put("yygl", yygl);
  4721 + double ksgl = Arith.add(culateMieageService.culateKsgl(scheduleRealInfos), culateMieageService.culateJccgl(lists));
  4722 + map.put("ksgl", ksgl);
  4723 + map.put("realMileage", Arith.add(yygl, ksgl));
  4724 + map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos, ""));
  4725 + map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
  4726 + map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
  4727 + int sjbc = culateMieageService.culateLjbc(lists, "") + culateMieageService.culateSjbc(lists, "");
  4728 + map.put("sjbc", sjbc);
4729 4729 // map=new HashMap<String,Object>();
4730   -
4731   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
4732   - String minfcsj="02:00";
4733   - List<Line> lineList=lineRepository.findLineByCode(listpl.get(0).getXlBm());
4734   - if(lineList.size()>0){
4735   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
4736   - + " id = ("
4737   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
4738   - + ")";
4739   - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
4740   - }
4741   - String[] minSjs = minfcsj.split(":");
4742   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
4743   -
4744   -
4745   - for (int i = 0; i < scheduleRealInfos.size(); i++) {
4746   - ScheduleRealInfo s=scheduleRealInfos.get(i);
4747   - String[] fcsj= s.getFcsj().split(":");
4748   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
4749   -
4750   - Long fscjT=0L;
4751   - if(fcsjL<minSj){
4752   - Calendar calendar = new GregorianCalendar();
4753   - calendar.setTime(s.getScheduleDate());
4754   - calendar.add(calendar.DATE,1);
4755   - s.setScheduleDate(calendar.getTime());
4756   - try {
4757   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
4758   - } catch (ParseException e) {
4759   - // TODO Auto-generated catch block
4760   - e.printStackTrace();
4761   - }
4762   -
4763   - }else{
4764   - try {
4765   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
4766   - } catch (ParseException e) {
4767   - // TODO Auto-generated catch block
4768   - e.printStackTrace();
4769   - };
4770   - }
4771   - s.setFcsjT(fscjT);
4772   - }
4773   - List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
4774   - Collections.sort(scheduleRealInfos, new ComparableReal());
4775   - for (int i = 0; i < scheduleRealInfos.size(); i++) {
4776   - ScheduleRealInfo s = scheduleRealInfos.get(i);
4777   - s.setAdjustExps(i + 1 + "");
4778   - String remarks = "";
4779   - if (s.getRemarks() != null) {
4780   - remarks += s.getRemarks();
4781   - }
4782   -
4783   - Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
4784   - if (!childTaskPlans.isEmpty()) {
4785   - s.setFcsjActual("");
4786   - s.setZdsjActual("");
4787   - s.setJhlc(0.0);
4788   - }
4789   -
4790   - if (s.isDestroy()) {
4791   - s.setFcsjActual("");
4792   - s.setZdsjActual("");
4793   - s.setJhlc(0.0);
4794   - remarks += "(烂班)";
4795   - s.setRemarks(remarks);
4796   - }
4797   -
4798   - listSchedule.add(s);
4799   - //计算营运里程,空驶里程
4800   - if (!childTaskPlans.isEmpty()) {
  4730 +
  4731 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  4732 + String minfcsj = "02:00";
  4733 + List<Line> lineList = lineRepository.findLineByCode(listpl.get(0).getXlBm());
  4734 + if (lineList.size() > 0) {
  4735 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  4736 + + " id = ("
  4737 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  4738 + + ")";
  4739 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  4740 + }
  4741 + String[] minSjs = minfcsj.split(":");
  4742 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  4743 +
  4744 +
  4745 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4746 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  4747 + String[] fcsj = s.getFcsj().split(":");
  4748 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  4749 +
  4750 + Long fscjT = 0L;
  4751 + if (fcsjL < minSj) {
  4752 + Calendar calendar = new GregorianCalendar();
  4753 + calendar.setTime(s.getScheduleDate());
  4754 + calendar.add(calendar.DATE, 1);
  4755 + s.setScheduleDate(calendar.getTime());
  4756 + try {
  4757 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
  4758 + } catch (ParseException e) {
  4759 + // TODO Auto-generated catch block
  4760 + e.printStackTrace();
  4761 + }
  4762 +
  4763 + } else {
  4764 + try {
  4765 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  4766 + } catch (ParseException e) {
  4767 + // TODO Auto-generated catch block
  4768 + e.printStackTrace();
  4769 + }
  4770 + ;
  4771 + }
  4772 + s.setFcsjT(fscjT);
  4773 + }
  4774 + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
  4775 + Collections.sort(scheduleRealInfos, new ComparableReal());
  4776 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4777 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  4778 + s.setAdjustExps(i + 1 + "");
  4779 + String remarks = "";
  4780 + if (s.getRemarks() != null) {
  4781 + remarks += s.getRemarks();
  4782 + }
  4783 +
  4784 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  4785 + if (!childTaskPlans.isEmpty()) {
  4786 + s.setFcsjActual("");
  4787 + s.setZdsjActual("");
  4788 + s.setJhlc(0.0);
  4789 + }
  4790 +
  4791 + if (s.isDestroy()) {
  4792 + s.setFcsjActual("");
  4793 + s.setZdsjActual("");
  4794 + s.setJhlc(0.0);
  4795 + remarks += "(烂班)";
  4796 + s.setRemarks(remarks);
  4797 + }
  4798 +
  4799 + listSchedule.add(s);
  4800 + //计算营运里程,空驶里程
  4801 + if (!childTaskPlans.isEmpty()) {
4801 4802 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
4802   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
4803   - Collections.sort(listit, new ComparableChild());
4804   - for (int j = 0; j < listit.size(); j++) {
4805   - ScheduleRealInfo t = new ScheduleRealInfo();
4806   - ChildTaskPlan childTaskPlan = listit.get(j);
4807   - if (childTaskPlan.isDestroy()) {
4808   - t.setFcsjActual("");
4809   - t.setZdsjActual("");
4810   - t.setJhlc(0.0);
4811   - } else {
4812   - t.setFcsjActual(childTaskPlan.getStartDate());
4813   - t.setZdsjActual(childTaskPlan.getEndDate());
4814   - t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
4815   - }
4816   - t.setQdzName(childTaskPlan.getStartStationName());
4817   - t.setZdzName(childTaskPlan.getEndStationName());
4818   - t.setRemarks(childTaskPlan.getRemarks());
4819   - t.setAdjustExps("子");
4820   - t.setjGh("");
4821   - t.setjName("");
4822   - t.setsGh("");
4823   - t.setsName("");
4824   - listSchedule.add(t);
4825   - }
4826   - }
4827   - }
4828   - Map<String, Object> maps;
4829   - for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
4830   - maps = new HashMap<String, Object>();
4831   - try {
4832   - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
4833   - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
4834   - maps = rru.getMapValue(scheduleRealInfo);
4835   - maps.put("bcs", scheduleRealInfo.getAdjustExps());
4836   - String zdsj = scheduleRealInfo.getZdsj();
4837   - String zdsjActual = scheduleRealInfo.getZdsjActual();
4838   - if (zdsj != null && zdsjActual != null &&
4839   - !zdsj.equals(zdsjActual) &&
4840   - !zdsj.equals("")&&
4841   - !zdsjActual.equals("")) {
4842   - int zdsjT = Integer.valueOf(zdsj.split(":")[0])*60 + Integer.valueOf(zdsj.split(":")[1]);
4843   - int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0])*60 + Integer.valueOf(zdsjActual.split(":")[1]);
4844   - if (zdsj.compareTo(zdsjActual) > 0) {
4845   - if(zdsjT - zdsjAT > 1000){
4846   - maps.put("fast", "");
4847   - maps.put("slow", zdsjAT - zdsjT + 1440);
4848   - } else {
4849   - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
4850   - maps.put("slow", "");
4851   - }
4852   - } else {
4853   - if(zdsjAT - zdsjT > 1000){
4854   - maps.put("fast", zdsjT - zdsjAT + 1440);
4855   - maps.put("slow", "");
4856   - } else {
4857   - maps.put("fast", "");
4858   - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
4859   - }
4860   - }
4861   - } else {
4862   - maps.put("fast", "");
4863   - maps.put("slow", "");
4864   - }
4865   - listMap.add(maps);
4866   - } catch (Exception e) {
4867   - e.printStackTrace();
4868   - }
4869   - }
  4803 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
  4804 + Collections.sort(listit, new ComparableChild());
  4805 + for (int j = 0; j < listit.size(); j++) {
  4806 + ScheduleRealInfo t = new ScheduleRealInfo();
  4807 + ChildTaskPlan childTaskPlan = listit.get(j);
  4808 + if (childTaskPlan.isDestroy()) {
  4809 + t.setFcsjActual("");
  4810 + t.setZdsjActual("");
  4811 + t.setJhlc(0.0);
  4812 + } else {
  4813 + t.setFcsjActual(childTaskPlan.getStartDate());
  4814 + t.setZdsjActual(childTaskPlan.getEndDate());
  4815 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  4816 + }
  4817 + t.setQdzName(childTaskPlan.getStartStationName());
  4818 + t.setZdzName(childTaskPlan.getEndStationName());
  4819 + t.setRemarks(childTaskPlan.getRemarks());
  4820 + t.setAdjustExps("子");
  4821 + t.setjGh("");
  4822 + t.setjName("");
  4823 + t.setsGh("");
  4824 + t.setsName("");
  4825 + listSchedule.add(t);
  4826 + }
  4827 + }
  4828 + }
  4829 + Map<String, Object> maps;
  4830 + for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
  4831 + maps = new HashMap<String, Object>();
  4832 + try {
  4833 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  4834 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  4835 + maps = rru.getMapValue(scheduleRealInfo);
  4836 + maps.put("bcs", scheduleRealInfo.getAdjustExps());
  4837 + String zdsj = scheduleRealInfo.getZdsj();
  4838 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  4839 + if (zdsj != null && zdsjActual != null &&
  4840 + !zdsj.equals(zdsjActual) &&
  4841 + !zdsj.equals("") &&
  4842 + !zdsjActual.equals("")) {
  4843 + int zdsjT = Integer.valueOf(zdsj.split(":")[0]) * 60 + Integer.valueOf(zdsj.split(":")[1]);
  4844 + int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0]) * 60 + Integer.valueOf(zdsjActual.split(":")[1]);
  4845 + if (zdsj.compareTo(zdsjActual) > 0) {
  4846 + if (zdsjT - zdsjAT > 1000) {
  4847 + maps.put("fast", "");
  4848 + maps.put("slow", zdsjAT - zdsjT + 1440);
  4849 + } else {
  4850 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4851 + maps.put("slow", "");
  4852 + }
  4853 + } else {
  4854 + if (zdsjAT - zdsjT > 1000) {
  4855 + maps.put("fast", zdsjT - zdsjAT + 1440);
  4856 + maps.put("slow", "");
  4857 + } else {
  4858 + maps.put("fast", "");
  4859 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4860 + }
  4861 + }
  4862 + } else {
  4863 + maps.put("fast", "");
  4864 + maps.put("slow", "");
  4865 + }
  4866 + listMap.add(maps);
  4867 + } catch (Exception e) {
  4868 + e.printStackTrace();
  4869 + }
  4870 + }
4870 4871  
4871 4872  
4872 4873 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
4873 4874 list.add(listMap.iterator());
4874   - String xls="";
4875   - if(map.get("type").toString().equals("0")){
4876   - xls="waybill_minhang.xls";
4877   - }else{
4878   - xls="waybill_minhang_dl.xls";
  4875 + String xls = "";
  4876 + if (map.get("type").toString().equals("0")) {
  4877 + xls = "waybill_minhang.xls";
  4878 + } else {
  4879 + xls = "waybill_minhang_dl.xls";
4879 4880 }
4880 4881 map.put("sheetName", jName + "-" + clZbh + "-" + lpName);
4881   - ee.excelReplace(list, new Object[]{map}, path + "mould/"+xls,
  4882 + ee.excelReplace(list, new Object[]{map}, path + "mould/" + xls,
4882 4883 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
4883 4884 }
4884 4885  
... ... @@ -4897,25 +4898,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4897 4898 while (true) {
4898 4899 String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date));
4899 4900 // file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/")); //新建文件夹
4900   - file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件
4901   - if (file.exists()) { //判断是否已存在重名
  4901 + file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件
  4902 + if (file.exists()) { //判断是否已存在重名
4902 4903 num++;
4903 4904 } else {
4904 4905 break;
4905 4906 }
4906 4907 }
4907 4908 // file.mkdirs(); //创建
4908   - List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  4909 + List<ScheduleRealInfo> lists_line = scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
4909 4910 List<File> files = new ArrayList<File>();
4910   - for (List<String> list : lists){
4911   - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  4911 + for (List<String> list : lists) {
  4912 + List<ScheduleRealInfo> newList = new ArrayList<ScheduleRealInfo>();
4912 4913 String jName = list.get(0);
4913 4914 String clZbh = list.get(1);
4914 4915 String lpName = list.get(2);
4915   - String jGh =list.get(3);
  4916 + String jGh = list.get(3);
4916 4917 for (int i = 0; i < lists_line.size(); i++) {
4917   - ScheduleRealInfo s=lists_line.get(i);
4918   - if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){
  4918 + ScheduleRealInfo s = lists_line.get(i);
  4919 + if (s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)) {
4919 4920 newList.add(s);
4920 4921 }
4921 4922 }
... ... @@ -4924,10 +4925,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4924 4925 String fileName = file.getName();
4925 4926 files.add(temp);
4926 4927 }
4927   - for(int i = 1; i < files.size(); i++){
4928   - File file1 = files.get(0);
4929   - File file2 = files.get(i);
4930   - ee.copySheetByFile(file2, file1, 0, 145);
  4928 + for (int i = 1; i < files.size(); i++) {
  4929 + File file1 = files.get(0);
  4930 + File file2 = files.get(i);
  4931 + ee.copySheetByFile(file2, file1, 0, 145);
4931 4932 }
4932 4933 File newFile = files.get(0);
4933 4934 newFile.renameTo(file);
... ... @@ -5009,7 +5010,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5009 5010 if (i < smallList.size()) {
5010 5011 rightSch = smallList.get(i);
5011 5012 ts.add(rightSch);
5012   - } else{
  5013 + } else {
5013 5014 //不对称时多出来的
5014 5015 lpChangeByLeft(leftSch, largeList.get(i - 1), type);
5015 5016 ts.add(leftSch);
... ... @@ -5026,7 +5027,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5026 5027 }
5027 5028  
5028 5029 //重新计算路牌的起点应到时间
5029   - for(String lpName : lpSet){
  5030 + for (String lpName : lpSet) {
5030 5031 ts.addAll(dayOfSchedule.updateQdzTimePlan(lpName));
5031 5032 }
5032 5033  
... ... @@ -5056,7 +5057,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5056 5057 @Override
5057 5058 public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) {
5058 5059 //释放班次映射
5059   - if(type > 0) {
  5060 + if (type > 0) {
5060 5061 dayOfSchedule.removeNbbm2SchMapp(leftSch);
5061 5062 dayOfSchedule.removeNbbm2SchMapp(rightSch);
5062 5063 }
... ... @@ -5068,7 +5069,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5068 5069 leftData.appendTo(rightSch, type);
5069 5070 rightData.appendTo(leftSch, type);
5070 5071  
5071   - if(type > 0){
  5072 + if (type > 0) {
5072 5073 //重新映射
5073 5074 dayOfSchedule.addNbbm2SchMapp(leftSch);
5074 5075 dayOfSchedule.addNbbm2SchMapp(rightSch);
... ... @@ -5077,20 +5078,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5077 5078  
5078 5079 /**
5079 5080 * 更换左边班次的路牌,右边不变
  5081 + *
5080 5082 * @param leftSch
5081 5083 * @param rightSch
5082 5084 * @param type
5083 5085 */
5084 5086 public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) {
5085 5087 //释放班次映射
5086   - if(type > 0)
  5088 + if (type > 0)
5087 5089 dayOfSchedule.removeNbbm2SchMapp(leftSch);
5088 5090  
5089 5091 LpData rightData = new LpData(rightSch);
5090 5092 rightData.appendTo(leftSch, type);
5091 5093  
5092 5094 //重新映射
5093   - if(type > 0)
  5095 + if (type > 0)
5094 5096 dayOfSchedule.addNbbm2SchMapp(leftSch);
5095 5097  
5096 5098 }
... ... @@ -5144,16 +5146,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5144 5146 List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx);
5145 5147  
5146 5148 ScheduleRealInfo sch;
5147   - for(String id : ids){
  5149 + for (String id : ids) {
5148 5150 sch = dayOfSchedule.get(Long.parseLong(id));
5149   - if(sch != null && sch.getStatus() == 0){
5150   - if(minute > 0){
  5151 + if (sch != null && sch.getStatus() == 0) {
  5152 + if (minute > 0) {
5151 5153 sch.setLateMinute(minute);
5152   - }
5153   - else if(minute == 0){
  5154 + } else if (minute == 0) {
5154 5155 LateAdjustHandle.remove(sch);
5155 5156 }
5156   - count ++;
  5157 + count++;
5157 5158 list.add(sch);
5158 5159 }
5159 5160 }
... ... @@ -5161,7 +5162,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5161 5162 rs.put("status", ResponseCode.SUCCESS);
5162 5163 rs.put("count", count);
5163 5164 rs.put("ts", list);
5164   - }catch (Exception e){
  5165 + } catch (Exception e) {
5165 5166 logger.error("", e);
5166 5167 rs.put("status", ResponseCode.ERROR);
5167 5168 rs.put("msg", e.getMessage());
... ... @@ -5176,36 +5177,36 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5176 5177 List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx);
5177 5178  
5178 5179 Collection<ScheduleRealInfo> all = LateAdjustHandle.allLateSch();
5179   - for(ScheduleRealInfo sch : all){
5180   - if(ids.indexOf(sch.getXlBm()) != -1){
  5180 + for (ScheduleRealInfo sch : all) {
  5181 + if (ids.indexOf(sch.getXlBm()) != -1) {
5181 5182 rs.add(sch);
5182 5183 }
5183 5184 }
5184 5185 return rs;
5185 5186 }
5186   -
5187   -
5188   - @Override
5189   - public List<Map<String, Object>> mileageReport(String gsdm,
5190   - String fgsdm, String line, String date, String date2) {
5191   -
5192   - String sql = "select * from calc_mileage where 1=1 " ;
5193   - if (!line.equals(" ")) {
5194   - sql = sql+" and line_code='"+ line+"' ";
5195   - }
5196   - sql = sql+" and DATE_FORMAT(rq,'%Y-%m-%d') between '"+ date+"' and '"+ date2+"'";
5197   - if (!gsdm.equals(" ")) {
5198   - sql = sql+" and company_id="+gsdm;
5199   - }
5200   - if (!gsdm.equals(" ")) {
5201   - sql = sql+" and sub_company_id="+fgsdm;
5202   - }
5203   - sql = sql+" order by line_code";
5204   - List<MileageReport> list = jdbcTemplate.query(sql,
  5187 +
  5188 +
  5189 + @Override
  5190 + public List<Map<String, Object>> mileageReport(String gsdm,
  5191 + String fgsdm, String line, String date, String date2) {
  5192 +
  5193 + String sql = "select * from calc_mileage where 1=1 ";
  5194 + if (!line.equals(" ")) {
  5195 + sql = sql + " and line_code='" + line + "' ";
  5196 + }
  5197 + sql = sql + " and DATE_FORMAT(rq,'%Y-%m-%d') between '" + date + "' and '" + date2 + "'";
  5198 + if (!gsdm.equals(" ")) {
  5199 + sql = sql + " and company_id=" + gsdm;
  5200 + }
  5201 + if (!gsdm.equals(" ")) {
  5202 + sql = sql + " and sub_company_id=" + fgsdm;
  5203 + }
  5204 + sql = sql + " order by line_code";
  5205 + List<MileageReport> list = jdbcTemplate.query(sql,
5205 5206 new RowMapper<MileageReport>() {
5206 5207 @Override
5207 5208 public MileageReport mapRow(ResultSet rs, int rowNum) throws SQLException {
5208   - MileageReport mr = new MileageReport();
  5209 + MileageReport mr = new MileageReport();
5209 5210 mr.setCompanyName(rs.getString("company_name"));
5210 5211 mr.setSubCompanyName(rs.getString("sub_company_name"));
5211 5212 mr.setLineName(rs.getString("line_name"));
... ... @@ -5223,189 +5224,189 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5223 5224 return mr;
5224 5225 }
5225 5226 });
5226   - List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
5227   - double sjyygl = 0.0;
5228   - double sjksgl = 0.0;
5229   - double zgl = 0.0;
5230   - double sddfgl = 0.0;
5231   - double zddfgl = 0.0;
5232   - double wqwxhgl = 0.0;
5233   - double bfwxhgl = 0.0;
5234   - double pygl = 0.0;
5235   - double ljgl = 0.0;
5236   - double zrwgl = 0.0;
5237   - for(MileageReport mr:list) {
5238   - Map<String, Object> resMap = new HashMap<String, Object>();
5239   - resMap.put("gsName", mr.getCompanyName());
5240   - resMap.put("fgsName", mr.getSubCompanyName());
5241   - resMap.put("xlName", mr.getLineName());
5242   - resMap.put("sjyygl", mr.getSjyygl());
5243   - resMap.put("sjksgl", mr.getSjksgl());
5244   - resMap.put("zgl", mr.getZgl());
5245   - resMap.put("sddfgl", mr.getSddfgl());
5246   - resMap.put("zddfgl", mr.getZddfgl());
5247   - resMap.put("wqwxhgl", mr.getWqwxhgl());
5248   - resMap.put("bfwxhgl", mr.getBfwxhgl());
5249   - resMap.put("pygl", mr.getPygl());
5250   - resMap.put("ljgl", mr.getLjgl());
5251   - resMap.put("zrwgl", mr.getZrwgl());
5252   - resMap.put("other", mr.getOther());
5253   - lMap.add(resMap);
5254   - sjyygl = Arith.add(sjyygl,mr.getSjyygl());
5255   - sjksgl = Arith.add(sjksgl,mr.getSjksgl());
5256   - zgl = Arith.add(zgl,mr.getZgl());
5257   - sddfgl = Arith.add(sddfgl,mr.getSddfgl());
5258   - zddfgl = Arith.add(zddfgl,mr.getZddfgl());
5259   - wqwxhgl = Arith.add(wqwxhgl,mr.getWqwxhgl());
5260   - bfwxhgl = Arith.add(bfwxhgl,mr.getBfwxhgl());
5261   - pygl = Arith.add(pygl,mr.getPygl());
5262   - ljgl = Arith.add(ljgl,mr.getLjgl());
5263   - zrwgl = Arith.add(zrwgl,mr.getZrwgl());
5264   - }
5265   - Map<String, Object> resMap = new HashMap<String, Object>();
5266   - resMap.put("xlName", "合计");
5267   - resMap.put("sjyygl", sjyygl);
5268   - resMap.put("sjksgl", sjksgl);
5269   - resMap.put("zgl", zgl);
5270   - resMap.put("sddfgl", sddfgl);
5271   - resMap.put("zddfgl", zddfgl);
5272   - resMap.put("wqwxhgl", wqwxhgl);
5273   - resMap.put("bfwxhgl", bfwxhgl);
5274   - resMap.put("pygl", pygl);
5275   - resMap.put("ljgl", ljgl);
5276   - resMap.put("zrwgl", zrwgl);
5277   - resMap.put("other", null);
5278   - lMap.add(resMap);
5279   - return lMap;
5280   - }
5281   -
5282   - @Override
5283   - public List<Map<String, Object>> scheduleCorrectionReport(String gsdm,
5284   - String fgsdm, String line, String date, String date2) {
5285   -
5286   - String sql = "select * from calc_schedule where 1=1 " ;
5287   - if (!line.equals(" ")) {
5288   - sql = sql+" and line_code='"+ line+"' ";
5289   - }
5290   - sql = sql+" and DATE_FORMAT(rq,'%Y-%m-%d') between '"+ date+"' and '"+ date2+"'";
5291   - if (!gsdm.equals(" ")) {
5292   - sql = sql+" and company_id="+gsdm;
5293   - }
5294   - if (!gsdm.equals(" ")) {
5295   - sql = sql+" and sub_company_id="+fgsdm;
5296   - }
5297   - sql = sql+" order by line_code";
5298   - List<ScheduleCorrectionReport> list = jdbcTemplate.query(sql,
5299   - new RowMapper<ScheduleCorrectionReport>() {
5300   - @Override
5301   - public ScheduleCorrectionReport mapRow(ResultSet rs, int rowNum) throws SQLException {
5302   - ScheduleCorrectionReport sReport = new ScheduleCorrectionReport();
5303   - sReport.setCompanyName(rs.getString("company_name"));
5304   - sReport.setSubCompanyName(rs.getString("sub_company_name"));
5305   - sReport.setLineName(rs.getString("line_name"));
5306   - sReport.setSjyybc(rs.getInt("sjyybc"));
5307   - sReport.setSjksbc(rs.getInt("sjksbc"));
5308   - sReport.setZbc(rs.getInt("zyybc"));
5309   - sReport.setZddfbc(rs.getInt("zddfbc"));
5310   - sReport.setSddfbc(rs.getInt("sddfbc"));
5311   - sReport.setWqwxhbc(rs.getInt("wqwxhbc"));
5312   - sReport.setBfwxhbc(rs.getInt("bfwxhbc"));
5313   - sReport.setPybc(rs.getInt("pybc"));
5314   - sReport.setLjbc(rs.getInt("ljbc"));
5315   - sReport.setZrwbc(rs.getInt("zrwbc"));
5316   - sReport.setOther(rs.getString("other"));
5317   - return sReport;
5318   - }
5319   - });
5320   - List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
5321   - int sjyybc = 0;
5322   - int sjksbc = 0;
5323   - int zbc = 0;
5324   - int sddfbc = 0;
5325   - int zddfbc = 0;
5326   - int wqwxhbc = 0;
5327   - int bfwxhbc = 0;
5328   - int pybc = 0;
5329   - int ljbc = 0;
5330   - int zrwbc = 0;
5331   - for(ScheduleCorrectionReport sReport:list) {
5332   - Map<String, Object> resMap = new HashMap<String, Object>();
5333   - resMap.put("gsName", sReport.getCompanyName());
5334   - resMap.put("fgsName", sReport.getSubCompanyName());
5335   - resMap.put("xlName", sReport.getLineName());
5336   - resMap.put("sjyybc", sReport.getSjyybc());
5337   - resMap.put("sjksbc", sReport.getSjksbc());
5338   - resMap.put("zbc", sReport.getZbc());
5339   - resMap.put("sddfbc", sReport.getSddfbc());
5340   - resMap.put("zddfbc", sReport.getZddfbc());
5341   - resMap.put("wqwxhbc", sReport.getWqwxhbc());
5342   - resMap.put("bfwxhbc", sReport.getBfwxhbc());
5343   - resMap.put("pybc", sReport.getPybc());
5344   - resMap.put("ljbc", sReport.getLjbc());
5345   - resMap.put("zrwbc", sReport.getZrwbc());
5346   - resMap.put("other", sReport.getOther());
5347   - lMap.add(resMap);
5348   - sjyybc = sjyybc + sReport.getSjyybc();
5349   - sjksbc = sjksbc + sReport.getSjksbc();
5350   - zbc = zbc + sReport.getZbc();
5351   - sddfbc = sddfbc + sReport.getSddfbc();
5352   - zddfbc = zddfbc + sReport.getZddfbc();
5353   - wqwxhbc = wqwxhbc + sReport.getWqwxhbc();
5354   - bfwxhbc = bfwxhbc + sReport.getBfwxhbc();
5355   - pybc = pybc + sReport.getPybc();
5356   - ljbc = ljbc + sReport.getLjbc();
5357   - zrwbc = zrwbc + sReport.getZrwbc();
5358   - }
5359   - Map<String, Object> resMap = new HashMap<String, Object>();
5360   - resMap.put("xlName", "合计");
5361   - resMap.put("sjyybc", sjyybc);
5362   - resMap.put("sjksbc", sjksbc);
5363   - resMap.put("zbc", zbc);
5364   - resMap.put("sddfbc", sddfbc);
5365   - resMap.put("zddfbc", zddfbc);
5366   - resMap.put("wqwxhbc", wqwxhbc);
5367   - resMap.put("bfwxhbc", bfwxhbc);
5368   - resMap.put("pybc", pybc);
5369   - resMap.put("ljbc", ljbc);
5370   - resMap.put("zrwbc", zrwbc);
5371   - resMap.put("other", null);
5372   - lMap.add(resMap);
5373   - return lMap;
5374   - }
  5227 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  5228 + double sjyygl = 0.0;
  5229 + double sjksgl = 0.0;
  5230 + double zgl = 0.0;
  5231 + double sddfgl = 0.0;
  5232 + double zddfgl = 0.0;
  5233 + double wqwxhgl = 0.0;
  5234 + double bfwxhgl = 0.0;
  5235 + double pygl = 0.0;
  5236 + double ljgl = 0.0;
  5237 + double zrwgl = 0.0;
  5238 + for (MileageReport mr : list) {
  5239 + Map<String, Object> resMap = new HashMap<String, Object>();
  5240 + resMap.put("gsName", mr.getCompanyName());
  5241 + resMap.put("fgsName", mr.getSubCompanyName());
  5242 + resMap.put("xlName", mr.getLineName());
  5243 + resMap.put("sjyygl", mr.getSjyygl());
  5244 + resMap.put("sjksgl", mr.getSjksgl());
  5245 + resMap.put("zgl", mr.getZgl());
  5246 + resMap.put("sddfgl", mr.getSddfgl());
  5247 + resMap.put("zddfgl", mr.getZddfgl());
  5248 + resMap.put("wqwxhgl", mr.getWqwxhgl());
  5249 + resMap.put("bfwxhgl", mr.getBfwxhgl());
  5250 + resMap.put("pygl", mr.getPygl());
  5251 + resMap.put("ljgl", mr.getLjgl());
  5252 + resMap.put("zrwgl", mr.getZrwgl());
  5253 + resMap.put("other", mr.getOther());
  5254 + lMap.add(resMap);
  5255 + sjyygl = Arith.add(sjyygl, mr.getSjyygl());
  5256 + sjksgl = Arith.add(sjksgl, mr.getSjksgl());
  5257 + zgl = Arith.add(zgl, mr.getZgl());
  5258 + sddfgl = Arith.add(sddfgl, mr.getSddfgl());
  5259 + zddfgl = Arith.add(zddfgl, mr.getZddfgl());
  5260 + wqwxhgl = Arith.add(wqwxhgl, mr.getWqwxhgl());
  5261 + bfwxhgl = Arith.add(bfwxhgl, mr.getBfwxhgl());
  5262 + pygl = Arith.add(pygl, mr.getPygl());
  5263 + ljgl = Arith.add(ljgl, mr.getLjgl());
  5264 + zrwgl = Arith.add(zrwgl, mr.getZrwgl());
  5265 + }
  5266 + Map<String, Object> resMap = new HashMap<String, Object>();
  5267 + resMap.put("xlName", "合计");
  5268 + resMap.put("sjyygl", sjyygl);
  5269 + resMap.put("sjksgl", sjksgl);
  5270 + resMap.put("zgl", zgl);
  5271 + resMap.put("sddfgl", sddfgl);
  5272 + resMap.put("zddfgl", zddfgl);
  5273 + resMap.put("wqwxhgl", wqwxhgl);
  5274 + resMap.put("bfwxhgl", bfwxhgl);
  5275 + resMap.put("pygl", pygl);
  5276 + resMap.put("ljgl", ljgl);
  5277 + resMap.put("zrwgl", zrwgl);
  5278 + resMap.put("other", null);
  5279 + lMap.add(resMap);
  5280 + return lMap;
  5281 + }
  5282 +
  5283 + @Override
  5284 + public List<Map<String, Object>> scheduleCorrectionReport(String gsdm,
  5285 + String fgsdm, String line, String date, String date2) {
  5286 +
  5287 + String sql = "select * from calc_schedule where 1=1 ";
  5288 + if (!line.equals(" ")) {
  5289 + sql = sql + " and line_code='" + line + "' ";
  5290 + }
  5291 + sql = sql + " and DATE_FORMAT(rq,'%Y-%m-%d') between '" + date + "' and '" + date2 + "'";
  5292 + if (!gsdm.equals(" ")) {
  5293 + sql = sql + " and company_id=" + gsdm;
  5294 + }
  5295 + if (!gsdm.equals(" ")) {
  5296 + sql = sql + " and sub_company_id=" + fgsdm;
  5297 + }
  5298 + sql = sql + " order by line_code";
  5299 + List<ScheduleCorrectionReport> list = jdbcTemplate.query(sql,
  5300 + new RowMapper<ScheduleCorrectionReport>() {
  5301 + @Override
  5302 + public ScheduleCorrectionReport mapRow(ResultSet rs, int rowNum) throws SQLException {
  5303 + ScheduleCorrectionReport sReport = new ScheduleCorrectionReport();
  5304 + sReport.setCompanyName(rs.getString("company_name"));
  5305 + sReport.setSubCompanyName(rs.getString("sub_company_name"));
  5306 + sReport.setLineName(rs.getString("line_name"));
  5307 + sReport.setSjyybc(rs.getInt("sjyybc"));
  5308 + sReport.setSjksbc(rs.getInt("sjksbc"));
  5309 + sReport.setZbc(rs.getInt("zyybc"));
  5310 + sReport.setZddfbc(rs.getInt("zddfbc"));
  5311 + sReport.setSddfbc(rs.getInt("sddfbc"));
  5312 + sReport.setWqwxhbc(rs.getInt("wqwxhbc"));
  5313 + sReport.setBfwxhbc(rs.getInt("bfwxhbc"));
  5314 + sReport.setPybc(rs.getInt("pybc"));
  5315 + sReport.setLjbc(rs.getInt("ljbc"));
  5316 + sReport.setZrwbc(rs.getInt("zrwbc"));
  5317 + sReport.setOther(rs.getString("other"));
  5318 + return sReport;
  5319 + }
  5320 + });
  5321 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  5322 + int sjyybc = 0;
  5323 + int sjksbc = 0;
  5324 + int zbc = 0;
  5325 + int sddfbc = 0;
  5326 + int zddfbc = 0;
  5327 + int wqwxhbc = 0;
  5328 + int bfwxhbc = 0;
  5329 + int pybc = 0;
  5330 + int ljbc = 0;
  5331 + int zrwbc = 0;
  5332 + for (ScheduleCorrectionReport sReport : list) {
  5333 + Map<String, Object> resMap = new HashMap<String, Object>();
  5334 + resMap.put("gsName", sReport.getCompanyName());
  5335 + resMap.put("fgsName", sReport.getSubCompanyName());
  5336 + resMap.put("xlName", sReport.getLineName());
  5337 + resMap.put("sjyybc", sReport.getSjyybc());
  5338 + resMap.put("sjksbc", sReport.getSjksbc());
  5339 + resMap.put("zbc", sReport.getZbc());
  5340 + resMap.put("sddfbc", sReport.getSddfbc());
  5341 + resMap.put("zddfbc", sReport.getZddfbc());
  5342 + resMap.put("wqwxhbc", sReport.getWqwxhbc());
  5343 + resMap.put("bfwxhbc", sReport.getBfwxhbc());
  5344 + resMap.put("pybc", sReport.getPybc());
  5345 + resMap.put("ljbc", sReport.getLjbc());
  5346 + resMap.put("zrwbc", sReport.getZrwbc());
  5347 + resMap.put("other", sReport.getOther());
  5348 + lMap.add(resMap);
  5349 + sjyybc = sjyybc + sReport.getSjyybc();
  5350 + sjksbc = sjksbc + sReport.getSjksbc();
  5351 + zbc = zbc + sReport.getZbc();
  5352 + sddfbc = sddfbc + sReport.getSddfbc();
  5353 + zddfbc = zddfbc + sReport.getZddfbc();
  5354 + wqwxhbc = wqwxhbc + sReport.getWqwxhbc();
  5355 + bfwxhbc = bfwxhbc + sReport.getBfwxhbc();
  5356 + pybc = pybc + sReport.getPybc();
  5357 + ljbc = ljbc + sReport.getLjbc();
  5358 + zrwbc = zrwbc + sReport.getZrwbc();
  5359 + }
  5360 + Map<String, Object> resMap = new HashMap<String, Object>();
  5361 + resMap.put("xlName", "合计");
  5362 + resMap.put("sjyybc", sjyybc);
  5363 + resMap.put("sjksbc", sjksbc);
  5364 + resMap.put("zbc", zbc);
  5365 + resMap.put("sddfbc", sddfbc);
  5366 + resMap.put("zddfbc", zddfbc);
  5367 + resMap.put("wqwxhbc", wqwxhbc);
  5368 + resMap.put("bfwxhbc", bfwxhbc);
  5369 + resMap.put("pybc", pybc);
  5370 + resMap.put("ljbc", ljbc);
  5371 + resMap.put("zrwbc", zrwbc);
  5372 + resMap.put("other", null);
  5373 + lMap.add(resMap);
  5374 + return lMap;
  5375 + }
5375 5376 }
5376 5377  
5377   -class AccountMap implements Comparator<Map<String, Object>>{
5378   - @Override
5379   - public int compare(Map<String, Object> o1, Map<String, Object> o2) {
5380   - // TODO Auto-generated method stub
5381   - return o1.get("clZbh").toString().compareTo(o2.get("clZbh").toString());
5382   - }
  5378 +class AccountMap implements Comparator<Map<String, Object>> {
  5379 + @Override
  5380 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  5381 + // TODO Auto-generated method stub
  5382 + return o1.get("clZbh").toString().compareTo(o2.get("clZbh").toString());
  5383 + }
5383 5384 }
5384 5385  
5385   -class AccountMap2 implements Comparator<Map<String, Object>>{
5386   - @Override
5387   - public int compare(Map<String, Object> o1, Map<String, Object> o2) {
5388   - // TODO Auto-generated method stub
5389   - return o2.get("clZbh").toString().compareTo(o1.get("clZbh").toString());
5390   - }
  5386 +class AccountMap2 implements Comparator<Map<String, Object>> {
  5387 + @Override
  5388 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  5389 + // TODO Auto-generated method stub
  5390 + return o2.get("clZbh").toString().compareTo(o1.get("clZbh").toString());
  5391 + }
5391 5392 }
5392 5393  
5393   -class AccountXlbm implements Comparator<Map<String, Object>>{
5394   - @Override
5395   - public int compare(Map<String, Object> o1, Map<String, Object> o2) {
5396   - // TODO Auto-generated method stub
  5394 +class AccountXlbm implements Comparator<Map<String, Object>> {
  5395 + @Override
  5396 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  5397 + // TODO Auto-generated method stub
5397 5398 // PinyinHelper.convertToPinyinString(ppy.getName(),
5398 5399 // "" , PinyinFormat.WITHOUT_TONE)
5399   - return o1.get("xlNamePy").toString().compareTo(
5400   - o2.get("xlNamePy").toString());
5401   - }
  5400 + return o1.get("xlNamePy").toString().compareTo(
  5401 + o2.get("xlNamePy").toString());
  5402 + }
5402 5403 }
5403 5404  
5404   -class compareFcsjType implements Comparator<ScheduleRealInfo>{
5405   - @Override
5406   - public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
5407   - // TODO Auto-generated method stub
5408   - return (o1.getFcsjT()+o1.getRemark()).compareTo(o2.getFcsjT()+o2.getRemark());
5409   - }
  5405 +class compareFcsjType implements Comparator<ScheduleRealInfo> {
  5406 + @Override
  5407 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  5408 + // TODO Auto-generated method stub
  5409 + return (o1.getFcsjT() + o1.getRemark()).compareTo(o2.getFcsjT() + o2.getRemark());
  5410 + }
5410 5411  
5411 5412 }
... ...