Commit 435bbc7f7d8e6fdddab9b0712da1cfa43c312391
1 parent
60344d0f
update..
Showing
11 changed files
with
710 additions
and
3 deletions
src/main/java/com/bsth/controller/realcontrol/summary/TempSchSituationController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol.summary; | |
| 2 | + | |
| 3 | +import com.bsth.controller.BaseController; | |
| 4 | +import com.bsth.data.summary.entity.TempSchSituation; | |
| 5 | +import com.bsth.data.summary.service.TempSchSituationService; | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 8 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 9 | +import org.springframework.web.bind.annotation.RestController; | |
| 10 | + | |
| 11 | +import javax.servlet.http.HttpServletRequest; | |
| 12 | +import javax.servlet.http.HttpServletResponse; | |
| 13 | +import java.util.Map; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Created by panzhao on 2017/11/1. | |
| 17 | + */ | |
| 18 | +@RestController | |
| 19 | +@RequestMapping("/summary/temp_sch") | |
| 20 | +public class TempSchSituationController extends BaseController<TempSchSituation, Long> { | |
| 21 | + | |
| 22 | + @Autowired | |
| 23 | + TempSchSituationService tempSchSituationService; | |
| 24 | + | |
| 25 | + @RequestMapping("excel") | |
| 26 | + public void excel(@RequestParam Map<String, Object> map, HttpServletRequest request, HttpServletResponse response) { | |
| 27 | + tempSchSituationService.excel(map, request, response); | |
| 28 | + } | |
| 29 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata_v2/cache/GeoCacheData.java
| ... | ... | @@ -139,7 +139,7 @@ public class GeoCacheData { |
| 139 | 139 | |
| 140 | 140 | private void loadTccMapData(){ |
| 141 | 141 | //加载停车场数据 |
| 142 | - String sql = "select PARK_CODE, ST_AsText(G_PARK_POINT) as G_PARK_POINT from bsth_c_car_park where park_code is not null and b_park_point is not null"; | |
| 142 | + String sql = "select PARK_CODE, ST_AsText(G_PARK_POINT) as G_PARK_POINT from bsth_c_car_park where park_code is not null and b_park_point is not null and destroy=0"; | |
| 143 | 143 | List<Map<String, Object>> tccList = jdbcTemplate.queryForList(sql); |
| 144 | 144 | Map<String, Polygon> tccTempMap = new HashMap<>(); |
| 145 | 145 | ... | ... |
src/main/java/com/bsth/data/summary/entity/TempSchSituation.java
0 → 100644
| 1 | +package com.bsth.data.summary.entity; | |
| 2 | + | |
| 3 | +import javax.persistence.Entity; | |
| 4 | +import javax.persistence.Id; | |
| 5 | +import javax.persistence.Table; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 临加情况 | |
| 9 | + * Created by panzhao on 2017/10/31. | |
| 10 | + */ | |
| 11 | +@Entity | |
| 12 | +@Table(name = "z_calc_temp_detail") | |
| 13 | +public class TempSchSituation { | |
| 14 | + | |
| 15 | + @Id | |
| 16 | + private Long id; | |
| 17 | + | |
| 18 | + private String rq; | |
| 19 | + | |
| 20 | + private String gsBm; | |
| 21 | + | |
| 22 | + private String fgsBm; | |
| 23 | + | |
| 24 | + private String lineCode; | |
| 25 | + | |
| 26 | + private String lineName; | |
| 27 | + | |
| 28 | + private String nbbm; | |
| 29 | + | |
| 30 | + private String jGh; | |
| 31 | + | |
| 32 | + private String sGh; | |
| 33 | + | |
| 34 | + private String reason; | |
| 35 | + | |
| 36 | + private int size; | |
| 37 | + | |
| 38 | + private Double mileage; | |
| 39 | + | |
| 40 | + private Long t; | |
| 41 | + | |
| 42 | + private String remark; | |
| 43 | + | |
| 44 | + private String idsStr; | |
| 45 | + | |
| 46 | + public Long getId() { | |
| 47 | + return id; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setId(Long id) { | |
| 51 | + this.id = id; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public String getRq() { | |
| 55 | + return rq; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public void setRq(String rq) { | |
| 59 | + this.rq = rq; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public String getLineCode() { | |
| 63 | + return lineCode; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public void setLineCode(String lineCode) { | |
| 67 | + this.lineCode = lineCode; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public String getLineName() { | |
| 71 | + return lineName; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setLineName(String lineName) { | |
| 75 | + this.lineName = lineName; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public String getNbbm() { | |
| 79 | + return nbbm; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public void setNbbm(String nbbm) { | |
| 83 | + this.nbbm = nbbm; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public String getjGh() { | |
| 87 | + return jGh; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public void setjGh(String jGh) { | |
| 91 | + this.jGh = jGh; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public String getsGh() { | |
| 95 | + return sGh; | |
| 96 | + } | |
| 97 | + | |
| 98 | + public void setsGh(String sGh) { | |
| 99 | + this.sGh = sGh; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public String getReason() { | |
| 103 | + return reason; | |
| 104 | + } | |
| 105 | + | |
| 106 | + public void setReason(String reason) { | |
| 107 | + this.reason = reason; | |
| 108 | + } | |
| 109 | + | |
| 110 | + public int getSize() { | |
| 111 | + return size; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void setSize(int size) { | |
| 115 | + this.size = size; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public Double getMileage() { | |
| 119 | + return mileage; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public void setMileage(Double mileage) { | |
| 123 | + this.mileage = mileage; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public Long getT() { | |
| 127 | + return t; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public void setT(Long t) { | |
| 131 | + this.t = t; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public String getRemark() { | |
| 135 | + return remark; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public void setRemark(String remark) { | |
| 139 | + this.remark = remark; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public String getIdsStr() { | |
| 143 | + return idsStr; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public void setIdsStr(String idsStr) { | |
| 147 | + this.idsStr = idsStr; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public String getGsBm() { | |
| 151 | + return gsBm; | |
| 152 | + } | |
| 153 | + | |
| 154 | + public void setGsBm(String gsBm) { | |
| 155 | + this.gsBm = gsBm; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public String getFgsBm() { | |
| 159 | + return fgsBm; | |
| 160 | + } | |
| 161 | + | |
| 162 | + public void setFgsBm(String fgsBm) { | |
| 163 | + this.fgsBm = fgsBm; | |
| 164 | + } | |
| 165 | +} | ... | ... |
src/main/java/com/bsth/data/summary/repository/TempSchSituationRepository.java
0 → 100644
| 1 | +package com.bsth.data.summary.repository; | |
| 2 | + | |
| 3 | +import com.bsth.data.summary.entity.TempSchSituation; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | +import org.springframework.stereotype.Repository; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by panzhao on 2017/11/1. | |
| 9 | + */ | |
| 10 | +@Repository | |
| 11 | +public interface TempSchSituationRepository extends BaseRepository<TempSchSituation, Long> { | |
| 12 | +} | ... | ... |
src/main/java/com/bsth/data/summary/service/TempSchSituationService.java
0 → 100644
| 1 | +package com.bsth.data.summary.service; | |
| 2 | + | |
| 3 | +import com.bsth.data.summary.entity.TempSchSituation; | |
| 4 | +import com.bsth.service.BaseService; | |
| 5 | + | |
| 6 | +import javax.servlet.http.HttpServletRequest; | |
| 7 | +import javax.servlet.http.HttpServletResponse; | |
| 8 | +import java.util.Map; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Created by panzhao on 2017/11/1. | |
| 12 | + */ | |
| 13 | +public interface TempSchSituationService extends BaseService<TempSchSituation, Long> { | |
| 14 | + void excel(Map<String, Object> map, HttpServletRequest request, HttpServletResponse response); | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/summary/service/impl/DestroySituationServiceImpl.java
| ... | ... | @@ -118,7 +118,7 @@ public class DestroySituationServiceImpl extends BaseServiceImpl<DestroySituatio |
| 118 | 118 | row.createCell(9).setCellValue(dys.getRemark()); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - String name = list.get(0).getLineName(); | |
| 121 | + String name = "";//list.get(0).getLineName(); | |
| 122 | 122 | wb.setSheetName(0, name + "烂班明细"); |
| 123 | 123 | //response 输出 |
| 124 | 124 | String filename = name + map.get("rq_ge") + "至" + map.get("rq_le") + "烂班明细情况.xls"; | ... | ... |
src/main/java/com/bsth/data/summary/service/impl/TempSchSituationServiceImpl.java
0 → 100644
| 1 | +package com.bsth.data.summary.service.impl; | |
| 2 | + | |
| 3 | +import com.bsth.data.summary.entity.TempSchSituation; | |
| 4 | +import com.bsth.data.summary.service.TempSchSituationService; | |
| 5 | +import com.bsth.data.utils.CustomStringUtils; | |
| 6 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 7 | +import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
| 8 | +import org.apache.poi.poifs.filesystem.POIFSFileSystem; | |
| 9 | +import org.apache.poi.ss.usermodel.Row; | |
| 10 | +import org.apache.poi.ss.usermodel.Sheet; | |
| 11 | +import org.slf4j.Logger; | |
| 12 | +import org.slf4j.LoggerFactory; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | + | |
| 15 | +import javax.servlet.http.HttpServletRequest; | |
| 16 | +import javax.servlet.http.HttpServletResponse; | |
| 17 | +import java.io.FileInputStream; | |
| 18 | +import java.io.OutputStream; | |
| 19 | +import java.net.URLEncoder; | |
| 20 | +import java.text.SimpleDateFormat; | |
| 21 | +import java.util.*; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * Created by panzhao on 2017/11/1. | |
| 25 | + */ | |
| 26 | +@Service | |
| 27 | +public class TempSchSituationServiceImpl extends BaseServiceImpl<TempSchSituation, Long> implements TempSchSituationService { | |
| 28 | + | |
| 29 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public Iterable<TempSchSituation> list(Map<String, Object> map) { | |
| 33 | + List<TempSchSituation> list = (List<TempSchSituation>) super.list(map); | |
| 34 | + | |
| 35 | + //排序 | |
| 36 | + Collections.sort(list, new Comparator<TempSchSituation>() { | |
| 37 | + @Override | |
| 38 | + public int compare(TempSchSituation o1, TempSchSituation o2) { | |
| 39 | + int i = o1.getRq().compareTo(o2.getRq()); | |
| 40 | + if(i != 0) | |
| 41 | + return i; | |
| 42 | + | |
| 43 | + i = o1.getLineName().compareTo(o2.getLineName()); | |
| 44 | + if(i != 0) | |
| 45 | + return i; | |
| 46 | + | |
| 47 | + i = (int) (o1.getT() - o2.getT()); | |
| 48 | + if(i != 0) | |
| 49 | + return i; | |
| 50 | + | |
| 51 | + i = o1.getReason().compareTo(o2.getReason()); | |
| 52 | + | |
| 53 | + return i; | |
| 54 | + } | |
| 55 | + }); | |
| 56 | + return list; | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Override | |
| 60 | + public void excel(Map<String, Object> map, HttpServletRequest request, HttpServletResponse response) { | |
| 61 | + try { | |
| 62 | + map.put("rq_le", CustomStringUtils.maxEndTime(map.get("rq_ge").toString() | |
| 63 | + , map.get("rq_le").toString(), 62)); | |
| 64 | + | |
| 65 | + List<TempSchSituation> list = (List<TempSchSituation>) super.list(map); | |
| 66 | + | |
| 67 | + if(list.size() == 0){ | |
| 68 | + response.setHeader("Content-type", "text/html;charset=UTF-8"); | |
| 69 | + response.getWriter().print("<span style='color:red;font-size:24px;'>根据查询条件没有搜索到数据,别导了!</span>"); | |
| 70 | + return ; | |
| 71 | + } | |
| 72 | + | |
| 73 | + //排序 | |
| 74 | + Collections.sort(list, new Comparator<TempSchSituation>() { | |
| 75 | + @Override | |
| 76 | + public int compare(TempSchSituation o1, TempSchSituation o2) { | |
| 77 | + int i = o1.getRq().compareTo(o2.getRq()); | |
| 78 | + if(i != 0) | |
| 79 | + return i; | |
| 80 | + | |
| 81 | + i = o1.getLineName().compareTo(o2.getLineName()); | |
| 82 | + if(i != 0) | |
| 83 | + return i; | |
| 84 | + | |
| 85 | + i = (int) (o1.getT() - o2.getT()); | |
| 86 | + if(i != 0) | |
| 87 | + return i; | |
| 88 | + | |
| 89 | + i = o1.getReason().compareTo(o2.getReason()); | |
| 90 | + | |
| 91 | + return i; | |
| 92 | + } | |
| 93 | + }); | |
| 94 | + | |
| 95 | + //输出excel | |
| 96 | + String basePath = Thread.currentThread().getContextClassLoader().getResource("").getPath(); | |
| 97 | + String filePath = basePath + "/static/pages/summary/excel/临加明细情况.xls"; | |
| 98 | + POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(filePath)); | |
| 99 | + HSSFWorkbook wb = new HSSFWorkbook(fs); | |
| 100 | + | |
| 101 | + //写入数据 | |
| 102 | + Sheet sheet = wb.getSheetAt(0); | |
| 103 | + Row row; | |
| 104 | + TempSchSituation tss; | |
| 105 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | |
| 106 | + for(int i = 0; i < list.size(); i++){ | |
| 107 | + tss = list.get(i); | |
| 108 | + row = sheet.createRow(i + 1); | |
| 109 | + row.createCell(0).setCellValue(tss.getRq()); | |
| 110 | + row.createCell(1).setCellValue(tss.getLineName()); | |
| 111 | + row.createCell(2).setCellValue(tss.getNbbm()); | |
| 112 | + row.createCell(3).setCellValue(tss.getjGh()); | |
| 113 | + row.createCell(4).setCellValue(tss.getsGh()); | |
| 114 | + row.createCell(5).setCellValue(tss.getSize()); | |
| 115 | + row.createCell(6).setCellValue(tss.getMileage()); | |
| 116 | + row.createCell(7).setCellValue(sdf.format(new Date(tss.getT()))); | |
| 117 | + row.createCell(8).setCellValue(tss.getRemark()); | |
| 118 | + } | |
| 119 | + | |
| 120 | + String name = "";//list.get(0).getLineName(); | |
| 121 | + wb.setSheetName(0, name + "临加明细"); | |
| 122 | + //response 输出 | |
| 123 | + String filename = name + map.get("rq_ge") + "至" + map.get("rq_le") + "临加明细情况.xls"; | |
| 124 | + response.setContentType("application/x-msdownload"); | |
| 125 | + response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8")); | |
| 126 | + | |
| 127 | + OutputStream os = response.getOutputStream(); | |
| 128 | + wb.write(os); | |
| 129 | + os.flush(); | |
| 130 | + os.close(); | |
| 131 | + } catch (Exception e) { | |
| 132 | + logger.error("", e); | |
| 133 | + } | |
| 134 | + } | |
| 135 | + | |
| 136 | +} | |
| 0 | 137 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/summary/destory_sch_detail/list.html
| ... | ... | @@ -127,7 +127,7 @@ |
| 127 | 127 | <div uk-spinner></div> |
| 128 | 128 | </div> |
| 129 | 129 | <div class="ct_page" style="display: none;"> |
| 130 | - <h3 class="uk-heading-line uk-heading-bullet"><span>烂班明细统计</span></h3> | |
| 130 | + <h3 class="uk-heading-line uk-heading-bullet"><span style="color: #ff5353;">烂班明细统计</span></h3> | |
| 131 | 131 | <div class="ct_cont" > |
| 132 | 132 | <div class="ct_search_form_wrap"> |
| 133 | 133 | <form> | ... | ... |
src/main/resources/static/pages/summary/excel/临加明细情况.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/summary/temp_sch_detail/d_s_d_wrap.html
0 → 100644
src/main/resources/static/pages/summary/temp_sch_detail/list.html
0 → 100644
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/> | |
| 7 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | |
| 8 | + <!-- flatpickr --> | |
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css"> | |
| 10 | + <style> | |
| 11 | + html,body{ | |
| 12 | + height: 100%; | |
| 13 | + } | |
| 14 | + .ct_page{ | |
| 15 | + padding: 25px 15px; | |
| 16 | + height: 100%; | |
| 17 | + height: calc(100% - 50px); | |
| 18 | + } | |
| 19 | + | |
| 20 | + .ct_cont{ | |
| 21 | + height: calc(100% - 35px); | |
| 22 | + } | |
| 23 | + | |
| 24 | + .ct_cont>div>div.uk-card{ | |
| 25 | + height: 99%; | |
| 26 | + } | |
| 27 | + | |
| 28 | + .loading{ | |
| 29 | + height: 100%; | |
| 30 | + text-align: center; | |
| 31 | + } | |
| 32 | + .loading .uk-spinner{ | |
| 33 | + margin-top: 200px; | |
| 34 | + } | |
| 35 | + .loading circle{ | |
| 36 | + stroke: red; | |
| 37 | + } | |
| 38 | + | |
| 39 | + .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{ | |
| 40 | + opacity: 0.6 !important; | |
| 41 | + padding: 0 !important; | |
| 42 | + } | |
| 43 | + | |
| 44 | + .ct_destroy_sch_table_width th:nth-of-type(1),.ct_destroy_sch_table_width td:nth-of-type(1){ | |
| 45 | + width: 9%; | |
| 46 | + } | |
| 47 | + .ct_destroy_sch_table_width th:nth-of-type(2),.ct_destroy_sch_table_width td:nth-of-type(2){ | |
| 48 | + width: 10%; | |
| 49 | + } | |
| 50 | + .ct_destroy_sch_table_width th:nth-of-type(3),.ct_destroy_sch_table_width td:nth-of-type(3){ | |
| 51 | + width: 9%; | |
| 52 | + } | |
| 53 | + .ct_destroy_sch_table_width th:nth-of-type(4),.ct_destroy_sch_table_width td:nth-of-type(4){ | |
| 54 | + width: 9%; | |
| 55 | + } | |
| 56 | + .ct_destroy_sch_table_width th:nth-of-type(5),.ct_destroy_sch_table_width td:nth-of-type(5){ | |
| 57 | + width: 9%; | |
| 58 | + } | |
| 59 | + .ct_destroy_sch_table_width th:nth-of-type(6),.ct_destroy_sch_table_width td:nth-of-type(6){ | |
| 60 | + width: 8%; | |
| 61 | + } | |
| 62 | + .ct_destroy_sch_table_width th:nth-of-type(7),.ct_destroy_sch_table_width td:nth-of-type(7){ | |
| 63 | + width: 8%; | |
| 64 | + } | |
| 65 | + .ct_destroy_sch_table_width th:nth-of-type(8),.ct_destroy_sch_table_width td:nth-of-type(8){ | |
| 66 | + width: 8%; | |
| 67 | + } | |
| 68 | + .ct_destroy_sch_table_width th:nth-of-type(9),.ct_destroy_sch_table_width td:nth-of-type(9){ | |
| 69 | + } | |
| 70 | + | |
| 71 | + .ct_search_form_wrap{ | |
| 72 | + border-bottom: 1px solid #e5e5e5; | |
| 73 | + padding: 10px 0 25px 10px; | |
| 74 | + } | |
| 75 | + .ct_search_form_wrap .ct_field{ | |
| 76 | + display: inline-block; | |
| 77 | + margin: 0 5px; | |
| 78 | + } | |
| 79 | + | |
| 80 | + .ct_search_form_wrap .ct_field label{ | |
| 81 | + font-size: 14px; | |
| 82 | + } | |
| 83 | + | |
| 84 | + .ct_search_form_wrap .ct_field input{ | |
| 85 | + width: 110px; | |
| 86 | + } | |
| 87 | + | |
| 88 | + .ct_search_form_wrap .ct_field select{ | |
| 89 | + width: auto; | |
| 90 | + min-width: 100px; | |
| 91 | + } | |
| 92 | + | |
| 93 | + .ct_search_form_wrap .uk-button{ | |
| 94 | + padding: 0 14px; | |
| 95 | + } | |
| 96 | + | |
| 97 | + .ct_search_form_wrap .uk-button i{ | |
| 98 | + vertical-align: middle; | |
| 99 | + margin-top: -2px; | |
| 100 | + margin-right: 7px; | |
| 101 | + } | |
| 102 | + | |
| 103 | + .ct_table_wrap{ | |
| 104 | + font-size: 14px; | |
| 105 | + height: calc(100% - 77px); | |
| 106 | + } | |
| 107 | + | |
| 108 | + .t_body_wrap{ | |
| 109 | + height: calc(100% - 41px); | |
| 110 | + overflow: auto; | |
| 111 | + position: relative; | |
| 112 | + } | |
| 113 | + | |
| 114 | + .ct_field.ct_field_bottom{ | |
| 115 | + vertical-align: bottom; | |
| 116 | + font-size: 12px; | |
| 117 | + margin-left: 0; | |
| 118 | + } | |
| 119 | + </style> | |
| 120 | +</head> | |
| 121 | + | |
| 122 | +<body> | |
| 123 | +<div class="loading"> | |
| 124 | + <div uk-spinner></div> | |
| 125 | +</div> | |
| 126 | +<div class="ct_page" style="display: none;"> | |
| 127 | + <h3 class="uk-heading-line uk-heading-bullet"><span>临加明细统计</span></h3> | |
| 128 | + <div class="ct_cont" > | |
| 129 | + <div class="ct_search_form_wrap"> | |
| 130 | + <form> | |
| 131 | + <div class="ct_field"> | |
| 132 | + <label>公司: | |
| 133 | + <select class="uk-select" name="gsBm_eq"> | |
| 134 | + </select> | |
| 135 | + </label> | |
| 136 | + </div> | |
| 137 | + <div class="ct_field"> | |
| 138 | + <label>分公司: | |
| 139 | + <select class="uk-select" name="fgsBm_eq"> | |
| 140 | + </select> | |
| 141 | + </label> | |
| 142 | + </div> | |
| 143 | + <div class="ct_field"> | |
| 144 | + <label>线路: | |
| 145 | + <select class="uk-select" name="lineCode_eq"> | |
| 146 | + </select> | |
| 147 | + </label> | |
| 148 | + </div> | |
| 149 | + <div class="ct_field"> | |
| 150 | + <label>日期: | |
| 151 | + <input class="uk-input" name="rq" style="width: 220px;"> | |
| 152 | + </label> | |
| 153 | + </div> | |
| 154 | + <div class="ct_field"> | |
| 155 | + <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> | |
| 156 | + </div> | |
| 157 | + <div class="ct_field ct_field_bottom"> | |
| 158 | + <button class="uk-button uk-button-text export_excel" style="padding: 0 5px;">导出数据</button> | |
| 159 | + </div> | |
| 160 | + <div class="ct_field ct_field_bottom"> | |
| 161 | + <span uk-icon="icon: question" title="不统计进出场和2点间空驶" uk-tooltip="pos: bottom"></span> | |
| 162 | + </div> | |
| 163 | + </form> | |
| 164 | + </div> | |
| 165 | + <div class="ct_table_wrap day"> | |
| 166 | + <table class="uk-table uk-table-small ct_destroy_sch_table_width" style="margin-bottom: 0;"> | |
| 167 | + <thead> | |
| 168 | + <tr> | |
| 169 | + <th>日期</th> | |
| 170 | + <th>线路</th> | |
| 171 | + <th>车号</th> | |
| 172 | + <th>司机</th> | |
| 173 | + <th>售票员</th> | |
| 174 | + <th>班次</th> | |
| 175 | + <th>烂班公里</th> | |
| 176 | + <th>烂班时间</th> | |
| 177 | + <th>备注</th> | |
| 178 | + </tr> | |
| 179 | + </thead> | |
| 180 | + </table> | |
| 181 | + <div class="t_body_wrap"> | |
| 182 | + <table class="uk-table uk-table-divider uk-table-hover uk-table-small ct_destroy_sch_table ct_destroy_sch_table_width"> | |
| 183 | + <tbody> | |
| 184 | + </tbody> | |
| 185 | + </table> | |
| 186 | + </div> | |
| 187 | + </div> | |
| 188 | + </div> | |
| 189 | +</div> | |
| 190 | + | |
| 191 | +<script id="destroy_sch_list_temp" type="text/html"> | |
| 192 | + {{each list as obj i}} | |
| 193 | + <tr> | |
| 194 | + <td>{{obj.rq}}</td> | |
| 195 | + <td>{{obj.lineName}}</td> | |
| 196 | + <td>{{obj.nbbm}}</td> | |
| 197 | + <td>{{obj.jGh}}</td> | |
| 198 | + <td>{{obj.sGh}}</td> | |
| 199 | + <td><a style="text-decoration: underline;">{{obj.size}}</a></td> | |
| 200 | + <td>{{obj.mileage}}</td> | |
| 201 | + <td>{{obj.timeStr}}</td> | |
| 202 | + <td>{{obj.remark}}</td> | |
| 203 | + </tr> | |
| 204 | + {{/each}} | |
| 205 | +</script> | |
| 206 | + | |
| 207 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | |
| 208 | +<script src="/assets/plugins/uk3.0/uikit.min.js"></script> | |
| 209 | +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script> | |
| 210 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | |
| 211 | +<!-- EventProxy --> | |
| 212 | +<script src="/assets/js/eventproxy.js"></script> | |
| 213 | +<!-- art-template 模版引擎 --> | |
| 214 | +<script src="/assets/plugins/template.js"></script> | |
| 215 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 216 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 217 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | |
| 218 | +<!-- flatpickr --> | |
| 219 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" ></script> | |
| 220 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" ></script> | |
| 221 | +<script> | |
| 222 | + | |
| 223 | + var f = $('form', ''); | |
| 224 | + //var page=0, pageSize=120; | |
| 225 | + | |
| 226 | + var ep = EventProxy.create('query_comps', 'query_lines', function () { | |
| 227 | + $('[name=gsBm_eq]', f).trigger('change');//公司change | |
| 228 | + query(); | |
| 229 | + | |
| 230 | + $('.loading').remove(); | |
| 231 | + $('.ct_page').show(); | |
| 232 | + }); | |
| 233 | + | |
| 234 | + //点击搜索 | |
| 235 | + $('button.search', f).on('click', query); | |
| 236 | + | |
| 237 | + function query() { | |
| 238 | + $('button.search', f).attr('disabled', 'disabled'); | |
| 239 | + var data = f.serializeJSON(); | |
| 240 | + $('.ct_destroy_sch_table tbody').html(''); | |
| 241 | + //开始结束时间 | |
| 242 | + data.rq_ge = data.rq.substr(0, 10); | |
| 243 | + data.rq_le = data.rq.substr(13); | |
| 244 | + //data.order='t'; | |
| 245 | + delete data.rq; | |
| 246 | + | |
| 247 | + $.get('/summary/temp_sch/all', data, function (rs) { | |
| 248 | + $('button.search', f).removeAttr('disabled'); | |
| 249 | + if(!rs || rs.length==0) | |
| 250 | + return UIkit.notification('没有搜索到相关数据!!', 'danger'); | |
| 251 | + $.each(rs, function () { | |
| 252 | + this.timeStr=moment(this.t).format('HH:mm') | |
| 253 | + }); | |
| 254 | + | |
| 255 | + var htmlStr = template('destroy_sch_list_temp', {list: rs}); | |
| 256 | + $('.ct_destroy_sch_table tbody').html(htmlStr); | |
| 257 | + $('.t_body_wrap').perfectScrollbar('update'); | |
| 258 | + }); | |
| 259 | + } | |
| 260 | + | |
| 261 | + | |
| 262 | + //日期选择框 | |
| 263 | + var fs='YYYY-MM-DD' | |
| 264 | + , ets=moment().subtract(1, 'days').format(fs) | |
| 265 | + , sts=moment().subtract(3, 'days').format(fs); | |
| 266 | + flatpickr('.ct_search_form_wrap [name=rq]', { | |
| 267 | + mode: "range", dateFormat: "Y-m-d","locale": "zh", defaultDate: [sts, ets] | |
| 268 | + }); | |
| 269 | + var comps; | |
| 270 | + //构建公司级联下拉框 | |
| 271 | + $.get('/user/companyData', function (rs) { | |
| 272 | + comps = rs; | |
| 273 | + var opts = ''; | |
| 274 | + for(var i=0,obj;obj=comps[i++];){ | |
| 275 | + opts += '<option value="'+obj.companyCode+'">'+obj.companyName+'</option>'; | |
| 276 | + } | |
| 277 | + $('[name=gsBm_eq]', f).html(opts); | |
| 278 | + ep.emit('query_comps'); | |
| 279 | + }); | |
| 280 | + | |
| 281 | + var lineMapps; | |
| 282 | + //加载线路信息 | |
| 283 | + $.get('/line/all', {'destroy_eq': 0}, function (rs) { | |
| 284 | + rs.sort(function (a, b) { | |
| 285 | + return a.name.localeCompare(b.name); | |
| 286 | + }); | |
| 287 | + lineMapps={}; | |
| 288 | + var k; | |
| 289 | + $.each(rs, function () { | |
| 290 | + k = this.company+'_'+this.brancheCompany; | |
| 291 | + if(!lineMapps[k]) | |
| 292 | + lineMapps[k]=[]; | |
| 293 | + lineMapps[k].push(this); | |
| 294 | + }); | |
| 295 | + | |
| 296 | + ep.emit('query_lines'); | |
| 297 | + }); | |
| 298 | + | |
| 299 | + $('[name=gsBm_eq]', f).on('change', function () { | |
| 300 | + var code = $(this).val(), subs=[]; | |
| 301 | + $.each(comps, function () { | |
| 302 | + if(this.companyCode==code) | |
| 303 | + subs=this.children; | |
| 304 | + }); | |
| 305 | + | |
| 306 | + var opts=''; | |
| 307 | + $.each(subs, function () { | |
| 308 | + opts += '<option value="'+this.code+'">'+this.name+'</option>'; | |
| 309 | + }); | |
| 310 | + $('[name=fgsBm_eq]', f).html(opts).trigger('change'); | |
| 311 | + }); | |
| 312 | + | |
| 313 | + $('[name=fgsBm_eq]', f).on('change', function () { | |
| 314 | + var k = $('[name=gsBm_eq]', f).val() + '_' + $(this).val(); | |
| 315 | + var array = lineMapps[k]; | |
| 316 | + var opts = '<option value="">全部</option>'; | |
| 317 | + if(array){ | |
| 318 | + $.each(array, function () { | |
| 319 | + opts += '<option value="'+this.lineCode+'">'+this.name+'</option>'; | |
| 320 | + }); | |
| 321 | + } | |
| 322 | + $('[name=lineCode_eq]', f).html(opts); | |
| 323 | + }); | |
| 324 | + | |
| 325 | + // | |
| 326 | + //滚动条 | |
| 327 | + $('.t_body_wrap').perfectScrollbar({suppressScrollX: true}); | |
| 328 | + | |
| 329 | + $(document).on('submit', 'form', function () { | |
| 330 | + return false; | |
| 331 | + }); | |
| 332 | + | |
| 333 | + /** | |
| 334 | + * 导出 | |
| 335 | + */ | |
| 336 | + $('.export_excel').on('click', function () { | |
| 337 | + var data = f.serializeJSON(); | |
| 338 | + data.rq_ge = data.rq.substr(0, 10); | |
| 339 | + data.rq_le = data.rq.substr(13); | |
| 340 | + data.order='t'; | |
| 341 | + delete data.rq; | |
| 342 | + | |
| 343 | + window.open('/summary/temp_sch/excel?' + $.param(data)); | |
| 344 | + }); | |
| 345 | + | |
| 346 | +</script> | |
| 347 | +</body> | |
| 348 | +</html> | |
| 0 | 349 | \ No newline at end of file | ... | ... |