Commit 324c6bd87013c05e5e343cbba3a7c67e75765a5f
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
# Conflicts: # src/main/java/com/bsth/controller/realcontrol/summary/FastAndSlowController.java # src/main/java/com/bsth/data/summary/entity/FastAndSlow.java # src/main/java/com/bsth/data/summary/service/FastAndSlowService.java # src/main/java/com/bsth/data/summary/service/impl/FastAndSlowServiceImpl.java
Showing
9 changed files
with
95 additions
and
139 deletions
src/main/java/com/bsth/controller/realcontrol/summary/FastAndSlowController.java
| @@ -28,4 +28,4 @@ public class FastAndSlowController extends BaseController<FastAndSlow, Long> { | @@ -28,4 +28,4 @@ public class FastAndSlowController extends BaseController<FastAndSlow, Long> { | ||
| 28 | , @RequestParam String et, @RequestParam int type, HttpServletRequest request, HttpServletResponse response) { | 28 | , @RequestParam String et, @RequestParam int type, HttpServletRequest request, HttpServletResponse response) { |
| 29 | fastAndSlowService.excel(lineCode, st, et, type, request, response); | 29 | fastAndSlowService.excel(lineCode, st, et, type, request, response); |
| 30 | } | 30 | } |
| 31 | -} | 31 | -} |
| 32 | +} | ||
| 32 | \ No newline at end of file | 33 | \ No newline at end of file |
src/main/java/com/bsth/data/summary/entity/FastAndSlow.java
| @@ -281,4 +281,4 @@ public class FastAndSlow { | @@ -281,4 +281,4 @@ public class FastAndSlow { | ||
| 281 | public boolean isFast() { | 281 | public boolean isFast() { |
| 282 | return this.fcsjFast>0 || this.dfsjFast>0 || this.zdsjFast>0 || this.zdsjDfFast>0; | 282 | return this.fcsjFast>0 || this.dfsjFast>0 || this.zdsjFast>0 || this.zdsjDfFast>0; |
| 283 | } | 283 | } |
| 284 | -} | 284 | -} |
| 285 | +} | ||
| 285 | \ No newline at end of file | 286 | \ No newline at end of file |
src/main/java/com/bsth/data/summary/repository/FastAndSlowRepository.java
| 1 | -package com.bsth.data.summary.repository; | ||
| 2 | - | ||
| 3 | -import com.bsth.data.summary.entity.FastAndSlow; | ||
| 4 | -import com.bsth.repository.BaseRepository; | ||
| 5 | -import org.springframework.stereotype.Repository; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * Created by panzhao on 2017/10/24. | ||
| 9 | - */ | ||
| 10 | -@Repository | ||
| 11 | -public interface FastAndSlowRepository extends BaseRepository<FastAndSlow, Long> { | ||
| 12 | -} | 1 | +package com.bsth.data.summary.repository; |
| 2 | + | ||
| 3 | +import com.bsth.data.summary.entity.FastAndSlow; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.stereotype.Repository; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Created by panzhao on 2017/10/24. | ||
| 9 | + */ | ||
| 10 | +@Repository | ||
| 11 | +public interface FastAndSlowRepository extends BaseRepository<FastAndSlow, Long> { | ||
| 12 | +} |
src/main/java/com/bsth/data/summary/service/FastAndSlowService.java
| @@ -11,4 +11,4 @@ import javax.servlet.http.HttpServletResponse; | @@ -11,4 +11,4 @@ import javax.servlet.http.HttpServletResponse; | ||
| 11 | */ | 11 | */ |
| 12 | public interface FastAndSlowService extends BaseService<FastAndSlow, Long>{ | 12 | public interface FastAndSlowService extends BaseService<FastAndSlow, Long>{ |
| 13 | void excel(String lineCode, String st, String et, int type, HttpServletRequest request, HttpServletResponse response); | 13 | void excel(String lineCode, String st, String et, int type, HttpServletRequest request, HttpServletResponse response); |
| 14 | -} | 14 | -} |
| 15 | +} | ||
| 15 | \ No newline at end of file | 16 | \ No newline at end of file |
src/main/java/com/bsth/data/summary/service/impl/FastAndSlowServiceImpl.java
| @@ -78,7 +78,7 @@ public class FastAndSlowServiceImpl extends BaseServiceImpl<FastAndSlow, Long> i | @@ -78,7 +78,7 @@ public class FastAndSlowServiceImpl extends BaseServiceImpl<FastAndSlow, Long> i | ||
| 78 | }); | 78 | }); |
| 79 | //按日期分组 | 79 | //按日期分组 |
| 80 | ArrayListMultimap<String, FastAndSlow> multimap = | 80 | ArrayListMultimap<String, FastAndSlow> multimap = |
| 81 | - new ConvertUtil<FastAndSlow>().groupMultiList(list, "_", FastAndSlow.class.getDeclaredField("rq")); | 81 | + new ConvertUtil<FastAndSlow>().groupMultiList(list, "_", FastAndSlow.class.getDeclaredField("rq")); |
| 82 | //输出excel | 82 | //输出excel |
| 83 | String basePath = Thread.currentThread().getContextClassLoader().getResource("").getPath(); | 83 | String basePath = Thread.currentThread().getContextClassLoader().getResource("").getPath(); |
| 84 | String filePath = basePath + "/static/pages/summary/excel/快慢误点报表.xls"; | 84 | String filePath = basePath + "/static/pages/summary/excel/快慢误点报表.xls"; |
| @@ -432,4 +432,4 @@ public class FastAndSlowServiceImpl extends BaseServiceImpl<FastAndSlow, Long> i | @@ -432,4 +432,4 @@ public class FastAndSlowServiceImpl extends BaseServiceImpl<FastAndSlow, Long> i | ||
| 432 | } | 432 | } |
| 433 | return sum; | 433 | return sum; |
| 434 | } | 434 | } |
| 435 | -} | 435 | -} |
| 436 | +} | ||
| 436 | \ No newline at end of file | 437 | \ No newline at end of file |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -25,16 +25,16 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -25,16 +25,16 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 25 | @Query(value="select s from ScheduleRealInfo s where s.id = ?1 ") | 25 | @Query(value="select s from ScheduleRealInfo s where s.id = ?1 ") |
| 26 | ScheduleRealInfo scheduleById(Long id); | 26 | ScheduleRealInfo scheduleById(Long id); |
| 27 | 27 | ||
| 28 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,dfsj") | 28 | + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,dfsj") |
| 29 | List<ScheduleRealInfo> scheduleDailyQp(String line,String date); | 29 | List<ScheduleRealInfo> scheduleDailyQp(String line,String date); |
| 30 | 30 | ||
| 31 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") | 31 | + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") |
| 32 | List<ScheduleRealInfo> queryUserInfo(String line,String date); | 32 | List<ScheduleRealInfo> queryUserInfo(String line,String date); |
| 33 | 33 | ||
| 34 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)") | 34 | + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)") |
| 35 | List<ScheduleRealInfo> queryUserInfo2(String line,String date); | 35 | List<ScheduleRealInfo> queryUserInfo2(String line,String date); |
| 36 | 36 | ||
| 37 | - @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ") | 37 | + @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 GROUP BY s.clZbh ") |
| 38 | List<ScheduleRealInfo> queryUserInfo3(String line,String date); | 38 | List<ScheduleRealInfo> queryUserInfo3(String line,String date); |
| 39 | 39 | ||
| 40 | @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs") | 40 | @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs") |
| @@ -43,7 +43,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -43,7 +43,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 43 | //把sum(addMileage) 替换为0 数据表去掉了 add_mileage 字段 | 43 | //把sum(addMileage) 替换为0 数据表去掉了 add_mileage 字段 |
| 44 | @Query(value="select new map(clZbh as clZbh,jGh as jGh,jName as jName,sum(jhlc) as zgl," | 44 | @Query(value="select new map(clZbh as clZbh,jGh as jGh,jName as jName,sum(jhlc) as zgl," |
| 45 | + "0 as ksgl,count(jName) as bcs) from ScheduleRealInfo s where" | 45 | + "0 as ksgl,count(jName) as bcs) from ScheduleRealInfo s where" |
| 46 | - + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName") | 46 | + + " s.xlBm = ?1 and s.scheduleDateStr = ?2 group by clZbh,jGh,jName") |
| 47 | List<Map<String, Object>> dailyInfo(String line,String date); | 47 | List<Map<String, Object>> dailyInfo(String line,String date); |
| 48 | 48 | ||
| 49 | @Query(value="select t.inside_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from (" | 49 | @Query(value="select t.inside_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from (" |
| @@ -57,7 +57,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -57,7 +57,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 57 | @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " | 57 | @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " |
| 58 | + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d " | 58 | + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d " |
| 59 | + " ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND " | 59 | + " ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND " |
| 60 | - + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% group by " | 60 | + + " r.schedule_date_str = ?2 and r.cl_zbh like %?3% group by " |
| 61 | + " lp_name,xl_name,cl_zbh",nativeQuery=true) | 61 | + " lp_name,xl_name,cl_zbh",nativeQuery=true) |
| 62 | List<Object[]> historyMessageCount(String line,String date,String code); | 62 | List<Object[]> historyMessageCount(String line,String date,String code); |
| 63 | 63 | ||
| @@ -72,7 +72,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -72,7 +72,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 72 | List<ScheduleRealInfo> findByDate(String dateStr); | 72 | List<ScheduleRealInfo> findByDate(String dateStr); |
| 73 | 73 | ||
| 74 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 74 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 75 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and cl_zbh=?3 order by bcs") | 75 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 and cl_zbh=?3 order by bcs") |
| 76 | List<ScheduleRealInfo> findByDate2(String line,String date,String clzbh); | 76 | List<ScheduleRealInfo> findByDate2(String line,String date,String clzbh); |
| 77 | 77 | ||
| 78 | @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.status = -1") | 78 | @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.status = -1") |
| @@ -84,17 +84,17 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -84,17 +84,17 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 84 | @Query(value="SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,device_id FROM bsth_v_report_80 WHERE FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = ?2 AND line_id = ?1 and device_id like %?3%",nativeQuery=true) | 84 | @Query(value="SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,device_id FROM bsth_v_report_80 WHERE FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = ?2 AND line_id = ?1 and device_id like %?3%",nativeQuery=true) |
| 85 | List<Object[]> account(String line,String date,String code); | 85 | List<Object[]> account(String line,String date,String code); |
| 86 | 86 | ||
| 87 | - @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') " | ||
| 88 | - + " and s.scheduleDate <= str_to_date(?3,'%Y-%m-%d') and s.lpName like %?4% " | 87 | + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 " |
| 88 | + + " and s.scheduleDateStr <= ?3 and s.lpName like %?4% " | ||
| 89 | + " and clZbh like %?5% order by s.fcsj") | 89 | + " and clZbh like %?5% order by s.fcsj") |
| 90 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code); | 90 | List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code); |
| 91 | 91 | ||
| 92 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 92 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 93 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj") | 93 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDateStr = ?4 and s.xlBm=?5 order by realExecDate,fcsj") |
| 94 | List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line); | 94 | List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line); |
| 95 | 95 | ||
| 96 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 96 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 97 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj") | 97 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDateStr = ?4 and s.xlBm=?5 order by realExecDate,fcsj") |
| 98 | List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line); | 98 | List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line); |
| 99 | 99 | ||
| 100 | // @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 100 | // @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| @@ -102,27 +102,27 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -102,27 +102,27 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 102 | // List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date,String gsbm,String fgsbm); | 102 | // List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date,String gsbm,String fgsbm); |
| 103 | 103 | ||
| 104 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 104 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 105 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlBm,s.clZbh,s.jGh,s.adjustExps,s.fcsj") | 105 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 order by s.xlBm,s.clZbh,s.jGh,s.adjustExps,s.fcsj") |
| 106 | List<ScheduleRealInfo> scheduleByDateAndLineTjrb(String line,String date); | 106 | List<ScheduleRealInfo> scheduleByDateAndLineTjrb(String line,String date); |
| 107 | 107 | ||
| 108 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 108 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 109 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.xlDir=?3 and s.fcsjActual is not null and s.zdsjActual is not null order by s.realExecDate,s.fcsjActual") | 109 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 and s.xlDir=?3 and s.fcsjActual is not null and s.zdsjActual is not null order by s.realExecDate,s.fcsjActual") |
| 110 | List<ScheduleRealInfo> scheduleByDateAndLineInOut(String line,String date,String zd); | 110 | List<ScheduleRealInfo> scheduleByDateAndLineInOut(String line,String date,String zd); |
| 111 | 111 | ||
| 112 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 112 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 113 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDate = str_to_date(?2,'%Y-%m-%d') and xlBm =?3 order by realExecDate,fcsj") | 113 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDateStr = ?2 and xlBm =?3 order by realExecDate,fcsj") |
| 114 | List<ScheduleRealInfo> queryListWaybill2(String clZbh,String date,String line); | 114 | List<ScheduleRealInfo> queryListWaybill2(String clZbh,String date,String line); |
| 115 | 115 | ||
| 116 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 116 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 117 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') and s.gsBm like %?4% and s.fgsBm like %?5% order by realExecDate,dfsj") | 117 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDateStr = ?3 and s.gsBm like %?4% and s.fgsBm like %?5% order by realExecDate,dfsj") |
| 118 | List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date,String gsbm,String fgsbm); | 118 | List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date,String gsbm,String fgsbm); |
| 119 | 119 | ||
| 120 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 120 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 121 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between str_to_date(?3,'%Y-%m-%d') and str_to_date(?4,'%Y-%m-%d') order by bcs") | 121 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.scheduleDateStr >=?3 and s.scheduleDateStr <=?4 order by bcs") |
| 122 | List<ScheduleRealInfo> queryListWaybill4(String jName,String clZbh,String date,String enddate); | 122 | List<ScheduleRealInfo> queryListWaybill4(String jName,String clZbh,String date,String enddate); |
| 123 | 123 | ||
| 124 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 124 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 125 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2") | 125 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2") |
| 126 | List<ScheduleRealInfo> scheduleDaily(String line,String date); | 126 | List<ScheduleRealInfo> scheduleDaily(String line,String date); |
| 127 | 127 | ||
| 128 | @Query(value = "select count(*) from ScheduleRealInfo s where s.xlBm=?1 and s.scheduleDateStr=?2") | 128 | @Query(value = "select count(*) from ScheduleRealInfo s where s.xlBm=?1 and s.scheduleDateStr=?2") |
| @@ -139,66 +139,66 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -139,66 +139,66 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 139 | 139 | ||
| 140 | //去掉了 xlBm is not null | 140 | //去掉了 xlBm is not null |
| 141 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 141 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 142 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.fcsj, lpName") | 142 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr = ?2 order by s.xlDir,s.realExecDate,s.fcsj, lpName") |
| 143 | List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); | 143 | List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); |
| 144 | 144 | ||
| 145 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 145 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 146 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.lpName, s.realExecDate,s.fcsj") | 146 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and s.scheduleDateStr = ?2 order by s.lpName, s.realExecDate,s.fcsj") |
| 147 | List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); | 147 | List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); |
| 148 | 148 | ||
| 149 | 149 | ||
| 150 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 150 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 151 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") | 151 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and s.scheduleDateStr = ?3 order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") |
| 152 | List<ScheduleRealInfo> scheduleByDateAndLineByGs_(String gsdm,String fgsdm,String date); | 152 | List<ScheduleRealInfo> scheduleByDateAndLineByGs_(String gsdm,String fgsdm,String date); |
| 153 | 153 | ||
| 154 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 154 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 155 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 and s.bcType not in ('in','out','ldks') order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") | 155 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and s.scheduleDateStr = ?3 and s.bcType not in ('in','out','ldks') order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") |
| 156 | List<ScheduleRealInfo> scheduleByDateAndLineByGs(String gsdm,String fgsdm,String date); | 156 | List<ScheduleRealInfo> scheduleByDateAndLineByGs(String gsdm,String fgsdm,String date); |
| 157 | 157 | ||
| 158 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 158 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 159 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") | 159 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr= ?2 order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") |
| 160 | List<ScheduleRealInfo> scheduleByDateAndLineQp2(String line,String date); | 160 | List<ScheduleRealInfo> scheduleByDateAndLineQp2(String line,String date); |
| 161 | 161 | ||
| 162 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 162 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 163 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out','ldks') order by s.xlBm,s.adjustExps,s.fcsj") | 163 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr = ?2 and s.bcType not in ('in','out','ldks') order by s.xlBm,s.adjustExps,s.fcsj") |
| 164 | List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date); | 164 | List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date); |
| 165 | 165 | ||
| 166 | //按月统计 | 166 | //按月统计 |
| 167 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 167 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 168 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m') = ?2 and s.bcType not in ('in','out','ldks') order by s.xlBm") | 168 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr = ?2 and s.bcType not in ('in','out','ldks') order by s.xlBm") |
| 169 | List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date); | 169 | List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date); |
| 170 | 170 | ||
| 171 | //按照时间段统计 | 171 | //按照时间段统计 |
| 172 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 172 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 173 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and gsBm like %?4% and fgsBm like %?5% order by s.xlBm") | 173 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 and gsBm like %?4% and fgsBm like %?5% order by s.xlBm") |
| 174 | List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm); | 174 | List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm); |
| 175 | 175 | ||
| 176 | //按照时间段统计 | 176 | //按照时间段统计 |
| 177 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 177 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 178 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm") | 178 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.xlBm") |
| 179 | List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); | 179 | List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); |
| 180 | //月报表 | 180 | //月报表 |
| 181 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 181 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 182 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm") | 182 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDateStr >= ?2 and s.scheduleDateStr<= ?3 order by s.xlBm") |
| 183 | List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); | 183 | List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); |
| 184 | 184 | ||
| 185 | 185 | ||
| 186 | - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj") | 186 | + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj") |
| 187 | List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm); | 187 | List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm); |
| 188 | 188 | ||
| 189 | - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj") | 189 | + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm =?1 and s.scheduleDateStr = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj") |
| 190 | List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm); | 190 | List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm); |
| 191 | 191 | ||
| 192 | - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") | 192 | + @Query(value="select s from ScheduleRealInfo s where s.scheduleDateStr = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") |
| 193 | List<ScheduleRealInfo> setLD(String date); | 193 | List<ScheduleRealInfo> setLD(String date); |
| 194 | 194 | ||
| 195 | - @Query(value="select new map(xlBm as xlBm,lpName as lpName,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh") | 195 | + @Query(value="select new map(xlBm as xlBm,lpName as lpName,clZbh as clZbh) from ScheduleRealInfo s where s.scheduleDateStr = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh") |
| 196 | List<Map<String,Object>> setLDGroup(String date); | 196 | List<Map<String,Object>> setLDGroup(String date); |
| 197 | 197 | ||
| 198 | - @Query(value="select new map(xlBm as xlBm,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh") | 198 | + @Query(value="select new map(xlBm as xlBm,clZbh as clZbh) from ScheduleRealInfo s where s.scheduleDateStr = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh") |
| 199 | List<Map<String,Object>> setLCYHGroup(String date); | 199 | List<Map<String,Object>> setLCYHGroup(String date); |
| 200 | 200 | ||
| 201 | - @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") | 201 | + @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where s.scheduleDateStr = ?1 GROUP BY xlBm ORDER BY xlBm") |
| 202 | List<Map<String,Object>> setDDRBGroup(String date); | 202 | List<Map<String,Object>> setDDRBGroup(String date); |
| 203 | 203 | ||
| 204 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 204 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -201,7 +201,7 @@ public class FormsServiceImpl implements FormsService { | @@ -201,7 +201,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 201 | + " LEFT JOIN bsth_c_s_sp_info_real r on r.xl_bm=l.line_code" | 201 | + " LEFT JOIN bsth_c_s_sp_info_real r on r.xl_bm=l.line_code" |
| 202 | + " where 1=1 "; | 202 | + " where 1=1 "; |
| 203 | if(map.get("date").toString()!=""){ | 203 | if(map.get("date").toString()!=""){ |
| 204 | - sql+="and to_days(r.schedule_date)=to_days('"+map.get("date").toString() + "') "; | 204 | + sql+="and r.schedule_date_str='"+map.get("date").toString() + "'"; |
| 205 | } | 205 | } |
| 206 | if( map.get("line").toString()!=""){ | 206 | if( map.get("line").toString()!=""){ |
| 207 | sql+=" and l.line_code=" + map.get("line").toString(); | 207 | sql+=" and l.line_code=" + map.get("line").toString(); |
| @@ -251,24 +251,14 @@ public class FormsServiceImpl implements FormsService { | @@ -251,24 +251,14 @@ public class FormsServiceImpl implements FormsService { | ||
| 251 | }else{ | 251 | }else{ |
| 252 | sql += " r.cl_zbh"; | 252 | sql += " r.cl_zbh"; |
| 253 | } | 253 | } |
| 254 | - sql += " from bsth_c_s_sp_info_real r where 1=1 "; | ||
| 255 | - if(map.get("startDate")!=null&&!map.get("startDate").equals("")){ | ||
| 256 | - sql+=" and to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') "; | ||
| 257 | - } | ||
| 258 | - | ||
| 259 | - if(map.get("endDate")!=null&&!map.get("endDate").equals("")){ | ||
| 260 | - sql+=" and to_days('" + map.get("endDate").toString() + "') "; | ||
| 261 | - } | 254 | + sql += " from bsth_c_s_sp_info_real r where " |
| 255 | + + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " | ||
| 256 | + + " and r.schedule_date_str <='" + map.get("endDate").toString() + "' "; | ||
| 262 | if(map.get("line")!=null&&!map.get("line").equals("")){ | 257 | if(map.get("line")!=null&&!map.get("line").equals("")){ |
| 263 | sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; | 258 | sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; |
| 264 | } | 259 | } |
| 265 | -// sql+= " AND r.gs_bm is not null and r.bc_type not in('in','out')"; | ||
| 266 | -// if(map.get("gsdmManth")!=null&&!map.get("gsdmManth").equals("")){ | ||
| 267 | - sql+=" and r.gs_bm like'%"+gsdmManth+"%' "; | ||
| 268 | -// } | ||
| 269 | - if(map.get("fgsdmManth")!=null&&!map.get("fgsdmManth").equals("")){ | ||
| 270 | - sql+=" and r.fgs_bm like'%"+fgsdmManth+"%' "; | ||
| 271 | - } | 260 | + sql+=" and r.gs_bm like'%"+gsdmManth+"%' and r.fgs_bm like'%"+fgsdmManth+"%'"; |
| 261 | + | ||
| 272 | if(empnames.equals("驾驶员")){ | 262 | if(empnames.equals("驾驶员")){ |
| 273 | sql += " GROUP BY " | 263 | sql += " GROUP BY " |
| 274 | + "r.j_name,r.j_gh"; | 264 | + "r.j_name,r.j_gh"; |
| @@ -278,11 +268,6 @@ public class FormsServiceImpl implements FormsService { | @@ -278,11 +268,6 @@ public class FormsServiceImpl implements FormsService { | ||
| 278 | sql += " GROUP BY r.cl_zbh"; | 268 | sql += " GROUP BY r.cl_zbh"; |
| 279 | } | 269 | } |
| 280 | 270 | ||
| 281 | -// + ",r.gs_bm,r.gs_name," | ||
| 282 | -// + "r.fgs_bm,r.fgs_name,r.bc_type "; | ||
| 283 | - | ||
| 284 | -// r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name," | ||
| 285 | -// + " r.fgs_bm,r.fgs_name,r.bc_type,r.s_name,r.lp_name | ||
| 286 | List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { | 271 | List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { |
| 287 | 272 | ||
| 288 | @Override | 273 | @Override |
| @@ -409,7 +394,7 @@ public class FormsServiceImpl implements FormsService { | @@ -409,7 +394,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 409 | + "IFNULL(r.s_name,'')as s_name," | 394 | + "IFNULL(r.s_name,'')as s_name," |
| 410 | + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name " | 395 | + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name " |
| 411 | + "FROM bsth_c_s_sp_info_real r where 1=1 " | 396 | + "FROM bsth_c_s_sp_info_real r where 1=1 " |
| 412 | - + " and to_days(r.schedule_date)=to_days('"+date + "') " | 397 | + + " and r.schedule_date_str='"+date + "' " |
| 413 | + " and r.xl_bm like '%"+line+"%' " | 398 | + " and r.xl_bm like '%"+line+"%' " |
| 414 | + " and r.gs_bm like '%"+gsdmShif+"%' " | 399 | + " and r.gs_bm like '%"+gsdmShif+"%' " |
| 415 | + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" | 400 | + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" |
| @@ -547,19 +532,6 @@ public class FormsServiceImpl implements FormsService { | @@ -547,19 +532,6 @@ public class FormsServiceImpl implements FormsService { | ||
| 547 | if(map.get("fgsdm")!=null){ | 532 | if(map.get("fgsdm")!=null){ |
| 548 | fgs =map.get("fgsdm").toString(); | 533 | fgs =map.get("fgsdm").toString(); |
| 549 | } | 534 | } |
| 550 | - /*String sql = " select c.*,l.line_code from bsth_c_chtoch c LEFT JOIN bsth_c_line l on c.xl=l.name WHERE 1=1 "; | ||
| 551 | - if (!map.get("startDate").toString().equals(" ") && !map.get("endDate").toString().equals(" ")) { | ||
| 552 | - sql += "and DATE_FORMAT( c.rq,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" | ||
| 553 | - + map.get("endDate").toString() + "'"; | ||
| 554 | - } | ||
| 555 | - if (!map.get("line").equals("")) { | ||
| 556 | - sql += "and line_code='" + map.get("line") + "'"; | ||
| 557 | - } | ||
| 558 | - if (map.get("sel").equals("2")) { | ||
| 559 | - sql += " and c.pcch!=c.pcry"; | ||
| 560 | - } else if (map.get("sel").equals("1")) { | ||
| 561 | - sql += " and c.jhgh!=c.sjgh"; | ||
| 562 | - }*/ | ||
| 563 | 535 | ||
| 564 | String sql="select * from bsth_c_chtoch where rq BETWEEN '"+ map.get("startDate").toString()+"' " | 536 | String sql="select * from bsth_c_chtoch where rq BETWEEN '"+ map.get("startDate").toString()+"' " |
| 565 | + " and '"+map.get("endDate").toString() +"'"; | 537 | + " and '"+map.get("endDate").toString() +"'"; |
| @@ -630,19 +602,6 @@ public class FormsServiceImpl implements FormsService { | @@ -630,19 +602,6 @@ public class FormsServiceImpl implements FormsService { | ||
| 630 | 602 | ||
| 631 | // rq = rq2 + "-" + rq3; | 603 | // rq = rq2 + "-" + rq3; |
| 632 | startDate = map.get("startDate").toString(); | 604 | startDate = map.get("startDate").toString(); |
| 633 | -// endDate = map.get("endDate").toString(); | ||
| 634 | -// String sql = "select t.*,y.yh,y.jzl from (" | ||
| 635 | -// + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | ||
| 636 | -// + " from bsth_c_s_sp_info_real r where r.schedule_date_str " | ||
| 637 | -// + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' " | ||
| 638 | -// + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' " | ||
| 639 | -// + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' " | ||
| 640 | -// + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t " | ||
| 641 | -// + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl " | ||
| 642 | -// + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and " | ||
| 643 | -// + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' " | ||
| 644 | -// + "group by a.nbbm,a.jsy) y" | ||
| 645 | -// + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh"; | ||
| 646 | 605 | ||
| 647 | String sql="select r.s_gh,r.s_name, " | 606 | String sql="select r.s_gh,r.s_name, " |
| 648 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | 607 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" |
| @@ -775,19 +734,28 @@ public class FormsServiceImpl implements FormsService { | @@ -775,19 +734,28 @@ public class FormsServiceImpl implements FormsService { | ||
| 775 | String line=y.getXlbm(); | 734 | String line=y.getXlbm(); |
| 776 | String clzbh=y.getNbbm(); | 735 | String clzbh=y.getNbbm(); |
| 777 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | 736 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); |
| 737 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 778 | for (int j = 0; j < listReal.size(); j++) { | 738 | for (int j = 0; j < listReal.size(); j++) { |
| 779 | ScheduleRealInfo s=listReal.get(j); | 739 | ScheduleRealInfo s=listReal.get(j); |
| 780 | if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | 740 | if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) |
| 781 | &&s.getXlBm().equals(line)){ | 741 | &&s.getXlBm().equals(line)){ |
| 782 | newList.add(s); | 742 | newList.add(s); |
| 743 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 744 | + if(cts != null && cts.size() > 0){ | ||
| 745 | + newList_.add(s); | ||
| 746 | + }else{ | ||
| 747 | + if(s.getZdsjActual()!=null){ | ||
| 748 | + newList_.add(s); | ||
| 749 | + } | ||
| 750 | + } | ||
| 783 | } | 751 | } |
| 784 | } | 752 | } |
| 785 | double jhgl=culateMileageService.culateJhgl(newList); | 753 | double jhgl=culateMileageService.culateJhgl(newList); |
| 786 | double jhjcc=culateMileageService.culateJhJccgl(newList); | 754 | double jhjcc=culateMileageService.culateJhJccgl(newList); |
| 787 | - double yygl=culateMileageService.culateSjgl(newList); | ||
| 788 | - double ljgl=culateMileageService.culateLjgl(newList); | ||
| 789 | - double ksgl=culateMileageService.culateKsgl(newList); | ||
| 790 | - double jcgl=culateMileageService.culateJccgl(newList); | 755 | + double yygl=culateMileageService.culateSjgl(newList_); |
| 756 | + double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 757 | + double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 758 | + double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 791 | 759 | ||
| 792 | double zyygl=Arith.add(yygl, ljgl); | 760 | double zyygl=Arith.add(yygl, ljgl); |
| 793 | double zksgl=Arith.add(ksgl, jcgl); | 761 | double zksgl=Arith.add(ksgl, jcgl); |
| @@ -1210,8 +1178,8 @@ public class FormsServiceImpl implements FormsService { | @@ -1210,8 +1178,8 @@ public class FormsServiceImpl implements FormsService { | ||
| 1210 | 1178 | ||
| 1211 | String sql = "select gs_name, fgs_name, cl_zbh, fcsj, bc_type, xl_bm, xl_name, schedule_date" | 1179 | String sql = "select gs_name, fgs_name, cl_zbh, fcsj, bc_type, xl_bm, xl_name, schedule_date" |
| 1212 | + " from bsth_c_s_sp_info where gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"' " | 1180 | + " from bsth_c_s_sp_info where gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"' " |
| 1213 | - + "and DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' " | ||
| 1214 | - + "and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"' "; | 1181 | + + "and schedule_date_str >= '"+startDate+"' " |
| 1182 | + + "and schedule_date_str <= '"+endDate+"' "; | ||
| 1215 | if(line.trim().length() != 0){ | 1183 | if(line.trim().length() != 0){ |
| 1216 | sql += "and xl_bm = '"+line+"' "; | 1184 | sql += "and xl_bm = '"+line+"' "; |
| 1217 | } | 1185 | } |
| @@ -1367,8 +1335,8 @@ public class FormsServiceImpl implements FormsService { | @@ -1367,8 +1335,8 @@ public class FormsServiceImpl implements FormsService { | ||
| 1367 | 1335 | ||
| 1368 | String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " | 1336 | String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " |
| 1369 | + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" | 1337 | + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" |
| 1370 | - + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" | ||
| 1371 | - + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" | 1338 | + + " from bsth_c_s_sp_info" + " where schedule_date_str >= '" |
| 1339 | + + map.get("startDate").toString() + "' and schedule_date_str <='" + map.get("endDate").toString() + "' and xl_bm='" | ||
| 1372 | + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" | 1340 | + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out')" |
| 1373 | + " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'" | 1341 | + " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'" |
| 1374 | + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'" | 1342 | + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'" |
| @@ -1376,7 +1344,7 @@ public class FormsServiceImpl implements FormsService { | @@ -1376,7 +1344,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 1376 | + " ) a left JOIN (" | 1344 | + " ) a left JOIN (" |
| 1377 | + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " | 1345 | + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " |
| 1378 | + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " | 1346 | + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl,bc_type from bsth_c_s_sp_info_real " |
| 1379 | - + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" | 1347 | + + "where schedule_date_str >= '" + map.get("startDate").toString() + "' and schedule_date_str <= '" |
| 1380 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() | 1348 | + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() |
| 1381 | + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " | 1349 | + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " |
| 1382 | // + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type" | 1350 | // + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name,bc_type" |
| @@ -1451,8 +1419,8 @@ public class FormsServiceImpl implements FormsService { | @@ -1451,8 +1419,8 @@ public class FormsServiceImpl implements FormsService { | ||
| 1451 | 1419 | ||
| 1452 | String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " | 1420 | String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.xl_name,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,a.bc_type from " |
| 1453 | + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" | 1421 | + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl,bc_type" |
| 1454 | - + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" | ||
| 1455 | - + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" | 1422 | + + " from bsth_c_s_sp_info" + " where schedule_date_str >= '" |
| 1423 | + + map.get("startDate").toString() + "' and schedule_date_str<= '" + map.get("endDate").toString() + "' and xl_bm='" | ||
| 1456 | + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " | 1424 | + map.get("line").toString() + "' AND gs_bm is not null AND bc_type NOT IN ('in', 'out') " |
| 1457 | + " and gs_bm='"+ map.get("gsdmAllline").toString() + "'" | 1425 | + " and gs_bm='"+ map.get("gsdmAllline").toString() + "'" |
| 1458 | + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'" | 1426 | + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'" |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -17,7 +17,6 @@ import java.util.List; | @@ -17,7 +17,6 @@ import java.util.List; | ||
| 17 | import java.util.Map; | 17 | import java.util.Map; |
| 18 | import java.util.Set; | 18 | import java.util.Set; |
| 19 | 19 | ||
| 20 | -import org.apache.commons.lang3.StringEscapeUtils; | ||
| 21 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 22 | import org.springframework.jdbc.core.BeanPropertyRowMapper; | 21 | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| 23 | import org.springframework.jdbc.core.JdbcTemplate; | 22 | import org.springframework.jdbc.core.JdbcTemplate; |
| @@ -25,7 +24,6 @@ import org.springframework.jdbc.core.RowMapper; | @@ -25,7 +24,6 @@ import org.springframework.jdbc.core.RowMapper; | ||
| 25 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
| 26 | 25 | ||
| 27 | import com.alibaba.fastjson.JSONArray; | 26 | import com.alibaba.fastjson.JSONArray; |
| 28 | -import com.alibaba.fastjson.JSONObject; | ||
| 29 | import com.bsth.data.BasicData; | 27 | import com.bsth.data.BasicData; |
| 30 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | 28 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; |
| 31 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 29 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| @@ -1715,13 +1713,13 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1715,13 +1713,13 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1715 | } | 1713 | } |
| 1716 | } | 1714 | } |
| 1717 | boolean flag = true; | 1715 | boolean flag = true; |
| 1718 | - if(jhlc.toString().equals("0")){ | 1716 | + if(jhlc.doubleValue() == 0d){ |
| 1719 | flag = false; | 1717 | flag = false; |
| 1720 | } | 1718 | } |
| 1721 | tempMap.put("date", Date); | 1719 | tempMap.put("date", Date); |
| 1722 | tempMap.put("company", companyName); | 1720 | tempMap.put("company", companyName); |
| 1723 | tempMap.put("subCompany", subCompanyName); | 1721 | tempMap.put("subCompany", subCompanyName); |
| 1724 | - tempMap.put("times", times); | 1722 | + tempMap.put("times", sfqr == 1 ? times : "全日"); |
| 1725 | tempMap.put("line", key); | 1723 | tempMap.put("line", key); |
| 1726 | tempMap.put("jhbc", jhbc); | 1724 | tempMap.put("jhbc", jhbc); |
| 1727 | tempMap.put("sjbc", sjbc); | 1725 | tempMap.put("sjbc", sjbc); |
| @@ -1732,37 +1730,37 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1732,37 +1730,37 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1732 | tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%"); | 1730 | tempMap.put("lcbfb", df.format(flag?sjlc.divide(jhlc, 4, BigDecimal.ROUND_HALF_UP).doubleValue()*100:0)+"%"); |
| 1733 | tempMap.put("lzbc", lzbc); | 1731 | tempMap.put("lzbc", lzbc); |
| 1734 | tempMap.put("lzlc", lzlc.doubleValue()); | 1732 | tempMap.put("lzlc", lzlc.doubleValue()); |
| 1735 | - tempMap.put("lzbfb", df.format(flag?(double)lzbc/jhbc*100:0)+"%"); | 1733 | + tempMap.put("lzbfb", df.format(jhbc>0?(double)lzbc/jhbc*100:0)+"%"); |
| 1736 | tempMap.put("dmbc", dmbc); | 1734 | tempMap.put("dmbc", dmbc); |
| 1737 | tempMap.put("dmlc", dmlc.doubleValue()); | 1735 | tempMap.put("dmlc", dmlc.doubleValue()); |
| 1738 | - tempMap.put("dmbfb", df.format(flag?(double)dmbc/jhbc*100:0)+"%"); | 1736 | + tempMap.put("dmbfb", df.format(jhbc>0?(double)dmbc/jhbc*100:0)+"%"); |
| 1739 | tempMap.put("gzbc", gzbc); | 1737 | tempMap.put("gzbc", gzbc); |
| 1740 | tempMap.put("gzlc", gzlc.doubleValue()); | 1738 | tempMap.put("gzlc", gzlc.doubleValue()); |
| 1741 | - tempMap.put("gzbfb", df.format(flag?(double)gzbc/jhbc*100:0)+"%"); | 1739 | + tempMap.put("gzbfb", df.format(jhbc>0?(double)gzbc/jhbc*100:0)+"%"); |
| 1742 | tempMap.put("jfbc", jfbc); | 1740 | tempMap.put("jfbc", jfbc); |
| 1743 | tempMap.put("jflc", jflc.doubleValue()); | 1741 | tempMap.put("jflc", jflc.doubleValue()); |
| 1744 | - tempMap.put("jfbfb", df.format(flag?(double)jfbc/jhbc*100:0)+"%"); | 1742 | + tempMap.put("jfbfb", df.format(jhbc>0?(double)jfbc/jhbc*100:0)+"%"); |
| 1745 | tempMap.put("zsbc", zsbc); | 1743 | tempMap.put("zsbc", zsbc); |
| 1746 | tempMap.put("zslc", zslc.doubleValue()); | 1744 | tempMap.put("zslc", zslc.doubleValue()); |
| 1747 | - tempMap.put("zsbfb", df.format(flag?(double)zsbc/jhbc*100:0)+"%"); | 1745 | + tempMap.put("zsbfb", df.format(jhbc>0?(double)zsbc/jhbc*100:0)+"%"); |
| 1748 | tempMap.put("qrbc", qrbc); | 1746 | tempMap.put("qrbc", qrbc); |
| 1749 | tempMap.put("qrlc", qrlc.doubleValue()); | 1747 | tempMap.put("qrlc", qrlc.doubleValue()); |
| 1750 | - tempMap.put("qrbfb", df.format(flag?(double)qrbc/jhbc*100:0)+"%"); | 1748 | + tempMap.put("qrbfb", df.format(jhbc>0?(double)qrbc/jhbc*100:0)+"%"); |
| 1751 | tempMap.put("qcbc", qcbc); | 1749 | tempMap.put("qcbc", qcbc); |
| 1752 | tempMap.put("qclc", qclc.doubleValue()); | 1750 | tempMap.put("qclc", qclc.doubleValue()); |
| 1753 | - tempMap.put("qcbfb", df.format(flag?(double)qcbc/jhbc*100:0)+"%"); | 1751 | + tempMap.put("qcbfb", df.format(jhbc>0?(double)qcbc/jhbc*100:0)+"%"); |
| 1754 | tempMap.put("kxbc", kxbc); | 1752 | tempMap.put("kxbc", kxbc); |
| 1755 | tempMap.put("kxlc", kxlc.doubleValue()); | 1753 | tempMap.put("kxlc", kxlc.doubleValue()); |
| 1756 | - tempMap.put("kxbfb", df.format(flag?(double)kxbc/jhbc*100:0)+"%"); | 1754 | + tempMap.put("kxbfb", df.format(jhbc>0?(double)kxbc/jhbc*100:0)+"%"); |
| 1757 | tempMap.put("qhbc", qhbc); | 1755 | tempMap.put("qhbc", qhbc); |
| 1758 | tempMap.put("qhlc", qhlc.doubleValue()); | 1756 | tempMap.put("qhlc", qhlc.doubleValue()); |
| 1759 | - tempMap.put("qhbfb", df.format(flag?(double)qhbc/jhbc*100:0)+"%"); | 1757 | + tempMap.put("qhbfb", df.format(jhbc>0?(double)qhbc/jhbc*100:0)+"%"); |
| 1760 | tempMap.put("wybc", wybc); | 1758 | tempMap.put("wybc", wybc); |
| 1761 | tempMap.put("wylc", wylc.doubleValue()); | 1759 | tempMap.put("wylc", wylc.doubleValue()); |
| 1762 | - tempMap.put("wybfb", df.format(flag?(double)wybc/jhbc*100:0)+"%"); | 1760 | + tempMap.put("wybfb", df.format(jhbc>0?(double)wybc/jhbc*100:0)+"%"); |
| 1763 | tempMap.put("qtbc", qtbc); | 1761 | tempMap.put("qtbc", qtbc); |
| 1764 | tempMap.put("qtlc", qtlc.doubleValue()); | 1762 | tempMap.put("qtlc", qtlc.doubleValue()); |
| 1765 | - tempMap.put("qtbfb", df.format(flag?(double)qtbc/jhbc*100:0)+"%"); | 1763 | + tempMap.put("qtbfb", df.format(jhbc>0?(double)qtbc/jhbc*100:0)+"%"); |
| 1766 | 1764 | ||
| 1767 | resList.add(tempMap); | 1765 | resList.add(tempMap); |
| 1768 | } | 1766 | } |
| @@ -1784,7 +1782,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1784,7 +1782,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1784 | e.printStackTrace(); | 1782 | e.printStackTrace(); |
| 1785 | } | 1783 | } |
| 1786 | } | 1784 | } |
| 1787 | - System.out.println(map); | ||
| 1788 | 1785 | ||
| 1789 | return resList; | 1786 | return resList; |
| 1790 | } | 1787 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -24,6 +24,7 @@ import com.bsth.data.utils.CustomStringUtils; | @@ -24,6 +24,7 @@ import com.bsth.data.utils.CustomStringUtils; | ||
| 24 | import com.bsth.entity.Cars; | 24 | import com.bsth.entity.Cars; |
| 25 | import com.bsth.entity.Line; | 25 | import com.bsth.entity.Line; |
| 26 | import com.bsth.entity.Personnel; | 26 | import com.bsth.entity.Personnel; |
| 27 | +import com.bsth.entity.mcy_forms.Waybillday; | ||
| 27 | import com.bsth.entity.oil.Dlb; | 28 | import com.bsth.entity.oil.Dlb; |
| 28 | import com.bsth.entity.oil.Ylb; | 29 | import com.bsth.entity.oil.Ylb; |
| 29 | import com.bsth.entity.oil.Ylxxb; | 30 | import com.bsth.entity.oil.Ylxxb; |
| @@ -789,13 +790,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -789,13 +790,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 789 | + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, " | 790 | + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, " |
| 790 | + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ," | 791 | + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ," |
| 791 | + " min(s.fcsj) as fcsj,1 as px from bsth_c_s_sp_info_real s where " | 792 | + " min(s.fcsj) as fcsj,1 as px from bsth_c_s_sp_info_real s where " |
| 792 | - + " s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"'" | 793 | + + " s.xl_Bm = '"+line+"' and s.schedule_date_str ='"+date+"'" |
| 793 | + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name ) x where x.fcsj >'"+minfcsj+"'" | 794 | + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name ) x where x.fcsj >'"+minfcsj+"'" |
| 794 | + " UNION " | 795 | + " UNION " |
| 795 | + " select * from ( select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, " | 796 | + " select * from ( select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, " |
| 796 | + " s.lp_Name as lpName,s.j_Name as jName, max(s.schedule_date_str) as dateStr," | 797 | + " s.lp_Name as lpName,s.j_Name as jName, max(s.schedule_date_str) as dateStr," |
| 797 | + " min(s.fcsj) as fcsj,2 as px from bsth_c_s_sp_info_real s " | 798 | + " min(s.fcsj) as fcsj,2 as px from bsth_c_s_sp_info_real s " |
| 798 | - + " where s.xl_Bm = '"+line+"' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='"+date+"'" | 799 | + + " where s.xl_Bm = '"+line+"' and s.schedule_date_str ='"+date+"'" |
| 799 | + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name " | 800 | + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name " |
| 800 | + " ) y where y.fcsj <='"+minfcsj+"') z order by (" + state + "),dateStr,px " + type; | 801 | + " ) y where y.fcsj <='"+minfcsj+"') z order by (" + state + "),dateStr,px " + type; |
| 801 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, | 802 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, |
| @@ -2944,17 +2945,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2944,17 +2945,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2944 | }else{ | 2945 | }else{ |
| 2945 | yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList_eq(line, date,gsbm,fgsbm,nbbm); | 2946 | yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList_eq(line, date,gsbm,fgsbm,nbbm); |
| 2946 | } | 2947 | } |
| 2947 | - | ||
| 2948 | -// System.out.println("shijian2:"+new Date()); | ||
| 2949 | - // List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | 2948 | + System.out.println("time2:"+new Date()); |
| 2949 | + | ||
| 2950 | List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm); | 2950 | List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm); |
| 2951 | -// System.out.println("shijian3:"+new Date()); | ||
| 2952 | for (int x = 0; x < yesterdayDataList.size(); x++) { | 2951 | for (int x = 0; x < yesterdayDataList.size(); x++) { |
| 2953 | String jName = yesterdayDataList.get(x).get("jGh").toString(); | 2952 | String jName = yesterdayDataList.get(x).get("jGh").toString(); |
| 2954 | String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); | 2953 | String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); |
| 2955 | String xlbm = yesterdayDataList.get(x).get("xlBm").toString(); | 2954 | String xlbm = yesterdayDataList.get(x).get("xlBm").toString(); |
| 2956 | -// double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0; | ||
| 2957 | - double addMileage = 0, remMileage = 0; | ||
| 2958 | Map<String, Object> map = new HashMap<String, Object>(); | 2955 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2959 | boolean fage = true; | 2956 | boolean fage = true; |
| 2960 | String company=""; | 2957 | String company=""; |
| @@ -2982,7 +2979,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2982,7 +2979,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2982 | 2979 | ||
| 2983 | yesterdayDataList.get(x).put("company", company); | 2980 | yesterdayDataList.get(x).put("company", company); |
| 2984 | yesterdayDataList.get(x).put("bCompany", bCompany); | 2981 | yesterdayDataList.get(x).put("bCompany", bCompany); |
| 2985 | -// Double zgl=Arith.add(yygl,ksgl); | ||
| 2986 | Double ljgl=culateMieageService.culateLjgl(listS); | 2982 | Double ljgl=culateMieageService.culateLjgl(listS); |
| 2987 | Double sjgl=culateMieageService.culateSjgl(listS); | 2983 | Double sjgl=culateMieageService.culateSjgl(listS); |
| 2988 | Double ksgl=culateMieageService.culateKsgl(listS); | 2984 | Double ksgl=culateMieageService.culateKsgl(listS); |
| @@ -2993,15 +2989,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2993,15 +2989,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2993 | yesterdayDataList.get(x).put("totalKilometers", zlc); | 2989 | yesterdayDataList.get(x).put("totalKilometers", zlc); |
| 2994 | 2990 | ||
| 2995 | } | 2991 | } |
| 2996 | - /* List<Map<String, Object>> yesterdayDataLists = new ArrayList<Map<String, Object>>(); | ||
| 2997 | - | ||
| 2998 | - for (int i = 0; i < yesterdayDataList.size(); i++) { | ||
| 2999 | - Map<String, Object> map=yesterdayDataList.get(i); | ||
| 3000 | - Double zlc=map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString()); | ||
| 3001 | -// if(zlc>0){ | ||
| 3002 | - yesterdayDataLists.add(map); | ||
| 3003 | -// } | ||
| 3004 | - }*/ | ||
| 3005 | //增加顺序号 | 2992 | //增加顺序号 |
| 3006 | for (int i = 0; i < yesterdayDataList.size(); i++) { | 2993 | for (int i = 0; i < yesterdayDataList.size(); i++) { |
| 3007 | if (i == 0) { | 2994 | if (i == 0) { |