Commit 3985217708acc159bcde3fe3ea1a31c486e12b77

Authored by 潘钊
2 parents 46c96c4c d8547d46

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html
src/main/java/com/bsth/controller/schedule/PeopleCarPlanController.java 0 → 100644
  1 +package com.bsth.controller.schedule;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  13 +import com.bsth.service.schedule.PeopleCarPlanService;
  14 +
  15 +@RestController
  16 +@RequestMapping("pcpc")
  17 +public class PeopleCarPlanController {
  18 +
  19 + @Autowired
  20 + private PeopleCarPlanService peopleCarPlanService;
  21 +
  22 + @RequestMapping(value = "/queryPeopleCar", method = RequestMethod.GET)
  23 + public List<Map<String,Object>> queryPeopleCar(@RequestParam String line, @RequestParam String date, @RequestParam String type){
  24 + return peopleCarPlanService.queryPeopleCar(line, date, type);
  25 + }
  26 +
  27 + @RequestMapping(value="/workDaily", method = RequestMethod.GET)
  28 + public List<Map<String,Object>> workDaily(@RequestParam String line, @RequestParam String date, @RequestParam String type){
  29 + return peopleCarPlanService.workDaily(line, date, type);
  30 + }
  31 +
  32 + @RequestMapping(value="/scheduleAnaly", method = RequestMethod.GET)
  33 + public Map<String, Object> scheduleAnaly(@RequestParam String page, @RequestParam String line, @RequestParam String startDate, @RequestParam String endDate, @RequestParam String model, @RequestParam String type){
  34 + return peopleCarPlanService.scheduleAnaly(page, line, startDate, endDate, model, type);
  35 + }
  36 +
  37 + @RequestMapping(value="/getModel", method = RequestMethod.GET)
  38 + public List<Map<String,Object>> getModel(@RequestParam String line, @RequestParam String startDate, @RequestParam String endDate){
  39 + return peopleCarPlanService.getModel(line, startDate, endDate);
  40 + }
  41 +
  42 + @RequestMapping(value="/firstAndLastBus", method = RequestMethod.GET)
  43 + public List<Map<String,Object>> firstAndLastBus(@RequestParam String line, @RequestParam String date, @RequestParam String type){
  44 + return peopleCarPlanService.firstAndLastBus(line, date, type);
  45 + }
  46 +
  47 + @RequestMapping(value="/commandState", method = RequestMethod.GET)
  48 + public List<Map<String,Object>> commandState(@RequestParam String line, @RequestParam String date, @RequestParam String code){
  49 + return peopleCarPlanService.commandState(line, date, code);
  50 + }
  51 +
  52 +}
... ...
src/main/java/com/bsth/data/schedule/thread/SubmitToTrafficManage.java
1 1 package com.bsth.data.schedule.thread;
2 2  
3 3 import com.bsth.service.TrafficManageService;
  4 +import com.bsth.service.oil.YlbService;
  5 +
