Commit a9f59587db883a275f9a751b6cd040db851804e5

Authored by ljq
1 parent 6c19df85

嘉定调度升级

Showing 21 changed files with 859 additions and 100 deletions
src/main/java/com/bsth/controller/BusIntervalController.java
... ... @@ -74,4 +74,8 @@ public class BusIntervalController {
74 74 public Map<String, Object> exportWaybillMoreJd(@RequestParam Map<String, Object> map){
75 75 return busIntervalService.exportWaybillMoreJd(map);
76 76 }
  77 + @RequestMapping(value = "schedulingAll", method = RequestMethod.GET)
  78 + public List<ScheduleRealInfo> schedulingAll(@RequestParam Map<String, Object> map){
  79 + return busIntervalService.schedulingAll(map);
  80 + }
77 81 }
... ...
src/main/java/com/bsth/controller/schedule/core/SchedulePlanController.java
... ... @@ -5,10 +5,7 @@ import com.bsth.controller.schedule.BController;
5 5 import com.bsth.entity.schedule.SchedulePlan;
6 6 import com.bsth.service.schedule.SchedulePlanService;
7 7 import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.web.bind.annotation.PathVariable;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RestController;
  8 +import org.springframework.web.bind.annotation.*;
12 9  
13 10 import java.util.Date;
14 11 import java.util.HashMap;
... ... @@ -74,4 +71,14 @@ public class SchedulePlanController extends BController&lt;SchedulePlan, Long&gt; {
74 71 return rtn;
75 72 }
76 73  
  74 + /**
  75 + * 查询线路最新的排班数据
  76 + * @param map
  77 + * @return
  78 + */
  79 + @RequestMapping(value = "/listwest",method = RequestMethod.GET)
  80 + public Map<String,Object> listwest(@RequestParam Map map){
  81 + return schedulePlanService.listwest(map);
  82 + }
  83 +
77 84 }
... ...
src/main/java/com/bsth/controller/schedule/core/SchedulePlanInfoController.java
... ... @@ -2,11 +2,16 @@ package com.bsth.controller.schedule.core;
2 2  
3 3 import com.bsth.common.ResponseCode;
4 4 import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.Line;
5 6 import com.bsth.entity.schedule.SchedulePlanInfo;
6 7 import com.bsth.service.schedule.SchedulePlanInfoService;
7 8 import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.jdbc.core.RowMapper;
8 10 import org.springframework.web.bind.annotation.*;
9 11  
  12 +import java.sql.ResultSet;
  13 +import java.sql.SQLException;
  14 +import java.text.SimpleDateFormat;
10 15 import java.util.Date;
11 16 import java.util.HashMap;
12 17 import java.util.List;
... ... @@ -39,6 +44,16 @@ public class SchedulePlanInfoController extends BController&lt;SchedulePlanInfo, Lo
39 44 return resultMap;
40 45 }
41 46  
  47 +
  48 + @RequestMapping(value = "/groupextinfosexport/{xlid}/{date}", method = RequestMethod.GET)
  49 + public List<Map<String, Object>> groupextinfosexport(@PathVariable(value = "xlid") Integer xlid,
  50 + @PathVariable(value = "date") Date scheduleDate) {
  51 +
  52 + List<SchedulePlanInfoService.SchedulePlanGroupInfo> list = schedulePlanInfoService.findSchedulePlanGroupInfo(xlid, scheduleDate);
  53 + return schedulePlanInfoService.infoexport(list);
  54 + }
  55 +
  56 +