4 6 import org.slf4j.Logger;
5 7 import org.slf4j.LoggerFactory;
6 8 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -17,10 +19,19 @@ public class SubmitToTrafficManage extends Thread{
17 19  
18 20 @Autowired
19 21 TrafficManageService trafficManageService;
  22 +
  23 + @Autowired
  24 + YlbService YlbService;
20 25  
21 26 @Override
22 27 public void run() {
23 28 logger.info("开始提交数据到运管处...");
  29 + try{
  30 + YlbService.obtainDsq();
  31 + } catch(Exception e){
  32 + logger.error("计算路单里程加注量失败",e);
  33 + }
  34 +
24 35 try {
25 36 //路单
26 37 trafficManageService.setLD();
... ...
src/main/java/com/bsth/service/oil/YlbService.java
... ... @@ -8,7 +8,7 @@ import com.bsth.service.BaseService;
8 8  
9 9 public interface YlbService extends BaseService<Ylb, Integer>{
10 10 Map<String, Object> obtain(String rq);
11   -
  11 + String obtainDsq();
12 12 Map<String, Object> sort(Map<String, Object> map);
13 13  
14 14 Map<String, Object> outAndIn(Map<String, Object> map);
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
1 1 package com.bsth.service.oil.impl;
2 2  
  3 +import java.sql.ResultSet;
  4 +import java.sql.SQLException;
3 5 import java.text.DecimalFormat;
4 6 import java.text.ParseException;
5 7 import java.text.SimpleDateFormat;
6 8 import java.util.ArrayList;
  9 +import java.util.Calendar;
7 10 import java.util.Date;
8 11 import java.util.HashMap;
9 12 import java.util.Iterator;
... ... @@ -17,6 +20,8 @@ import org.slf4j.LoggerFactory;
17 20 import org.springframework.beans.factory.annotation.Autowired;
18 21 import org.springframework.data.domain.Sort;
19 22 import org.springframework.data.domain.Sort.Direction;
  23 +import org.springframework.jdbc.core.JdbcTemplate;
  24 +import org.springframework.jdbc.core.RowMapper;
20 25 import org.springframework.stereotype.Service;
21 26  
22 27 import com.bsth.common.ResponseCode;
... ... @@ -46,9 +51,100 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
46 51 @Autowired
47 52 ScheduleRealInfoService scheduleRealInfoService;
48 53  
  54 + @Autowired
  55 + JdbcTemplate jdbcTemplate;
  56 +
49 57 Logger logger = LoggerFactory.getLogger(this.getClass());
50 58  
51 59  
  60 +
  61 + /**
  62 + * 获取进存油信息
  63 + * @Transactional 回滚事物
  64 + */
  65 + @Transactional
  66 + @Override
  67 + public String obtainDsq() {
  68 + String result = "failure";
  69 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  70 + Date dNow = new Date(); //当前时间
  71 + Date dBefore = new Date();
  72 + Calendar calendar = Calendar.getInstance(); //得到日历
  73 + calendar.setTime(dNow);//把当前时间赋给日历
  74 + calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天
  75 + dBefore = calendar.getTime(); //得到前一天的时间
  76 + String rq=sdf.format(dBefore);
  77 + //保留两位小数
  78 + DecimalFormat df = new DecimalFormat("#.00");
  79 + // TODO Auto-generated method stub
  80 + Map<String, Object> newMap=new HashMap<String,Object>();
  81 + //当天YLB信息
  82 + List<Ylb> ylList=repository.obtainYl(rq);
  83 + //当天YLXXB信息
  84 +// List<Ylxxb> ylxxList=ylxxbRepository.obtainYlxx(rq);
  85 + //前一天所有车辆最后进场班次信息
  86 + List<Ylb> ylListBe=repository.obtainYlbefore(rq);
  87 + //从排班表中计算出行驶的总里程
  88 + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("1024",rq);
  89 +
  90 + for(int x=0;x<listpb.size();x++){
  91 +
  92 + Map<String, Object> map=listpb.get(x);
  93 +
  94 + //判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断)
  95 + Ylb t=new Ylb();
  96 + for(int k=0;k<ylList.size();k++){
  97 + Ylb t1=ylList.get(k);
  98 + if(t1.getNbbm().equals(map.get("clZbh").toString())
  99 + &&t1.getJsy().equals(map.get("jGh").toString())
  100 + &&t1.getXlbm().equals(map.get("xlBm").toString()))
  101 + {
  102 + t=t1;
  103 + }
  104 + }
  105 + try {
  106 + //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
  107 + if(map.get("seqNumber").toString().equals("1")){
  108 + for (int y = 0; y < ylListBe.size(); y++) {
  109 + Ylb ylb=ylListBe.get(y);
  110 + if(map.get("clZbh").toString().equals(ylb.getNbbm())){
  111 + t.setCzyl(ylb.getJzyl());
  112 + break;
  113 + }else{
  114 + t.setCzyl(0.0);
  115 + }
  116 + }
  117 + }
  118 +
  119 + /*Double jzl=0.0;
  120 + //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
  121 + for(int j=0;j<ylxxList.size();j++){
  122 + Ylxxb ylxxb= ylxxList.get(j);
  123 + if(map.get("clZbh").toString().equals(ylxxb.getNbbm()) &&map.get("jGh").toString().equals(ylxxb.getJsy())){
  124 + jzl+=ylxxb.getJzl();
  125 + }
  126 + }
  127 + t.setJzl(jzl);*/
  128 + t.setNbbm(map.get("clZbh").toString());
  129 + t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
  130 + t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
  131 + t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
  132 + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
  133 + t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  134 + t.setRq(dBefore);
  135 + repository.save(t);
  136 + result = "success";
  137 + } catch (Exception e) {
  138 + // TODO Auto-generated catch block
  139 + e.printStackTrace();
  140 + }finally{
  141 + logger.info("setDDRB:"+result);
  142 + }
  143 + }
  144 +
  145 + return result;
  146 + }
  147 +
52 148 /**
53 149 * 获取进存油信息
54 150 * @Transactional 回滚事物
... ... @@ -394,8 +490,36 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
394 490  
395 491 @Override
396 492 public List<Ylb> oilListMonth(String line, String date) {
  493 + String date2=date.substring(0, 8)+"01";
  494 + String lineStr="";
  495 + if(line !=null && !line.equals("")){
  496 + lineStr =" and xlbm= '"+ line +"'";
  497 + }
  498 + String sql="select a.nbbm,a.rq,a.jzyl from (" +
  499 + " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from "
  500 + + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '"
  501 + + date2 +"' and '" + date+"' "+lineStr
  502 + + "group by nbbm,rq) x group by x.nbbm ) b"
  503 + + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb "
  504 + + " where rq between '"
  505 + + date2 +"' and '" + date+"' "+lineStr
  506 + + ") a "
  507 + + " on a.nbbm =b.nbbm and a.jcsx=b.jcsx and a.rq=b.rq "
  508 + + " where a.nbbm is not null order by a.nbbm";
  509 +
397 510 // TODO Auto-generated method stub
398   - return null;
  511 + List<Ylb> list =jdbcTemplate.query(sql,
  512 + new RowMapper<Ylb>(){
  513 + @Override
  514 + public Ylb mapRow(ResultSet rs, int rowNum) throws SQLException {
  515 + Ylb s = new Ylb();
  516 + s.setNbbm(rs.getString("nbbm"));
  517 + s.setRq(rs.getDate("rq"));
  518 + s.setJzyl(rs.getDouble("jzyl"));
  519 + return s;
  520 + }
  521 + });
  522 + return list;
399 523 }
400 524  
401 525  
... ...
src/main/java/com/bsth/service/schedule/PeopleCarPlanService.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +public interface PeopleCarPlanService {
  7 +
  8 + List<Map<String, Object>> queryPeopleCar(String line, String date, String type);
  9 +
  10 + List<Map<String, Object>> workDaily(String line, String date, String type);
  11 +
  12 + Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type);
  13 +
  14 + List<Map<String, Object>> getModel(String line, String startDate, String endDate);
  15 +
  16 + List<Map<String, Object>> firstAndLastBus(String line, String date, String type);
  17 +
  18 + List<Map<String, Object>> commandState(String line, String date, String code);
  19 +}
... ...
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import java.math.BigDecimal;
  4 +import java.sql.ResultSet;
  5 +import java.sql.SQLException;
  6 +import java.text.DecimalFormat;
  7 +import java.text.ParseException;
  8 +import java.text.SimpleDateFormat;
  9 +import java.util.ArrayList;
  10 +import java.util.Collections;
  11 +import java.util.Date;
  12 +import java.util.HashMap;
  13 +import java.util.HashSet;
  14 +import java.util.Iterator;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +import java.util.Set;
  18 +
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.jdbc.core.JdbcTemplate;
  21 +import org.springframework.jdbc.core.RowMapper;
  22 +import org.springframework.stereotype.Service;
  23 +
  24 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  25 +import com.bsth.entity.schedule.SchedulePlanInfo;
  26 +import com.bsth.entity.schedule.TTInfoDetail;
  27 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  28 +import com.bsth.util.ReportUtils;
  29 +
  30 +@Service
  31 +public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
  32 +
  33 + @Autowired
  34 + private ScheduleRealInfoRepository scheduleRealInfoRepository;
  35 +
  36 + @Autowired
  37 + private JdbcTemplate jdbcTemplate;
  38 +
  39 + @Override
  40 + public List<Map<String, Object>> queryPeopleCar(String line, String date, String type) {
  41 + Map<String, List<SchedulePlanInfo>> keyMap = new HashMap<String, List<SchedulePlanInfo>>();
  42 + Map<String, List<Map<String, Object>>> temp = new HashMap<String, List<Map<String, Object>>>();
  43 + List<SchedulePlanInfo> list = new ArrayList<SchedulePlanInfo>();
  44 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  45 + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
  46 +
  47 + if(date.length() == 0){
  48 + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  49 + }
  50 +
  51 + try {
  52 +
  53 + String sql = "select * from bsth_c_s_sp_info where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'";
  54 + if(line.length() != 0){
  55 + sql += " and xl_bm = '"+line+"'";
  56 + }
  57 +
  58 + list =jdbcTemplate.query(sql,
  59 + new RowMapper<SchedulePlanInfo>(){
  60 + @Override
  61 + public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  62 +
  63 + SchedulePlanInfo schedule = new SchedulePlanInfo();
  64 +
  65 + schedule.setXlName(rs.getString("xl_name"));
  66 + schedule.setLpName(rs.getString("lp_name"));
  67 + schedule.setClZbh(rs.getString("cl_zbh"));
  68 + schedule.setjName(rs.getString("j_name"));
  69 + schedule.setsName(rs.getString("s_name"));
  70 + schedule.setJhlc(rs.getDouble("jhlc"));
  71 + return schedule;
  72 + }
  73 + });
  74 +
  75 +
  76 + } catch (Exception e) {
  77 + // TODO Auto-generated catch block
  78 + e.printStackTrace();
  79 + }
  80 +
  81 + //分组计算路程公里
  82 + for(SchedulePlanInfo schedule : list){
  83 + String key = schedule.getXlName() + "/" + schedule.getLpName() + "/" +
  84 + schedule.getClZbh() + "/" + schedule.getjName() + "/" + schedule.getsName();
  85 + if(!keyMap.containsKey(key))
  86 + keyMap.put(key, new ArrayList<SchedulePlanInfo>());
  87 + keyMap.get(key).add(schedule);
  88 + }
  89 + for(String key : keyMap.keySet()){
  90 + Map<String, Object> tempMap = new HashMap<String, Object>();
  91 + BigDecimal jhlc = new BigDecimal(0);
  92 + for(SchedulePlanInfo schedule : keyMap.get(key)){
  93 + if(schedule.getJhlc() != null)
  94 + jhlc = jhlc.add(new BigDecimal(schedule.getJhlc()));
  95 + }
  96 + String[] split = key.split("/");
  97 + tempMap.put("date", date);
  98 + tempMap.put("line", split[0]);
  99 + tempMap.put("lp", split[1]);
  100 + tempMap.put("clzbh", split[2]);
  101 + tempMap.put("jName", split[3]);
  102 + tempMap.put("sName", split[4]);
  103 + if(split[4].equals("null"))
  104 + tempMap.put("sName", "/");
  105 + tempMap.put("jhlc", jhlc.setScale(2, BigDecimal.ROUND_UP));
  106 + mapList.add(tempMap);
  107 + }
  108 +
  109 + for(Map<String, Object> m : mapList){
  110 + String key = m.get("line").toString();
  111 + if(!temp.containsKey(key))
  112 + temp.put(key, new ArrayList<Map<String, Object>>());
  113 + temp.get(key).add(m);
  114 + }
  115 + for(String key : temp.keySet()){
  116 + Map<Integer, List<Map<String, Object>>> tempList = new HashMap<Integer, List<Map<String,Object>>>();
  117 + List<Integer> keyList = new ArrayList<Integer>();
  118 + for(Map<String, Object> m : temp.get(key)){
  119 + int i = Integer.valueOf(m.get("lp").toString());
  120 + if(!tempList.containsKey(i))
  121 + tempList.put(i, new ArrayList<Map<String, Object>>());
  122 + tempList.get(i).add(m);
  123 + keyList.add(i);
  124 + }
  125 + Collections.sort(keyList);
  126 + for(Integer i : keyList){
  127 + for(Map<String, Object> m : tempList.get(i)){
  128 + resList.add(m);
  129 + }
  130 + }
  131 + }
  132 +
  133 + if(type.equals("export")){
  134 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  135 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  136 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  137 + Map<String,Object> map = new HashMap<String, Object>();
  138 + ReportUtils ee = new ReportUtils();
  139 + try {
  140 + listI.add(resList.iterator());
  141 + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
  142 + ee.excelReplace(listI, new Object[] { map }, path+"mould\\peoCarPlan.xls",
  143 + path+"export\\计划车辆班次人员" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  144 + } catch (Exception e) {
  145 + // TODO: handle exception
  146 + e.printStackTrace();
  147 + }
  148 + }
  149 +
  150 + return resList;
  151 + }
  152 +
  153 + @Override
  154 + public List<Map<String, Object>> workDaily(String line, String date, String type) {
  155 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  156 + DecimalFormat df = new DecimalFormat("###0.##");
  157 + if(date.length() == 0){
  158 + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  159 + }
  160 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  161 + if(line.length() != 0)
  162 + list = scheduleRealInfoRepository.scheduleDaily(line, date);
  163 + else
  164 + list = scheduleRealInfoRepository.findByDate(date);
  165 + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
  166 + for(ScheduleRealInfo schedule : list){
  167 + String key = schedule.getXlName();
  168 + if(!keyMap.containsKey(key)){
  169 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  170 + }
  171 + keyMap.get(key).add(schedule);
  172 + }
  173 +
  174 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ddHH:mm");
  175 + Long zgfBegin = 0l;
  176 + Long zgfEnd = 0l;
  177 + Long wgfBegin = 0l;
  178 + Long wgfEnd = 0l;
  179 + try {
  180 + //早晚高峰时段
  181 + zgfBegin = sdf.parse(date + "07:30").getTime();
  182 + zgfEnd = sdf.parse(date + "09:30").getTime();
  183 + wgfBegin = sdf.parse(date + "16:30").getTime();
  184 + wgfEnd = sdf.parse(date + "18:30").getTime();
  185 + } catch (ParseException e) {
  186 + // TODO Auto-generated catch block
  187 + e.printStackTrace();
  188 + }
  189 + for(String key : keyMap.keySet()){
  190 + Map<String, Object> tempMap = new HashMap<String, Object>();
  191 + Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>();
  192 + int jhbc = 0;
  193 + int dftz = 0;
  194 + int jhcc = 0;
  195 + int sjcc = 0;
  196 + int upfk = 0;
  197 + int updk = 0;
  198 + int dnfk = 0;
  199 + int dndk = 0;
  200 + int upfm = 0;
  201 + int updm = 0;
  202 + int dnfm = 0;
  203 + int dndm = 0;
  204 + int jhsb = 0;
  205 + int sjsb = 0;
  206 + int jhmb = 0;
  207 + int sjmb = 0;
  208 + int jhzgf = 0;
  209 + int sjzgf = 0;
  210 + int jhwgf = 0;
  211 + int sjwgf = 0;
  212 + for(ScheduleRealInfo schedule : keyMap.get(key)){
  213 + schedule.setFcsjAll(schedule.getFcsj());
  214 +
  215 + //早晚高峰时段执行率
  216 + if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){
  217 + jhzgf++;
  218 + if(schedule.getFcsjActual() != null)
  219 + sjzgf++;
  220 + }
  221 + if(schedule.getFcsjT() >= wgfBegin && schedule.getFcsjT() <= wgfEnd){
  222 + jhwgf++;
  223 + if(schedule.getFcsjActual() != null)
  224 + sjwgf++;
  225 + }
  226 +
  227 + //班次数和出场数
  228 + jhbc++;
  229 + if(schedule.getBcType().equals("out"))
  230 + jhcc++;
  231 +
  232 + //发出时间快慢
  233 + if(schedule.getFcsjActual() != null){
  234 + if(schedule.getBcType().equals("out"))
  235 + sjcc++;
  236 + schedule.setFcsjActualAll(schedule.getFcsjActual());
  237 + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -60000){
  238 + if(schedule.getXlDir().equals("0"))
  239 + upfk++;
  240 + else if (schedule.getXlDir().equals("1"))
  241 + dnfk++;
  242 + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 180000){
  243 + if(schedule.getXlDir().equals("0"))
  244 + upfm++;
  245 + else if (schedule.getXlDir().equals("1"))
  246 + dnfm++;
  247 + }
  248 + }
  249 + //到站时间快慢
  250 + if(schedule.getZdsjActual() != null && schedule.getBcsj() != null){
  251 + schedule.setZdsjActualAll(schedule.getZdsjActual());
  252 + schedule.setDfsjAll(schedule.getDfsj());
  253 + schedule.calcEndTime();
  254 + if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -60000){
  255 + if(schedule.getXlDir().equals("0"))
  256 + updk++;
  257 + else if (schedule.getXlDir().equals("1"))
  258 + dndk++;
  259 + } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 180000){
  260 + if(schedule.getXlDir().equals("0"))
  261 + updm++;
  262 + else if (schedule.getXlDir().equals("1"))
  263 + dndm++;
  264 + }
  265 + }
  266 +
  267 + //待发调整
  268 + if(schedule.getDfsj() != null){
  269 + if(!schedule.getDfsj().equals(schedule.getFcsj())){
  270 + dftz++;
  271 + }
  272 + }
  273 +
  274 + if(schedule.getBcType().equals("normal")){
  275 + String clZbh = schedule.getClZbh();
  276 + if(!listMap.containsKey(clZbh))
  277 + listMap.put(clZbh, new ArrayList<ScheduleRealInfo>());
  278 + listMap.get(clZbh).add(schedule);
  279 + }
  280 + }
  281 +
  282 + //求首末班准点率
  283 + for(String clZbh : listMap.keySet()){
  284 + Map<Integer, ScheduleRealInfo> temp = new HashMap<Integer, ScheduleRealInfo>();
  285 + List <ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>();
  286 + List<Integer> sort = new ArrayList<Integer>();
  287 + for(ScheduleRealInfo schedule : listMap.get(clZbh)){
  288 + String[] split = schedule.getFcsj().split(":");
  289 + int min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  290 + temp.put(min, schedule);
  291 + sort.add(min);
  292 + }
  293 + Collections.sort(sort);
  294 + for(Integer i : sort){
  295 + tempList.add(temp.get(i));
  296 + }
  297 + ScheduleRealInfo shouban = tempList.get(0);
  298 + ScheduleRealInfo moban = tempList.get(tempList.size() - 1);
  299 + if(shouban.getFcsjActual() != null){
  300 + jhsb++;
  301 + if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000)
  302 + sjsb++;
  303 + }
  304 + if(moban.getFcsjActual() != null){
  305 + jhmb++;
  306 + if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000)
  307 + sjmb++;
  308 + }
  309 +
  310 + }
  311 +
  312 + tempMap.put("date", date);
  313 + tempMap.put("line", key);
  314 + tempMap.put("jhbc", jhbc);
  315 + tempMap.put("dftz", dftz);
  316 + tempMap.put("dftzl", df.format(((float)dftz/jhbc)*100) + "%");
  317 + tempMap.put("ccl", df.format(((float)sjcc/jhcc)*100) + "%");
  318 + tempMap.put("upfk", upfk);
  319 + tempMap.put("updk", updk);
  320 + tempMap.put("dnfk", dnfk);
  321 + tempMap.put("dndk", dndk);
  322 + tempMap.put("upfm", upfm);
  323 + tempMap.put("updm", updm);
  324 + tempMap.put("dnfm", dnfm);
  325 + tempMap.put("dndm", dndm);
  326 + tempMap.put("wdzs", (upfk + updk + dnfk + dndk) + "/" + (upfm + updm + dnfm + dndm));
  327 + tempMap.put("smbzdl", (jhsb==0?"100%":df.format(((float)sjsb/jhsb)*100)+"%")+"/"+(jhmb==0?"100%":df.format(((float)sjmb/jhmb)*100)+"%"));
  328 + tempMap.put("gfbczxl", (jhzgf==0?"0%":df.format(((float)sjzgf/jhzgf)*100)+"%")+"/"+(jhwgf==0?"0%":df.format(((float)sjwgf/jhwgf)*100)+"%"));
  329 + resList.add(tempMap);
  330 + }
  331 +
  332 + if(type.equals("export")){
  333 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  334 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  335 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  336 + Map<String,Object> map = new HashMap<String, Object>();
  337 + ReportUtils ee = new ReportUtils();
  338 + try {
  339 + listI.add(resList.iterator());
  340 + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
  341 + ee.excelReplace(listI, new Object[] { map }, path+"mould\\workDaily.xls",
  342 + path+"export\\营运服务日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  343 + } catch (Exception e) {
  344 + // TODO: handle exception
  345 + e.printStackTrace();
  346 + }
  347 + }
  348 +
  349 + return resList;
  350 + }
  351 +
  352 + @Override
  353 + public Map<String, Object> scheduleAnaly(String page, String line, String startDate, String endDate, String model, String type) {
  354 + DecimalFormat df = new DecimalFormat("00");
  355 + List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>();
  356 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  357 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  358 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  359 + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
  360 + Map<String, Object> modelMap = new HashMap<String, Object>();
  361 +
  362 + if(startDate.length() == 0){
  363 + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  364 + }
  365 + if(endDate.length() == 0){
  366 + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  367 + }
  368 + try {
  369 +
  370 + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'";
  371 + if(line.length() != 0){
  372 + sql += " and xl_bm = '"+line+"'";
  373 + }
  374 + sql += " and bc_type = 'normal'";
  375 +
  376 + list =jdbcTemplate.query(sql,
  377 + new RowMapper<ScheduleRealInfo>(){
  378 + @Override
  379 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  380 + ScheduleRealInfo schedule = new ScheduleRealInfo();
  381 + schedule.setXlName(rs.getString("xl_name"));
  382 + schedule.setBcType(rs.getString("bc_type"));
  383 + schedule.setBcs(rs.getInt("bcs"));
  384 + schedule.setFcsj(rs.getString("fcsj"));
  385 + schedule.setFcsjActual(rs.getString("fcsj_actual"));
  386 + schedule.setZdsj(rs.getString("zdsj"));
  387 + schedule.setZdsjActual(rs.getString("zdsj_actual"));
  388 + schedule.setBcsj(rs.getInt("bcsj"));
  389 + schedule.setQdzName(rs.getString("qdz_name"));
  390 + return schedule;
  391 + }
  392 + });
  393 +
  394 + if(model.length() != 0){
  395 + sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'";
  396 + }
  397 +
  398 + ttList =jdbcTemplate.query(sql,
  399 + new RowMapper<TTInfoDetail>(){
  400 + @Override
  401 + public TTInfoDetail mapRow(ResultSet rs, int rowNum) throws SQLException {
  402 + TTInfoDetail ttInfo = new TTInfoDetail();
  403 + ttInfo.setBcType(rs.getString("bc_type"));
  404 + ttInfo.setBcs(rs.getInt("bcs"));
  405 + ttInfo.setFcsj(rs.getString("fcsj"));
  406 + ttInfo.setBcsj(rs.getInt("bcsj"));
  407 + return ttInfo;
  408 + }
  409 + });
  410 +
  411 + } catch (Exception e) {
  412 + // TODO Auto-generated catch block
  413 + e.printStackTrace();
  414 + }
  415 +
  416 + //分组计算 同时判断是否所选时刻信息
  417 + for(ScheduleRealInfo schedule : list){
  418 + if(model.length() != 0){
  419 + for(TTInfoDetail tt : ttList){
  420 + if(tt.getBcs() == schedule.getBcs() && tt.getFcsj().equals(schedule.getFcsj())
  421 + && tt.getBcsj() == schedule.getBcsj()){
  422 + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
  423 + if(!keyMap.containsKey(key))
  424 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  425 + keyMap.get(key).add(schedule);
  426 + continue;
  427 + }
  428 + }
  429 + } else {
  430 + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
  431 + if(!keyMap.containsKey(key))
  432 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  433 + keyMap.get(key).add(schedule);
  434 + }
  435 + }
  436 + for(String key : keyMap.keySet()){
  437 + Map<String, Object> tempMap = new HashMap<String, Object>();
  438 + List<Integer> fcsj = new ArrayList<Integer>();
  439 + List<Integer> yssj = new ArrayList<Integer>();
  440 + int jhbc = 0;
  441 + int sjbc = 0;
  442 + for(ScheduleRealInfo schedule : keyMap.get(key)){
  443 + tempMap.put("bcsj", schedule.getBcsj());
  444 + jhbc++;
  445 + if(schedule.getZdsjActual() != null && schedule.getFcsjActual() != null){
  446 + sjbc++;
  447 + String[] fcsj_ = schedule.getFcsjActual().split(":");
  448 + String[] zdsj_ = schedule.getZdsjActual().split(":");
  449 + int fcsj_m = (Integer.valueOf(fcsj_[0]) * 60) + Integer.valueOf(fcsj_[1]);
  450 + int zdsj_m = (Integer.valueOf(zdsj_[0]) * 60) + Integer.valueOf(zdsj_[1]);
  451 + fcsj.add(fcsj_m);
  452 + yssj.add(zdsj_m - fcsj_m);
  453 + }
  454 + }
  455 + int zzfc = 0;
  456 + int zwfc = 0;
  457 + int pjfc = 0;
  458 + int fcSum = 0;
  459 + int zkys = 0;
  460 + int zmys = 0;
  461 + int pjys = 0;
  462 + int ysSum = 0;
  463 + for(int i : fcsj){
  464 + fcSum += i;
  465 + if(zzfc == 0 || zzfc > i)
  466 + zzfc = i;
  467 + if(zwfc == 0 || zwfc < i)
  468 + zwfc = i;
  469 + }
  470 + for(int i : yssj){
  471 + ysSum += i;
  472 + if(zkys == 0 || zkys > i)
  473 + zkys = i;
  474 + if(zmys == 0 || zmys < i)
  475 + zmys = i;
  476 + }
  477 + if(fcsj.size() != 0){
  478 + pjfc = fcSum / fcsj.size();
  479 + tempMap.put("zzfc", df.format(zzfc/60)+":"+df.format(zzfc%60));
  480 + tempMap.put("zwfc", df.format(zwfc/60)+":"+df.format(zwfc%60));
  481 + tempMap.put("pjfc", df.format(pjfc/60)+":"+df.format(pjfc%60));
  482 + } else {
  483 + tempMap.put("zzfc", "/");
  484 + tempMap.put("zwfc", "/");
  485 + tempMap.put("pjfc", "/");
  486 + }
  487 + if(yssj.size() != 0){
  488 + pjys = ysSum / yssj.size();
  489 + tempMap.put("zkys", zkys);
  490 + tempMap.put("zmys", zmys);
  491 + tempMap.put("pjys", pjys);
  492 + } else {
  493 + tempMap.put("zkys", "/");
  494 + tempMap.put("zmys", "/");
  495 + tempMap.put("pjys", "/");
  496 + }
  497 + String[] split = key.split("/");
  498 + tempMap.put("line", split[0]);
  499 + tempMap.put("qdz", split[1]);
  500 + tempMap.put("jhfc", split[2]);
  501 + tempMap.put("jhbc", jhbc);
  502 + tempMap.put("sjbc", sjbc);
  503 + tempList.add(tempMap);
  504 + }
  505 +
  506 + //排序
  507 + Map<String, List<Map<String, Object>>> listMap = new HashMap<String, List<Map<String, Object>>>();
  508 + Map<String, List<Map<String, Object>>> listMap2 = new HashMap<String, List<Map<String, Object>>>();
  509 + for(Map<String, Object> m : tempList){
  510 + String key = m.get("line").toString() + m.get("qdz");
  511 + if(!listMap.containsKey(key))
  512 + listMap.put(key, new ArrayList<Map<String, Object>>());
  513 + listMap.get(key).add(m);
  514 + }
  515 + for(String key : listMap.keySet()){
  516 + Map<Integer, Map<String, Object>> tempMap = new HashMap<Integer, Map<String,Object>>();
  517 + List<Integer> keyList = new ArrayList<Integer>();
  518 + for(Map<String, Object> m : listMap.get(key)){
  519 + String[] split = m.get("jhfc").toString().split(":");
  520 + int jhfc = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  521 + tempMap.put(jhfc, m);
  522 + keyList.add(jhfc);
  523 + }
  524 + Collections.sort(keyList);
  525 + for(Integer Int : keyList){
  526 + Map<String, Object> map = tempMap.get(Int);
  527 + String str = map.get("line").toString();
  528 + if(!listMap2.containsKey(str))
  529 + listMap2.put(str, new ArrayList<Map<String, Object>>());
  530 + listMap2.get(str).add(map);
  531 + }
  532 + }
  533 + for(String str : listMap2.keySet()){
  534 + for(Map<String, Object> map : listMap2.get(str)){
  535 + resList.add(map);
  536 + }
  537 + }
  538 +
  539 + //分页
  540 + if(page.length() != 0 && type.equals("query")){
  541 + int currPage = Integer.valueOf(page);
  542 + modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10);
  543 + modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10));
  544 + }
  545 +
  546 + //导出
  547 + if(type.equals("export")){
  548 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  549 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  550 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  551 + Map<String,Object> map = new HashMap<String, Object>();
  552 + ReportUtils ee = new ReportUtils();
  553 + try {
  554 + listI.add(resList.iterator());
  555 + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
  556 + ee.excelReplace(listI, new Object[] { map }, path+"mould\\scheduleAnaly.xls",
  557 + path+"export\\时刻表分析" + sdfSimple.format(sdfMonth.parse(startDate)) + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
  558 + } catch (Exception e) {
  559 + // TODO: handle exception
  560 + e.printStackTrace();
  561 + }
  562 + }
  563 +
  564 + return modelMap;
  565 + }
  566 +
  567 + @Override
  568 + public List<Map<String, Object>> getModel(String line, String startDate, String endDate) {
  569 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  570 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  571 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  572 + SimpleDateFormat sdfEE = new SimpleDateFormat("EEEE");
  573 +
  574 + if(startDate.length() == 0){
  575 + startDate = sdf.format(new Date());
  576 + }
  577 + if(endDate.length() == 0){
  578 + endDate = sdf.format(new Date());
  579 + }
  580 + try {
  581 +
  582 + String sql = "select tt.id, tt.name, qyrq, tt.rule_days, tt.special_days from bsth_c_s_ttinfo tt left join bsth_c_line cl on cl.id = tt.xl where tt.is_cancel = 0 and tt.is_enable_dis_template = 1";
  583 + if(line.length() != 0){
  584 + sql += " and cl.line_code = '"+line+"'";
  585 + }
  586 + sql += " order by tt.create_date desc";
  587 +
  588 + list = jdbcTemplate.query(sql,
  589 + new RowMapper<Map<String, Object>>(){
  590 + @Override
  591 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  592 + Map<String, Object> map = new HashMap<String, Object>();
  593 + map.put("id", rs.getString("id"));
  594 + map.put("name", rs.getString("name"));
  595 + map.put("qyrq", rs.getString("qyrq"));
  596 + map.put("ruleDays", rs.getString("rule_days"));
  597 + map.put("specialDays", rs.getString("special_days"));
  598 + return map;
  599 + }
  600 + });
  601 +
  602 + } catch (Exception e) {
  603 + // TODO Auto-generated catch block
  604 + e.printStackTrace();
  605 + }
  606 +
  607 + Date date1 = null;
  608 + Date date2 = null;
  609 + try {
  610 + date1 = sdf.parse(startDate);
  611 + date2 = sdf.parse(endDate);
  612 + } catch (ParseException e) {
  613 + // TODO Auto-generated catch block
  614 + e.printStackTrace();
  615 + }
  616 +
  617 + Set<Integer> ruleDays1 = new HashSet<Integer>();
  618 + List<String> specialDays1 = new ArrayList<String>();
  619 + for(int i = 0; ; i++){
  620 + Date tempDate = new Date(date1.getTime() + i*1000*60*60*24);
  621 + if(tempDate.getTime() > date2.getTime())
  622 + break;
  623 + String week = sdfEE.format(tempDate);
  624 + if(week.equals("星期一"))
  625 + ruleDays1.add(0);
  626 + else if(week.equals("星期二"))
  627 + ruleDays1.add(1);
  628 + else if(week.equals("星期三"))
  629 + ruleDays1.add(2);
  630 + else if(week.equals("星期四"))
  631 + ruleDays1.add(3);
  632 + else if(week.equals("星期五"))
  633 + ruleDays1.add(4);
  634 + else if(week.equals("星期六"))
  635 + ruleDays1.add(5);
  636 + else if(week.equals("星期日"))
  637 + ruleDays1.add(6);
  638 + specialDays1.add(sdf.format(tempDate));
  639 + }
  640 + for(Map<String, Object> map : list){
  641 + String[] ruleDays = map.get("ruleDays").toString().split(",");
  642 + String[] specialDays = map.get("specialDays").toString().split(",");
  643 + boolean flag = false;
  644 + DO:{
  645 + try {
  646 + long qyrq = sdf.parse(map.get("qyrq").toString()).getTime();
  647 + if(qyrq > date2.getTime())
  648 + break;
  649 + } catch (ParseException e) {
  650 + // TODO Auto-generated catch block
  651 + e.printStackTrace();
  652 + }
  653 + for(int i = 0; i < ruleDays.length; i++){
  654 + if(ruleDays[i].equals("1")){
  655 + if(ruleDays1.contains(i)){
  656 + flag = true;
  657 + break DO;
  658 + }
  659 + }
  660 + }
  661 + for(int i = 0; i < specialDays.length; i++){
  662 + for(int j = 0; j < specialDays1.size(); j++){
  663 + if(specialDays[i].equals(specialDays1.get(j))){
  664 + flag = true;
  665 + break DO;
  666 + }
  667 + }
  668 + }
  669 + }
  670 + if(flag)
  671 + resList.add(map);
  672 + }
  673 +
  674 + return resList;
  675 + }
  676 +
  677 + @Override
  678 + public List<Map<String, Object>> firstAndLastBus(String line, String date, String type) {
  679 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  680 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  681 + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
  682 +
  683 + if(date.length() == 0)
  684 + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  685 + if(line.length() != 0)
  686 + list = scheduleRealInfoRepository.scheduleDaily(line, date);
  687 + else
  688 + list = scheduleRealInfoRepository.findByDate(date);
  689 +
  690 + for(ScheduleRealInfo schedule : list){
  691 + if(!schedule.getBcType().equals("normal"))
  692 + continue;
  693 + String key = schedule.getXlName();
  694 + if(!keyMap.containsKey(key))
  695 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  696 + keyMap.get(key).add(schedule);
  697 + }
  698 + for(String key : keyMap.keySet()){
  699 + Map<String, Object> tempMap = new HashMap<String, Object>();
  700 + Map<Long, ScheduleRealInfo> temp0 = new HashMap<Long, ScheduleRealInfo>();
  701 + List<Long> longList0 = new ArrayList<Long>();
  702 + Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>();
  703 + List<Long> longList1 = new ArrayList<Long>();
  704 + for(ScheduleRealInfo schedule : keyMap.get(key)){
  705 + String[] split = schedule.getFcsj().split(":");
  706 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  707 + schedule.setFcsjT(min);
  708 + if(schedule.getXlDir().equals("0")){
  709 + temp0.put(min, schedule);
  710 + longList0.add(min);
  711 + } else {
  712 + temp1.put(min, schedule);
  713 + longList1.add(min);
  714 + }
  715 + }
  716 + Collections.sort(longList0);
  717 + Collections.sort(longList1);
  718 + ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
  719 + ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));
  720 + ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));
  721 + ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1));
  722 + tempMap.put("date", date);
  723 + tempMap.put("line", key);
  724 + tempMap.put("qdzFirst0", shouban0.getQdzName());
  725 + tempMap.put("jhfcFirst0", shouban0.getFcsj());
  726 + tempMap.put("qdzLast0", moban0.getQdzName());
  727 + tempMap.put("jhfcLast0", moban0.getFcsj());
  728 + tempMap.put("qdzFirst1", shouban1.getQdzName());
  729 + tempMap.put("jhfcFirst1", shouban1.getFcsj());
  730 + tempMap.put("qdzLast1", moban1.getQdzName());
  731 + tempMap.put("jhfcLast1", moban1.getFcsj());
  732 + if(shouban0.getFcsjActual() != null){
  733 + String[] split = shouban0.getFcsjActual().split(":");
  734 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  735 + long delay = shouban0.getFcsjT() - min;
  736 + tempMap.put("sjfcFirst0", shouban0.getFcsjActual());
  737 + if(delay > 0)
  738 + tempMap.put("delayFirst0", "+" + delay);
  739 + else
  740 + tempMap.put("delayFirst0", delay);
  741 + } else {
  742 + tempMap.put("sjfcFirst0", "/");
  743 + tempMap.put("delayFirst0", "/");
  744 + }
  745 + if(moban0.getZdsjActual() != null){
  746 + String[] split = moban0.getFcsjActual().split(":");
  747 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  748 + long delay = moban0.getFcsjT() - min;
  749 + tempMap.put("sjfcLast0", moban0.getFcsjActual());
  750 + if(delay > 0)
  751 + tempMap.put("delayLast0", "+" + delay);
  752 + else
  753 + tempMap.put("delayLast0", delay);
  754 + } else {
  755 + tempMap.put("sjfcLast0", "/");
  756 + tempMap.put("delayLast0", "/");
  757 + }
  758 + if(shouban1.getFcsjActual() != null){
  759 + String[] split = shouban1.getFcsjActual().split(":");
  760 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  761 + long delay = shouban1.getFcsjT() - min;
  762 + tempMap.put("sjfcFirst1", shouban1.getFcsjActual());
  763 + if(delay > 0)
  764 + tempMap.put("delayFirst1", "+" + delay);
  765 + else
  766 + tempMap.put("delayFirst1", delay);
  767 + } else {
  768 + tempMap.put("sjfcFirst1", "/");
  769 + tempMap.put("delayFirst1", "/");
  770 + }
  771 + if(moban1.getZdsjActual() != null){
  772 + String[] split = moban1.getFcsjActual().split(":");
  773 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  774 + long delay = moban1.getFcsjT() - min;
  775 + tempMap.put("sjfcLast1", moban1.getFcsjActual());
  776 + if(delay > 0)
  777 + tempMap.put("delayLast1", "+" + delay);
  778 + else
  779 + tempMap.put("delayLast1", delay);
  780 + } else {
  781 + tempMap.put("sjfcLast1", "/");
  782 + tempMap.put("delayLast1", "/");
  783 + }
  784 + resList.add(tempMap);
  785 + }
  786 +
  787 + if(type.equals("export")){
  788 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  789 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  790 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  791 + Map<String,Object> map = new HashMap<String, Object>();
  792 + ReportUtils ee = new ReportUtils();
  793 + try {
  794 + listI.add(resList.iterator());
  795 + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
  796 + ee.excelReplace(listI, new Object[] { map }, path+"mould\\firstAndLastBus.xls",
  797 + path+"export\\线路首末班" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  798 + } catch (Exception e) {
  799 + // TODO: handle exception
  800 + e.printStackTrace();
  801 + }
  802 + }
  803 +
  804 + return resList;
  805 + }
  806 +
  807 + @Override
  808 + public List<Map<String, Object>> commandState(String line, String date, String code) {
  809 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  810 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  811 + Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>();
  812 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
  813 +
  814 + if(date.length() == 0)
  815 + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  816 +
  817 + try {
  818 +
  819 + String sql = "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " +
  820 + "FROM bsth_c_s_sp_info_real as r left join bsth_v_directive_60 as d on r.id = d.sch and d.is_dispatch = 1 where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'";
  821 + if(line.length() != 0){
  822 + sql += " and xl_bm = '"+line+"'";
  823 + }
  824 + if(code.length() != 0){
  825 + sql += " and cl_zbh = '"+code+"'";
  826 + }
  827 + sql += " union " +
  828 + "select r.id, r.schedule_date_str, r.xl_name, r.cl_zbh, r.j_gh, r.j_name, r.fcsj, d.timestamp, d.reply46, d.reply47, d.reply46time, d.reply47time " +
  829 + "FROM bsth_c_s_sp_info_real as r right join bsth_v_directive_60 as d on r.id = d.sch where d.is_dispatch = 1 and DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'";
  830 + if(line.length() != 0){
  831 + sql += " and xl_bm = '"+line+"'";
  832 + }
  833 + if(code.length() != 0){
  834 + sql += " and cl_zbh = '"+code+"'";
  835 + }
  836 + sql += " order by fcsj";
  837 +
  838 + list = jdbcTemplate.query(sql,
  839 + new RowMapper<Map<String, Object>>(){
  840 + @Override
  841 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  842 + Map<String, Object> map = new HashMap<String, Object>();
  843 + map.put("id", rs.getString("id"));
  844 + map.put("date", rs.getString("schedule_date_str"));
  845 + map.put("line", rs.getString("xl_name"));
  846 + map.put("clZbh", rs.getString("cl_zbh"));
  847 + map.put("jGh", rs.getString("j_gh"));
  848 + map.put("jName", rs.getString("j_name"));
  849 + map.put("fcsj", rs.getString("fcsj"));
  850 + map.put("timestamp", rs.getString("timestamp"));
  851 + map.put("reply46", rs.getString("reply46"));
  852 + map.put("reply47", rs.getString("reply47"));
  853 + map.put("reply46time", rs.getString("reply46time"));
  854 + map.put("reply47time", rs.getString("reply47time"));
  855 + return map;
  856 + }
  857 + });
  858 +
  859 + } catch (Exception e) {
  860 + // TODO Auto-generated catch block
  861 + e.printStackTrace();
  862 + }
  863 +
  864 + for(Map<String, Object> map : list){
  865 + String key = map.get("line") + "/" + map.get("clZbh") + "/" + map.get("jGh") + "/" + map.get("jName");
  866 + if(!keyMap.containsKey(key))
  867 + keyMap.put(key, new ArrayList<Map<String, Object>>());
  868 + keyMap.get(key).add(map);
  869 + }
  870 + for(String key : keyMap.keySet()){
  871 + Map<String, Object> tempMap = new HashMap<String, Object>();
  872 + Set<String> tempSet = new HashSet<String>();
  873 + int sjf = 0;
  874 + int wqr = 0;
  875 + for(Map<String, Object> map : keyMap.get(key)){
  876 + tempSet.add(map.get("id").toString());
  877 + if(map.get("timestamp") != null){
  878 + sjf++;
  879 + if(map.get("reply47").toString().equals("-1"))
  880 + wqr++;
  881 + map.put("time", sdf.format(new Date(Long.valueOf(map.get("timestamp").toString()))));
  882 + } else
  883 + map.put("time", "/");
  884 +
  885 + if(map.get("reply46time") != null)
  886 + map.put("time46", sdf.format(new Date(Long.valueOf(map.get("reply46time").toString()))));
  887 + else
  888 + map.put("time46", "/");
  889 +
  890 + if(map.get("reply47time") != null)
  891 + map.put("time47", sdf.format(new Date(Long.valueOf(map.get("reply47time").toString()))));
  892 + else
  893 + map.put("time47", "/");
  894 +
  895 + }
  896 + String[] split = key.split("/");
  897 + tempMap.put("date", date);
  898 + tempMap.put("line", split[0]);
  899 + tempMap.put("clZbh", split[1]);
  900 + tempMap.put("jsy", split[2] + "/" + split[3]);
  901 + tempMap.put("jhf", tempSet.size());
  902 + tempMap.put("sjf", sjf);
  903 + tempMap.put("wqr", wqr);
  904 + tempMap.put("workList", keyMap.get(key));
  905 + resList.add(tempMap);
  906 + }
  907 +
  908 + return resList;
  909 + }
  910 +
  911 +}
... ...
src/main/resources/static/pages/forms/mould/firstAndLastBus.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/peoCarPlan.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/workDaily.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/commandState.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">
  21 + <h1>指令状态分析</h1>
  22 + </div>
  23 +</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">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">线路: </span>
  32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">时间: </span>
  36 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 15px">
  39 + <span class="item-label" style="width: 140px;">内部编码: </span>
  40 + <select class="form-control" name="code" id="code" style="width: 180px;"></select>
  41 + </div>
  42 + <div class="form-group">
  43 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  44 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
  45 + </div>
  46 + </form>
  47 + </div>
  48 + <div class="portlet-body">
  49 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  50 + <table class="table table-bordered table-hover table-checkable" id="forms">
  51 + <thead>
  52 + <tr class="hidden">
  53 + <th>日期</th>
  54 + <th>线路</th>
  55 + <th>车辆</th>
  56 + <th>人员</th>
  57 + <th>应发</th>
  58 + <th>实发</th>
  59 + <th>未确认</th>
  60 + </tr>
  61 + </thead>
  62 + <tbody>
  63 +
  64 + </tbody>
  65 + </table>
  66 + <div id="works_hidden" class="hidden">
  67 + <span class="item-label" style="width: 80px;">明细: </span>
  68 + <span class="item-label" style="width: 80px;margin-left: 60px;">日期 </span>
  69 + <span class="item-label" style="width: 80px;" id="date1"></span>
  70 + <span class="item-label" style="width: 80px;margin-left: 60px;">线路 </span>
  71 + <span class="item-label" style="width: 80px;" id="line1"></span>
  72 + <span class="item-label" style="width: 80px;margin-left: 60px;">车辆 </span>
  73 + <span class="item-label" style="width: 80px;" id="clZbh1"></span>
  74 + <span class="item-label" style="width: 80px;margin-left: 60px;">人员 </span>
  75 + <span class="item-label" style="width: 80px;" id="jsy1"></span>
  76 + </div>
  77 + <table class="table table-bordered table-hover table-checkable" id="works">
  78 + <thead>
  79 + <tr class="hidden">
  80 + <th>日期</th>
  81 + <th>线路</th>
  82 + <th>车辆</th>
  83 + <th>计划发车时间</th>
  84 + <th>发送时间</th>
  85 + <th>收到时间</th>
  86 + <th>确认时间</th>
  87 + </tr>
  88 + </thead>
  89 + <tbody>
  90 +
  91 + </tbody>
  92 + </table>
  93 + <div style="text-align: right;">
  94 + <ul id="pagination" class="pagination"></ul>
  95 + </div>
  96 + </div>
  97 + </div>
  98 + </div>
  99 + </div>
  100 +</div>
  101 +
  102 +<script>
  103 + $(function(){
  104 + var list;
  105 +
  106 + // 关闭左侧栏
  107 + if (!$('body').hasClass('page-sidebar-closed'))
  108 + $('.menu-toggler.sidebar-toggler').click();
  109 +
  110 + $("#date").datetimepicker({
  111 + format : 'YYYY-MM-DD',
  112 + locale : 'zh-cn'
  113 + });
  114 +
  115 + var d = new Date();
  116 + var year = d.getFullYear();
  117 + var month = d.getMonth() + 1;
  118 + var day = d.getDate();
  119 + if(month > 9){
  120 + $("#date").val(year + "-" + month + "-" + day);
  121 + } else {
  122 + $("#date").val(year + "-0" + month + "-" + day);
  123 + }
  124 +
  125 + $('#line').select2({
  126 + ajax: {
  127 + url: '/realSchedule/findLine',
  128 + type: 'post',
  129 + dataType: 'json',
  130 + delay: 150,
  131 + data: function(params){
  132 + return{line: params.term};
  133 + },
  134 + processResults: function (data) {
  135 + return {
  136 + results: data
  137 + };
  138 + },
  139 + cache: true
  140 + },
  141 + templateResult: function(repo){
  142 + if (repo.loading) return repo.text;
  143 + var h = '<span>'+repo.text+'</span>';
  144 + return h;
  145 + },
  146 + escapeMarkup: function (markup) { return markup; },
  147 + minimumInputLength: 1,
  148 + templateSelection: function(repo){
  149 + return repo.text;
  150 + },
  151 + language: {
  152 + noResults: function(){
  153 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
  154 + },
  155 + inputTooShort : function(e) {
  156 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
  157 + },
  158 + searching : function() {
  159 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
  160 + }
  161 + }
  162 + });
  163 + $('#code').select2({
  164 + ajax: {
  165 + url: '/realSchedule/sreachVehic',
  166 + dataType: 'json',
  167 + delay: 150,
  168 + data: function(params){
  169 + return{nbbm: params.term};
  170 + },
  171 + processResults: function (data) {
  172 + return {
  173 + results: data
  174 + };
  175 + },
  176 + cache: true
  177 + },
  178 + templateResult: function(repo){
  179 + if (repo.loading) return repo.text;
  180 + var h = '<span>'+repo.text+'</span>';
  181 + h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
  182 + return h;
  183 + },
  184 + escapeMarkup: function (markup) { return markup; },
  185 + minimumInputLength: 1,
  186 + templateSelection: function(repo){
  187 + return repo.text;
  188 + },
  189 + language: {
  190 + noResults: function(){
  191 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  192 + },
  193 + inputTooShort : function(e) {
  194 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  195 + },
  196 + searching : function() {
  197 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  198 + }
  199 + }
  200 + });
  201 +
  202 +
  203 + $("#query").on("click",jsDoQuery);
  204 +
  205 + function jsDoQuery(pagination){
  206 + var params = {};
  207 + params['line'] = $("#line").val();
  208 + params['date'] = $("#date").val();
  209 + params['code'] = $("#code").val();
  210 + $("#forms .hidden").removeClass("hidden");
  211 + $get('/pcpc/commandState', params, function(result){
  212 + // 把数据填充到模版中
  213 + var tbodyHtml = template('list_commandState',{list:result});
  214 + list = result;
  215 + // 把渲染好的模版html文本追加到表格中
  216 + $('#forms tbody').html(tbodyHtml);
  217 +
  218 + });
  219 + }
  220 +
  221 + $("#export").on("click",function(){
  222 + $('#forms').tableExport({ type: 'excel', escape: 'false',filename:'(2016-02-29_2016-03-06)'});
  223 + });
  224 +
  225 + $("#forms tbody").on("click","a",function(){
  226 + var jsy = $(this).html();
  227 + $.each(list, function(i, g){
  228 + if(jsy == g.jsy){
  229 + $("#date1").html(g.date);
  230 + $("#line1").html(g.line);
  231 + $("#clZbh1").html(g.clZbh);
  232 + $("#jsy1").html(g.jsy);
  233 + $("#works_hidden").removeClass("hidden");
  234 + $("#works .hidden").removeClass("hidden");
  235 + // 把数据填充到模版中
  236 + var tbodyHtml = template('list_workList',{list:g.workList});
  237 + // 把渲染好的模版html文本追加到表格中
  238 + $('#works tbody').html(tbodyHtml);
  239 + }
  240 + });
  241 + });
  242 +
  243 +
  244 + });
  245 +
  246 +
  247 +</script>
  248 +<script type="text/html" id="list_commandState">
  249 + {{each list as obj i}}
  250 + <tr>
  251 + <td>{{obj.date}}</td>
  252 + <td>{{obj.line}}</td>
  253 + <td>{{obj.clZbh}}</td>
  254 + <td><a id="jsy">{{obj.jsy}}</a></td>
  255 + <td>{{obj.jhf}}</td>
  256 + <td>{{obj.sjf}}</td>
  257 + <td>{{obj.wqr}}</td>
  258 + </tr>
  259 + {{/each}}
  260 + {{if list.length == 0}}
  261 + <tr>
  262 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  263 + </tr>
  264 + {{/if}}
  265 +</script>
  266 +
  267 +<script type="text/html" id="list_workList">
  268 + {{each list as obj i}}
  269 + <tr>
  270 + <td>{{obj.date}}</td>
  271 + <td>{{obj.line}}</td>
  272 + <td>{{obj.clZbh}}</td>
  273 + <td>{{obj.fcsj}}</td>
  274 + <td>{{obj.time}}</td>
  275 + <td>{{obj.time46}}</td>
  276 + <td>{{obj.time47}}</td>
  277 + </tr>
  278 + {{/each}}
  279 + {{if list.length == 0}}
  280 + <tr>
  281 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  282 + </tr>
  283 + {{/if}}
  284 +</script>
0 285 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus.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">
  21 + <h1>线路首末班查询</h1>
  22 + </div>
  23 +</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">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">线路: </span>
  32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">时间: </span>
  36 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  37 + </div>
  38 + <div class="form-group">
  39 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  40 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  41 + </div>
  42 + </form>
  43 + </div>
  44 + <div class="portlet-body">
  45 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <table class="table table-bordered table-hover table-checkable" id="forms">
  47 + <thead>
  48 + <tr class="hidden">
  49 + <th width="100px" rowspan="2">日期</th>
  50 + <th width="100px" rowspan="2">线路</th>
  51 + <th colspan="4">上行首发</th>
  52 + <th colspan="4">上行末发</th>
  53 + <th colspan="4">下行首发</th>
  54 + <th colspan="4">下行末发</th>
  55 + </tr>
  56 + <tr class="hidden">
  57 + <th width="100px">站点</th>
  58 + <th>计发</th>
  59 + <th>实发</th>
  60 + <th>快慢</th>
  61 + <th width="100px">站点</th>
  62 + <th>计发</th>
  63 + <th>实发</th>
  64 + <th>快慢</th>
  65 + <th width="100px">站点</th>
  66 + <th>计发</th>
  67 + <th>实发</th>
  68 + <th>快慢</th>
  69 + <th width="100px">站点</th>
  70 + <th>计发</th>
  71 + <th>实发</th>
  72 + <th>快慢</th>
  73 + </tr>
  74 + </thead>
  75 + <tbody>
  76 +
  77 + </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 +
  88 +<script>
  89 + $(function(){
  90 +
  91 + // 关闭左侧栏
  92 + if (!$('body').hasClass('page-sidebar-closed'))
  93 + $('.menu-toggler.sidebar-toggler').click();
  94 +
  95 + $("#date").datetimepicker({
  96 + format : 'YYYY-MM-DD',
  97 + locale : 'zh-cn'
  98 + });
  99 +
  100 + var d = new Date();
  101 + var year = d.getFullYear();
  102 + var month = d.getMonth() + 1;
  103 + var day = d.getDate();
  104 + if(month > 9){
  105 + $("#date").val(year + "-" + month + "-" + day);
  106 + } else {
  107 + $("#date").val(year + "-0" + month + "-" + day);
  108 + }
  109 +
  110 + $('#line').select2({
  111 + ajax: {
  112 + url: '/realSchedule/findLine',
  113 + type: 'post',
  114 + dataType: 'json',
  115 + delay: 150,
  116 + data: function(params){
  117 + return{line: params.term};
  118 + },
  119 + processResults: function (data) {
  120 + return {
  121 + results: data
  122 + };
  123 + },
  124 + cache: true
  125 + },
  126 + templateResult: function(repo){
  127 + if (repo.loading) return repo.text;
  128 + var h = '<span>'+repo.text+'</span>';
  129 + return h;
  130 + },
  131 + escapeMarkup: function (markup) { return markup; },
  132 + minimumInputLength: 1,
  133 + templateSelection: function(repo){
  134 + return repo.text;
  135 + },
  136 + language: {
  137 + noResults: function(){
  138 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
  139 + },
  140 + inputTooShort : function(e) {
  141 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
  142 + },
  143 + searching : function() {
  144 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
  145 + }
  146 + }
  147 + });
  148 +
  149 + $("#query").on("click",jsDoQuery);
  150 +
  151 + var line = $("#line").val();
  152 + var date = $("#date").val();
  153 + function jsDoQuery(pagination){
  154 + var params = {};
  155 + line = $("#line").val();
  156 + date = $("#date").val();
  157 + params['line'] = line;
  158 + params['date'] = date;
  159 + params['type'] = "query";
  160 + $(".hidden").removeClass("hidden");
  161 + $get('/pcpc/firstAndLastBus', params, function(result){
  162 + // 把数据填充到模版中
  163 + var tbodyHtml = template('list_firstAndLastBus',{list:result});
  164 + // 把渲染好的模版html文本追加到表格中
  165 + $('#forms tbody').html(tbodyHtml);
  166 +
  167 + });
  168 + }
  169 +
  170 + $("#export").on("click",function(){
  171 + $get('/pcpc/firstAndLastBus',{line:line,date:date,type:'export'},function(result){
  172 + window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
  173 + });
  174 + });
  175 +
  176 +
  177 + });
  178 +
  179 +</script>
  180 +<script type="text/html" id="list_firstAndLastBus">
  181 + {{each list as obj i}}
  182 + <tr>
  183 + <td>{{obj.date}}</td>
  184 + <td>{{obj.line}}</td>
  185 + <td>{{obj.qdzFirst0}}</td>
  186 + <td>{{obj.jhfcFirst0}}</td>
  187 + <td>{{obj.sjfcFirst0}}</td>
  188 + <td>{{obj.delayFirst0}}</td>
  189 + <td>{{obj.qdzLast0}}</td>
  190 + <td>{{obj.jhfcLast0}}</td>
  191 + <td>{{obj.sjfcLast0}}</td>
  192 + <td>{{obj.delayLast0}}</td>
  193 + <td>{{obj.qdzFirst1}}</td>
  194 + <td>{{obj.jhfcFirst1}}</td>
  195 + <td>{{obj.sjfcFirst1}}</td>
  196 + <td>{{obj.delayFirst1}}</td>
  197 + <td>{{obj.qdzLast1}}</td>
  198 + <td>{{obj.jhfcLast1}}</td>
  199 + <td>{{obj.sjfcLast1}}</td>
  200 + <td>{{obj.delayLast1}}</td>
  201 + </tr>
  202 + {{/each}}
  203 + {{if list.length == 0}}
  204 + <tr>
  205 + <td colspan="18"><h6 class="muted">没有找到相关数据</h6></td>
  206 + </tr>
  207 + {{/if}}
  208 +</script>
0 209 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/peopleCarPlan.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">
  21 + <h1>计划车辆班次人员</h1>
  22 + </div>
  23 +</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">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">线路: </span>
  32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">时间: </span>
  36 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  37 + </div>
  38 + <div class="form-group">
  39 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  40 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  41 + </div>
  42 + </form>
  43 + </div>
  44 + <div class="portlet-body">
  45 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <table class="table table-bordered table-hover table-checkable" id="forms">
  47 + <thead>
  48 + <tr class="hidden">
  49 + <th>日期</th>
  50 + <th>线路</th>
  51 + <th>路牌</th>
  52 + <th>车辆</th>
  53 + <th>驾驶员</th>
  54 + <th>售票员</th>
  55 + <th>计划里程</th>
  56 + </tr>
  57 + </thead>
  58 + <tbody>
  59 +
  60 + </tbody>
  61 + </table>
  62 + <div style="text-align: right;">
  63 + <ul id="pagination" class="pagination"></ul>
  64 + </div>
  65 + </div>
  66 + </div>
  67 + </div>
  68 + </div>
  69 +</div>
  70 +
  71 +<script>
  72 + $(function(){
  73 +
  74 + // 关闭左侧栏
  75 + if (!$('body').hasClass('page-sidebar-closed'))
  76 + $('.menu-toggler.sidebar-toggler').click();
  77 +
  78 + $("#date").datetimepicker({
  79 + format : 'YYYY-MM-DD',
  80 + locale : 'zh-cn'
  81 + });
  82 +
  83 + var d = new Date();
  84 + var year = d.getFullYear();
  85 + var month = d.getMonth() + 1;
  86 + var day = d.getDate();
  87 + if(month > 9){
  88 + $("#date").val(year + "-" + month + "-" + day);
  89 + } else {
  90 + $("#date").val(year + "-0" + month + "-" + day);
  91 + }
  92 +
  93 + $('#line').select2({
  94 + ajax: {
  95 + url: '/realSchedule/findLine',
  96 + type: 'post',
  97 + dataType: 'json',
  98 + delay: 150,
  99 + data: function(params){
  100 + return{line: params.term};
  101 + },
  102 + processResults: function (data) {
  103 + return {
  104 + results: data
  105 + };
  106 + },
  107 + cache: true
  108 + },
  109 + templateResult: function(repo){
  110 + if (repo.loading) return repo.text;
  111 + var h = '<span>'+repo.text+'</span>';
  112 + return h;
  113 + },
  114 + escapeMarkup: function (markup) { return markup; },
  115 + minimumInputLength: 1,
  116 + templateSelection: function(repo){
  117 + return repo.text;
  118 + },
  119 + language: {
  120 + noResults: function(){
  121 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
  122 + },
  123 + inputTooShort : function(e) {
  124 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
  125 + },
  126 + searching : function() {
  127 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
  128 + }
  129 + }
  130 + });
  131 +
  132 +
  133 + $("#query").on("click",jsDoQuery);
  134 +
  135 + var line = $("#line").val();
  136 + var date = $("#date").val();
  137 + function jsDoQuery(pagination){
  138 + var params = {};
  139 + line = $("#line").val();
  140 + date = $("#date").val();
  141 + params['line'] = line;
  142 + params['date'] = date;
  143 + params['type'] = "query";
  144 + $(".hidden").removeClass("hidden");
  145 + $get('/pcpc/queryPeopleCar', params, function(result){
  146 + // 把数据填充到模版中
  147 + var tbodyHtml = template('list_queryPeopleCar',{list:result});
  148 + // 把渲染好的模版html文本追加到表格中
  149 + $('#forms tbody').html(tbodyHtml);
  150 +
  151 + });
  152 + }
  153 +
  154 + $("#export").on("click",function(){
  155 + $get('/pcpc/queryPeopleCar',{line:line,date:date,type:'export'},function(result){
  156 + window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD"));
  157 + });
  158 + });
  159 +
  160 +
  161 + });
  162 +
  163 +</script>
  164 +<script type="text/html" id="list_queryPeopleCar">
  165 + {{each list as obj i}}
  166 + <tr>
  167 + <td>{{obj.date}}</td>
  168 + <td>{{obj.line}}</td>
  169 + <td>{{obj.lp}}</td>
  170 + <td>{{obj.clzbh}}</td>
  171 + <td>{{obj.jName}}</td>
  172 + <td>{{obj.sName}}</td>
  173 + <td>{{obj.jhlc}}</td>
  174 + </tr>
  175 + {{/each}}
  176 + {{if list.length == 0}}
  177 + <tr>
  178 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  179 + </tr>
  180 + {{/if}}
  181 +</script>
0 182 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.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">
  21 + <h1>时刻表分析</h1>
  22 + </div>
  23 +</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">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">线路: </span>
  32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">开始时间: </span>
  36 + <input class="form-control" type="text" id="startDate" style="width: 180px;"/>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 15px;">
  39 + <span class="item-label" style="width: 80px;">结束时间: </span>
  40 + <input class="form-control" type="text" id="endDate" style="width: 180px;"/>
  41 + </div>
  42 + <div style="display: inline-block;">
  43 + <span class="item-label" style="width: 80px;">模板类型: </span>
  44 + <select class="form-control" name="model" id="model" style="width: 180px;">
  45 + <option value="">请选择...</option>
  46 + </select>
  47 + </div>
  48 + <div class="form-group">
  49 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  50 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  51 + </div>
  52 + </form>
  53 + </div>
  54 + <div class="portlet-body">
  55 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  56 + <table class="table table-bordered table-hover table-checkable" id="forms">
  57 + <thead>
  58 + <tr class="hidden">
  59 + <th width="10%">线路</th>
  60 + <th width="10%">起点站名</th>
  61 + <th width="8%">计发时间</th>
  62 + <th width="8%">计划运送时间(分)</th>
  63 + <th width="8%">计划完成次数</th>
  64 + <th width="8%">完成次数</th>
  65 + <th width="8%">最早发车时间</th>
  66 + <th width="8%">最晚发车时间</th>
  67 + <th width="8%">平均发车时间</th>
  68 + <th width="8%">最慢运送时间(分)</th>
  69 + <th width="8%">最快运送时间(分)</th>
  70 + <th width="8%">平均运送时间(分)</th>
  71 + </tr>
  72 + </thead>
  73 + <tbody>
  74 +
  75 + </tbody>
  76 + </table>
  77 + <div style="text-align: right;">
  78 + <ul id="pagination" class="pagination"></ul>
  79 + </div>
  80 + </div>
  81 + </div>
  82 + </div>
  83 + </div>
  84 +</div>
  85 +
  86 +<script>
  87 + $(function(){
  88 + var page = 0, initPagination;
  89 +
  90 + // 关闭左侧栏
  91 + if (!$('body').hasClass('page-sidebar-closed'))
  92 + $('.menu-toggler.sidebar-toggler').click();
  93 +
  94 + $("#startDate").datetimepicker({
  95 + format : 'YYYY-MM-DD',
  96 + locale : 'zh-cn'
  97 + });
  98 +
  99 + $("#endDate").datetimepicker({
  100 + format : 'YYYY-MM-DD',
  101 + locale : 'zh-cn'
  102 + });
  103 +
  104 + var d = new Date();
  105 + var year = d.getFullYear();
  106 + var month = d.getMonth() + 1;
  107 + var day = d.getDate();
  108 + if(month > 9){
  109 + $("#startDate").val(year + "-" + month + "-" + day);
  110 + $("#endDate").val(year + "-" + month + "-" + day);
  111 + } else {
  112 + $("#startDate").val(year + "-0" + month + "-" + day);
  113 + $("#endDate").val(year + "-0" + month + "-" + day);
  114 + }
  115 +
  116 + $('#line').select2({
  117 + ajax: {
  118 + url: '/realSchedule/findLine',
  119 + type: 'post',
  120 + dataType: 'json',
  121 + delay: 150,
  122 + data: function(params){
  123 + return{line: params.term};
  124 + },
  125 + processResults: function (data) {
  126 + return {
  127 + results: data
  128 + };
  129 + },
  130 + cache: true
  131 + },
  132 + templateResult: function(repo){
  133 + if (repo.loading) return repo.text;
  134 + var h = '<span>'+repo.text+'</span>';
  135 + return h;
  136 + },
  137 + escapeMarkup: function (markup) { return markup; },
  138 + minimumInputLength: 1,
  139 + templateSelection: function(repo){
  140 + return repo.text;
  141 + },
  142 + language: {
  143 + noResults: function(){
  144 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
  145 + },
  146 + inputTooShort : function(e) {
  147 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
  148 + },
  149 + searching : function() {
  150 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
  151 + }
  152 + }
  153 + });
  154 +
  155 + $("#query").on("click", function(){
  156 + page = 0;
  157 + jsDoQuery(true);
  158 + });
  159 +
  160 + var line = $("#line").val();
  161 + var startDate = $("#startDate").val();
  162 + var endDate = $("#endDate").val();
  163 + var model = $("#model").val();
  164 + function jsDoQuery(pagination){
  165 + var params = {};
  166 + line = $("#line").val();
  167 + startDate = $("#startDate").val();
  168 + endDate = $("#endDate").val();
  169 + model = $("#model").val();
  170 + params['page'] = page;
  171 + params['line'] = line;
  172 + params['startDate'] = startDate;
  173 + params['endDate'] = endDate;
  174 + params['model'] = model;
  175 + params['type'] = "query";
  176 + $(".hidden").removeClass("hidden");
  177 + $get('/pcpc/scheduleAnaly', params, function(result){
  178 + // 把数据填充到模版中
  179 + var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList});
  180 + // 把渲染好的模版html文本追加到表格中
  181 + $('#forms tbody').html(tbodyHtml);
  182 +
  183 + if(pagination && result.dataList.length > 0){
  184 + //重新分页
  185 + initPagination = true;
  186 + showPagination(result);
  187 + }
  188 + });
  189 + }
  190 +
  191 + $("#export").on("click",function(){
  192 + $get('/pcpc/scheduleAnaly',{page:'',line:line,startDate:startDate,endDate:endDate,model:model,type:'export'},function(result){
  193 + window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  194 + });
  195 + });
  196 +
  197 +
  198 + $("#line").on("change", function(){
  199 + line = $("#line").val();
  200 + updateModel();
  201 + });
  202 + $('#startDate').on("blur", function(){
  203 + startDate = $("#startDate").val();
  204 + endDate = $("#endDate").val();
  205 + updateModel();
  206 + });
  207 + $('#endDate').on("blur", function(){
  208 + startDate = $("#startDate").val();
  209 + endDate = $("#endDate").val();
  210 + updateModel();
  211 + });
  212 +
  213 + var flag = 0;
  214 + function updateModel(){
  215 + if(flag == 1)
  216 + return;
  217 + flag = 1;
  218 + var treeData = [];
  219 + var params = {};
  220 + params['line'] = line;
  221 + params['startDate'] = startDate;
  222 + params['endDate'] = endDate;
  223 + $get('/pcpc/getModel', params, function(result){
  224 + treeData = createTreeData(result);
  225 + var options = '<option value="">请选择...</option>';
  226 + var size = 0;
  227 + $.each(treeData, function(i, g){
  228 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  229 + size++;
  230 + });
  231 + $('#model').html(options)/* .select2() */;
  232 + flag = 0;
  233 + });
  234 + }
  235 + updateModel();
  236 +
  237 +
  238 + function showPagination(data){
  239 + //分页
  240 + $('#pagination').jqPaginator({
  241 + totalPages: data.totalPage,
  242 + visiblePages: 6,
  243 + currentPage: page + 1,
  244 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  245 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  246 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  247 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  248 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  249 + onPageChange: function (num, type) {
  250 + if(initPagination){
  251 + initPagination = false;
  252 + return;
  253 + }
  254 + page = num - 1;
  255 + jsDoQuery(false);
  256 + }
  257 + });
  258 + }
  259 +
  260 +
  261 + });
  262 +
  263 +</script>
  264 +<script type="text/html" id="list_scheduleAnaly">
  265 + {{each list as obj i}}
  266 + <tr>
  267 + <td>{{obj.line}}</td>
  268 + <td>{{obj.qdz}}</td>
  269 + <td>{{obj.jhfc}}</td>
  270 + <td>{{obj.bcsj}}</td>
  271 + <td>{{obj.jhbc}}</td>
  272 + <td>{{obj.sjbc}}</td>
  273 + <td>{{obj.zzfc}}</td>
  274 + <td>{{obj.zwfc}}</td>
  275 + <td>{{obj.pjfc}}</td>
  276 + <td>{{obj.zmys}}</td>
  277 + <td>{{obj.zkys}}</td>
  278 + <td>{{obj.pjys}}</td>
  279 + </tr>
  280 + {{/each}}
  281 + {{if list.length == 0}}
  282 + <tr>
  283 + <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td>
  284 + </tr>
  285 + {{/if}}
  286 +</script>