42 57 @RequestMapping(value = "/lastestsd/{xlid}", method = RequestMethod.GET)
43 58 public Map<String, Object> findLastestPlanDate(
44 59 @PathVariable(value = "xlid") Integer xlid) {
... ...
src/main/java/com/bsth/service/BusIntervalService.java
... ... @@ -30,4 +30,6 @@ public interface BusIntervalService {
30 30 List<ScheduleRealInfo> exportWaybillJd(String jName,String clZbh,String lpName,String date,String line);
31 31  
32 32 List<Map<String, Object>> onTime(Map<String, Object> map);
  33 +
  34 + List<ScheduleRealInfo> schedulingAll(Map<String, Object> map);
33 35 }
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -21,6 +21,7 @@ import java.util.List;
21 21 import java.util.Map;
22 22 import java.util.Set;
23 23  
  24 +import com.bsth.entity.geo_data.GeoRoad;
24 25 import org.springframework.beans.factory.annotation.Autowired;
25 26 import org.springframework.jdbc.core.BeanPropertyRowMapper;
26 27 import org.springframework.jdbc.core.JdbcTemplate;
... ... @@ -56,6 +57,7 @@ import com.bsth.util.ReportRelatedUtils;
56 57 import com.bsth.util.ReportUtils;
57 58 import com.bsth.util.TimeUtils;
58 59 import com.google.gson.Gson;
  60 +import org.springframework.web.bind.annotation.RequestParam;
59 61  
60 62  
61 63 @Service
... ... @@ -1966,32 +1968,59 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1966 1968  
1967 1969 Map<String, Object> temp = new HashMap<String, Object>();
1968 1970 int jhbc_ = 0, sjbc_ = 0,
1969   - lzbc_ = 0, dmbc_ = 0,
  1971 + lzbc_ = 0, dmbc_ = 0, zgbc_ = 0,
1970 1972 gzbc_ = 0, jfbc_ = 0, zsbc_ = 0,
1971 1973 qrbc_ = 0, qcbc_ = 0, kxbc_ = 0,
1972 1974 qhbc_ = 0, wybc_ = 0, qtbc_ = 0;
  1975 + List<ScheduleRealInfo> jhbclist = new ArrayList();
  1976 + List<ScheduleRealInfo> sjbclist = new ArrayList();
  1977 + List<ScheduleRealInfo> lzbclist = new ArrayList();
  1978 + List<ScheduleRealInfo> dmbclist = new ArrayList();
  1979 + List<ScheduleRealInfo> gzbclist = new ArrayList();
  1980 + List<ScheduleRealInfo> jfbclist = new ArrayList();
  1981 + List<ScheduleRealInfo> zsbclist = new ArrayList();
  1982 + List<ScheduleRealInfo> qrbclist = new ArrayList();
  1983 + List<ScheduleRealInfo> qcbclist = new ArrayList();
  1984 + List<ScheduleRealInfo> kxbclist = new ArrayList();
  1985 + List<ScheduleRealInfo> qhbclist = new ArrayList();
  1986 + List<ScheduleRealInfo> wybclist = new ArrayList();
  1987 + List<ScheduleRealInfo> zgbclist = new ArrayList();
  1988 + List<ScheduleRealInfo> qtbclist = new ArrayList();
  1989 + String linecode ="";
1973 1990 BigDecimal jhlc_ = new BigDecimal("0"), sjlc_ = new BigDecimal("0"),
1974 1991 lzlc_ = new BigDecimal("0"), dmlc_ = new BigDecimal("0"),
1975 1992 gzlc_ = new BigDecimal("0"), jflc_ = new BigDecimal("0"),
1976 1993 zslc_ = new BigDecimal("0"), qrlc_ = new BigDecimal("0"),
1977 1994 qclc_ = new BigDecimal("0"), kxlc_ = new BigDecimal("0"),
1978 1995 qhlc_ = new BigDecimal("0"), wylc_ = new BigDecimal("0"),
1979   - qtlc_ = new BigDecimal("0");
  1996 + zglc_ = new BigDecimal("0"), qtlc_ = new BigDecimal("0");
1980 1997 // for(String key : keyMap.keySet()){
1981 1998 for(String key : keyList){
1982 1999 Map<String, Object> tempMap = new HashMap<String, Object>();
1983 2000 int jhbc = 0, sjbc = 0,
1984   - lzbc = 0, dmbc = 0,
  2001 + lzbc = 0, dmbc = 0, zgbc =0,
1985 2002 gzbc = 0, jfbc = 0, zsbc = 0,
1986 2003 qrbc = 0, qcbc = 0, kxbc = 0,
1987 2004 qhbc = 0, wybc = 0, qtbc = 0;
  2005 + lzbclist = new ArrayList();
  2006 + dmbclist = new ArrayList();
  2007 + gzbclist = new ArrayList();
  2008 + jfbclist = new ArrayList();
  2009 + zsbclist = new ArrayList();
  2010 + qrbclist = new ArrayList();
  2011 + qcbclist = new ArrayList();
  2012 + kxbclist = new ArrayList();
  2013 + qhbclist = new ArrayList();
  2014 + wybclist = new ArrayList();
  2015 + zgbclist = new ArrayList();
  2016 + qtbclist = new ArrayList();
1988 2017 BigDecimal jhlc = new BigDecimal("0"), sjlc = new BigDecimal("0"),
1989 2018 lzlc = new BigDecimal("0"), dmlc = new BigDecimal("0"),
1990 2019 gzlc = new BigDecimal("0"), jflc = new BigDecimal("0"),
1991 2020 zslc = new BigDecimal("0"), qrlc = new BigDecimal("0"),
1992 2021 qclc = new BigDecimal("0"), kxlc = new BigDecimal("0"),
1993 2022 qhlc = new BigDecimal("0"), wylc = new BigDecimal("0"),
1994   - qtlc = new BigDecimal("0");
  2023 + zglc = new BigDecimal("0"), qtlc = new BigDecimal("0");
1995 2024 String companyName = "", subCompanyName = "";
1996 2025 for(ScheduleRealInfo schedule : keyMap.get(key)){
1997 2026 if(schedule.getGsName() != null && companyName.trim().length() == 0)
... ... @@ -2009,6 +2038,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2009 2038 jhbc++;
2010 2039 jhlc = jhlc.add(lc);
2011 2040 }
  2041 + linecode = schedule.getXlBm();
2012 2042 if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null
2013 2043 && schedule.getStatus() != -1){
2014 2044 if(!schedule.isCcService())
... ... @@ -2017,36 +2047,52 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2017 2047 } else if(schedule.getStatus() == -1){
2018 2048 if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){
2019 2049 lzbc++;
  2050 + lzbclist.add(schedule);
2020 2051 // lzlc = lzlc.add(lc);
2021 2052 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){
2022 2053 dmbc++;
2023 2054 // dmlc = dmlc.add(lc);
  2055 + dmbclist.add(schedule);
2024 2056 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){
2025 2057 gzbc++;
  2058 + gzbclist.add(schedule);
2026 2059 // gzlc = gzlc.add(lc);
2027 2060 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){
2028 2061 jfbc++;
  2062 + jfbclist.add(schedule);
2029 2063 // jflc = jflc.add(lc);
2030 2064 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){
2031 2065 zsbc++;
  2066 + zsbclist.add(schedule);
2032 2067 // zslc = zslc.add(lc);
2033 2068 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){
2034 2069 qrbc++;
  2070 + qrbclist.add(schedule);
2035 2071 // qrlc = qrlc.add(lc);
2036 2072 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){
2037 2073 qcbc++;
  2074 + qcbclist.add(schedule);
2038 2075 // qclc = qclc.add(lc);
2039 2076 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){
2040 2077 kxbc++;
  2078 + kxbclist.add(schedule);
2041 2079 // kxlc = kxlc.add(lc);
2042 2080 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){
2043 2081 qhbc++;
  2082 + qhbclist.add(schedule);
2044 2083 // qhlc = qhlc.add(lc);
2045 2084 }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("援外") != -1){
2046 2085 wybc++;
  2086 + wybclist.add(schedule);
2047 2087 // wylc = wylc.add(lc);
2048   - } else {
  2088 + } else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("主观烂班") != -1){
  2089 + zgbc++;
  2090 + zgbclist.add(schedule);
  2091 +// wylc = wylc.add(lc);
  2092 + }
  2093 + else {
2049 2094 qtbc++;
  2095 + qtbclist.add(schedule);
2050 2096 // qtlc = qtlc.add(lc);
2051 2097 }
2052 2098 }
... ... @@ -2075,6 +2121,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2075 2121 kxlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "客稀"));
2076 2122 qhlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "气候"));
2077 2123 wylc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "援外"));
  2124 + zglc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "主观烂班"));
2078 2125 qtlc = new BigDecimal(culateService.culateCJLC(keyMap.get(key), "配车")).add(
2079 2126 new BigDecimal(culateService.culateCJLC(keyMap.get(key), "保养"))).add(
2080 2127 new BigDecimal(culateService.culateCJLC(keyMap.get(key), "抽减"))).add(
... ... @@ -2128,14 +2175,19 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2128 2175 tempMap.put("wybc", wybc);
2129 2176 tempMap.put("wylc", df.format(wylc.doubleValue()));
2130 2177 tempMap.put("wybfb", df.format(jhbc>0?(double)wybc/jhbc*100:0)+"%");
  2178 + tempMap.put("zgbc", zgbc);
  2179 + tempMap.put("zglc", df.format(zglc.doubleValue()));
  2180 + tempMap.put("zgbfb", df.format(jhbc>0?(double)zgbc/jhbc*100:0)+"%");
2131 2181 tempMap.put("qtbc", qtbc);
2132 2182 tempMap.put("qtlc", df.format(qtlc.doubleValue()));
2133 2183 tempMap.put("qtbfb", df.format(jhbc>0?(double)qtbc/jhbc*100:0)+"%");
  2184 +
  2185 + tempMap.put("linecode", linecode);
2134 2186  
2135 2187 resList.add(tempMap);
2136 2188  
2137 2189  
2138   - jhbc_ += jhbc; sjbc_ += sjbc;
  2190 + jhbc_ += jhbc; sjbc_ += sjbc;zgbc_ += zgbc;
2139 2191 lzbc_ += lzbc; dmbc_ += dmbc;
2140 2192 gzbc_ += gzbc; jfbc_ += jfbc; zsbc_ += zsbc;
2141 2193 qrbc_ += qrbc; qcbc_ += qcbc; kxbc_ += kxbc;
... ... @@ -2146,7 +2198,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2146 2198 zslc_ = zslc_.add(zslc); qrlc_ = qrlc_.add(qrlc);
2147 2199 qclc_ = qclc_.add(qclc); kxlc_ = kxlc_.add(kxlc);
2148 2200 qhlc_ = qhlc_.add(qhlc); wylc_ = wylc_.add(wylc);
2149   - qtlc_ = qtlc_.add(qtlc);
  2201 + zglc_ = zglc_.add(zglc); qtlc_ = qtlc_.add(qtlc);
2150 2202 }
2151 2203  
2152 2204 if(resList.size() > 0){
... ... @@ -2195,6 +2247,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2195 2247 temp.put("wybc", wybc_);
2196 2248 temp.put("wylc", df.format(wylc_.doubleValue()));
2197 2249 temp.put("wybfb", df.format(jhbc_>0?(double)wybc_/jhbc_*100:0)+"%");
  2250 + temp.put("zgbc", zgbc_);
  2251 + temp.put("zglc", df.format(zglc_.doubleValue()));
  2252 + temp.put("zgbfb", df.format(jhbc_>0?(double)zgbc_/jhbc_*100:0)+"%");
2198 2253 temp.put("qtbc", qtbc_);
2199 2254 temp.put("qtlc", df.format(qtlc_.doubleValue()));
2200 2255 temp.put("qtbfb", df.format(jhbc_>0?(double)qtbc_/jhbc_*100:0)+"%");
... ... @@ -4257,4 +4312,84 @@ public class BusIntervalServiceImpl implements BusIntervalService {
4257 4312 return resList;
4258 4313 }
4259 4314  
  4315 + public List<ScheduleRealInfo> schedulingAll(@RequestParam Map<String, Object> map){
  4316 + String company = "", subCompany = "";
  4317 + String sfyy = map.get("sfyy").toString();
  4318 + String linecode = map.get("linecode").toString();
  4319 + String startDate = map.get("startDate").toString();
  4320 + String endDate = map.get("endDate").toString();
  4321 + String times = map.get("times").toString();
  4322 + String type = map.get("type").toString();
  4323 + int sfqr = Integer.valueOf(map.get("sfqr").toString());
  4324 +
  4325 + if(startDate.length() == 0){
  4326 + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  4327 + }
  4328 + if(endDate.length() == 0){
  4329 + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  4330 + }
  4331 + if(times.length() == 0){
  4332 + times = "05:00-23:00";
  4333 + }
  4334 + String[] t = times.split("-");
  4335 + switch (type){
  4336 + case "lz":
  4337 + type = "路阻";
  4338 + break;
  4339 + case "dm":
  4340 + type = "吊慢";
  4341 + break;
  4342 + case "gz":
  4343 + type = "故障";
  4344 + break;
  4345 + case "jq":
  4346 + type = "纠纷";
  4347 + break;
  4348 + case "zs":
  4349 + type = "肇事";
  4350 + break;
  4351 + case "qr":
  4352 + type = "缺人";
  4353 + break;
  4354 + case "qc":
  4355 + type = "缺车";
  4356 + break;
  4357 + case "kx":
  4358 + type = "客稀";
  4359 + break;
  4360 + case "qh":
  4361 + type = "气候";
  4362 + break;
  4363 + case "yw":
  4364 + type = "援外";
  4365 + break;
  4366 + case "zg":
  4367 + type = "主观烂班";
  4368 + break;
  4369 + case "qt":
  4370 + type ="其他";
  4371 + break;
  4372 + }
  4373 +
  4374 + String sql ="";
  4375 + if(!type.equals("其他")) {
  4376 + sql = "select * from bsth_c_s_sp_info_real " +
  4377 + "where xl_bm= '" + linecode + "' " +
  4378 + "and status = '-1' and adjust_exps = '" + type + "' " +
  4379 + "and schedule_date_str BETWEEN '" + startDate + "' and '" + endDate + "' " +
  4380 + "and fcsj >'" + t[0] + "' and fcsj < '" + t[1] + "' ";
  4381 + }else {
  4382 + sql = "select * from bsth_c_s_sp_info_real " +
  4383 + "where xl_bm= '" + linecode + "' " +
  4384 + "and status = '-1' and adjust_exps in( '其他','配车','保养','抽减')" +
  4385 + "and schedule_date_str BETWEEN '" + startDate + "' and '" + endDate + "' " +
  4386 + "and fcsj >'" + t[0] + "' and fcsj < '" + t[1] + "' ";
  4387 + }
  4388 +
  4389 + List<ScheduleRealInfo> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(ScheduleRealInfo.class));
  4390 +
  4391 +
  4392 + return list;
  4393 + }
  4394 +
4260 4395 }
... ...
src/main/java/com/bsth/service/schedule/SchedulePlanInfoService.java
... ... @@ -6,10 +6,7 @@ import org.joda.time.DateTime;
6 6  
7 7 import java.sql.ResultSet;
8 8 import java.sql.SQLException;
9   -import java.util.ArrayList;
10   -import java.util.Arrays;
11   -import java.util.Date;
12   -import java.util.List;
  9 +import java.util.*;
13 10  
14 11 /**
15 12 * Created by xu on 16/6/16.
... ... @@ -32,6 +29,12 @@ public interface SchedulePlanInfoService extends BService&lt;SchedulePlanInfo, Long
32 29 List<SchedulePlanGroupInfo> findSchedulePlanGroupInfo(Integer xlId, Date scheduleDate);
33 30  
34 31 /**
  32 + * 导出调度值勤日报
  33 + * @return
  34 + */
  35 + List<Map<String, Object>> infoexport(List<SchedulePlanInfoService.SchedulePlanGroupInfo> list);
  36 +
  37 + /**
35 38 * 排班计划分组信息。
36 39 */
37 40 static class SchedulePlanGroupInfo implements Comparable<SchedulePlanGroupInfo> {
... ...
src/main/java/com/bsth/service/schedule/SchedulePlanService.java
... ... @@ -3,8 +3,10 @@ package com.bsth.service.schedule;
3 3 import com.bsth.entity.schedule.SchedulePlan;
4 4 import com.bsth.service.schedule.impl.plan.kBase3.validate.rule.ValidateRuleResult;
5 5 import com.bsth.service.schedule.impl.plan.kBase3.validate.timetable.Result;
  6 +import org.springframework.web.bind.annotation.RequestParam;
6 7  
7 8 import java.util.Date;
  9 +import java.util.Map;
8 10  
9 11 /**
10 12 * Created by xu on 16/6/16.
... ... @@ -36,4 +38,12 @@ public interface SchedulePlanService extends BService&lt;SchedulePlan, Long&gt; {
36 38 * @return
37 39 */
38 40 ValidateRuleResult validateRule(Integer xlId, Date from, Date to);
  41 +
  42 +
  43 + /**
  44 + * 查询线路最新的排班数据
  45 + * @param map
  46 + * @return
  47 + */
  48 + Map<String,Object> listwest(Map map);
39 49 }
40 50 \ No newline at end of file
... ...
src/main/java/com/bsth/service/schedule/impl/SchedulePlanInfoServiceImpl.java
1 1 package com.bsth.service.schedule.impl;
2 2  
  3 +import com.bsth.common.ResponseCode;
3 4 import com.bsth.entity.schedule.SchedulePlanInfo;
4 5 import com.bsth.repository.schedule.SchedulePlanInfoRepository;
5 6 import com.bsth.service.schedule.SchedulePlanInfoService;
  7 +import com.bsth.util.ReportUtils;
6 8 import org.springframework.beans.factory.annotation.Autowired;
7 9 import org.springframework.jdbc.core.JdbcTemplate;
8 10 import org.springframework.jdbc.core.RowCallbackHandler;
... ... @@ -12,10 +14,8 @@ import org.springframework.transaction.annotation.Transactional;
12 14  
13 15 import java.sql.ResultSet;
14 16 import java.sql.SQLException;
15   -import java.util.ArrayList;
16   -import java.util.Collections;
17   -import java.util.Date;
18   -import java.util.List;
  17 +import java.text.SimpleDateFormat;
  18 +import java.util.*;