0 287 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/workDaily.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">
  21 + <h1>营运服务日报表</h1>
  22 + </div>
  23 +</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">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">线路: </span>
  32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">时间: </span>
  36 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  37 + </div>
  38 + <div class="form-group">
  39 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  40 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  41 + </div>
  42 + </form>
  43 + </div>
  44 + <div class="portlet-body">
  45 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <table class="table table-bordered table-hover table-checkable" id="forms">
  47 + <thead>
  48 + <tr class="hidden">
  49 + <th width="80px">日期</th>
  50 + <th width="100px">线路</th>
  51 + <th>计划班次</th>
  52 + <th>待发调整</th>
  53 + <th>待发调整比率</th>
  54 + <th>出场率</th>
  55 + <th width="46px">上行发快</th>
  56 + <th width="46px">上行到快</th>
  57 + <th width="46px">下行发快</th>
  58 + <th width="46px">下行到快</th>
  59 + <th width="46px">上行发慢</th>
  60 + <th width="46px">上行到慢</th>
  61 + <th width="46px">下行发慢</th>
  62 + <th width="46px">下行到慢</th>
  63 + <th>误点总数(快/慢)</th>
  64 + <th>首末班准点率</th>
  65 + <th>高峰班次执行率(早/晚)</th>
  66 + </tr>
  67 + </thead>
  68 + <tbody>
  69 +
  70 + </tbody>
  71 + </table>
  72 + <div style="text-align: right;">
  73 + <ul id="pagination" class="pagination"></ul>
  74 + </div>
  75 + </div>
  76 + </div>
  77 + </div>
  78 + </div>
  79 +</div>
  80 +
  81 +<script>
  82 + $(function(){
  83 +
  84 + // 关闭左侧栏
  85 + if (!$('body').hasClass('page-sidebar-closed'))
  86 + $('.menu-toggler.sidebar-toggler').click();
  87 +
  88 + $("#date").datetimepicker({
  89 + format : 'YYYY-MM-DD',
  90 + locale : 'zh-cn'
  91 + });
  92 +
  93 + var d = new Date();
  94 + var year = d.getFullYear();
  95 + var month = d.getMonth() + 1;
  96 + var day = d.getDate();
  97 + if(month > 9){
  98 + $("#date").val(year + "-" + month + "-" + day);
  99 + } else {
  100 + $("#date").val(year + "-0" + month + "-" + day);
  101 + }
  102 +
  103 + $('#line').select2({
  104 + ajax: {
  105 + url: '/realSchedule/findLine',
  106 + type: 'post',
  107 + dataType: 'json',
  108 + delay: 150,
  109 + data: function(params){
  110 + return{line: params.term};
  111 + },
  112 + processResults: function (data) {
  113 + return {
  114 + results: data
  115 + };
  116 + },
  117 + cache: true
  118 + },
  119 + templateResult: function(repo){
  120 + if (repo.loading) return repo.text;
  121 + var h = '<span>'+repo.text+'</span>';
  122 + return h;
  123 + },
  124 + escapeMarkup: function (markup) { return markup; },
  125 + minimumInputLength: 1,
  126 + templateSelection: function(repo){
  127 + return repo.text;
  128 + },
  129 + language: {
  130 + noResults: function(){
  131 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
  132 + },
  133 + inputTooShort : function(e) {
  134 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
  135 + },
  136 + searching : function() {
  137 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
  138 + }
  139 + }
  140 + });
  141 +
  142 + $("#query").on("click",jsDoQuery);
  143 +
  144 + var line = $("#line").val();
  145 + var date = $("#date").val();
  146 + function jsDoQuery(pagination){
  147 + var params = {};
  148 + line = $("#line").val();
  149 + date = $("#date").val();
  150 + params['line'] = line;
  151 + params['date'] = date;
  152 + params['type'] = "query";
  153 + $(".hidden").removeClass("hidden");
  154 + $get('/pcpc/workDaily', params, function(result){
  155 + // 把数据填充到模版中
  156 + var tbodyHtml = template('list_workDaily',{list:result});
  157 + // 把渲染好的模版html文本追加到表格中
  158 + $('#forms tbody').html(tbodyHtml);
  159 +
  160 + });
  161 + }
  162 +
  163 + $("#export").on("click",function(){
  164 + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
  165 + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
  166 + });
  167 + });
  168 +
  169 +
  170 + });
  171 +
  172 +</script>
  173 +<script type="text/html" id="list_workDaily">
  174 + {{each list as obj i}}
  175 + <tr>
  176 + <td>{{obj.date}}</td>
  177 + <td>{{obj.line}}</td>
  178 + <td>{{obj.jhbc}}</td>
  179 + <td>{{obj.dftz}}</td>
  180 + <td>{{obj.dftzl}}</td>
  181 + <td>{{obj.ccl}}</td>
  182 + <td>{{obj.upfk}}</td>
  183 + <td>{{obj.updk}}</td>
  184 + <td>{{obj.dnfk}}</td>
  185 + <td>{{obj.dndk}}</td>
  186 + <td>{{obj.upfm}}</td>
  187 + <td>{{obj.updm}}</td>
  188 + <td>{{obj.dnfm}}</td>
  189 + <td>{{obj.dndm}}</td>
  190 + <td>{{obj.wdzs}}</td>
  191 + <td>{{obj.smbzdl}}</td>
  192 + <td>{{obj.gfbczxl}}</td>
  193 + </tr>
  194 + {{/each}}
  195 + {{if list.length == 0}}
  196 + <tr>
  197 + <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td>
  198 + </tr>
  199 + {{/if}}
  200 +</script>