19 19  
20 20 /**
21 21 * Created by xu on 16/6/16.
... ... @@ -190,4 +190,97 @@ public class SchedulePlanInfoServiceImpl extends BServiceImpl&lt;SchedulePlanInfo,
190 190  
191 191 return result;
192 192 }
  193 +
  194 +
  195 + public List<Map<String, Object>> infoexport(List<SchedulePlanInfoService.SchedulePlanGroupInfo> list){
  196 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  197 + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
  198 + try {
  199 + for (SchedulePlanInfoService.SchedulePlanGroupInfo t: list) {
  200 + Map<String, Object> m = new HashMap<String, Object>();
  201 + m.put("czr",t.getUpdateByName()+" \n"+"创建日期:"+sd.format(t.getCreateDate())+" \n"+"修改日期:"+sd.format(t.getUpdateDate()));
  202 + m.put("xl",t.getXlName());
  203 + m.put("rq",sd.format(t.getScheduleDate()));
  204 + m.put("lp",t.getLpName());
  205 + m.put("cl",exporttype(t.getClZbhs()));
  206 + m.put("jcsj",exporttype(t.getJcsjs()));
  207 + m.put("ccsj",exporttype(t.getCcsjs()));
  208 + m.put("jsy",exporttypety(t.getJsyNames(),t.getJsyGhs()));
  209 + m.put("spy",exporttypety(t.getSpyNames(),t.getSpyGhs()));
  210 + m.put("ttInfoName",t.getTtInfoName());
  211 + lMap.add(m);
  212 + }
  213 +
  214 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  215 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  216 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  217 + Map<String, Object> m = new HashMap<String, Object>();
  218 +// String by=map.get("by").toString();
  219 + String xls="dailyreport.xls";
  220 + String xlName = null;
  221 + String dateTime = null;
  222 + if(list != null){
  223 + xlName = list.get(0).getXlName();
  224 + dateTime =sd.format(list.get(0).getScheduleDate());
  225 + }
  226 +
  227 + ReportUtils ee = new ReportUtils();
  228 + try {
  229 +
  230 + listI.add(lMap.iterator());
  231 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  232 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  233 + path + "export/"+dateTime+"-"+xlName+"-调度值勤日报.xls");
  234 + } catch (Exception e) {
  235 + // TODO: handle exception
  236 + e.printStackTrace();
  237 + }
  238 + }catch (Exception exp) {
  239 + exp.printStackTrace();
  240 + }
  241 + return lMap;
  242 + }
  243 +
  244 + public String exporttype(List<String> t){
  245 + if(t.size() == 0) {
  246 + return "";
  247 + }else {
  248 + if (t.size() > 1) {
  249 + String y = "";
  250 + for(int i = 0 ; i< t.size();i++) {
  251 + if(i == 0) {
  252 + y = y + t.get(i);
  253 + }else {
  254 + y = y + " \n" + t.get(i);
  255 + }
  256 + }
  257 + return y;
  258 + } else {
  259 + return t.get(0);
  260 + }
  261 + }
  262 + }
  263 + public String exporttypety(List<String> x,List<String> y){
  264 + if(x.size() == 0 || y.size() == 0){
  265 + return "";
  266 + }else {
  267 + if(x.size() > 1 && y.size() >1){
  268 + String k ="";
  269 + for(int i = 0 ; i< x.size();i++) {
  270 + if(x.size() == y.size()){
  271 + if(x.size() -1 == i){
  272 + k = k + x.get(i) +" "+y.get(i);
  273 + }else {
  274 + k = k + x.get(i) +" "+y.get(i) + " \n";
  275 + }
  276 + }
  277 + }
  278 + return k;
  279 + }else {
  280 + return x.get(0) +" "+y.get(0);
  281 + }
  282 + }
  283 +
  284 + }
  285 +
193 286 }
... ...
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
1 1 package com.bsth.service.schedule.impl;
2 2  
  3 +import com.bsth.data.gpsdata_v2.entity.StationRoute;
3 4 import com.bsth.entity.Line;
4 5 import com.bsth.entity.schedule.SchedulePlan;
5 6 import com.bsth.entity.schedule.TTInfo;
... ... @@ -20,11 +21,17 @@ import org.slf4j.Logger;
20 21 import org.slf4j.LoggerFactory;
21 22 import org.springframework.beans.factory.annotation.Autowired;
22 23 import org.springframework.beans.factory.annotation.Qualifier;
  24 +import org.springframework.jdbc.core.JdbcTemplate;
  25 +import org.springframework.jdbc.core.RowMapper;
23 26 import org.springframework.stereotype.Service;
24 27 import org.springframework.transaction.annotation.Isolation;
25 28 import org.springframework.transaction.annotation.Propagation;
26 29 import org.springframework.transaction.annotation.Transactional;
  30 +import org.springframework.web.bind.annotation.RequestParam;
27 31  
  32 +import java.sql.ResultSet;
  33 +import java.sql.SQLException;
  34 +import java.text.SimpleDateFormat;
28 35 import java.util.*;
29 36 import java.util.concurrent.ConcurrentHashMap;
30 37 import java.util.concurrent.TimeUnit;
... ... @@ -68,6 +75,9 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
68 75 @Autowired
69 76 private RerunRuleRepository rerunRuleRepository;
70 77  
  78 + @Autowired
  79 + private JdbcTemplate jdbcTemplate;
  80 +
71 81 /** 日志记录器 */
72 82 private Logger logger = LoggerFactory.getLogger(SchedulePlanServiceImpl.class);
73 83  
... ... @@ -208,4 +218,68 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
208 218  
209 219 return result;
210 220 }
  221 +
  222 +
  223 + public Map<String,Object> listwest(Map map){
  224 +
  225 + SimpleDateFormat sfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  226 + String line = map.get("line").toString();
  227 + String page = map.get("page").toString();
  228 + Map<String, Object> modelMap = new HashMap<String, Object>();
  229 +
  230 +
  231 + String sql ="SELECT sp.xl as xl,MAX(sp.tt_info_names) as tt_info_name, " +
  232 + "MAX(sp.schedule_from_time) as from_time ,MAX(sp.schedule_to_time) as to_time, " +
  233 + "MAX(line.name) as name , MAX(us.user_name) as uname, " +
  234 + "MAX(sp.update_date) as updata_date " +
  235 + "from bsth_c_s_sp sp " +
  236 + "LEFT JOIN bsth_c_line line on sp.xl = line.line_code " +
  237 + "left join bsth_c_sys_user us on sp.update_by = us.id " +
  238 + "where line.name not like '%测试线路%' and sfyy = '1' " +
  239 + "and line.destroy = '0' " ;
  240 + if(!line.equals(" ") && !line.equals("")){
  241 + sql += "and sp.xl="+line;
  242 + }
  243 +
  244 + sql += " GROUP BY sp.xl ORDER BY MAX(sp.schedule_from_time);";
  245 + List<Map> list = null;
  246 + try {
  247 + list = jdbcTemplate.query(sql, new RowMapper<Map>() {
  248 + @Override
  249 + public Map mapRow(ResultSet rs, int rowNum) throws SQLException {
  250 + Map map = new HashMap();
  251 + map.put("xl", rs.getString("xl"));
  252 + map.put("ttInfoName", rs.getString("tt_info_name"));
  253 + map.put("fromTime",rs.getDate("from_time"));
  254 + map.put("toTime", rs.getDate("to_time"));
  255 + map.put("name", rs.getString("name"));
  256 + map.put("uName", rs.getString("uname"));
  257 + map.put("updataDate", rs.getString("updata_date"));
  258 +
  259 + return map;
  260 + }
  261 +
  262 + });
  263 +
  264 + for (Map m : list) {
  265 + m.put("updataDate", sfd.format(sfd.parse(m.get("updataDate").toString())));
  266 + }
  267 + }catch (Exception e){
  268 + e.printStackTrace();
  269 + }
  270 +
  271 +
  272 + //分页
  273 + if(page.length() != 0 ){
  274 + int currPage = Integer.valueOf(page);
  275 + modelMap.put("totalPage", list.size()%10>0?(list.size()/10 + 1):list.size()/10);
  276 +// modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10));
  277 + modelMap.put("list", list);
  278 + } else {
  279 + modelMap.put("dataList", list);
  280 + }
  281 +
  282 +
  283 + return modelMap;
  284 + }
211 285 }
... ...
src/main/resources/static/pages/forms/mould/dailyreport.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/lbStatuAnaly.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -14,6 +14,18 @@
14 14  
15 15 .table > tbody + tbody {
16 16 border-top: 1px solid; }
  17 +
  18 + .table-body{width:100%; height:94vh;overflow-y:scroll;}
  19 + .table-head table,.table-body table{width:100%;}
  20 + .table-container{
  21 + overflow-y:scroll;height: 540px; width: 100%;
  22 + }
  23 + td{
  24 + width: 15%;
  25 + }
  26 + .kw{
  27 + width: 97%;
  28 + }
17 29 </style>
18 30  
19 31 <div class="page-head">
... ... @@ -21,11 +33,11 @@
21 33 <h1>班次日报表</h1>
22 34 </div>
23 35 </div>
24   -
25   -<div class="row">
26   - <div class="col-md-12">
27   - <div class="portlet light porttlet-fit bordered">
28   - <div class="portlet-title">
  36 +
  37 +<div class="row">
  38 + <div class="col-md-12">
  39 + <div class="portlet light porttlet-fit bordered">
  40 + <div class="portlet-title">
29 41 <form class="form-inline" action="">
30 42 <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily">
31 43 <span class="item-label" style="width: 80px;">公司: </span>
... ... @@ -35,7 +47,7 @@
35 47 <span class="item-label" style="width: 80px;">分公司: </span>
36 48 <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 180px;"></select>
37 49 </div>
38   - <div style="margin-top: 2px"></div>
  50 + <div style="margin-top: 2px"></div>
39 51 <div style="display: inline-block;margin-left: 33px;">
40 52 <span class="item-label" style="width: 80px;">线路: </span>
41 53 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -47,34 +59,37 @@
47 59 <div class="form-group">
48 60 <input class="btn btn-default" type="button" id="query" value="筛选"/>
49 61 <input class="btn btn-default" type="button" id="export" value="导出"/>
50   - </div>
51   - </form>
52   - </div>
53   - <div class="portlet-body">
54   - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
55   - <table class="table table-bordered table-hover table-checkable" id="forms">
56   - <thead>
57   - <tr>
58   - <th colspan="7">调度班次日报</th>
59   - </tr>
60   - <tr>
61   - <td>路线:</td>
62   - <td colspan="2"><span id="form_line">&nbsp;</span></td>
63   - <td>时间:</td>
64   - <td colspan="3"><span id="form_date">&nbsp;</span></td>
65   - </tr>
66   - <tr>
67   - <td>车辆</td>
68   - <td>工号</td>
69   - <td>姓名</td>
70   - <td>总公里</td>
71   - <td>空驶公里</td>
72   - <td>油耗</td>
73   - <td>班次</td>
74   - </tr>
  62 + </div>
  63 + </form>
  64 + </div>
  65 + <div class="portlet-body">
  66 + <div class="kw">
  67 + <table class="table table-bordered table-hover table-checkable">
  68 + <thead >
  69 + <tr>
  70 + <th colspan="7">调度班次日报</th>
  71 + </tr>
  72 + <tr>
  73 + <td>路线:</td>
  74 + <td colspan="2"><span id="form_line">&nbsp;</span></td>
  75 + <td>时间:</td>
  76 + <td colspan="3"><span id="form_date">&nbsp;</span></td>
  77 + </tr>
  78 + <tr>
  79 + <td>车辆</td>
  80 + <td>工号</td>
  81 + <td>姓名</td>
  82 + <td>总公里</td>
  83 + <td>空驶公里</td>
  84 + <td>油耗</td>
  85 + <td>班次</td>
  86 + </tr>
75 87 </thead>
  88 + </table>
  89 + </div>
  90 + <div class="table-container" style="margin-top:-20px; overflow:auto;min-width: 906px ;width: 97%" >
  91 + <table class="table table-bordered table-hover table-checkable" id="forms">
76 92 <tbody id="tbody">
77   -
78 93 </tbody>
79 94 <tr>
80 95 <td colspan="3">小计</td>
... ... @@ -84,22 +99,22 @@
84 99 <td><span id="total_bc">&nbsp;</span></td>
85 100 </tr>
86 101 </table>
87   - </div>
88   - </div>
89   - </div>
90   - </div>
91   -</div>
92   -
93   -<script>
  102 + </div>
  103 + </div>
  104 + </div>
  105 + </div>
  106 +</div>
  107 +
  108 +<script>
94 109 $(function(){
95   -
96   - // 关闭左侧栏
97   - if (!$('body').hasClass('page-sidebar-closed'))
  110 +
  111 + // 关闭左侧栏
  112 + if (!$('body').hasClass('page-sidebar-closed'))
98 113 $('.menu-toggler.sidebar-toggler').click();
99   -
100   - $("#date").datetimepicker({
101   - format : 'YYYY-MM-DD',
102   - locale : 'zh-cn'
  114 +
  115 + $("#date").datetimepicker({
  116 + format : 'YYYY-MM-DD',
  117 + locale : 'zh-cn'
103 118 });
104 119 var fage=false;
105 120 var xlList;
... ... @@ -255,23 +270,23 @@
255 270 layer.close(i);
256 271 });
257 272 });
258   -});
259   -</script>
260   -<script type="text/html" id="dailyInfo">
261   - {{each list as obj i}}
262   - <tr>
  273 +});
  274 +</script>
  275 +<script type="text/html" id="dailyInfo">
  276 + {{each list as obj i}}
  277 + <tr>
263 278 <td>{{obj.zbh}}</td>
264 279 <td>{{obj.jgh}}</td>
265 280 <td>{{obj.jName}}</td>
266 281 <td>{{obj.zlc}}</td>
267 282 <td>{{obj.jzl1}}</td>
268 283 <td>{{obj.yh}}</td>
269   - <td>{{obj.bc}}</td>
270   - </tr>
  284 + <td>{{obj.bc}}</td>
  285 + </tr>
271 286 {{/each}}
272 287 {{if list.length == 0}}
273 288 <tr>
274 289 <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
275 290 </tr>
276   - {{/if}}
  291 + {{/if}}
277 292 </script>
278 293 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
... ... @@ -41,8 +41,9 @@
41 41 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="6" checked="true"/>缺车
42 42 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="7" checked="true"/>客稀
43 43 <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="8" checked="true"/>气候
44   - <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>援外
45   - <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他
  44 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>援外
  45 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>主观烂班
  46 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="11" checked="true"/>其他
46 47 </div>
47 48 <div style="margin-top: 5px"></div>
48 49 <div style="display: inline-block; margin-left: 33px;" id="company1">
... ... @@ -293,7 +294,7 @@
293 294 g.checked = checked;
294 295 });
295 296 if(checked == true)
296   - lb = 33;
  297 + lb = 36;
297 298 else
298 299 lb = 0;
299 300 });
... ... @@ -515,10 +516,37 @@
515 516 }
516 517 });
517 518 }
518   -
519   -
520 519 });
521   -
  520 + function opencalcSheetList2(linecode,type){
  521 + var sfqr = 0;
  522 + var sfyy = 1
  523 + var startDate = $("#startDate").val();
  524 + var endDate = $("#endDate").val();
  525 + var times = $("#times1").val() + "-" + $("#times2").val();
  526 +
  527 + var params = {};
  528 + params['linecode'] = linecode;
  529 + params['type'] = type;
  530 + params['startDate'] =startDate;
  531 + params['endDate'] =endDate;
  532 + params['times'] =times;
  533 + params['sfqr'] =sfqr;
  534 + params['sfyy'] =sfyy;
  535 +
  536 + $.get('/pages/forms/statement/lbStatuList.html', function (content) {
  537 + layer.open({
  538 + type: 1,
  539 + area: ['800px', '600px'],
  540 + content: content,
  541 + title: '烂班线路详细',
  542 + shift: 5,
  543 + scrollbar: false,
  544 + success: function () {
  545 + $('#lbStatuList').trigger('init', params);
  546 + }
  547 + });
  548 + });
  549 + }