0 201 \ No newline at end of file
... ...
src/main/resources/static/pages/report/oil/oilListMonth.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">
  21 + <h1>月存油报表</h1>
  22 + </div>
  23 +</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">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">时间: </span>
  32 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">线路: </span>
  36 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  37 + </div>
  38 + <div class="form-group">
  39 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  40 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  41 + </div>
  42 + </form>
  43 + </div>
  44 + <div class="portlet-body">
  45 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <table class="table table-bordered table-hover table-checkable" id="forms">
  47 + <thead>
  48 + <tr>
  49 + <td>序号</td>
  50 + <td>车号</td>
  51 + <td>日期</td>
  52 + <td>存油</td>
  53 +
  54 + <td>序号</td>
  55 + <td>车号</td>
  56 + <td>日期</td>
  57 + <td>存油</td>
  58 +
  59 + <td>序号</td>
  60 + <td>车号</td>
  61 + <td>日期</td>
  62 + <td>存油</td>
  63 +
  64 + <td>序号</td>
  65 + <td>车号</td>
  66 + <td>日期</td>
  67 + <td>存油</td>
  68 +
  69 + <td>序号</td>
  70 + <td>车号</td>
  71 + <td>日期</td>
  72 + <td>存油</td>
  73 + </tr>
  74 + </thead>
  75 +
  76 + <tbody >
  77 +
  78 + </tbody>
  79 + </table>
  80 + </div>
  81 + </div>
  82 + </div>
  83 + </div>
  84 +</div>
  85 +
  86 +<script>
  87 + $(function(){
  88 + // 关闭左侧栏
  89 + if (!$('body').hasClass('page-sidebar-closed'))
  90 + $('.menu-toggler.sidebar-toggler').click();
  91 +
  92 + $("#date").datetimepicker({
  93 + format : 'YYYY-MM-DD',
  94 + locale : 'zh-cn'
  95 + });
  96 +
  97 + $('#line').select2({
  98 + ajax: {
  99 + url: '/realSchedule/findLine',
  100 + dataType: 'json',
  101 + delay: 150,
  102 + data: function(params){
  103 + return{line: params.term};
  104 + },
  105 + processResults: function (data) {
  106 + return {
  107 + results: data
  108 + };
  109 + },
  110 + cache: true
  111 + },
  112 + templateResult: function(repo){
  113 + if (repo.loading) return repo.text;
  114 + var h = '<span>'+repo.text+'</span>';
  115 + return h;
  116 + },
  117 + escapeMarkup: function (markup) { return markup; },
  118 + minimumInputLength: 1,
  119 + templateSelection: function(repo){
  120 + return repo.text;
  121 + },
  122 + language: {
  123 + noResults: function(){
  124 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
  125 + },
  126 + inputTooShort : function(e) {
  127 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
  128 + },
  129 + searching : function() {
  130 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
  131 + }
  132 + }
  133 + });
  134 +
  135 + //查询
  136 + $("#query").on('click',function(){
  137 + var line = $("#line").val();
  138 + var date = $("#date").val();
  139 + $get('/ylb/oilListMonth',{line:line,date:date},function(result){
  140 + $.each(result, function(i, obj) {
  141 + obj.rq = moment(obj.rq).format("DD");
  142 + });
  143 + var oilListMonth = template('oilListMonth',{list:result});
  144 + $('#forms tbody').html(oilListMonth);
  145 + });
  146 + });
  147 + });
  148 +</script>
  149 +<script type="text/html" id="oilListMonth">
  150 + {{each list as obj i}}
  151 + {{if i%5 == 0}}
  152 + <tr>
  153 + {{/if}}
  154 + <td>{{i+1}}</td>
  155 + <td>{{obj.nbbm}}</td>
  156 + <td>{{obj.rq}}</td>
  157 + <td>{{obj.jzyl}}</td>
  158 + {{if (i+1)%5 == 0}}
  159 + </tr>
  160 + {{/if}}
  161 + {{/each}}
  162 + {{if list.length == 0}}
  163 + <tr>
  164 + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td>
  165 + </tr>
  166 + {{/if}}
  167 +</script>
0 168 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html
... ... @@ -138,4 +138,4 @@
138 138 }
139 139 })();
140 140 </script>
141 141 -</div>
  142 +</div>
142 143 \ No newline at end of file
... ...