522 550 </script>
523 551 <script type="text/html" id="list_lbAnaly">
524 552 <thead>
... ... @@ -547,7 +575,9 @@
547 575 {{if reason[7].checked == true}}<th colspan="3">客稀</th>{{/if}}
548 576 {{if reason[8].checked == true}}<th colspan="3">气候</th>{{/if}}
549 577 {{if reason[9].checked == true}}<th colspan="3">援外</th>{{/if}}
550   - {{if reason[10].checked == true}}<th colspan="3">其他</th>{{/if}}
  578 + {{if reason[10].checked == true}}<th colspan="3">主观烂班</th>{{/if}}
  579 + {{if reason[11].checked == true}}<th colspan="3">其他</th>{{/if}}
  580 +
551 581 </tr>
552 582 <tr>
553 583 <th class="hidden"></th>
... ... @@ -564,6 +594,7 @@
564 594 {{if reason[8].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
565 595 {{if reason[9].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
566 596 {{if reason[10].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  597 + {{if reason[11].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
567 598 </tr>
568 599 </thead>
569 600 <tbody>
... ... @@ -581,17 +612,18 @@
581 612 {{/if}}
582 613 <td>{{obj.jhbc}}</td><td>{{obj.sjbc}}</td><td>{{obj.bcbfb}}</td>
583 614 <td>{{obj.jhlc}}</td><td>{{obj.sjlc}}</td><td>{{obj.lcbfb}}</td>
584   - {{if reason[0].checked==true}}<td>{{obj.lzbc}}</td><td>{{obj.lzlc}}</td><td>{{obj.lzbfb}}</td>{{/if}}
585   - {{if reason[1].checked==true}}<td>{{obj.dmbc}}</td><td>{{obj.dmlc}}</td><td>{{obj.dmbfb}}</td>{{/if}}
586   - {{if reason[2].checked==true}}<td>{{obj.gzbc}}</td><td>{{obj.gzlc}}</td><td>{{obj.gzbfb}}</td>{{/if}}
587   - {{if reason[3].checked==true}}<td>{{obj.jfbc}}</td><td>{{obj.jflc}}</td><td>{{obj.jfbfb}}</td>{{/if}}
588   - {{if reason[4].checked==true}}<td>{{obj.zsbc}}</td><td>{{obj.zslc}}</td><td>{{obj.zsbfb}}</td>{{/if}}
589   - {{if reason[5].checked==true}}<td>{{obj.qrbc}}</td><td>{{obj.qrlc}}</td><td>{{obj.qrbfb}}</td>{{/if}}
590   - {{if reason[6].checked==true}}<td>{{obj.qcbc}}</td><td>{{obj.qclc}}</td><td>{{obj.qcbfb}}</td>{{/if}}
591   - {{if reason[7].checked==true}}<td>{{obj.kxbc}}</td><td>{{obj.kxlc}}</td><td>{{obj.kxbfb}}</td>{{/if}}
592   - {{if reason[8].checked==true}}<td>{{obj.qhbc}}</td><td>{{obj.qhlc}}</td><td>{{obj.qhbfb}}</td>{{/if}}
593   - {{if reason[9].checked==true}}<td>{{obj.wybc}}</td><td>{{obj.wylc}}</td><td>{{obj.wybfb}}</td>{{/if}}
594   - {{if reason[10].checked==true}}<td>{{obj.qtbc}}</td><td>{{obj.qtlc}}</td><td>{{obj.qtbfb}}</td>{{/if}}
  615 + {{if reason[0].checked==true}}{{if obj.lzbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','lz' )">{{obj.lzbc}}</td>{{else}}<td>{{obj.lzbc}}</td>{{/if}}<td>{{obj.lzlc}}</td><td>{{obj.lzbfb}}</td>{{/if}}
  616 + {{if reason[1].checked==true}}{{if obj.dmbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','dm' )">{{obj.dmbc}}</td>{{else}}<td >{{obj.dmbc}}</td>{{/if}}<td>{{obj.dmlc}}</td><td>{{obj.dmbfb}}</td>{{/if}}
  617 + {{if reason[2].checked==true}}{{if obj.gzbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','gz' )">{{obj.gzbc}}</td>{{else}}<td>{{obj.gzbc}}</td>{{/if}}<td>{{obj.gzlc}}</td><td>{{obj.gzbfb}}</td>{{/if}}
  618 + {{if reason[3].checked==true}}{{if obj.jfbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','jf' )">{{obj.jfbc}}</td>{{else}}<td>{{obj.jfbc}}</td>{{/if}}<td>{{obj.jflc}}</td><td>{{obj.jfbfb}}</td>{{/if}}
  619 + {{if reason[4].checked==true}}{{if obj.zsbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','zs' )">{{obj.zsbc}}</td>{{else}}<td>{{obj.zsbc}}</td>{{/if}}<td>{{obj.zslc}}</td><td>{{obj.zsbfb}}</td>{{/if}}
  620 + {{if reason[5].checked==true}}{{if obj.qrbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','qr' )">{{obj.qrbc}}</td>{{else}}<td>{{obj.qrbc}}</td>{{/if}}<td>{{obj.qrlc}}</td><td>{{obj.qrbfb}}</td>{{/if}}
  621 + {{if reason[6].checked==true}}{{if obj.qcbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','qc' )">{{obj.qcbc}}</td>{{else}}<td>{{obj.qcbc}}</td>{{/if}}<td>{{obj.qclc}}</td><td>{{obj.qcbfb}}</td>{{/if}}
  622 + {{if reason[7].checked==true}}{{if obj.kxbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','kx' )">{{obj.kxbc}}</td>{{else}}<td>{{obj.kxbc}}</td>{{/if}}<td>{{obj.kxlc}}</td><td>{{obj.kxbfb}}</td>{{/if}}
  623 + {{if reason[8].checked==true}}{{if obj.qhbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','qh' )">{{obj.qhbc}}</td>{{else}}<td>{{obj.qhbc}}</td>{{/if}}<td>{{obj.qhlc}}</td><td>{{obj.qhbfb}}</td>{{/if}}
  624 + {{if reason[9].checked==true}}{{if obj.wybc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','wy' )">{{obj.wybc}}</td>{{else}}<td>{{obj.wybc}}</td>{{/if}}<td>{{obj.wylc}}</td><td>{{obj.wybfb}}</td>{{/if}}
  625 + {{if reason[10].checked==true}}{{if obj.zgbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','zg' )">{{obj.zgbc}}</td>{{else}}<td>{{obj.zgbc}}</td>{{/if}}<td>{{obj.zglc}}</td><td>{{obj.zgbfb}}</td>{{/if}}
  626 + {{if reason[11].checked==true}}{{if obj.qtbc > 0 && obj.line!='合计'}}<td style="color: red" onclick="opencalcSheetList2('{{obj.linecode}}','qt' )">{{obj.qtbc}}</td>{{else}}<td>{{obj.qtbc}}</td>{{/if}}<td>{{obj.qtlc}}</td><td>{{obj.qtbfb}}</td>{{/if}}
595 627 </tr>
596 628 {{/each}}
597 629 {{if list.length == 0}}
... ...
src/main/resources/static/pages/forms/statement/lbStatuList.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<!--<div class="page-head">
  20 + <div class="page-title" style="margin-left: 20px">
  21 + <button id="exportList">数据导出</button>
  22 + </div>
  23 +</div>-->
  24 +
  25 +<div class="row" id="lbStatuList">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-body">
  29 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px">
  30 + <table class="table table-bordered table-hover table-checkable" id="forms_1">
  31 + <thead>
  32 + <tr>
  33 + <td></td>
  34 + <td>日期</td>
  35 + <td>线路名</td>
  36 + <td>自编号</td>
  37 + <td>驾驶员工号</td>
  38 + <td>驾驶员</td>
  39 + <td>计划发车</td>
  40 + <td>计划到站</td>
  41 + <td>计划历程</td>
  42 + <td>烂班说明</td>
  43 + </tr>
  44 + </thead>
  45 +
  46 + <tbody>
  47 +
  48 + </tbody>
  49 + </table>
  50 + </div>
  51 + </div>
  52 + </div>
  53 + </div>
  54 +</div>
  55 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  56 +<script>
  57 + $(function(){
  58 + // 关闭左侧栏
  59 + if (!$('body').hasClass('page-sidebar-closed'))
  60 + $('.menu-toggler.sidebar-toggler').click();
  61 + var params_;
  62 + $("#lbStatuList").on('init', function (e, params) {
  63 + params_=params;
  64 + $get('/busInterval/schedulingAll',params,function(result){
  65 + var lbStatu = template('lbStatu',{list:result});
  66 + $('#forms_1 tbody').html(lbStatu);
  67 + });
  68 + })
  69 +
  70 +
  71 + });
  72 +</script>
  73 +<script type="text/html" id="lbStatu">
  74 + {{each list as obj i}}
  75 + <tr><!-- {{if obj.sfzd!="准点"}}style="color: red" {{/if}}-->
  76 + <td>{{i+1}}</td>
  77 + <td>{{obj.scheduleDateStr}}</td>
  78 + <td>{{obj.xlName}}</td>
  79 + <td>{{obj.clZbh}}</td>
  80 + <td>{{obj.jGh}}</td>
  81 + <td>{{obj.jName}}</td>
  82 + <td>{{obj.fcsj}}</td>
  83 + <td>{{obj.zdsj}}</td>
  84 + <td>{{obj.jhlcOrig - obj.jhlc}}</td>
  85 + <td>{{obj.remarks}}</td>
  86 + </tr>
  87 + {{/each}}
  88 + {{if list.length == 0}}
  89 + <tr>
  90 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  91 + </tr>
  92 + {{/if}}
  93 +</script>
0 94 \ No newline at end of file
... ...
src/main/resources/static/pages/oil/jyglList.html
... ... @@ -131,9 +131,18 @@
131 131 {{obj.nbbm}}
132 132 </td>
133 133 <td>
134   - <select class="form-control in_carpark_jsy" style=" width:100px" name="jsy" id="{{obj.nbbm}}" data-id="{{obj.nbbm}}">
135   - <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option>
  134 + <select class="form-control in_carpark_jsy" style=" width:100px" name="jsy" id="{{obj.nbbm}}" data-id="{{obj.nbbm}}">
  135 + {{if obj.jsy == 0}}
  136 + {{if obj.ldgh.length == 6}}
  137 + <option selected="selected" value="{{obj.jsy}}">{{obj.ldgh}}<option>
  138 + {{else}}
  139 + <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option>
  140 + {{/if}}
  141 + {{else}}
  142 + <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option>
  143 + {{/if}}
136 144 </select>
  145 +
137 146 </td>
138 147 <td>
139 148  
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
... ... @@ -163,10 +163,15 @@ angular.module(&#39;ScheduleApp&#39;).controller(
163 163 // 导出excel
164 164 self.exportData = function() {
165 165 var p = busConfigService.dataExport();
  166 + var selects=document.getElementsByName('xl');
  167 + var t;
  168 + if(selects&&selects[1]){
  169 + t = selects[1].innerText;
  170 + }
166 171 if (p) {
167 172 p.then(
168 173 function(result) {
169   - fileDownload.downloadFile(result.data, "application/octet-stream", "车辆配置信息.xls");
  174 + fileDownload.downloadFile(result.data, "application/octet-stream", t+"车辆配置信息.xls");
170 175 },
171 176 function(result) {
172 177 console.log("exportData failed:" + result);
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
... ... @@ -168,10 +168,16 @@ angular.module(&#39;ScheduleApp&#39;).controller(
168 168 // 导出excel
169 169 self.exportData = function() {
170 170 var p = service.dataExport();
  171 + var selects=document.getElementsByName('xl');
  172 + var t;
  173 + if(selects&&selects[1]){
  174 + t = selects[1].innerText;
  175 + }
  176 +
171 177 if (p) {
172 178 p.then(
173 179 function(result) {
174   - fileDownload.downloadFile(result.data, "application/octet-stream", "人员配置信息.xls");
  180 + fileDownload.downloadFile(result.data, "application/octet-stream", t+"人员配置信息.xls");
175 181 },
176 182 function(result) {
177 183 console.log("exportData failed:" + result);
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/newest/list_newest.html 0 → 100644
  1 +<style>
  2 + a.ct_base_line_delete_link{
  3 + font-size: 12px;
  4 + color: red;
  5 + vertical-align: bottom;
  6 + display: inline-block;
  7 + margin-left: 5px;
  8 + text-decoration: underline;
  9 + }
  10 +
  11 + a.ct_base_line_delete_link:hover{
  12 + color: #d11608;
  13 + }
  14 +</style>
  15 +<div class="page-head">
  16 + <div class="page-title">
  17 + <h1>排班明细</h1>
  18 + </div>
  19 +</div>
  20 +<!-- 片段标题 END -->
  21 +
  22 +<!-- 线路信息导航栏组件 START -->
  23 +<ul class="page-breadcrumb breadcrumb">
  24 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  25 + <li><span class="active"></span> <i class="fa fa-circle"></i></li>
  26 + <li><span class="active">排班明细表</span></li>
  27 +</ul>
  28 +<!-- 线路信息导航栏组件 END -->
  29 +
  30 +<div class="row">
  31 + <div class="col-md-12">
  32 + <div class="portlet light porttlet-fit bordered">
  33 + <div class="portlet-title">
  34 + <div class="tipso-animation">
  35 + </div>
  36 + <div class="caption">
  37 + <i class="fa fa-info-circle font-dark"></i>
  38 + <span class="caption-subject font-dark sbold uppercase">排班明细</span>
  39 + </div>
  40 +
  41 + </div>
  42 + <div class="portlet-body">
  43 + <div class="table-container" style="margin-top: 10px">
  44 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_line">
  45 + <thead>
  46 + <tr role="row" class="heading">
  47 + <th style="width: 70px;">序号</th>
  48 + <th style="width: 160px;">线路名称</th>
  49 + <th style="width: 250px;">关联时刻表</th>
  50 + <th style="width: 150px;">排班开始日期</th>
  51 + <th style="width: 150px;">排班结束日期</th>
  52 + <th style="width: 150px;">排班人/操作时间</th>
  53 + </tr>
  54 + <tr role="row" class="filter">
  55 + <td></td>
  56 + <td>
  57 + <select class="form-control" name="line" id="line" style="width: 200px;"></select>
  58 + <td>
  59 +
  60 + </td>
  61 + <td>
  62 +
  63 + </td>
  64 + <td>
  65 + </td>
  66 + <td>
  67 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" id="query">
  68 + <i class="fa fa-search" ></i> 搜索
  69 + </button>
  70 +
  71 + <button class="btn btn-sm red btn-outline filter-cancel" id="notification-trigger">
  72 + <i class="fa fa-times"></i> 重置
  73 + </button>
  74 + </td>
  75 + </tr>
  76 + </thead>
  77 + <tbody></tbody>
  78 + </table>
  79 + <div style="text-align: right;">
  80 + <ul id="pagination" class="pagination"></ul>
  81 + </div>
  82 + </div>
  83 + </div>
  84 + </div>
  85 + </div>
  86 +</div>
  87 +<script>
  88 +
  89 +
  90 + $(function() {
  91 + var page = 0, initPagination;
  92 + // 关闭左侧栏
  93 + if (!$('body').hasClass('page-sidebar-closed'))
  94 + $('.menu-toggler.sidebar-toggler').click();
  95 +
  96 + var tempData = {};
  97 +
  98 + $.get('/report/lineList', function (xlList) {
  99 + var data = [];
  100 + data.push({id: " ", text: "全部线路"});
  101 + $.get('/user/companyData', function (result) {
  102 + for (var i = 0; i < result.length; i++) {
  103 + var companyCode = result[i].companyCode;
  104 + var children = result[i].children;
  105 + for (var j = 0; j < children.length; j++) {
  106 + var code = children[j].code;
  107 + for (var k = 0; k < xlList.length; k++) {
  108 + if (xlList[k]["fgsbm"] == code && xlList[k]["gsbm"] == companyCode) {
  109 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  110 + tempData[xlList[k]["xlbm"]] = companyCode + ":" + code;
  111 + }
  112 + }
  113 + }
  114 + }
  115 + initPinYinSelect2('#line', data, '');
  116 + });
  117 + });
  118 +
  119 + var list;
  120 + var line = $("#line").val();
  121 + //初始化页面
  122 + load(true);
  123 + $("#query").on("click",function(){
  124 + line = $("#line").val();
  125 + load(true);
  126 + });
  127 + $("#notification-trigger").on("click",function(){
  128 + line = " ";
  129 + $('tr.filter input, select').val(' ').change();
  130 + load(true);
  131 + });
  132 +
  133 + function load(pagination){
  134 + var params = {};
  135 + params.line = line;
  136 + params.page = page;
  137 + $get('/spc/listwest',params,function(result){
  138 + list = result.list;
  139 +
  140 + dataPageChange(page, result.list);
  141 +
  142 + if(pagination && result.list.length > 0){
  143 + //重新分页
  144 + initPagination = true;
  145 + showPagination(result);
  146 + $('#pagination').show();
  147 + } else if(result.list.length == 0){
  148 + $('#pagination').hide();
  149 + }
  150 +
  151 + });
  152 + }
  153 +
  154 + function showPagination(data){
  155 + //分页
  156 + $('#pagination').jqPaginator({
  157 + totalPages: data.totalPage,
  158 + visiblePages: 6,
  159 + currentPage: page + 1,
  160 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  161 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  162 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  163 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  164 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  165 + onPageChange: function (num, type) {
  166 + debugger;
  167 + if(initPagination){
  168 + initPagination = false;
  169 + return;
  170 + }
  171 + page = num - 1;
  172 +// jsDoQuery(false);
  173 + dataPageChange(page, list);
  174 + }
  175 + });
  176 + }
  177 +
  178 +
  179 + function dataPageChange(page, list){
  180 +
  181 + var tempList = [];
  182 + for(var f = page*10; f < list.length && f < (page+1)*10; f++){
  183 + tempList[tempList.length] = list[f];
  184 + }
  185 + tempList.page = page;
  186 + // 把数据填充到模版中
  187 + var tbodyHtml = template('line_west',{list:tempList});
  188 + // 把渲染好的模版html文本追加到表格中
  189 + $('#datatable_line tbody').html(tbodyHtml);
  190 + }
  191 +
  192 + });
  193 +
  194 +
  195 +
  196 +
  197 +
  198 +</script>
  199 +<script type="text/html" id="line_west">
  200 + {{each list as obj i }}
  201 + <tr>
  202 + <td style="vertical-align: middle;">
  203 + {{(list.page*10)+(i+1)}}
  204 + </td>
  205 + <td>
  206 + {{obj.name}}
  207 + </td>
  208 + <td>
  209 + {{obj.ttInfoName}}
  210 + </td>
  211 + <td>
  212 + {{obj.fromTime}}
  213 + </td>
  214 + <td>
  215 + {{obj.toTime}}
  216 + </td>
  217 +
  218 + <td>
  219 + <div>
  220 + <a href="#">
  221 + <i class="fa fa-user"></i>
  222 + <span>{{obj.uName}}</span>
  223 + </a>
  224 + </div>
  225 + <div>
  226 + <a href="#">
  227 + <span>{{obj.updataDate}}</span>
  228 + </a>
  229 + </div>
  230 + </td>
  231 + </tr>
  232 + {{/each}}
  233 + {{if list.length == 0}}
  234 + <tr>
  235 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
  236 + </tr>
  237 + {{/if}}
  238 +</script>
  239 +<!--
  240 +<script src="/pages/base/line/js/line-list-table.js"></script>-->
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html
... ... @@ -7,6 +7,7 @@
7 7 最近排班至
8 8 <span ng-bind="ctrl.lsd | date: 'yyyy年MM月dd日'">
9 9 </span>
  10 + <input class="btn btn-default" type="button" id="export" value= "导出"/>
10 11 </div>
11 12 </div>
12 13 </div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js
... ... @@ -167,7 +167,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
167 167 }
168 168 );
169 169 };
170   -
  170 + var newValuey;
171 171 // 获取查询条件数据
172 172 self.searchCondition = function() {
173 173 return service.getSearchCondition();
... ... @@ -176,22 +176,23 @@ angular.module(&#39;ScheduleApp&#39;).controller(
176 176 self.resetSearchCondition = function() {
177 177 return service.resetSearchCondition();
178 178 };
179   -
180   - self.lsd;
181   -
  179 + $('#export').attr('disabled', "true");
182 180 // 监控条件变化,触发查询
183 181 $scope.$watch(
184 182 function() {
  183 +
185 184 return service.getSearchCondition();
186 185 },
187 186 function(newValue, oldValue) {
188 187 if (newValue) {
  188 + newValuey = newValue;
189 189 if (newValue.xlid) {
190 190 service.getLastestsd().then(
191 191 function(result) {
192 192 if (result.length > 0) {
193 193 self.lsd = new Date();
194 194 self.lsd.setTime(result[0]);
  195 +
195 196 } else {
196 197 self.lsd = "暂无排班";
197 198 }
... ... @@ -203,12 +204,26 @@ angular.module(&#39;ScheduleApp&#39;).controller(
203 204 }
204 205  
205 206 if (newValue.xlid && newValue.sdate) {
  207 + $("#export").removeAttr("disabled");
206 208 self.pageChanaged();
207 209 }
208 210 }
209 211 },
210 212 true
211 213 );
  214 + $("#export").on("click",function(){
  215 + var value = newValuey;
  216 + var params = {};
  217 + $get('/spic/groupextinfosexport/'+newValuey.xlid+'/'+newValuey.sdate,params,function(result){
  218 + if(result != null){
  219 + window.open("/downloadFile/download?fileName="
  220 + +result[0].rq+"-"+result[0].xl+"-调度值勤日报");
  221 + layer.close(i);
  222 + }
  223 +
  224 + });
  225 + });
  226 +
212 227  
213 228 // 判定是否被修改过
214 229 self.isModify = function(info) {
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/jhlb.html
... ... @@ -106,7 +106,7 @@
106 106  
107 107 <script>
108 108 (function() {
109   - var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他'];
  109 + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他','主观烂班'];
110 110 var modal = '#schedule-jhlb-modal',
111 111 sch;
112 112 $(modal).on('init', function(e, data) {
... ...