Commit a575cb1b3abfb47ddffab66e6555488d9e54493f
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control
into pudong
Showing
26 changed files
with
2794 additions
and
691 deletions
Too many changes to show.
To preserve performance only 26 of 35 files are displayed.
src/main/java/com/bsth/controller/calc/CalcExportController.java
| @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 16 | import com.bsth.common.ResponseCode; | 16 | import com.bsth.common.ResponseCode; |
| 17 | import com.bsth.entity.calc.CalcWaybill; | 17 | import com.bsth.entity.calc.CalcWaybill; |
| 18 | import com.bsth.entity.mcy_forms.Waybillday; | 18 | import com.bsth.entity.mcy_forms.Waybillday; |
| 19 | +import com.bsth.service.calc.CalcLbStatuAnalyService; | ||
| 19 | import com.bsth.service.calc.CalcMixService; | 20 | import com.bsth.service.calc.CalcMixService; |
| 20 | import com.bsth.service.calc.CalcWaybillService; | 21 | import com.bsth.service.calc.CalcWaybillService; |
| 21 | import com.bsth.util.ReportUtils; | 22 | import com.bsth.util.ReportUtils; |
| @@ -26,6 +27,9 @@ public class CalcExportController { | @@ -26,6 +27,9 @@ public class CalcExportController { | ||
| 26 | 27 | ||
| 27 | @Autowired | 28 | @Autowired |
| 28 | CalcWaybillService service; | 29 | CalcWaybillService service; |
| 30 | + | ||
| 31 | + @Autowired | ||
| 32 | + CalcLbStatuAnalyService lbService; | ||
| 29 | 33 | ||
| 30 | @Autowired | 34 | @Autowired |
| 31 | CalcMixService clacMixService; | 35 | CalcMixService clacMixService; |
| @@ -204,5 +208,84 @@ public class CalcExportController { | @@ -204,5 +208,84 @@ public class CalcExportController { | ||
| 204 | } | 208 | } |
| 205 | return resMap; | 209 | return resMap; |
| 206 | } | 210 | } |
| 211 | + | ||
| 212 | + @RequestMapping(value = "/lbStatuAnalyExport", method = RequestMethod.GET) | ||
| 213 | + public Map<String, Object> lbStatuAnalyExport(@RequestParam Map<String, Object> map) { | ||
| 214 | + | ||
| 215 | + String gsdm=""; | ||
| 216 | + if(map.get("company")!=null){ | ||
| 217 | + gsdm=map.get("company").toString().trim(); | ||
| 218 | + } | ||
| 219 | + String fgsdm=""; | ||
| 220 | + if(map.get("subCompany")!=null){ | ||
| 221 | + fgsdm=map.get("subCompany").toString().trim(); | ||
| 222 | + } | ||
| 223 | + String line=""; | ||
| 224 | + if(map.get("line")!=null){ | ||
| 225 | + line=map.get("line").toString().trim(); | ||
| 226 | + } | ||
| 227 | + String lineName=""; | ||
| 228 | + if(map.get("lineName")!=null){ | ||
| 229 | + lineName=map.get("lineName").toString().trim(); | ||
| 230 | + } | ||
| 231 | + String date=""; | ||
| 232 | + if(map.get("startDate")!=null){ | ||
| 233 | + date=map.get("startDate").toString().trim(); | ||
| 234 | + } | ||
| 235 | + String date2=""; | ||
| 236 | + if(map.get("endDate")!=null){ | ||
| 237 | + date2=map.get("endDate").toString().trim(); | ||
| 238 | + } | ||
| 239 | + String sfyy=""; | ||
| 240 | + if(map.get("sfyy")!=null){ | ||
| 241 | + sfyy=map.get("sfyy").toString().trim(); | ||
| 242 | + } | ||
| 243 | + String type=""; | ||
| 244 | + if(map.get("type")!=null){ | ||
| 245 | + type=map.get("type").toString().trim(); | ||
| 246 | + } | ||
| 247 | + | ||
| 248 | + Map<String, Object> resMap = new HashMap<String, Object>(); | ||
| 249 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 250 | + List<Map<String, Object>> list = lbService.lbStatuAnaly(gsdm, fgsdm, line, date, date2, sfyy, type); | ||
| 251 | + | ||
| 252 | + for(int i = 0; i < list.size(); i++){ | ||
| 253 | + Map<String, Object> temp = list.get(i); | ||
| 254 | + temp.put("i", i+1); | ||
| 255 | + if(!temp.containsKey("date") || temp.get("date") == null){ | ||
| 256 | + temp.put("date", ""); | ||
| 257 | + } | ||
| 258 | + if(!temp.containsKey("company") || temp.get("company") == null){ | ||
| 259 | + temp.put("company", ""); | ||
| 260 | + } | ||
| 261 | + if(!temp.containsKey("subCompany") || temp.get("subCompany") == null){ | ||
| 262 | + temp.put("subCompany", ""); | ||
| 263 | + } | ||
| 264 | + resList.add(temp); | ||
| 265 | + } | ||
| 266 | + | ||
| 267 | + String Data = date.replaceAll("-", ""); | ||
| 268 | + if(!date.equals(date2)){ | ||
| 269 | + Data = date.replaceAll("-", "") + "-" + date2.replaceAll("-", ""); | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 273 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 274 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 275 | + Map<String,Object> mm = new HashMap<String, Object>(); | ||
| 276 | + ReportUtils ee = new ReportUtils(); | ||
| 277 | + | ||
| 278 | + try { | ||
| 279 | + listI.add(resList.iterator()); | ||
| 280 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 281 | + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcLbStatuAnaly.xls", | ||
| 282 | + path+"export/"+Data+"-"+lineName+"-烂班情况分析表(统计).xls"); | ||
| 283 | + resMap.put("status", ResponseCode.SUCCESS); | ||
| 284 | + } catch (Exception e) { | ||
| 285 | + e.printStackTrace(); | ||
| 286 | + resMap.put("status", ResponseCode.ERROR); | ||
| 287 | + } | ||
| 288 | + return resMap; | ||
| 289 | + } | ||
| 207 | 290 | ||
| 208 | } | 291 | } |
src/main/java/com/bsth/controller/calc/CalcLbStatuAnalyController.java
0 → 100644
| 1 | +package com.bsth.controller.calc; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import com.bsth.controller.BaseController; | ||
| 7 | +import com.bsth.entity.calc.CalcLbStatuAnaly; | ||
| 8 | +import com.bsth.service.calc.CalcLbStatuAnalyService; | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 12 | +import org.springframework.web.bind.annotation.RestController; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * Created by 19/03/18. | ||
| 16 | + */ | ||
| 17 | +@RestController | ||
| 18 | +@RequestMapping("calcLbStatuAnaly") | ||
| 19 | +public class CalcLbStatuAnalyController extends BaseController<CalcLbStatuAnaly, Integer> { | ||
| 20 | + | ||
| 21 | + @Autowired | ||
| 22 | + private CalcLbStatuAnalyService service; | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + @RequestMapping(value="/lbStatuAnaly") | ||
| 26 | + public List<Map<String,Object>> lbStatuAnaly(@RequestParam Map<String, Object> map){ | ||
| 27 | + String gsdm=""; | ||
| 28 | + if(map.get("company")!=null){ | ||
| 29 | + gsdm=map.get("company").toString().trim(); | ||
| 30 | + } | ||
| 31 | + String fgsdm=""; | ||
| 32 | + if(map.get("subCompany")!=null){ | ||
| 33 | + fgsdm=map.get("subCompany").toString().trim(); | ||
| 34 | + } | ||
| 35 | + String line=""; | ||
| 36 | + if(map.get("line")!=null){ | ||
| 37 | + line=map.get("line").toString().trim(); | ||
| 38 | + } | ||
| 39 | + String date=""; | ||
| 40 | + if(map.get("startDate")!=null){ | ||
| 41 | + date=map.get("startDate").toString().trim(); | ||
| 42 | + } | ||
| 43 | + String date2=""; | ||
| 44 | + if(map.get("endDate")!=null){ | ||
| 45 | + date2=map.get("endDate").toString().trim(); | ||
| 46 | + } | ||
| 47 | + String sfyy=""; | ||
| 48 | + if(map.get("sfyy")!=null){ | ||
| 49 | + sfyy=map.get("sfyy").toString().trim(); | ||
| 50 | + } | ||
| 51 | + String type=""; | ||
| 52 | + if(map.get("type")!=null){ | ||
| 53 | + type=map.get("type").toString().trim(); | ||
| 54 | + } | ||
| 55 | + return service.lbStatuAnaly(gsdm,fgsdm,line,date,date2,sfyy,type); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | +} |
src/main/java/com/bsth/entity/calc/CalcLbStatuAnaly.java
0 → 100644
| 1 | +package com.bsth.entity.calc; | ||
| 2 | + | ||
| 3 | +import java.util.Date; | ||
| 4 | + | ||
| 5 | +import javax.persistence.Entity; | ||
| 6 | +import javax.persistence.GeneratedValue; | ||
| 7 | +import javax.persistence.Id; | ||
| 8 | +import javax.persistence.Table; | ||
| 9 | + | ||
| 10 | +@Entity | ||
| 11 | +@Table(name = "calc_lb_statu_analy") | ||
| 12 | +public class CalcLbStatuAnaly { | ||
| 13 | + /* 主键*/ | ||
| 14 | + @Id | ||
| 15 | + @GeneratedValue | ||
| 16 | + private Long id; | ||
| 17 | + /* 公司代码*/ | ||
| 18 | + private String gsdm; | ||
| 19 | + /* 公司名称*/ | ||
| 20 | + private String gsname; | ||
| 21 | + /* 分公司代码*/ | ||
| 22 | + private String fgsdm; | ||
| 23 | + /* 分公司名称*/ | ||
| 24 | + private String fgsname; | ||
| 25 | + /* 日期*/ | ||
| 26 | + private Date rq; | ||
| 27 | + /* 日期字符串*/ | ||
| 28 | + private String rqStr; | ||
| 29 | + /* 线路编码*/ | ||
| 30 | + private String xl; | ||
| 31 | + /* 线路名称*/ | ||
| 32 | + private String xlName; | ||
| 33 | + /* 计划班次*/ | ||
| 34 | + private int jhbc; | ||
| 35 | + /* 实际班次*/ | ||
| 36 | + private int sjbc; | ||
| 37 | + /* 计划里程*/ | ||
| 38 | + private Double jhlc; | ||
| 39 | + /* 实际公里*/ | ||
| 40 | + private Double sjlc; | ||
| 41 | + /* 路阻(烂班班次)*/ | ||
| 42 | + private int lzbc; | ||
| 43 | + /* 路阻(烂班里程)*/ | ||
| 44 | + private Double lzlc; | ||
| 45 | + /* 吊慢(烂班班次)*/ | ||
| 46 | + private int dmbc; | ||
| 47 | + /* 吊慢(烂班里程)*/ | ||
| 48 | + private Double dmlc; | ||
| 49 | + /* 故障(烂班班次)*/ | ||
| 50 | + private int gzbc; | ||
| 51 | + /* 故障(烂班里程)*/ | ||
| 52 | + private Double gzlc; | ||
| 53 | + /* 纠纷(烂班班次)*/ | ||
| 54 | + private int jfbc; | ||
| 55 | + /* 纠纷(烂班里程)*/ | ||
| 56 | + private Double jflc; | ||
| 57 | + /* 肇事(烂班班次)*/ | ||
| 58 | + private int zsbc; | ||
| 59 | + /* 肇事(烂班里程)*/ | ||
| 60 | + private Double zslc; | ||
| 61 | + /* 缺人(烂班班次)*/ | ||
| 62 | + private int qrbc; | ||
| 63 | + /* 缺人(烂班里程)*/ | ||
| 64 | + private Double qrlc; | ||
| 65 | + /* 缺车(烂班班次)*/ | ||
| 66 | + private int qcbc; | ||
| 67 | + /* 缺车(烂班里程)*/ | ||
| 68 | + private Double qclc; | ||
| 69 | + /* 客稀(烂班班次)*/ | ||
| 70 | + private int kxbc; | ||
| 71 | + /* 客稀(烂班里程)*/ | ||
| 72 | + private Double kxlc; | ||
| 73 | + /* 气候(烂班班次)*/ | ||
| 74 | + private int qhbc; | ||
| 75 | + /* 气候(烂班里程)*/ | ||
| 76 | + private Double qhlc; | ||
| 77 | + /* 援外(烂班班次)*/ | ||
| 78 | + private int ywbc; | ||
| 79 | + /* 援外(烂班里程)*/ | ||
| 80 | + private Double ywlc; | ||
| 81 | + /* 其他(烂班班次)*/ | ||
| 82 | + private int qtbc; | ||
| 83 | + /* 其他(烂班里程)*/ | ||
| 84 | + private Double qtlc; | ||
| 85 | + /* 备注*/ | ||
| 86 | + private String remark; | ||
| 87 | + | ||
| 88 | + | ||
| 89 | + public Long getId() { | ||
| 90 | + return id; | ||
| 91 | + } | ||
| 92 | + public void setId(Long id) { | ||
| 93 | + this.id = id; | ||
| 94 | + } | ||
| 95 | + public String getGsdm() { | ||
| 96 | + return gsdm; | ||
| 97 | + } | ||
| 98 | + public void setGsdm(String gsdm) { | ||
| 99 | + this.gsdm = gsdm; | ||
| 100 | + } | ||
| 101 | + public String getGsname() { | ||
| 102 | + return gsname; | ||
| 103 | + } | ||
| 104 | + public void setGsname(String gsname) { | ||
| 105 | + this.gsname = gsname; | ||
| 106 | + } | ||
| 107 | + public String getFgsdm() { | ||
| 108 | + return fgsdm; | ||
| 109 | + } | ||
| 110 | + public void setFgsdm(String fgsdm) { | ||
| 111 | + this.fgsdm = fgsdm; | ||
| 112 | + } | ||
| 113 | + public String getFgsname() { | ||
| 114 | + return fgsname; | ||
| 115 | + } | ||
| 116 | + public void setFgsname(String fgsname) { | ||
| 117 | + this.fgsname = fgsname; | ||
| 118 | + } | ||
| 119 | + public Date getRq() { | ||
| 120 | + return rq; | ||
| 121 | + } | ||
| 122 | + public void setRq(Date rq) { | ||
| 123 | + this.rq = rq; | ||
| 124 | + } | ||
| 125 | + public String getRqStr() { | ||
| 126 | + return rqStr; | ||
| 127 | + } | ||
| 128 | + public void setRqStr(String rqStr) { | ||
| 129 | + this.rqStr = rqStr; | ||
| 130 | + } | ||
| 131 | + public String getXl() { | ||
| 132 | + return xl; | ||
| 133 | + } | ||
| 134 | + public void setXl(String xl) { | ||
| 135 | + this.xl = xl; | ||
| 136 | + } | ||
| 137 | + public String getXlName() { | ||
| 138 | + return xlName; | ||
| 139 | + } | ||
| 140 | + public void setXlName(String xlName) { | ||
| 141 | + this.xlName = xlName; | ||
| 142 | + } | ||
| 143 | + public int getJhbc() { | ||
| 144 | + return jhbc; | ||
| 145 | + } | ||
| 146 | + public void setJhbc(int jhbc) { | ||
| 147 | + this.jhbc = jhbc; | ||
| 148 | + } | ||
| 149 | + public int getSjbc() { | ||
| 150 | + return sjbc; | ||
| 151 | + } | ||
| 152 | + public void setSjbc(int sjbc) { | ||
| 153 | + this.sjbc = sjbc; | ||
| 154 | + } | ||
| 155 | + public Double getJhlc() { | ||
| 156 | + return jhlc; | ||
| 157 | + } | ||
| 158 | + public void setJhlc(Double jhlc) { | ||
| 159 | + this.jhlc = jhlc; | ||
| 160 | + } | ||
| 161 | + public Double getSjlc() { | ||
| 162 | + return sjlc; | ||
| 163 | + } | ||
| 164 | + public void setSjlc(Double sjlc) { | ||
| 165 | + this.sjlc = sjlc; | ||
| 166 | + } | ||
| 167 | + public int getLzbc() { | ||
| 168 | + return lzbc; | ||
| 169 | + } | ||
| 170 | + public void setLzbc(int lzbc) { | ||
| 171 | + this.lzbc = lzbc; | ||
| 172 | + } | ||
| 173 | + public Double getLzlc() { | ||
| 174 | + return lzlc; | ||
| 175 | + } | ||
| 176 | + public void setLzlc(Double lzlc) { | ||
| 177 | + this.lzlc = lzlc; | ||
| 178 | + } | ||
| 179 | + public int getDmbc() { | ||
| 180 | + return dmbc; | ||
| 181 | + } | ||
| 182 | + public void setDmbc(int dmbc) { | ||
| 183 | + this.dmbc = dmbc; | ||
| 184 | + } | ||
| 185 | + public Double getDmlc() { | ||
| 186 | + return dmlc; | ||
| 187 | + } | ||
| 188 | + public void setDmlc(Double dmlc) { | ||
| 189 | + this.dmlc = dmlc; | ||
| 190 | + } | ||
| 191 | + public int getGzbc() { | ||
| 192 | + return gzbc; | ||
| 193 | + } | ||
| 194 | + public void setGzbc(int gzbc) { | ||
| 195 | + this.gzbc = gzbc; | ||
| 196 | + } | ||
| 197 | + public Double getGzlc() { | ||
| 198 | + return gzlc; | ||
| 199 | + } | ||
| 200 | + public void setGzlc(Double gzlc) { | ||
| 201 | + this.gzlc = gzlc; | ||
| 202 | + } | ||
| 203 | + public int getJfbc() { | ||
| 204 | + return jfbc; | ||
| 205 | + } | ||
| 206 | + public void setJfbc(int jfbc) { | ||
| 207 | + this.jfbc = jfbc; | ||
| 208 | + } | ||
| 209 | + public Double getJflc() { | ||
| 210 | + return jflc; | ||
| 211 | + } | ||
| 212 | + public void setJflc(Double jflc) { | ||
| 213 | + this.jflc = jflc; | ||
| 214 | + } | ||
| 215 | + public int getZsbc() { | ||
| 216 | + return zsbc; | ||
| 217 | + } | ||
| 218 | + public void setZsbc(int zsbc) { | ||
| 219 | + this.zsbc = zsbc; | ||
| 220 | + } | ||
| 221 | + public Double getZslc() { | ||
| 222 | + return zslc; | ||
| 223 | + } | ||
| 224 | + public void setZslc(Double zslc) { | ||
| 225 | + this.zslc = zslc; | ||
| 226 | + } | ||
| 227 | + public int getQrbc() { | ||
| 228 | + return qrbc; | ||
| 229 | + } | ||
| 230 | + public void setQrbc(int qrbc) { | ||
| 231 | + this.qrbc = qrbc; | ||
| 232 | + } | ||
| 233 | + public Double getQrlc() { | ||
| 234 | + return qrlc; | ||
| 235 | + } | ||
| 236 | + public void setQrlc(Double qrlc) { | ||
| 237 | + this.qrlc = qrlc; | ||
| 238 | + } | ||
| 239 | + public int getQcbc() { | ||
| 240 | + return qcbc; | ||
| 241 | + } | ||
| 242 | + public void setQcbc(int qcbc) { | ||
| 243 | + this.qcbc = qcbc; | ||
| 244 | + } | ||
| 245 | + public Double getQclc() { | ||
| 246 | + return qclc; | ||
| 247 | + } | ||
| 248 | + public void setQclc(Double qclc) { | ||
| 249 | + this.qclc = qclc; | ||
| 250 | + } | ||
| 251 | + public int getKxbc() { | ||
| 252 | + return kxbc; | ||
| 253 | + } | ||
| 254 | + public void setKxbc(int kxbc) { | ||
| 255 | + this.kxbc = kxbc; | ||
| 256 | + } | ||
| 257 | + public Double getKxlc() { | ||
| 258 | + return kxlc; | ||
| 259 | + } | ||
| 260 | + public void setKxlc(Double kxlc) { | ||
| 261 | + this.kxlc = kxlc; | ||
| 262 | + } | ||
| 263 | + public int getQhbc() { | ||
| 264 | + return qhbc; | ||
| 265 | + } | ||
| 266 | + public void setQhbc(int qhbc) { | ||
| 267 | + this.qhbc = qhbc; | ||
| 268 | + } | ||
| 269 | + public Double getQhlc() { | ||
| 270 | + return qhlc; | ||
| 271 | + } | ||
| 272 | + public void setQhlc(Double qhlc) { | ||
| 273 | + this.qhlc = qhlc; | ||
| 274 | + } | ||
| 275 | + public int getYwbc() { | ||
| 276 | + return ywbc; | ||
| 277 | + } | ||
| 278 | + public void setYwbc(int ywbc) { | ||
| 279 | + this.ywbc = ywbc; | ||
| 280 | + } | ||
| 281 | + public Double getYwlc() { | ||
| 282 | + return ywlc; | ||
| 283 | + } | ||
| 284 | + public void setYwlc(Double ywlc) { | ||
| 285 | + this.ywlc = ywlc; | ||
| 286 | + } | ||
| 287 | + public int getQtbc() { | ||
| 288 | + return qtbc; | ||
| 289 | + } | ||
| 290 | + public void setQtbc(int qtbc) { | ||
| 291 | + this.qtbc = qtbc; | ||
| 292 | + } | ||
| 293 | + public Double getQtlc() { | ||
| 294 | + return qtlc; | ||
| 295 | + } | ||
| 296 | + public void setQtlc(Double qtlc) { | ||
| 297 | + this.qtlc = qtlc; | ||
| 298 | + } | ||
| 299 | + public String getRemark() { | ||
| 300 | + return remark; | ||
| 301 | + } | ||
| 302 | + public void setRemark(String remark) { | ||
| 303 | + this.remark = remark; | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | +} |
src/main/java/com/bsth/repository/calc/CalcLbStatuAnalyRepository.java
0 → 100644
| 1 | +package com.bsth.repository.calc; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | + | ||
| 5 | +import javax.transaction.Transactional; | ||
| 6 | + | ||
| 7 | +import com.bsth.entity.calc.CalcLbStatuAnaly; | ||
| 8 | +import com.bsth.repository.BaseRepository; | ||
| 9 | + | ||
| 10 | +import org.springframework.data.jpa.repository.Modifying; | ||
| 11 | +import org.springframework.data.jpa.repository.Query; | ||
| 12 | +import org.springframework.stereotype.Repository; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * | ||
| 16 | + */ | ||
| 17 | +@Repository | ||
| 18 | +public interface CalcLbStatuAnalyRepository extends BaseRepository<CalcLbStatuAnaly, Integer>{ | ||
| 19 | + | ||
| 20 | + //按照时间段统计,公司下线路 | ||
| 21 | + @Query(value="select DISTINCT c from CalcLbStatuAnaly c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.xl") | ||
| 22 | + List<CalcLbStatuAnaly> selectByDateAndLine(String line,String date,String date2,String gsdm,String fgsdm); | ||
| 23 | + | ||
| 24 | + //按照时间段统计,单条线路 | ||
| 25 | + @Query(value="select DISTINCT c from CalcLbStatuAnaly c where c.xl = ?1 and c.rqStr between ?2 and ?3 order by c.xl") | ||
| 26 | + List<CalcLbStatuAnaly> selectByDateAndLine(String line,String date,String date2); | ||
| 27 | + | ||
| 28 | + //按照日期和线路删除数据 | ||
| 29 | + @Modifying | ||
| 30 | + @Transactional | ||
| 31 | + @Query(value = "delete CalcLbStatuAnaly c where c.rqStr=?1 and c.xl=?2") | ||
| 32 | + void deleteByDateAndLine(String date, String line); | ||
| 33 | + | ||
| 34 | + //按照日期删除数据 | ||
| 35 | + @Modifying | ||
| 36 | + @Transactional | ||
| 37 | + @Query(value = "delete CalcLbStatuAnaly c where c.rqStr=?1") | ||
| 38 | + void deleteByDate(String date); | ||
| 39 | + | ||
| 40 | +} |
src/main/java/com/bsth/service/calc/CalcLbStatuAnalyService.java
0 → 100644
| 1 | +package com.bsth.service.calc; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import com.bsth.entity.calc.CalcLbStatuAnaly; | ||
| 7 | +import com.bsth.service.BaseService; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * Created by 19/03/18. | ||
| 11 | + */ | ||
| 12 | +public interface CalcLbStatuAnalyService extends BaseService<CalcLbStatuAnaly, Integer> { | ||
| 13 | + | ||
| 14 | + List<Map<String, Object>> lbStatuAnaly(String gsdm, String fgsdm, String line, String date, String date2, String sfyy, String type); | ||
| 15 | + | ||
| 16 | +} |
src/main/java/com/bsth/service/calc/impl/CalcLbStatuAnalyServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.calc.impl; | ||
| 2 | + | ||
| 3 | +import java.util.ArrayList; | ||
| 4 | +import java.util.Collections; | ||
| 5 | +import java.util.Comparator; | ||
| 6 | +import java.util.HashMap; | ||
| 7 | +import java.util.List; | ||
| 8 | +import java.util.Map; | ||
| 9 | + | ||
| 10 | +import com.bsth.entity.calc.CalcLbStatuAnaly; | ||
| 11 | +import com.bsth.repository.calc.CalcLbStatuAnalyRepository; | ||
| 12 | +import com.bsth.service.LineService; | ||
| 13 | +import com.bsth.service.calc.CalcLbStatuAnalyService; | ||
| 14 | +import com.bsth.service.impl.BaseServiceImpl; | ||
| 15 | +import com.bsth.util.Arith; | ||
| 16 | + | ||
| 17 | +import org.slf4j.Logger; | ||
| 18 | +import org.slf4j.LoggerFactory; | ||
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 21 | +import org.springframework.stereotype.Service; | ||
| 22 | + | ||
| 23 | +/** | ||
| 24 | + * Created by 19/03/18. | ||
| 25 | + */ | ||
| 26 | +@Service | ||
| 27 | +public class CalcLbStatuAnalyServiceImpl extends BaseServiceImpl<CalcLbStatuAnaly, Integer> implements CalcLbStatuAnalyService { | ||
| 28 | + | ||
| 29 | + @Autowired | ||
| 30 | + private CalcLbStatuAnalyRepository calcRepository; | ||
| 31 | + | ||
| 32 | + @Autowired | ||
| 33 | + private LineService lineService; | ||
| 34 | + | ||
| 35 | + @Autowired | ||
| 36 | + JdbcTemplate jdbcTemplate; | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public List<Map<String, Object>> lbStatuAnaly(String gsdm, String fgsdm, | ||
| 44 | + String line, String date, String date2, String sfyy, String type) { | ||
| 45 | + // TODO Auto-generated method stub | ||
| 46 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 47 | + List<CalcLbStatuAnaly> query = calcRepository.selectByDateAndLine(line, date, date2, gsdm, fgsdm); | ||
| 48 | + Map<String, Boolean> lineNature = lineService.lineNature(); | ||
| 49 | + Map<String, List<CalcLbStatuAnaly>> keyMap = new HashMap<String, List<CalcLbStatuAnaly>>(); | ||
| 50 | + List<String> keyList = new ArrayList<String>(); | ||
| 51 | + | ||
| 52 | + String[] Date1 = date.split("-"); | ||
| 53 | + String[] Date2 = date2.split("-"); | ||
| 54 | + String Date = ""; | ||
| 55 | + if(date.equals(date2)) | ||
| 56 | + Date = Date1[0] + "年" + Date1[1] + "月" + Date1[2] + "日"; | ||
| 57 | + else | ||
| 58 | + Date = Date1[0] + "年" + Date1[1] + "月" + Date1[2] + "日 - " | ||
| 59 | + + Date2[0] + "年" + Date2[1] + "月" + Date2[2] + "日"; | ||
| 60 | + | ||
| 61 | + for(CalcLbStatuAnaly lb : query){ | ||
| 62 | + String xlBm = lb.getXl(); | ||
| 63 | + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm) != null){ | ||
| 64 | + if(sfyy.equals("1") && !lineNature.get(xlBm)){ | ||
| 65 | + continue; | ||
| 66 | + } else if(sfyy.equals("2") && lineNature.get(xlBm)){ | ||
| 67 | + continue; | ||
| 68 | + } | ||
| 69 | + } else if(sfyy.equals("2")){ | ||
| 70 | + continue; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + String key = lb.getGsdm() + "/" + lb.getFgsdm() + "/" + lb.getXl(); | ||
| 74 | + | ||
| 75 | + if(!keyMap.containsKey(key)){ | ||
| 76 | + keyMap.put(key, new ArrayList<CalcLbStatuAnaly>()); | ||
| 77 | + keyList.add(key); | ||
| 78 | + } | ||
| 79 | + keyMap.get(key).add(lb); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + Collections.sort(keyList, new Comparator<String>() { | ||
| 83 | + | ||
| 84 | + public int compare(String o1, String o2) { | ||
| 85 | + | ||
| 86 | + Long a = 0l; | ||
| 87 | + Long b = 0l; | ||
| 88 | + String[] split1 = o1.split("/"); | ||
| 89 | + String[] split2 = o2.split("/"); | ||
| 90 | + char[] charArray1 = split1[2].toCharArray(); | ||
| 91 | + char[] charArray2 = split2[2].toCharArray(); | ||
| 92 | + for(int i = 0; i < charArray1.length; i++){ | ||
| 93 | + long temp = 1l; | ||
| 94 | + for(int j = 0; j < i; j++) | ||
| 95 | + temp *= 10; | ||
| 96 | + a += (long)charArray1[charArray1.length - 1 - i] * temp; | ||
| 97 | + } | ||
| 98 | + for(int i = 0; i < charArray2.length; i++){ | ||
| 99 | + long temp = 1l; | ||
| 100 | + for(int j = 0; j < i; j++) | ||
| 101 | + temp *= 10; | ||
| 102 | + b += (long)charArray2[charArray2.length - 1 - i] * temp; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + return a.compareTo(b); | ||
| 106 | + } | ||
| 107 | + }); | ||
| 108 | + Collections.sort(keyList, new Comparator<String>() { | ||
| 109 | + | ||
| 110 | + public int compare(String o1, String o2) { | ||
| 111 | + | ||
| 112 | + Long a = 0l; | ||
| 113 | + Long b = 0l; | ||
| 114 | + String[] split1 = o1.split("/"); | ||
| 115 | + String[] split2 = o2.split("/"); | ||
| 116 | + char[] charArray1 = split1[1].toCharArray(); | ||
| 117 | + char[] charArray2 = split2[1].toCharArray(); | ||
| 118 | + for(int i = 0; i < charArray1.length; i++){ | ||
| 119 | + long temp = 1l; | ||
| 120 | + for(int j = 0; j < i; j++) | ||
| 121 | + temp *= 10; | ||
| 122 | + a += (long)charArray1[charArray1.length - 1 - i] * temp; | ||
| 123 | + } | ||
| 124 | + for(int i = 0; i < charArray2.length; i++){ | ||
| 125 | + long temp = 1l; | ||
| 126 | + for(int j = 0; j < i; j++) | ||
| 127 | + temp *= 10; | ||
| 128 | + b += (long)charArray2[charArray2.length - 1 - i] * temp; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + return a.compareTo(b); | ||
| 132 | + } | ||
| 133 | + }); | ||
| 134 | + | ||
| 135 | + String company = "", subCompany = "", lineName = ""; | ||
| 136 | + Map<String, Object> lastMap = new HashMap<String, Object>(); | ||
| 137 | + lastMap.put("line", "合计"); | ||
| 138 | + for(String key : keyList){ | ||
| 139 | + List<CalcLbStatuAnaly> list = keyMap.get(key); | ||
| 140 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 141 | + company = ""; | ||
| 142 | + subCompany = ""; | ||
| 143 | + lineName = ""; | ||
| 144 | + for(CalcLbStatuAnaly lb : list){ | ||
| 145 | + if(lb.getGsname() != null && company.trim().length() == 0) | ||
| 146 | + company = lb.getGsname(); | ||
| 147 | + if(lb.getFgsname() != null && subCompany.trim().length() == 0) | ||
| 148 | + subCompany = lb.getFgsname(); | ||
| 149 | + if(lb.getXlName() != null && lineName.trim().length() == 0) | ||
| 150 | + lineName = lb.getXlName(); | ||
| 151 | + m.put("jhbc", Arith.add(m.get("jhbc")!=null?m.get("jhbc"):"0", lb.getJhbc())); | ||
| 152 | + m.put("sjbc", Arith.add(m.get("sjbc")!=null?m.get("sjbc"):"0", lb.getSjbc())); | ||
| 153 | + m.put("jhlc", Arith.add(m.get("jhlc")!=null?m.get("jhlc"):"0", lb.getJhlc()!=null?lb.getJhlc():"0")); | ||
| 154 | + m.put("sjlc", Arith.add(m.get("sjlc")!=null?m.get("sjlc"):"0", lb.getSjlc()!=null?lb.getSjlc():"0")); | ||
| 155 | + m.put("lzbc", Arith.add(m.get("lzbc")!=null?m.get("lzbc"):"0", lb.getLzbc())); | ||
| 156 | + m.put("lzlc", Arith.add(m.get("lzlc")!=null?m.get("lzlc"):"0", lb.getLzlc()!=null?lb.getLzlc():"0")); | ||
| 157 | + m.put("dmbc", Arith.add(m.get("dmbc")!=null?m.get("dmbc"):"0", lb.getDmbc())); | ||
| 158 | + m.put("dmlc", Arith.add(m.get("dmlc")!=null?m.get("dmlc"):"0", lb.getDmlc()!=null?lb.getDmlc():"0")); | ||
| 159 | + m.put("gzbc", Arith.add(m.get("gzbc")!=null?m.get("gzbc"):"0", lb.getGzbc())); | ||
| 160 | + m.put("gzlc", Arith.add(m.get("gzlc")!=null?m.get("gzlc"):"0", lb.getGzlc()!=null?lb.getGzlc():"0")); | ||
| 161 | + m.put("jfbc", Arith.add(m.get("jfbc")!=null?m.get("jfbc"):"0", lb.getJfbc())); | ||
| 162 | + m.put("jflc", Arith.add(m.get("jflc")!=null?m.get("jflc"):"0", lb.getJflc()!=null?lb.getJflc():"0")); | ||
| 163 | + m.put("zsbc", Arith.add(m.get("zsbc")!=null?m.get("zsbc"):"0", lb.getZsbc())); | ||
| 164 | + m.put("zslc", Arith.add(m.get("zslc")!=null?m.get("zslc"):"0", lb.getZslc()!=null?lb.getZslc():"0")); | ||
| 165 | + m.put("qrbc", Arith.add(m.get("qrbc")!=null?m.get("qrbc"):"0", lb.getQrbc())); | ||
| 166 | + m.put("qrlc", Arith.add(m.get("qrlc")!=null?m.get("qrlc"):"0", lb.getQrlc()!=null?lb.getQrlc():"0")); | ||
| 167 | + m.put("qcbc", Arith.add(m.get("qcbc")!=null?m.get("qcbc"):"0", lb.getQcbc())); | ||
| 168 | + m.put("qclc", Arith.add(m.get("qclc")!=null?m.get("qclc"):"0", lb.getQclc()!=null?lb.getQclc():"0")); | ||
| 169 | + m.put("kxbc", Arith.add(m.get("kxbc")!=null?m.get("kxbc"):"0", lb.getKxbc())); | ||
| 170 | + m.put("kxlc", Arith.add(m.get("kxlc")!=null?m.get("kxlc"):"0", lb.getKxlc()!=null?lb.getKxlc():"0")); | ||
| 171 | + m.put("qhbc", Arith.add(m.get("qhbc")!=null?m.get("qhbc"):"0", lb.getQhbc())); | ||
| 172 | + m.put("qhlc", Arith.add(m.get("qhlc")!=null?m.get("qhlc"):"0", lb.getQhlc()!=null?lb.getQhlc():"0")); | ||
| 173 | + m.put("ywbc", Arith.add(m.get("ywbc")!=null?m.get("ywbc"):"0", lb.getYwbc())); | ||
| 174 | + m.put("ywlc", Arith.add(m.get("ywlc")!=null?m.get("ywlc"):"0", lb.getYwlc()!=null?lb.getYwlc():"0")); | ||
| 175 | + m.put("qtbc", Arith.add(m.get("qtbc")!=null?m.get("qtbc"):"0", lb.getQtbc())); | ||
| 176 | + m.put("qtlc", Arith.add(m.get("qtlc")!=null?m.get("qtlc"):"0", lb.getQtlc()!=null?lb.getQtlc():"0")); | ||
| 177 | + } | ||
| 178 | + m.put("date", Date); | ||
| 179 | + m.put("company", company); | ||
| 180 | + m.put("subCompany", subCompany); | ||
| 181 | + m.put("line", lineName); | ||
| 182 | + resList.add(m); | ||
| 183 | + | ||
| 184 | + lastMap.put("jhbc", Arith.add(m.get("jhbc")!=null?m.get("jhbc"):"0", lastMap.get("jhbc")!=null?lastMap.get("jhbc"):"0")); | ||
| 185 | + lastMap.put("sjbc", Arith.add(m.get("sjbc")!=null?m.get("sjbc"):"0", lastMap.get("sjbc")!=null?lastMap.get("sjbc"):"0")); | ||
| 186 | + lastMap.put("jhlc", Arith.add(m.get("jhlc")!=null?m.get("jhlc"):"0", lastMap.get("jhlc")!=null?lastMap.get("jhlc"):"0")); | ||
| 187 | + lastMap.put("sjlc", Arith.add(m.get("sjlc")!=null?m.get("sjlc"):"0", lastMap.get("sjlc")!=null?lastMap.get("sjlc"):"0")); | ||
| 188 | + lastMap.put("lzbc", Arith.add(m.get("lzbc")!=null?m.get("lzbc"):"0", lastMap.get("lzbc")!=null?lastMap.get("lzbc"):"0")); | ||
| 189 | + lastMap.put("lzlc", Arith.add(m.get("lzlc")!=null?m.get("lzlc"):"0", lastMap.get("lzlc")!=null?lastMap.get("lzlc"):"0")); | ||
| 190 | + lastMap.put("dmbc", Arith.add(m.get("dmbc")!=null?m.get("dmbc"):"0", lastMap.get("dmbc")!=null?lastMap.get("dmbc"):"0")); | ||
| 191 | + lastMap.put("dmlc", Arith.add(m.get("dmlc")!=null?m.get("dmlc"):"0", lastMap.get("dmlc")!=null?lastMap.get("dmlc"):"0")); | ||
| 192 | + lastMap.put("gzbc", Arith.add(m.get("gzbc")!=null?m.get("gzbc"):"0", lastMap.get("gzbc")!=null?lastMap.get("gzbc"):"0")); | ||
| 193 | + lastMap.put("gzlc", Arith.add(m.get("gzlc")!=null?m.get("gzlc"):"0", lastMap.get("gzlc")!=null?lastMap.get("gzlc"):"0")); | ||
| 194 | + lastMap.put("jfbc", Arith.add(m.get("jfbc")!=null?m.get("jfbc"):"0", lastMap.get("jfbc")!=null?lastMap.get("jfbc"):"0")); | ||
| 195 | + lastMap.put("jflc", Arith.add(m.get("jflc")!=null?m.get("jflc"):"0", lastMap.get("jflc")!=null?lastMap.get("jflc"):"0")); | ||
| 196 | + lastMap.put("zsbc", Arith.add(m.get("zsbc")!=null?m.get("zsbc"):"0", lastMap.get("zsbc")!=null?lastMap.get("zsbc"):"0")); | ||
| 197 | + lastMap.put("zslc", Arith.add(m.get("zslc")!=null?m.get("zslc"):"0", lastMap.get("zslc")!=null?lastMap.get("zslc"):"0")); | ||
| 198 | + lastMap.put("qrbc", Arith.add(m.get("qrbc")!=null?m.get("qrbc"):"0", lastMap.get("qrbc")!=null?lastMap.get("qrbc"):"0")); | ||
| 199 | + lastMap.put("qrlc", Arith.add(m.get("qrlc")!=null?m.get("qrlc"):"0", lastMap.get("qrlc")!=null?lastMap.get("qrlc"):"0")); | ||
| 200 | + lastMap.put("qcbc", Arith.add(m.get("qcbc")!=null?m.get("qcbc"):"0", lastMap.get("qcbc")!=null?lastMap.get("qcbc"):"0")); | ||
| 201 | + lastMap.put("qclc", Arith.add(m.get("qclc")!=null?m.get("qclc"):"0", lastMap.get("qclc")!=null?lastMap.get("qclc"):"0")); | ||
| 202 | + lastMap.put("kxbc", Arith.add(m.get("kxbc")!=null?m.get("kxbc"):"0", lastMap.get("kxbc")!=null?lastMap.get("kxbc"):"0")); | ||
| 203 | + lastMap.put("kxlc", Arith.add(m.get("kxlc")!=null?m.get("kxlc"):"0", lastMap.get("kxlc")!=null?lastMap.get("kxlc"):"0")); | ||
| 204 | + lastMap.put("qhbc", Arith.add(m.get("qhbc")!=null?m.get("qhbc"):"0", lastMap.get("qhbc")!=null?lastMap.get("qhbc"):"0")); | ||
| 205 | + lastMap.put("qhlc", Arith.add(m.get("qhlc")!=null?m.get("qhlc"):"0", lastMap.get("qhlc")!=null?lastMap.get("qhlc"):"0")); | ||
| 206 | + lastMap.put("ywbc", Arith.add(m.get("ywbc")!=null?m.get("ywbc"):"0", lastMap.get("ywbc")!=null?lastMap.get("ywbc"):"0")); | ||
| 207 | + lastMap.put("ywlc", Arith.add(m.get("ywlc")!=null?m.get("ywlc"):"0", lastMap.get("ywlc")!=null?lastMap.get("ywlc"):"0")); | ||
| 208 | + lastMap.put("qtbc", Arith.add(m.get("qtbc")!=null?m.get("qtbc"):"0", lastMap.get("qtbc")!=null?lastMap.get("qtbc"):"0")); | ||
| 209 | + lastMap.put("qtlc", Arith.add(m.get("qtlc")!=null?m.get("qtlc"):"0", lastMap.get("qtlc")!=null?lastMap.get("qtlc"):"0")); | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + if(resList.size() > 0){ | ||
| 213 | + resList.add(lastMap); | ||
| 214 | + for(Map<String, Object> m : resList){ | ||
| 215 | + if(Arith.compareTo(m.get("sjbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 216 | + m.put("bcbfb", Arith.div(Arith.mul(m.get("sjbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 217 | + } else { | ||
| 218 | + m.put("bcbfb", "0%"); | ||
| 219 | + } | ||
| 220 | + if(Arith.compareTo(m.get("sjlc"), 0) == 1 && Arith.compareTo(m.get("jhlc"), 0) == 1){ | ||
| 221 | + m.put("lcbfb", Arith.div(Arith.mul(m.get("sjlc"), 100), m.get("jhlc"), 2) + "%"); | ||
| 222 | + } else { | ||
| 223 | + m.put("lcbfb", "0%"); | ||
| 224 | + } | ||
| 225 | + if(Arith.compareTo(m.get("lzbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 226 | + m.put("lzbfb", Arith.div(Arith.mul(m.get("lzbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 227 | + } else { | ||
| 228 | + m.put("lzbfb", "0%"); | ||
| 229 | + } | ||
| 230 | + if(Arith.compareTo(m.get("dmbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 231 | + m.put("dmbfb", Arith.div(Arith.mul(m.get("dmbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 232 | + } else { | ||
| 233 | + m.put("dmbfb", "0%"); | ||
| 234 | + } | ||
| 235 | + if(Arith.compareTo(m.get("gzbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 236 | + m.put("gzbfb", Arith.div(Arith.mul(m.get("gzbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 237 | + } else { | ||
| 238 | + m.put("gzbfb", "0%"); | ||
| 239 | + } | ||
| 240 | + if(Arith.compareTo(m.get("jfbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 241 | + m.put("jfbfb", Arith.div(Arith.mul(m.get("jfbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 242 | + } else { | ||
| 243 | + m.put("jfbfb", "0%"); | ||
| 244 | + } | ||
| 245 | + if(Arith.compareTo(m.get("zsbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 246 | + m.put("zsbfb", Arith.div(Arith.mul(m.get("zsbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 247 | + } else { | ||
| 248 | + m.put("zsbfb", "0%"); | ||
| 249 | + } | ||
| 250 | + if(Arith.compareTo(m.get("qrbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 251 | + m.put("qrbfb", Arith.div(Arith.mul(m.get("qrbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 252 | + } else { | ||
| 253 | + m.put("qrbfb", "0%"); | ||
| 254 | + } | ||
| 255 | + if(Arith.compareTo(m.get("qcbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 256 | + m.put("qcbfb", Arith.div(Arith.mul(m.get("qcbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 257 | + } else { | ||
| 258 | + m.put("qcbfb", "0%"); | ||
| 259 | + } | ||
| 260 | + if(Arith.compareTo(m.get("kxbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 261 | + m.put("kxbfb", Arith.div(Arith.mul(m.get("kxbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 262 | + } else { | ||
| 263 | + m.put("kxbfb", "0%"); | ||
| 264 | + } | ||
| 265 | + if(Arith.compareTo(m.get("qhbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 266 | + m.put("qhbfb", Arith.div(Arith.mul(m.get("qhbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 267 | + } else { | ||
| 268 | + m.put("qhbfb", "0%"); | ||
| 269 | + } | ||
| 270 | + if(Arith.compareTo(m.get("ywbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 271 | + m.put("ywbfb", Arith.div(Arith.mul(m.get("ywbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 272 | + } else { | ||
| 273 | + m.put("ywbfb", "0%"); | ||
| 274 | + } | ||
| 275 | + if(Arith.compareTo(m.get("qtbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){ | ||
| 276 | + m.put("qtbfb", Arith.div(Arith.mul(m.get("qtbc"), 100), m.get("jhbc"), 2) + "%"); | ||
| 277 | + } else { | ||
| 278 | + m.put("qtbfb", "0%"); | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + return resList; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | +} |
src/main/java/com/bsth/service/calc/impl/CalcMixServiceImpl.java
| @@ -306,9 +306,9 @@ public class CalcMixServiceImpl implements CalcMixService { | @@ -306,9 +306,9 @@ public class CalcMixServiceImpl implements CalcMixService { | ||
| 306 | m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0)); | 306 | m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0)); |
| 307 | m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0)); | 307 | m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0)); |
| 308 | m.put("sh", Arith.add(m.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0)); | 308 | m.put("sh", Arith.add(m.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0)); |
| 309 | - last.put("hyl", Arith.add(last.get("hyl"), m.get("hyl"))); | ||
| 310 | - last.put("jzl", Arith.add(last.get("jzl"), m.get("jzl"))); | ||
| 311 | - last.put("sh", Arith.add(last.get("sh"), m.get("sh"))); | 309 | + last.put("hyl", Arith.add(last.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0)); |
| 310 | + last.put("jzl", Arith.add(last.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0)); | ||
| 311 | + last.put("sh", Arith.add(last.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0)); | ||
| 312 | } else { | 312 | } else { |
| 313 | Map<String, Object> m = new HashMap<String, Object>(); | 313 | Map<String, Object> m = new HashMap<String, Object>(); |
| 314 | m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | 314 | m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -16,6 +16,7 @@ import com.bsth.entity.LineVersions; | @@ -16,6 +16,7 @@ import com.bsth.entity.LineVersions; | ||
| 16 | import com.bsth.entity.directive.D80; | 16 | import com.bsth.entity.directive.D80; |
| 17 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 17 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 18 | import com.bsth.repository.CarParkRepository; | 18 | import com.bsth.repository.CarParkRepository; |
| 19 | +import com.bsth.repository.LineRepository; | ||
| 19 | import com.bsth.repository.LineVersionsRepository; | 20 | import com.bsth.repository.LineVersionsRepository; |
| 20 | import com.bsth.repository.StationRepository; | 21 | import com.bsth.repository.StationRepository; |
| 21 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 22 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| @@ -87,6 +88,9 @@ public class GpsServiceImpl implements GpsService { | @@ -87,6 +88,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 87 | @Autowired | 88 | @Autowired |
| 88 | LineVersionsRepository lineVersionsRepository; | 89 | LineVersionsRepository lineVersionsRepository; |
| 89 | 90 | ||
| 91 | + @Autowired | ||
| 92 | + LineRepository lineRepository; | ||
| 93 | + | ||
| 90 | // 历史gps查询 | 94 | // 历史gps查询 |
| 91 | @Override | 95 | @Override |
| 92 | public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { | 96 | public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { |
| @@ -228,50 +232,68 @@ public class GpsServiceImpl implements GpsService { | @@ -228,50 +232,68 @@ public class GpsServiceImpl implements GpsService { | ||
| 228 | //查询GPS数据 | 232 | //查询GPS数据 |
| 229 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); | 233 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 230 | List<Map<String, Object>> dataList = jdbcTemplate_ms.queryForList(sql.toString()); | 234 | List<Map<String, Object>> dataList = jdbcTemplate_ms.queryForList(sql.toString()); |
| 231 | - if (!dataList.isEmpty()){ | ||
| 232 | 235 | ||
| 233 | - int lineId=Integer.parseInt(map_get_str(dataList.get(0), "LINE_ID")); | ||
| 234 | - List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId); | ||
| 235 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | ||
| 236 | - List<Map<String,Object>> vlist=new ArrayList<>(); | ||
| 237 | - Map<String,Object> vMap; | ||
| 238 | - if (lvs!=null&&!lvs.isEmpty()){ | ||
| 239 | - for (LineVersions lv : lvs) { | ||
| 240 | - vMap=new HashMap(); | ||
| 241 | - Long sd=lv.getStartDate().getTime(); | ||
| 242 | - Long ed=lv.getEndDate().getTime(); | ||
| 243 | - if (sd<st&&et<ed){ | ||
| 244 | - vMap.put("version",lv.getVersions()); | ||
| 245 | - vMap.put("vtime","all"); | ||
| 246 | - vlist.add(vMap); | ||
| 247 | - }else if(sd<st&&et>ed&&st<ed){ | ||
| 248 | - vMap.put("version",lv.getVersions()); | ||
| 249 | - vMap.put("endTime",lv.getEndDate().getTime()); | ||
| 250 | - vlist.add(vMap); | ||
| 251 | - }else if(st<sd&&et<ed&&sd<et){ | ||
| 252 | - vMap.put("version",lv.getVersions()); | ||
| 253 | - vMap.put("startTime",lv.getStartDate().getTime()); | ||
| 254 | - vlist.add(vMap); | ||
| 255 | - } | ||
| 256 | - } | ||
| 257 | - } | ||
| 258 | - rsMap.put("lineVerson",vlist); | ||
| 259 | - } | ||
| 260 | Float lon, lat; | 236 | Float lon, lat; |
| 261 | Location bdLoc, gdLoc; | 237 | Location bdLoc, gdLoc; |
| 262 | int inOutStop; | 238 | int inOutStop; |
| 263 | long serviceState; | 239 | long serviceState; |
| 264 | ArrivalEntity arrival; | 240 | ArrivalEntity arrival; |
| 265 | - | 241 | + Set<String> lineSet=new HashSet(); |
| 242 | + List<Map<String,Object>> lineSwitch=new ArrayList<>(); | ||
| 243 | + | ||
| 244 | + List<Map> gpsNotValidList=new ArrayList(); | ||
| 245 | + List<Map> versionSwitchList=new ArrayList(); | ||
| 246 | + List<Map> gpsEqualsZeroList=new ArrayList(); | ||
| 247 | + Map<String,Object> zeroMap=null; | ||
| 248 | + Map<String,Object> gpsNotValidMap=null; | ||
| 249 | + boolean isFirstNotValid=true; | ||
| 250 | + boolean isFirstLonlatZero=true; | ||
| 266 | Map<String, Object> map = null; | 251 | Map<String, Object> map = null; |
| 267 | for(Map<String, Object> rs : dataList){ | 252 | for(Map<String, Object> rs : dataList){ |
| 253 | + int index=dataList.indexOf(rs); | ||
| 254 | + if (index< dataList.size()-1&&!map_get_str( rs,"LINE_ID").equals(map_get_str( dataList.get(index+1),"LINE_ID"))){ | ||
| 255 | + Map<String,Object> LSmap=new HashMap<>(); | ||
| 256 | + String name=lineRepository.findOne(Integer.valueOf(map_get_str( rs,"LINE_ID"))).getName(); | ||
| 257 | + String NextName=lineRepository.findOne(Integer.valueOf(map_get_str( dataList.get(index+1),"LINE_ID"))).getName(); | ||
| 258 | + LSmap.put("abnormalType","linesSwitch"); | ||
| 259 | + LSmap.put("line_line",name+"-->"+NextName); | ||
| 260 | + LSmap.put("st",map_get_long(rs, "TS")); | ||
| 261 | + LSmap.put("et",index== dataList.size()-1?map_get_long(rs, "TS"):map_get_long( dataList.get(index+1), "TS")); | ||
| 262 | + lineSwitch.add(LSmap); | ||
| 263 | + } | ||
| 268 | serviceState = map_get_long(rs, "SERVICE_STATE"); | 264 | serviceState = map_get_long(rs, "SERVICE_STATE"); |
| 269 | - if(getGpsValid(serviceState) == 1) | ||
| 270 | - continue; | 265 | + if(getGpsValid(serviceState) == 1){ |
| 266 | + if (isFirstNotValid) { | ||
| 267 | + gpsNotValidMap=new HashMap<>(); | ||
| 268 | + gpsNotValidMap.put("abnormalType","gpsNotValid"); | ||
| 269 | + gpsNotValidMap.put("st",map_get_long(rs,"TS")); | ||
| 270 | + isFirstNotValid=false; | ||
| 271 | + } | ||
| 272 | + if (index== dataList.size()-1||index< dataList.size()-1&&getGpsValid(map_get_long(dataList.get(index+1), "SERVICE_STATE"))!=1){ | ||
| 273 | + gpsNotValidMap.put("et",map_get_long(rs,"TS")); | ||
| 274 | + gpsNotValidList.add(gpsNotValidMap); | ||
| 275 | + isFirstNotValid=true; | ||
| 276 | + gpsNotValidMap=null; | ||
| 277 | + } | ||
| 278 | + } | ||
| 279 | + //continue; | ||
| 271 | 280 | ||
| 272 | map = new HashMap<>(); | 281 | map = new HashMap<>(); |
| 273 | lon = map_get_float(rs, "LON"); | 282 | lon = map_get_float(rs, "LON"); |
| 274 | lat = map_get_float(rs, "LAT"); | 283 | lat = map_get_float(rs, "LAT"); |
| 284 | + if (lon==0||lat==0){ | ||
| 285 | + if (isFirstLonlatZero){ | ||
| 286 | + zeroMap=new HashMap<>(); | ||
| 287 | + zeroMap.put("abnormalType","gpsZero"); | ||
| 288 | + zeroMap.put("st",map_get_long(rs,"TS")); | ||
| 289 | + isFirstLonlatZero=false; | ||
| 290 | + } | ||
| 291 | + if (index<dataList.size()-1&&(map_get_float(dataList.get(index+1),"LON")!=0&&map_get_float(dataList.get(index+1),"LAT")!=0)){ | ||
| 292 | + zeroMap.put("et",map_get_long(rs,"TS")); | ||
| 293 | + gpsEqualsZeroList.add(zeroMap); | ||
| 294 | + isFirstLonlatZero=true; | ||
| 295 | + } | ||
| 296 | + } | ||
| 275 | // 高德坐标 | 297 | // 高德坐标 |
| 276 | gdLoc = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(lon, lat)); | 298 | gdLoc = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(lon, lat)); |
| 277 | map.put("gcj_lon", gdLoc.getLng()); | 299 | map.put("gcj_lon", gdLoc.getLng()); |
| @@ -292,7 +314,7 @@ public class GpsServiceImpl implements GpsService { | @@ -292,7 +314,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 292 | 314 | ||
| 293 | map.put("lineId", map_get_str(rs, "LINE_ID")); | 315 | map.put("lineId", map_get_str(rs, "LINE_ID")); |
| 294 | map.put("speed", map_get_float(rs,"SPEED_GPS")); | 316 | map.put("speed", map_get_float(rs,"SPEED_GPS")); |
| 295 | - | 317 | + lineSet.add(map_get_str(rs, "LINE_ID")); |
| 296 | inOutStop = Integer.parseInt(rs.get("INOUT_STOP").toString()); | 318 | inOutStop = Integer.parseInt(rs.get("INOUT_STOP").toString()); |
| 297 | map.put("inout_stop", inOutStop); | 319 | map.put("inout_stop", inOutStop); |
| 298 | 320 | ||
| @@ -310,6 +332,48 @@ public class GpsServiceImpl implements GpsService { | @@ -310,6 +332,48 @@ public class GpsServiceImpl implements GpsService { | ||
| 310 | map.put("section_code", map_get_str(rs,"SECTION_CODE")); | 332 | map.put("section_code", map_get_str(rs,"SECTION_CODE")); |
| 311 | list.add(map); | 333 | list.add(map); |
| 312 | } | 334 | } |
| 335 | + | ||
| 336 | + if (lineSet.size()>0){ | ||
| 337 | + for (String s : lineSet) { | ||
| 338 | + int lineId=Integer.parseInt(s); | ||
| 339 | + List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId); | ||
| 340 | + List<Map<String,Object>> vlist=new ArrayList<>(); | ||
| 341 | + Map<String,Object> vMap; | ||
| 342 | + Long qt=0L; | ||
| 343 | + if (lvs!=null&&!lvs.isEmpty()){ | ||
| 344 | + for (LineVersions lv : lvs) { | ||
| 345 | + vMap=new HashMap(); | ||
| 346 | + Long sd=lv.getStartDate().getTime(); | ||
| 347 | + Long ed=lv.getEndDate().getTime(); | ||
| 348 | + if (sd<st&&et<ed){ | ||
| 349 | + vMap.put("version",lv.getVersions()); | ||
| 350 | + vMap.put("vtime","all"); | ||
| 351 | + vlist.add(vMap); | ||
| 352 | + }else if(sd<st&&et>ed&&st<ed){ | ||
| 353 | + vMap.put("version",lv.getVersions()); | ||
| 354 | + vMap.put("endTime",lv.getEndDate().getTime()); | ||
| 355 | + vMap.put("abnormalType","versionSwitch"); | ||
| 356 | + vMap.put("st",lv.getEndDate().getTime()); | ||
| 357 | + //vMap.put("et",lvs.indexOf(lv)==lvs.size()-1?lv.getEndDate().getTime():lvs.get(lvs.indexOf(lv)+1).getStartDate().getTime()); | ||
| 358 | + qt=lv.getEndDate().getTime(); | ||
| 359 | + vlist.add(vMap); | ||
| 360 | + }else if(st<sd&&et<ed&&sd<et){ | ||
| 361 | + vMap.put("version",lv.getVersions()); | ||
| 362 | + vMap.put("startTime",lv.getStartDate().getTime()); | ||
| 363 | + vlist.add(vMap); | ||
| 364 | + } | ||
| 365 | + } | ||
| 366 | + } | ||
| 367 | + rsMap.put("lineVerson",vlist); | ||
| 368 | + if (vlist.size()>1){ | ||
| 369 | + Map<String,Object> VSmap=new HashMap<>(); | ||
| 370 | + VSmap.put("abnormalType","vserionSwitch"); | ||
| 371 | + VSmap.put("st",qt); | ||
| 372 | + versionSwitchList.add(VSmap); | ||
| 373 | + } | ||
| 374 | + } | ||
| 375 | + | ||
| 376 | + } | ||
| 313 | // 按时间排序 | 377 | // 按时间排序 |
| 314 | Collections.sort(list, new Comparator<Map<String, Object>>() { | 378 | Collections.sort(list, new Comparator<Map<String, Object>>() { |
| 315 | 379 | ||
| @@ -321,6 +385,9 @@ public class GpsServiceImpl implements GpsService { | @@ -321,6 +385,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 321 | 385 | ||
| 322 | rsMap.put("list", list); | 386 | rsMap.put("list", list); |
| 323 | rsMap.put("dcs", dcs); | 387 | rsMap.put("dcs", dcs); |
| 388 | + rsMap.put("gpsNotValid",gpsNotValidList); | ||
| 389 | + rsMap.put("lineSwitch",lineSwitch); | ||
| 390 | + rsMap.put("lonlatZero",gpsEqualsZeroList); | ||
| 324 | return rsMap; | 391 | return rsMap; |
| 325 | } | 392 | } |
| 326 | 393 | ||
| @@ -749,6 +816,9 @@ public class GpsServiceImpl implements GpsService { | @@ -749,6 +816,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 749 | rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000)); | 816 | rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000)); |
| 750 | rs.put("dcs", gpsMap.get("dcs")); | 817 | rs.put("dcs", gpsMap.get("dcs")); |
| 751 | rs.put("lineVerson",gpsMap.get("lineVerson")); | 818 | rs.put("lineVerson",gpsMap.get("lineVerson")); |
| 819 | + rs.put("gpsInvalid",gpsMap.get("gpsNotValid")); | ||
| 820 | + rs.put("gpslineSwitch",gpsMap.get("lineSwitch")); | ||
| 821 | + rs.put("gpslonlatex",gpsMap.get("lonlatZero")); | ||
| 752 | } catch (Exception e) { | 822 | } catch (Exception e) { |
| 753 | logger.error("", e); | 823 | logger.error("", e); |
| 754 | rs.put("status", ResponseCode.ERROR); | 824 | rs.put("status", ResponseCode.ERROR); |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -306,10 +306,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -306,10 +306,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 306 | String sql = "select id,cc_id,mileage_type,destroy,destroy_reason," + | 306 | String sql = "select id,cc_id,mileage_type,destroy,destroy_reason," + |
| 307 | " mileage,type1,type2,schedule from bsth_c_s_child_task" + | 307 | " mileage,type1,type2,schedule from bsth_c_s_child_task" + |
| 308 | " where 1=1"; | 308 | " where 1=1"; |
| 309 | - if(schedule1 != null && schedule1 > 0){ | 309 | + if(schedule1 != null && schedule1 >= 0){ |
| 310 | sql += " and schedule >= '"+schedule1+"'"; | 310 | sql += " and schedule >= '"+schedule1+"'"; |
| 311 | } | 311 | } |
| 312 | - if(schedule2 != null && schedule2 > 0){ | 312 | + if(schedule2 != null && schedule2 >= 0){ |
| 313 | sql += " and schedule <= '"+schedule2+"'"; | 313 | sql += " and schedule <= '"+schedule2+"'"; |
| 314 | } | 314 | } |
| 315 | 315 | ||
| @@ -520,9 +520,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -520,9 +520,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 520 | continue; | 520 | continue; |
| 521 | Map<String, List<ScheduleRealInfo>> keyMap2 = new HashMap<String, List<ScheduleRealInfo>>(); | 521 | Map<String, List<ScheduleRealInfo>> keyMap2 = new HashMap<String, List<ScheduleRealInfo>>(); |
| 522 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 522 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 523 | - if(companyName.length() == 0 && schedule.getGsName() != null) | 523 | + if(companyName.trim().length() == 0 && schedule.getGsName() != null) |
| 524 | companyName = schedule.getGsName(); | 524 | companyName = schedule.getGsName(); |
| 525 | - if(subCompanyName.length() == 0 && schedule.getFgsName() != null) | 525 | + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null) |
| 526 | subCompanyName = schedule.getFgsName(); | 526 | subCompanyName = schedule.getFgsName(); |
| 527 | String date = schedule.getScheduleDateStr(); | 527 | String date = schedule.getScheduleDateStr(); |
| 528 | if(!keyMap2.containsKey(date)) | 528 | if(!keyMap2.containsKey(date)) |
| @@ -1061,7 +1061,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1061,7 +1061,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1061 | continue; | 1061 | continue; |
| 1062 | } | 1062 | } |
| 1063 | String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" | 1063 | String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" |
| 1064 | - + schedule.getLpName() + "/" + schedule.getFgsName(); | 1064 | + + schedule.getLpName() + "/" + schedule.getFgsBm(); |
| 1065 | if(model.length() != 0){ | 1065 | if(model.length() != 0){ |
| 1066 | if(ttSet.contains(schedule.getSpId())){ | 1066 | if(ttSet.contains(schedule.getSpId())){ |
| 1067 | if(!keyMap.containsKey(key)) | 1067 | if(!keyMap.containsKey(key)) |
| @@ -1099,10 +1099,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1099,10 +1099,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1099 | long jhyssj1 = 0, sjyssj1 = 0; | 1099 | long jhyssj1 = 0, sjyssj1 = 0; |
| 1100 | double jhlc = 0, sjlc = 0; | 1100 | double jhlc = 0, sjlc = 0; |
| 1101 | for(ScheduleRealInfo schedule : list2){ | 1101 | for(ScheduleRealInfo schedule : list2){ |
| 1102 | - if(companyName.length() == 0 && schedule.getGsName() != null){ | 1102 | + if(companyName.trim().length() == 0 && schedule.getGsName() != null){ |
| 1103 | companyName = schedule.getGsName(); | 1103 | companyName = schedule.getGsName(); |
| 1104 | } | 1104 | } |
| 1105 | - if(subCompanyName.length() == 0 && schedule.getFgsName() != null){ | 1105 | + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null){ |
| 1106 | subCompanyName = schedule.getFgsName(); | 1106 | subCompanyName = schedule.getFgsName(); |
| 1107 | } | 1107 | } |
| 1108 | long fcsj = schedule.getFcsjT(); | 1108 | long fcsj = schedule.getFcsjT(); |
| @@ -1887,7 +1887,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1887,7 +1887,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1887 | continue; | 1887 | continue; |
| 1888 | } | 1888 | } |
| 1889 | 1889 | ||
| 1890 | - String key = schedule.getXlName() + "/" + schedule.getFgsName(); | 1890 | + String key = schedule.getXlName() + "/" + schedule.getFgsBm(); |
| 1891 | if(!keyMap.containsKey(key)) | 1891 | if(!keyMap.containsKey(key)) |
| 1892 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | 1892 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 1893 | keyMap.get(key).add(schedule); | 1893 | keyMap.get(key).add(schedule); |
| @@ -1978,9 +1978,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1978,9 +1978,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1978 | qtlc = new BigDecimal("0"); | 1978 | qtlc = new BigDecimal("0"); |
| 1979 | String companyName = "", subCompanyName = ""; | 1979 | String companyName = "", subCompanyName = ""; |
| 1980 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 1980 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 1981 | - if(schedule.getGsName() != null && companyName.length() == 0) | 1981 | + if(schedule.getGsName() != null && companyName.trim().length() == 0) |
| 1982 | companyName = schedule.getGsName(); | 1982 | companyName = schedule.getGsName(); |
| 1983 | - if(schedule.getFgsName() != null && subCompanyName.length() == 0) | 1983 | + if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0) |
| 1984 | subCompanyName = schedule.getFgsName(); | 1984 | subCompanyName = schedule.getFgsName(); |
| 1985 | BigDecimal lc = new BigDecimal("0"); | 1985 | BigDecimal lc = new BigDecimal("0"); |
| 1986 | if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){ | 1986 | if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){ |
| @@ -2071,7 +2071,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2071,7 +2071,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2071 | String[] keys = key.split("/"); | 2071 | String[] keys = key.split("/"); |
| 2072 | tempMap.put("date", Date); | 2072 | tempMap.put("date", Date); |
| 2073 | tempMap.put("company", companyName); | 2073 | tempMap.put("company", companyName); |
| 2074 | - tempMap.put("subCompany", keys[1]); | 2074 | + tempMap.put("subCompany", subCompanyName); |
| 2075 | +// tempMap.put("subCompany", keys[1]); | ||
| 2075 | tempMap.put("times", sfqr == 1 ? times : "全日"); | 2076 | tempMap.put("times", sfqr == 1 ? times : "全日"); |
| 2076 | tempMap.put("line", keys[0]); | 2077 | tempMap.put("line", keys[0]); |
| 2077 | tempMap.put("jhbc", jhbc); | 2078 | tempMap.put("jhbc", jhbc); |
| @@ -2338,17 +2339,23 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2338,17 +2339,23 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2338 | continue; | 2339 | continue; |
| 2339 | } | 2340 | } |
| 2340 | 2341 | ||
| 2341 | - String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlBm(); | 2342 | + String key = schedule.getGsBm() + "/" + schedule.getFgsBm() + "/" + schedule.getXlBm(); |
| 2342 | if(!keyMap.containsKey(key)) | 2343 | if(!keyMap.containsKey(key)) |
| 2343 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | 2344 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 2344 | keyMap.get(key).add(schedule); | 2345 | keyMap.get(key).add(schedule); |
| 2345 | } | 2346 | } |
| 2347 | + | ||
| 2346 | for(String key : keyMap.keySet()){ | 2348 | for(String key : keyMap.keySet()){ |
| 2349 | + String companyName = "", subCompanyName = ""; | ||
| 2347 | Map<String, Object> tempMap = new HashMap<String, Object>(); | 2350 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 2348 | List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); | 2351 | List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); |
| 2349 | int sjbc = 0, sddf = 0, zddf = 0, | 2352 | int sjbc = 0, sddf = 0, zddf = 0, |
| 2350 | dxtz = 0, lbtz = 0; | 2353 | dxtz = 0, lbtz = 0; |
| 2351 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 2354 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 2355 | + if(schedule.getGsName() != null && companyName.trim().length() == 0) | ||
| 2356 | + companyName = schedule.getGsName(); | ||
| 2357 | + if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0) | ||
| 2358 | + subCompanyName = schedule.getFgsName(); | ||
| 2352 | boolean flag = false; | 2359 | boolean flag = false; |
| 2353 | if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null | 2360 | if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null |
| 2354 | && schedule.getStatus() != -1 && !schedule.isCcService()){ | 2361 | && schedule.getStatus() != -1 && !schedule.isCcService()){ |
| @@ -2373,8 +2380,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2373,8 +2380,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2373 | } | 2380 | } |
| 2374 | tempMap.put("date", date); | 2381 | tempMap.put("date", date); |
| 2375 | String[] keys = key.split("/"); | 2382 | String[] keys = key.split("/"); |
| 2376 | - tempMap.put("company", keys[0]); | ||
| 2377 | - tempMap.put("subCompany", keys[1]); | 2383 | + tempMap.put("company", companyName); |
| 2384 | + tempMap.put("subCompany", subCompanyName); | ||
| 2385 | +// tempMap.put("company", keys[0]); | ||
| 2386 | +// tempMap.put("subCompany", keys[1]); | ||
| 2378 | tempMap.put("line", keys[2]); | 2387 | tempMap.put("line", keys[2]); |
| 2379 | tempMap.put("sjbc", sjbc); | 2388 | tempMap.put("sjbc", sjbc); |
| 2380 | tempMap.put("sddf", sddf); | 2389 | tempMap.put("sddf", sddf); |
| @@ -3108,7 +3117,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3108,7 +3117,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3108 | continue; | 3117 | continue; |
| 3109 | } | 3118 | } |
| 3110 | 3119 | ||
| 3111 | - String xl = s.getXlName() + "/" + s.getFgsName(); | 3120 | + String xl = s.getXlName() + "/" + s.getFgsBm(); |
| 3112 | String dateStr = s.getScheduleDateStr(); | 3121 | String dateStr = s.getScheduleDateStr(); |
| 3113 | if(!sches.containsKey(xl)){ | 3122 | if(!sches.containsKey(xl)){ |
| 3114 | sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>()); | 3123 | sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>()); |
| @@ -3138,12 +3147,19 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3138,12 +3147,19 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3138 | List<List<Map<String, Object>>> lists = new ArrayList<List<Map<String, Object>>>(); | 3147 | List<List<Map<String, Object>>> lists = new ArrayList<List<Map<String, Object>>>(); |
| 3139 | Map<Long, ScheduleRealInfo> keyTemp = new HashMap<Long, ScheduleRealInfo>(); | 3148 | Map<Long, ScheduleRealInfo> keyTemp = new HashMap<Long, ScheduleRealInfo>(); |
| 3140 | for(Long time : timeList){ | 3149 | for(Long time : timeList){ |
| 3150 | + String companyName = "", subCompanyName = ""; | ||
| 3141 | List<Long> keyList = new ArrayList<Long>(); | 3151 | List<Long> keyList = new ArrayList<Long>(); |
| 3142 | String date = timeTemp.get(time); | 3152 | String date = timeTemp.get(time); |
| 3143 | List<ScheduleRealInfo> sche2 = sche1.get(date); | 3153 | List<ScheduleRealInfo> sche2 = sche1.get(date); |
| 3144 | for(ScheduleRealInfo s : sche2){ | 3154 | for(ScheduleRealInfo s : sche2){ |
| 3145 | if(s.getFcsj()!=null && s.getFcsj().trim().length() > 0 | 3155 | if(s.getFcsj()!=null && s.getFcsj().trim().length() > 0 |
| 3146 | && s.getFcsj().contains(":")){ | 3156 | && s.getFcsj().contains(":")){ |
| 3157 | + | ||
| 3158 | + if(s.getGsName() != null && companyName.trim().length() == 0) | ||
| 3159 | + companyName = s.getGsName(); | ||
| 3160 | + if(s.getFgsName() != null && subCompanyName.trim().length() == 0) | ||
| 3161 | + subCompanyName = s.getFgsName(); | ||
| 3162 | + | ||
| 3147 | String[] split = s.getFcsj().split(":"); | 3163 | String[] split = s.getFcsj().split(":"); |
| 3148 | Long key = Long.valueOf(s.getXlDir())*1500 + Long.valueOf(split[0])*60 + Long.valueOf(split[1]); | 3164 | Long key = Long.valueOf(s.getXlDir())*1500 + Long.valueOf(split[0])*60 + Long.valueOf(split[1]); |
| 3149 | while(keyTemp.containsKey(key)){ | 3165 | while(keyTemp.containsKey(key)){ |
| @@ -3158,8 +3174,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3158,8 +3174,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3158 | for(Long l : keyList){ | 3174 | for(Long l : keyList){ |
| 3159 | ScheduleRealInfo s = keyTemp.get(l); | 3175 | ScheduleRealInfo s = keyTemp.get(l); |
| 3160 | Map<String, Object> temp = new HashMap<String, Object>(); | 3176 | Map<String, Object> temp = new HashMap<String, Object>(); |
| 3161 | - temp.put("gs", s.getGsName()); | ||
| 3162 | - temp.put("fgs", s.getFgsName()); | 3177 | + temp.put("gs", companyName); |
| 3178 | + temp.put("fgs", subCompanyName); | ||
| 3179 | +// temp.put("gs", s.getGsName()); | ||
| 3180 | +// temp.put("fgs", s.getFgsName()); | ||
| 3163 | temp.put("fgsBm", s.getFgsBm()); | 3181 | temp.put("fgsBm", s.getFgsBm()); |
| 3164 | temp.put("date", date); | 3182 | temp.put("date", date); |
| 3165 | temp.put("xlbm", s.getXlBm()); | 3183 | temp.put("xlbm", s.getXlBm()); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -568,7 +568,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -568,7 +568,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 568 | 568 | ||
| 569 | //公司 和 分公司名称 | 569 | //公司 和 分公司名称 |
| 570 | t.setGsName(BasicData.businessCodeNameMap.get(t.getGsBm())); | 570 | t.setGsName(BasicData.businessCodeNameMap.get(t.getGsBm())); |
| 571 | - t.setFgsName(BasicData.businessFgsCodeNameMap.get(t.getGsBm() + "_" + t.getFgsBm())); | 571 | + t.setFgsName(BasicData.businessFgsCodeNameMap.get(t.getFgsBm()+ "_" + t.getGsBm() )); |
| 572 | 572 | ||
| 573 | //t.setScheduleDateStr(schDate); | 573 | //t.setScheduleDateStr(schDate); |
| 574 | t.setScheduleDate(sdfyyyyMMdd.parse(t.getScheduleDateStr())); | 574 | t.setScheduleDate(sdfyyyyMMdd.parse(t.getScheduleDateStr())); |
src/main/resources/application-dev.properties
| @@ -8,9 +8,10 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | @@ -8,9 +8,10 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| 9 | spring.jpa.show-sql= true | 9 | spring.jpa.show-sql= true |
| 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://127.0.0.1/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 11 | +#spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | +spring.datasource.url= jdbc:mysql://192.168.168.222/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 12 | spring.datasource.username= root | 13 | spring.datasource.username= root |
| 13 | -spring.datasource.password= | 14 | +spring.datasource.password= root |
| 14 | #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 15 | #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 15 | #spring.datasource.username= root | 16 | #spring.datasource.username= root |
| 16 | #spring.datasource.password= root | 17 | #spring.datasource.password= root |
src/main/resources/fatso/package.json
| @@ -11,8 +11,8 @@ | @@ -11,8 +11,8 @@ | ||
| 11 | "dependencies": { | 11 | "dependencies": { |
| 12 | "cheerio": "^0.20.0", | 12 | "cheerio": "^0.20.0", |
| 13 | "clean-css": "^4.0.12", | 13 | "clean-css": "^4.0.12", |
| 14 | - "colors": "^1.1.2", | 14 | + "colors": "^1.3.3", |
| 15 | "eventproxy": "^0.3.4", | 15 | "eventproxy": "^0.3.4", |
| 16 | "uglify-js": "^2.6.2" | 16 | "uglify-js": "^2.6.2" |
| 17 | } | 17 | } |
| 18 | -} | ||
| 19 | \ No newline at end of file | 18 | \ No newline at end of file |
| 19 | +} |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| @@ -77,6 +77,7 @@ | @@ -77,6 +77,7 @@ | ||
| 77 | CSMap = getMaxCarAndStopSpace1(map); | 77 | CSMap = getMaxCarAndStopSpace1(map); |
| 78 | } else if (map.baseRes == '3') { // 主站停站使用v2_2版本 | 78 | } else if (map.baseRes == '3') { // 主站停站使用v2_2版本 |
| 79 | _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中 | 79 | _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中 |
| 80 | + console.log(_paramObj); | ||
| 80 | map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj); | 81 | map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj); |
| 81 | CSMap = getMaxCarAndStopSpace1(map); | 82 | CSMap = getMaxCarAndStopSpace1(map); |
| 82 | } | 83 | } |
| @@ -186,7 +187,7 @@ | @@ -186,7 +187,7 @@ | ||
| 186 | return _rtnBcArray; | 187 | return _rtnBcArray; |
| 187 | }; | 188 | }; |
| 188 | 189 | ||
| 189 | - // Main_v2_2.exportExcelConfig(_dfun); | 190 | + Main_v2_2.exportExcelConfig(_paramObj, _dfun); |
| 190 | } | 191 | } |
| 191 | 192 | ||
| 192 | // 关闭弹出层 | 193 | // 关闭弹出层 |
src/main/resources/static/pages/forms/calc/calcLbStatuAnaly.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 | + .table > tbody + tbody { | ||
| 15 | + border-top: 1px solid; } | ||
| 16 | + #forms > tbody > tr{ | ||
| 17 | + background-color: #FFFFFF; | ||
| 18 | + } | ||
| 19 | +</style> | ||
| 20 | + | ||
| 21 | +<div class="page-head"> | ||
| 22 | + <div class="page-title"> | ||
| 23 | + <h1>烂班情况分析表(统计)</h1> | ||
| 24 | + </div> | ||
| 25 | +</div> | ||
| 26 | + | ||
| 27 | +<div class="row"> | ||
| 28 | + <div class="col-md-12"> | ||
| 29 | + <div class="portlet light porttlet-fit bordered"> | ||
| 30 | + <div class="portlet-title"> | ||
| 31 | + <form id="history" class="form-inline" action=""> | ||
| 32 | + <div style="display: inline-block;margin-left: 5px;"> | ||
| 33 | + <span class="item-label" style="width: 80px;">烂班原因: </span> | ||
| 34 | + <input class="form-control" type="checkbox" id="totalLb" style="width: 20px;" checked="true"/>全选 | ||
| 35 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="0" checked="true"/>路阻 | ||
| 36 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="1" checked="true"/>吊慢 | ||
| 37 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="2" checked="true"/>故障 | ||
| 38 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="3" checked="true"/>纠纷 | ||
| 39 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="4" checked="true"/>肇事 | ||
| 40 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="5" checked="true"/>缺人 | ||
| 41 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="6" checked="true"/>缺车 | ||
| 42 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="7" checked="true"/>客稀 | ||
| 43 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="8" checked="true"/>气候 | ||
| 44 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>援外 | ||
| 45 | + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他 | ||
| 46 | + </div> | ||
| 47 | + <div style="margin-top: 5px"></div> | ||
| 48 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> | ||
| 49 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 50 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | ||
| 51 | + </div> | ||
| 52 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> | ||
| 53 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 54 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | ||
| 55 | + </div> | ||
| 56 | + <div style="display: inline-block; margin-left: 10px;"> | ||
| 57 | + <span class="item-label" style="width: 80px;">选择线路: </span> | ||
| 58 | + <select class="form-control" name="line" id="line" style="width: 150px;"></select> | ||
| 59 | + </div> | ||
| 60 | + <div style="margin-top: 10px"></div> | ||
| 61 | + <div style="display: inline-block; margin-left: 5px"> | ||
| 62 | + <span class="item-label" style="width: 80px;">是否营运: </span> | ||
| 63 | + <select class="form-control" name="sfyy" id="sfyy" style="width: 140px;"> | ||
| 64 | + <option value="0">全部线路</option> | ||
| 65 | + <option value="1" selected="selected">营运线路</option> | ||
| 66 | + <option value="2">非营运线路</option> | ||
| 67 | + </select> | ||
| 68 | + </div> | ||
| 69 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 70 | + <span class="item-label" style="width: 80px;">开始时间: </span> | ||
| 71 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | ||
| 72 | + </div> | ||
| 73 | + <div style="display: inline-block;margin-left: 10px;"> | ||
| 74 | + <span class="item-label" style="width: 80px;">结束时间: </span> | ||
| 75 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | ||
| 76 | + </div> | ||
| 77 | + <div class="form-group" style="margin-left: 10px"> | ||
| 78 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 79 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 80 | + </div> | ||
| 81 | + </form> | ||
| 82 | + </div> | ||
| 83 | + <div class="portlet-body"> | ||
| 84 | + <div class="table-container" id="table" style="margin-top: 0px;overflow:auto;min-width: 906px;"> | ||
| 85 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | ||
| 86 | + <thead> | ||
| 87 | + | ||
| 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 | + $('#export').attr('disabled', "true"); | ||
| 105 | + | ||
| 106 | + // 关闭左侧栏 | ||
| 107 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 108 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 109 | + | ||
| 110 | + | ||
| 111 | + var d = new Date(); | ||
| 112 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 113 | + var year = d.getFullYear(); | ||
| 114 | + var month = d.getMonth() + 1; | ||
| 115 | + var day = d.getDate(); | ||
| 116 | + if(month < 10) | ||
| 117 | + month = "0" + month; | ||
| 118 | + if(day < 10) | ||
| 119 | + day = "0" + day; | ||
| 120 | + var dateTime = year + "-" + month + "-" + day; | ||
| 121 | + $("#startDate").datetimepicker({ | ||
| 122 | + format : 'YYYY-MM-DD', | ||
| 123 | + locale : 'zh-cn', | ||
| 124 | + maxDate : dateTime | ||
| 125 | + }); | ||
| 126 | + $("#endDate").datetimepicker({ | ||
| 127 | + format : 'YYYY-MM-DD', | ||
| 128 | + locale : 'zh-cn', | ||
| 129 | + maxDate : dateTime | ||
| 130 | + }); | ||
| 131 | + $("#startDate").val(dateTime); | ||
| 132 | + $("#endDate").val(dateTime); | ||
| 133 | + | ||
| 134 | + | ||
| 135 | + var fage=false; | ||
| 136 | + var xlList; | ||
| 137 | + var obj = []; | ||
| 138 | + | ||
| 139 | + $.get('/report/lineList',function(result){ | ||
| 140 | + xlList=result; | ||
| 141 | + $.get('/user/companyData', function(result){ | ||
| 142 | + obj = result; | ||
| 143 | + var options = ''; | ||
| 144 | + for(var i = 0; i < obj.length; i++){ | ||
| 145 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + if(obj.length ==0){ | ||
| 149 | + $("#company1").css('display','none'); | ||
| 150 | + }else if(obj.length ==1){ | ||
| 151 | + $("#company1").css('display','none'); | ||
| 152 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 153 | + $('#subCompany1').css('display','none'); | ||
| 154 | + } | ||
| 155 | + $('#company').html(options); | ||
| 156 | + updateCompany(); | ||
| 157 | + }); | ||
| 158 | + }) | ||
| 159 | + $("#company").on("change",updateCompany); | ||
| 160 | + function updateCompany(){ | ||
| 161 | + var company = $('#company').val(); | ||
| 162 | + var options = '<option value="">全部分公司</option>'; | ||
| 163 | + for(var i = 0; i < obj.length; i++){ | ||
| 164 | + if(obj[i].companyCode == company){ | ||
| 165 | + var children = obj[i].children; | ||
| 166 | + for(var j = 0; j < children.length; j++){ | ||
| 167 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + $('#subCompany').html(options); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + var tempData = {}; | ||
| 175 | + $.get('/report/lineList',function(xlList){ | ||
| 176 | + var data = []; | ||
| 177 | + data.push({id: " ", text: "全部线路"}); | ||
| 178 | + $.get('/user/companyData', function(result){ | ||
| 179 | + for(var i = 0; i < result.length; i++){ | ||
| 180 | + var companyCode = result[i].companyCode; | ||
| 181 | + var children = result[i].children; | ||
| 182 | + for(var j = 0; j < children.length; j++){ | ||
| 183 | + var code = children[j].code; | ||
| 184 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 185 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 186 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 187 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 188 | + } | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | + } | ||
| 192 | + initPinYinSelect2('#line',data,''); | ||
| 193 | + | ||
| 194 | + }); | ||
| 195 | + }); | ||
| 196 | + | ||
| 197 | + $("#line").on("change", function(){ | ||
| 198 | + if($("#line").val() == " "){ | ||
| 199 | + $("#company").attr("disabled", false); | ||
| 200 | + $("#subCompany").attr("disabled", false); | ||
| 201 | + } else { | ||
| 202 | + var temp = tempData[$("#line").val()].split(":"); | ||
| 203 | + $("#company").val(temp[0]); | ||
| 204 | + updateCompany(); | ||
| 205 | +// $("#subCompany").val(temp[1]); | ||
| 206 | + $("#subCompany").val(""); | ||
| 207 | + $("#company").attr("disabled", true); | ||
| 208 | +// $("#subCompany").attr("disabled", true); | ||
| 209 | + } | ||
| 210 | + }); | ||
| 211 | + | ||
| 212 | + var lb = 0; //标志是否有选择至少一个烂班类型 | ||
| 213 | + $("#totalLb").on("change", function(){ | ||
| 214 | + var reason = $("input[name='reason']"); | ||
| 215 | + var checked = this.checked; | ||
| 216 | + $.each(reason, function(i, g){ | ||
| 217 | + g.checked = checked; | ||
| 218 | + }); | ||
| 219 | + if(checked == true) | ||
| 220 | + lb = 33; | ||
| 221 | + else | ||
| 222 | + lb = 0; | ||
| 223 | + }); | ||
| 224 | + | ||
| 225 | + $("input[name='reason']").on("change", function(){ | ||
| 226 | + var totalLb = $("#totalLb")[0]; | ||
| 227 | + totalLb.checked = true; | ||
| 228 | + lb = 0; | ||
| 229 | + $.each($("input[name='reason']"), function(i, g){ | ||
| 230 | + if(g.checked == false){ | ||
| 231 | + totalLb.checked = false; | ||
| 232 | + }else{ | ||
| 233 | + lb += 3; | ||
| 234 | + } | ||
| 235 | + }); | ||
| 236 | + }); | ||
| 237 | + | ||
| 238 | + $("#query").on("click",jsDoQuery); | ||
| 239 | + | ||
| 240 | + var sfyy = 1; | ||
| 241 | + var line = $("#line").val(); | ||
| 242 | + var startDate = $("#startDate").val(); | ||
| 243 | + var endDate = $("#endDate").val(); | ||
| 244 | + var company = $("#company").val(); | ||
| 245 | + var subCompany = $("#subCompany").val(); | ||
| 246 | + var lineName = $('#line option:selected').text(); | ||
| 247 | + function jsDoQuery(pagination){ | ||
| 248 | + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ | ||
| 249 | + layer.msg("请选择日期"); | ||
| 250 | + return; | ||
| 251 | + } | ||
| 252 | + var reason = $("input[name='reason']"); | ||
| 253 | + var params = {}; | ||
| 254 | + if(line == " ") | ||
| 255 | + line = ""; | ||
| 256 | +// line = $("#line").val(); | ||
| 257 | + sfyy = $("#sfyy").val(); | ||
| 258 | + startDate = $("#startDate").val(); | ||
| 259 | + endDate = $("#endDate").val(); | ||
| 260 | + company = $("#company").val(); | ||
| 261 | + subCompany = $("#subCompany").val(); | ||
| 262 | + params['line'] = line; | ||
| 263 | + params['sfyy'] = sfyy; | ||
| 264 | + params['startDate'] = startDate; | ||
| 265 | + params['endDate'] = endDate; | ||
| 266 | + params['company'] = company; | ||
| 267 | + params['subCompany'] = subCompany; | ||
| 268 | + params['type'] = "query"; | ||
| 269 | + lineName = $('#line option:selected').text(); | ||
| 270 | + if(lineName == "全部线路") | ||
| 271 | + lineName = $('#subCompany option:selected').text(); | ||
| 272 | + var i = layer.load(2); | ||
| 273 | +// $(".hidden").removeClass("hidden"); | ||
| 274 | + $get('/calcLbStatuAnaly/lbStatuAnaly', params, function(result){ | ||
| 275 | + // 把数据填充到模版中 | ||
| 276 | + var tbodyHtml = template('list_lbAnaly',{list:result, reason:reason, lb:lb}); | ||
| 277 | + // 把渲染好的模版html文本追加到表格中 | ||
| 278 | + $('#forms').html(tbodyHtml); | ||
| 279 | + layer.close(i); | ||
| 280 | + | ||
| 281 | + _w_table_rowspan("#forms", 1); | ||
| 282 | + _w_table_rowspan("#forms", 2); | ||
| 283 | + _w_table_rowspan("#forms", 3); | ||
| 284 | + _w_table_rowspan("#forms", 4); | ||
| 285 | +// _w_table_rowspan("#forms", 5); | ||
| 286 | + | ||
| 287 | + if(result.length == 0) | ||
| 288 | + $('#export').attr('disabled', "true"); | ||
| 289 | + else | ||
| 290 | + $("#export").removeAttr("disabled"); | ||
| 291 | + | ||
| 292 | + if($("#forms").height()+70 > $(window).height()-110){ | ||
| 293 | + $("#table").height($(window).height()-110); | ||
| 294 | + } else { | ||
| 295 | + $("#table").height($("#forms").height()+70); | ||
| 296 | + } | ||
| 297 | + }); | ||
| 298 | + } | ||
| 299 | + | ||
| 300 | + $("#export").on("click", function(){ | ||
| 301 | + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ | ||
| 302 | + layer.msg("请选择日期"); | ||
| 303 | + return; | ||
| 304 | + } | ||
| 305 | + var params = {}; | ||
| 306 | + params['line'] = line; | ||
| 307 | + params['sfyy'] = sfyy; | ||
| 308 | + params['startDate'] = startDate; | ||
| 309 | + params['endDate'] = endDate; | ||
| 310 | + params['company'] = company; | ||
| 311 | + params['subCompany'] = subCompany; | ||
| 312 | + params['type'] = "export"; | ||
| 313 | + params['lineName'] = lineName; | ||
| 314 | + var i = layer.load(2); | ||
| 315 | + $get('/calc_export/lbStatuAnalyExport', params, function(result){ | ||
| 316 | + var dd = ""; | ||
| 317 | + if(startDate == endDate){ | ||
| 318 | + dd = moment(startDate).format("YYYYMMDD"); | ||
| 319 | + } else { | ||
| 320 | + dd = moment(startDate).format("YYYYMMDD") | ||
| 321 | + +"-"+moment(endDate).format("YYYYMMDD"); | ||
| 322 | + } | ||
| 323 | + window.open("/downloadFile/download?fileName=" | ||
| 324 | + +dd+"-"+lineName+"-烂班情况分析表(统计)"); | ||
| 325 | + layer.close(i); | ||
| 326 | + }); | ||
| 327 | + }); | ||
| 328 | + | ||
| 329 | + | ||
| 330 | + $("#line").on("change", function(){ | ||
| 331 | + line = $("#line").val(); | ||
| 332 | + if(line == " ") | ||
| 333 | + line = ""; | ||
| 334 | + }); | ||
| 335 | + $('#startDate').on("blur", function(){ | ||
| 336 | + startDate = $("#startDate").val(); | ||
| 337 | + endDate = $("#endDate").val(); | ||
| 338 | + }); | ||
| 339 | + $('#endDate').on("blur", function(){ | ||
| 340 | + startDate = $("#startDate").val(); | ||
| 341 | + endDate = $("#endDate").val(); | ||
| 342 | + }); | ||
| 343 | + | ||
| 344 | + | ||
| 345 | + /** | ||
| 346 | + * 将模块List 转换为树结构 | ||
| 347 | + * @param arr | ||
| 348 | + * @returns {Array} | ||
| 349 | + */ | ||
| 350 | + function createTreeData(arr){ | ||
| 351 | + var treeData = []; | ||
| 352 | + var len = arr.length; | ||
| 353 | + for(var i = 0; i < len; i ++){ | ||
| 354 | + var pId = arr[i].pId; | ||
| 355 | + arr[i].text = arr[i].name; | ||
| 356 | + if(!pId){ | ||
| 357 | + treeData.push(arr[i]); | ||
| 358 | + } | ||
| 359 | + | ||
| 360 | + for(var j = 0; j < len; j ++){ | ||
| 361 | + if(pId == arr[j].id){ | ||
| 362 | + if(!arr[j].children) | ||
| 363 | + arr[j].children = []; | ||
| 364 | + arr[j].children.push(arr[i]); | ||
| 365 | + break; | ||
| 366 | + } | ||
| 367 | + } | ||
| 368 | + } | ||
| 369 | + return treeData; | ||
| 370 | + } | ||
| 371 | + | ||
| 372 | + function _w_table_rowspan(_w_table_id, _w_table_colnum){ | ||
| 373 | + _w_table_firsttd = ""; | ||
| 374 | + _w_table_currenttd = ""; | ||
| 375 | + _w_table_SpanNum = 0; | ||
| 376 | + _w_table_Obj = jQuery(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")"); | ||
| 377 | + _w_table_Obj.each(function(i){ | ||
| 378 | + if(i==0){ | ||
| 379 | + _w_table_firsttd = jQuery(this); | ||
| 380 | + _w_table_SpanNum = 1; | ||
| 381 | + }else{ | ||
| 382 | + _w_table_currenttd = jQuery(this); | ||
| 383 | + if(_w_table_firsttd.text()==_w_table_currenttd.text()){ | ||
| 384 | + _w_table_SpanNum++; | ||
| 385 | + _w_table_currenttd.hide(); //remove(); | ||
| 386 | + _w_table_firsttd.attr("rowSpan",_w_table_SpanNum); | ||
| 387 | + }else{ | ||
| 388 | + _w_table_firsttd = jQuery(this); | ||
| 389 | + _w_table_SpanNum = 1; | ||
| 390 | + } | ||
| 391 | + } | ||
| 392 | + }); | ||
| 393 | + } | ||
| 394 | + | ||
| 395 | + | ||
| 396 | + }); | ||
| 397 | + | ||
| 398 | +</script> | ||
| 399 | +<script type="text/html" id="list_lbAnaly"> | ||
| 400 | +<thead> | ||
| 401 | + <tr> | ||
| 402 | + <th class="hidden"></th> | ||
| 403 | + <th rowspan="3" style=" width:120px;">日期</th> | ||
| 404 | + <th rowspan="3">公司</th> | ||
| 405 | + <th rowspan="3">分公司</th> | ||
| 406 | + <th rowspan="3">线路</th> | ||
| 407 | + <th rowspan="2" colspan="3">总班次</th> | ||
| 408 | + <th rowspan="2" colspan="3">总营运公里</th> | ||
| 409 | + {{if lb != 0}} | ||
| 410 | + <th colspan={{lb}}>烂班原因</th> | ||
| 411 | + {{/if}} | ||
| 412 | + </tr> | ||
| 413 | + <tr> | ||
| 414 | + <th class="hidden"></th> | ||
| 415 | + {{if reason[0].checked == true}}<th colspan="3">路阻</th>{{/if}} | ||
| 416 | + {{if reason[1].checked == true}}<th colspan="3">吊慢</th>{{/if}} | ||
| 417 | + {{if reason[2].checked == true}}<th colspan="3">故障</th>{{/if}} | ||
| 418 | + {{if reason[3].checked == true}}<th colspan="3">纠纷</th>{{/if}} | ||
| 419 | + {{if reason[4].checked == true}}<th colspan="3">肇事</th>{{/if}} | ||
| 420 | + {{if reason[5].checked == true}}<th colspan="3">缺人</th>{{/if}} | ||
| 421 | + {{if reason[6].checked == true}}<th colspan="3">缺车</th>{{/if}} | ||
| 422 | + {{if reason[7].checked == true}}<th colspan="3">客稀</th>{{/if}} | ||
| 423 | + {{if reason[8].checked == true}}<th colspan="3">气候</th>{{/if}} | ||
| 424 | + {{if reason[9].checked == true}}<th colspan="3">援外</th>{{/if}} | ||
| 425 | + {{if reason[10].checked == true}}<th colspan="3">其他</th>{{/if}} | ||
| 426 | + </tr> | ||
| 427 | + <tr> | ||
| 428 | + <th class="hidden"></th> | ||
| 429 | + <th>计划</th><th>实际</th><th>百分比</th> | ||
| 430 | + <th>计划</th><th>实际</th><th>百分比</th> | ||
| 431 | + {{if reason[0].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 432 | + {{if reason[1].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 433 | + {{if reason[2].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 434 | + {{if reason[3].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 435 | + {{if reason[4].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 436 | + {{if reason[5].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 437 | + {{if reason[6].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 438 | + {{if reason[7].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 439 | + {{if reason[8].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 440 | + {{if reason[9].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 441 | + {{if reason[10].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}} | ||
| 442 | + </tr> | ||
| 443 | +</thead> | ||
| 444 | +<tbody> | ||
| 445 | + {{each list as obj i}} | ||
| 446 | + <tr> | ||
| 447 | + {{if obj.line!='合计'}} | ||
| 448 | + <td>{{obj.date}}</td> | ||
| 449 | + <td>{{obj.company}}</td> | ||
| 450 | + <td>{{obj.subCompany}}</td> | ||
| 451 | + <td>{{obj.line}}</td> | ||
| 452 | + {{/if}} | ||
| 453 | + {{if obj.line=='合计'}} | ||
| 454 | + <td colspan="4">{{obj.line}}</td> | ||
| 455 | + {{/if}} | ||
| 456 | + <td>{{obj.jhbc}}</td><td>{{obj.sjbc}}</td><td>{{obj.bcbfb}}</td> | ||
| 457 | + <td>{{obj.jhlc}}</td><td>{{obj.sjlc}}</td><td>{{obj.lcbfb}}</td> | ||
| 458 | + {{if reason[0].checked==true}}<td>{{obj.lzbc}}</td><td>{{obj.lzlc}}</td><td>{{obj.lzbfb}}</td>{{/if}} | ||
| 459 | + {{if reason[1].checked==true}}<td>{{obj.dmbc}}</td><td>{{obj.dmlc}}</td><td>{{obj.dmbfb}}</td>{{/if}} | ||
| 460 | + {{if reason[2].checked==true}}<td>{{obj.gzbc}}</td><td>{{obj.gzlc}}</td><td>{{obj.gzbfb}}</td>{{/if}} | ||
| 461 | + {{if reason[3].checked==true}}<td>{{obj.jfbc}}</td><td>{{obj.jflc}}</td><td>{{obj.jfbfb}}</td>{{/if}} | ||
| 462 | + {{if reason[4].checked==true}}<td>{{obj.zsbc}}</td><td>{{obj.zslc}}</td><td>{{obj.zsbfb}}</td>{{/if}} | ||
| 463 | + {{if reason[5].checked==true}}<td>{{obj.qrbc}}</td><td>{{obj.qrlc}}</td><td>{{obj.qrbfb}}</td>{{/if}} | ||
| 464 | + {{if reason[6].checked==true}}<td>{{obj.qcbc}}</td><td>{{obj.qclc}}</td><td>{{obj.qcbfb}}</td>{{/if}} | ||
| 465 | + {{if reason[7].checked==true}}<td>{{obj.kxbc}}</td><td>{{obj.kxlc}}</td><td>{{obj.kxbfb}}</td>{{/if}} | ||
| 466 | + {{if reason[8].checked==true}}<td>{{obj.qhbc}}</td><td>{{obj.qhlc}}</td><td>{{obj.qhbfb}}</td>{{/if}} | ||
| 467 | + {{if reason[9].checked==true}}<td>{{obj.ywbc}}</td><td>{{obj.ywlc}}</td><td>{{obj.ywbfb}}</td>{{/if}} | ||
| 468 | + {{if reason[10].checked==true}}<td>{{obj.qtbc}}</td><td>{{obj.qtlc}}</td><td>{{obj.qtbfb}}</td>{{/if}} | ||
| 469 | + </tr> | ||
| 470 | + {{/each}} | ||
| 471 | + {{if list.length == 0}} | ||
| 472 | + <tr> | ||
| 473 | + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> | ||
| 474 | + </tr> | ||
| 475 | + {{/if}} | ||
| 476 | +</tbody> | ||
| 477 | +</script> | ||
| 0 | \ No newline at end of file | 478 | \ No newline at end of file |
src/main/resources/static/pages/forms/calc/calcjsyspy.html
| @@ -89,7 +89,6 @@ | @@ -89,7 +89,6 @@ | ||
| 89 | <th>实际空驶里程</th> | 89 | <th>实际空驶里程</th> |
| 90 | <th>烂班里程</th> | 90 | <th>烂班里程</th> |
| 91 | <th>临加营运里程</th> | 91 | <th>临加营运里程</th> |
| 92 | - <th>临加空驶里程</th> | ||
| 93 | </tr> | 92 | </tr> |
| 94 | </thead> | 93 | </thead> |
| 95 | <tbody> | 94 | <tbody> |
| @@ -302,7 +301,6 @@ | @@ -302,7 +301,6 @@ | ||
| 302 | <td>{{obj.sjfyylc}}</td> | 301 | <td>{{obj.sjfyylc}}</td> |
| 303 | <td>{{obj.lblc}}</td> | 302 | <td>{{obj.lblc}}</td> |
| 304 | <td>{{obj.ljyylc}}</td> | 303 | <td>{{obj.ljyylc}}</td> |
| 305 | - <td>{{obj.ljfyylc}}</td> | ||
| 306 | </tr> | 304 | </tr> |
| 307 | {{/each}} | 305 | {{/each}} |
| 308 | {{if list.length == 0}} | 306 | {{if list.length == 0}} |
src/main/resources/static/pages/forms/calc/calcsingledata.html
| @@ -186,10 +186,10 @@ | @@ -186,10 +186,10 @@ | ||
| 186 | var temp = tempData[$("#line").val()].split(":"); | 186 | var temp = tempData[$("#line").val()].split(":"); |
| 187 | $("#gsdmSing").val(temp[0]); | 187 | $("#gsdmSing").val(temp[0]); |
| 188 | updateCompany(); | 188 | updateCompany(); |
| 189 | -// $("#fgsdmSing").val(temp[1]); | ||
| 190 | - $("#fgsdmSing").val(""); | 189 | + $("#fgsdmSing").val(temp[1]); |
| 190 | +// $("#fgsdmSing").val(""); | ||
| 191 | $("#gsdmSing").attr("disabled", true); | 191 | $("#gsdmSing").attr("disabled", true); |
| 192 | -// $("#fgsdmSing").attr("disabled", true); | 192 | + $("#fgsdmSing").attr("disabled", true); |
| 193 | } | 193 | } |
| 194 | }); | 194 | }); |
| 195 | 195 |
src/main/resources/static/pages/forms/mould/calcLbStatuAnaly.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/calcjsyspy.xls
No preview for this file type
src/main/resources/static/pages/permission/user/authorize.html
| @@ -312,8 +312,6 @@ | @@ -312,8 +312,6 @@ | ||
| 312 | <form> | 312 | <form> |
| 313 | <div class="uk-margin"> | 313 | <div class="uk-margin"> |
| 314 | <div class="uk-inline" > | 314 | <div class="uk-inline" > |
| 315 | - <!--<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>--> | ||
| 316 | - <!--<input class="uk-input role_search_input" type="text" placeholder="搜索角色">--> | ||
| 317 | </div> | 315 | </div> |
| 318 | </div> | 316 | </div> |
| 319 | </form> | 317 | </form> |
| @@ -329,8 +327,6 @@ | @@ -329,8 +327,6 @@ | ||
| 329 | <form> | 327 | <form> |
| 330 | <div class="uk-margin"> | 328 | <div class="uk-margin"> |
| 331 | <div class="uk-inline" > | 329 | <div class="uk-inline" > |
| 332 | - <!--<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>--> | ||
| 333 | - <!--<input class="uk-input user_search_input" type="text" placeholder="搜索用户">--> | ||
| 334 | </div> | 330 | </div> |
| 335 | </div> | 331 | </div> |
| 336 | </form> | 332 | </form> |
| @@ -349,16 +345,16 @@ | @@ -349,16 +345,16 @@ | ||
| 349 | </div> | 345 | </div> |
| 350 | </div> | 346 | </div> |
| 351 | 347 | ||
| 352 | -<script id="authorize-role-list-temp" type="text/html"> | 348 | +<script id="authorize-role-list-temp1" type="text/html"> |
| 353 | {{each list as r i}} | 349 | {{each list as r i}} |
| 354 | - <li data-id="{{r.id}}" data-name="{{r.roleName}}" data-code="{{r.codeUp}}">{{r.roleName}} | ||
| 355 | - <span class="role-code">{{r.codeName}}</span> | ||
| 356 | - <div class="ct_li_desc">{{r.createDateStr}}</div> | ||
| 357 | - <span class="uk-badge">{{r.count}}</span> | ||
| 358 | - </li> | 350 | + <li data-id="{{r.id}}" data-name="{{r.roleName}}" data-code="{{r.codeUp}}">{{r.roleName}} |
| 351 | + <span class="role-code">{{r.codeName}}</span> | ||
| 352 | + <div class="ct_li_desc">{{r.createDateStr}}</div> | ||
| 353 | + <span class="uk-badge">{{r.count}}</span> | ||
| 354 | + </li> | ||
| 359 | {{/each}} | 355 | {{/each}} |
| 360 | </script> | 356 | </script> |
| 361 | -<script id="authorize-user-list-temp" type="text/html"> | 357 | +<script id="authorize-user-list-temp1" type="text/html"> |
| 362 | {{each list as u i}} | 358 | {{each list as u i}} |
| 363 | <li class="uk-animation-fade uk-animation-fast" data-name="{{u.name}}" data-code="{{u.userNameUp}}" data-id="{{u.id}}">{{u.name}}<span class="role-code">{{u.userName}}</span></li> | 359 | <li class="uk-animation-fade uk-animation-fast" data-name="{{u.name}}" data-code="{{u.userNameUp}}" data-id="{{u.id}}">{{u.name}}<span class="role-code">{{u.userName}}</span></li> |
| 364 | {{/each}} | 360 | {{/each}} |
| @@ -481,9 +477,9 @@ | @@ -481,9 +477,9 @@ | ||
| 481 | var userA={}; | 477 | var userA={}; |
| 482 | for(var i=0,u;u=rs[i++];){ | 478 | for(var i=0,u;u=rs[i++];){ |
| 483 | if (u.id==userId){ | 479 | if (u.id==userId){ |
| 484 | - discard_field(u); | ||
| 485 | - u.userNameUp=u.userName.toUpperCase(); | ||
| 486 | - u.lastLoginDateStr=moment(u.lastLoginDate).format('YYYY-MM-DD HH:ss'); | 480 | + discard_field(u); |
| 481 | + u.userNameUp=u.userName.toUpperCase(); | ||
| 482 | + u.lastLoginDateStr=moment(u.lastLoginDate).format('YYYY-MM-DD HH:ss'); | ||
| 487 | userA[0]=u; | 483 | userA[0]=u; |
| 488 | } | 484 | } |
| 489 | } | 485 | } |
| @@ -514,14 +510,14 @@ | @@ -514,14 +510,14 @@ | ||
| 514 | } | 510 | } |
| 515 | 511 | ||
| 516 | function render_role_list(list) { | 512 | function render_role_list(list) { |
| 517 | - var htmlStr = template('authorize-role-list-temp', {list: list}); | 513 | + var htmlStr = template('authorize-role-list-temp1', {list: list}); |
| 518 | $('ul.role-list').html(htmlStr); | 514 | $('ul.role-list').html(htmlStr); |
| 519 | up_scroll(); | 515 | up_scroll(); |
| 520 | } | 516 | } |
| 521 | 517 | ||
| 522 | 518 | ||
| 523 | function render_user_list(list) { | 519 | function render_user_list(list) { |
| 524 | - var htmlStr = template('authorize-user-list-temp', {list: list}); | 520 | + var htmlStr = template('authorize-user-list-temp1', {list: list}); |
| 525 | $('ul.user-list').html(htmlStr); | 521 | $('ul.user-list').html(htmlStr); |
| 526 | up_scroll(); | 522 | up_scroll(); |
| 527 | } | 523 | } |
| @@ -604,7 +600,7 @@ | @@ -604,7 +600,7 @@ | ||
| 604 | 600 | ||
| 605 | var groupBy = function (list, field) { | 601 | var groupBy = function (list, field) { |
| 606 | var rs = {}, | 602 | var rs = {}, |
| 607 | - key; | 603 | + key; |
| 608 | $.each(list, function () { | 604 | $.each(list, function () { |
| 609 | key = this[field]; | 605 | key = this[field]; |
| 610 | if (!rs[key]) | 606 | if (!rs[key]) |
src/main/resources/static/pages/report/inoutstation/js/Blob.js
| 1 | -/* Blob.js | ||
| 2 | - * A Blob implementation. | ||
| 3 | - * 2014-07-24 | ||
| 4 | - * | ||
| 5 | - * By Eli Grey, http://eligrey.com | ||
| 6 | - * By Devin Samarin, https://github.com/dsamarin | ||
| 7 | - * License: X11/MIT | ||
| 8 | - * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md | ||
| 9 | - */ | ||
| 10 | - | ||
| 11 | -/*global self, unescape */ | ||
| 12 | -/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, | ||
| 13 | - plusplus: true */ | ||
| 14 | - | ||
| 15 | -/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */ | ||
| 16 | - | ||
| 17 | -(function (view) { | ||
| 18 | - "use strict"; | ||
| 19 | - | ||
| 20 | - view.URL = view.URL || view.webkitURL; | ||
| 21 | - | ||
| 22 | - if (view.Blob && view.URL) { | ||
| 23 | - try { | ||
| 24 | - new Blob; | ||
| 25 | - return; | ||
| 26 | - } catch (e) {} | ||
| 27 | - } | ||
| 28 | - | ||
| 29 | - // Internally we use a BlobBuilder implementation to base Blob off of | ||
| 30 | - // in order to support older browsers that only have BlobBuilder | ||
| 31 | - var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) { | ||
| 32 | - var | ||
| 33 | - get_class = function(object) { | ||
| 34 | - return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1]; | ||
| 35 | - } | ||
| 36 | - , FakeBlobBuilder = function BlobBuilder() { | ||
| 37 | - this.data = []; | ||
| 38 | - } | ||
| 39 | - , FakeBlob = function Blob(data, type, encoding) { | ||
| 40 | - this.data = data; | ||
| 41 | - this.size = data.length; | ||
| 42 | - this.type = type; | ||
| 43 | - this.encoding = encoding; | ||
| 44 | - } | ||
| 45 | - , FBB_proto = FakeBlobBuilder.prototype | ||
| 46 | - , FB_proto = FakeBlob.prototype | ||
| 47 | - , FileReaderSync = view.FileReaderSync | ||
| 48 | - , FileException = function(type) { | ||
| 49 | - this.code = this[this.name = type]; | ||
| 50 | - } | ||
| 51 | - , file_ex_codes = ( | ||
| 52 | - "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " | ||
| 53 | - + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR" | ||
| 54 | - ).split(" ") | ||
| 55 | - , file_ex_code = file_ex_codes.length | ||
| 56 | - , real_URL = view.URL || view.webkitURL || view | ||
| 57 | - , real_create_object_URL = real_URL.createObjectURL | ||
| 58 | - , real_revoke_object_URL = real_URL.revokeObjectURL | ||
| 59 | - , URL = real_URL | ||
| 60 | - , btoa = view.btoa | ||
| 61 | - , atob = view.atob | ||
| 62 | - | ||
| 63 | - , ArrayBuffer = view.ArrayBuffer | ||
| 64 | - , Uint8Array = view.Uint8Array | ||
| 65 | - | ||
| 66 | - , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/ | ||
| 67 | - ; | ||
| 68 | - FakeBlob.fake = FB_proto.fake = true; | ||
| 69 | - while (file_ex_code--) { | ||
| 70 | - FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1; | ||
| 71 | - } | ||
| 72 | - // Polyfill URL | ||
| 73 | - if (!real_URL.createObjectURL) { | ||
| 74 | - URL = view.URL = function(uri) { | ||
| 75 | - var | ||
| 76 | - uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a") | ||
| 77 | - , uri_origin | ||
| 78 | - ; | ||
| 79 | - uri_info.href = uri; | ||
| 80 | - if (!("origin" in uri_info)) { | ||
| 81 | - if (uri_info.protocol.toLowerCase() === "data:") { | ||
| 82 | - uri_info.origin = null; | ||
| 83 | - } else { | ||
| 84 | - uri_origin = uri.match(origin); | ||
| 85 | - uri_info.origin = uri_origin && uri_origin[1]; | ||
| 86 | - } | ||
| 87 | - } | ||
| 88 | - return uri_info; | ||
| 89 | - }; | ||
| 90 | - } | ||
| 91 | - URL.createObjectURL = function(blob) { | ||
| 92 | - var | ||
| 93 | - type = blob.type | ||
| 94 | - , data_URI_header | ||
| 95 | - ; | ||
| 96 | - if (type === null) { | ||
| 97 | - type = "application/octet-stream"; | ||
| 98 | - } | ||
| 99 | - if (blob instanceof FakeBlob) { | ||
| 100 | - data_URI_header = "data:" + type; | ||
| 101 | - if (blob.encoding === "base64") { | ||
| 102 | - return data_URI_header + ";base64," + blob.data; | ||
| 103 | - } else if (blob.encoding === "URI") { | ||
| 104 | - return data_URI_header + "," + decodeURIComponent(blob.data); | ||
| 105 | - } if (btoa) { | ||
| 106 | - return data_URI_header + ";base64," + btoa(blob.data); | ||
| 107 | - } else { | ||
| 108 | - return data_URI_header + "," + encodeURIComponent(blob.data); | ||
| 109 | - } | ||
| 110 | - } else if (real_create_object_URL) { | ||
| 111 | - return real_create_object_URL.call(real_URL, blob); | ||
| 112 | - } | ||
| 113 | - }; | ||
| 114 | - URL.revokeObjectURL = function(object_URL) { | ||
| 115 | - if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) { | ||
| 116 | - real_revoke_object_URL.call(real_URL, object_URL); | ||
| 117 | - } | ||
| 118 | - }; | ||
| 119 | - FBB_proto.append = function(data/*, endings*/) { | ||
| 120 | - var bb = this.data; | ||
| 121 | - // decode data to a binary string | ||
| 122 | - if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) { | ||
| 123 | - var | ||
| 124 | - str = "" | ||
| 125 | - , buf = new Uint8Array(data) | ||
| 126 | - , i = 0 | ||
| 127 | - , buf_len = buf.length | ||
| 128 | - ; | ||
| 129 | - for (; i < buf_len; i++) { | ||
| 130 | - str += String.fromCharCode(buf[i]); | ||
| 131 | - } | ||
| 132 | - bb.push(str); | ||
| 133 | - } else if (get_class(data) === "Blob" || get_class(data) === "File") { | ||
| 134 | - if (FileReaderSync) { | ||
| 135 | - var fr = new FileReaderSync; | ||
| 136 | - bb.push(fr.readAsBinaryString(data)); | ||
| 137 | - } else { | ||
| 138 | - // async FileReader won't work as BlobBuilder is sync | ||
| 139 | - throw new FileException("NOT_READABLE_ERR"); | ||
| 140 | - } | ||
| 141 | - } else if (data instanceof FakeBlob) { | ||
| 142 | - if (data.encoding === "base64" && atob) { | ||
| 143 | - bb.push(atob(data.data)); | ||
| 144 | - } else if (data.encoding === "URI") { | ||
| 145 | - bb.push(decodeURIComponent(data.data)); | ||
| 146 | - } else if (data.encoding === "raw") { | ||
| 147 | - bb.push(data.data); | ||
| 148 | - } | ||
| 149 | - } else { | ||
| 150 | - if (typeof data !== "string") { | ||
| 151 | - data += ""; // convert unsupported types to strings | ||
| 152 | - } | ||
| 153 | - // decode UTF-16 to binary string | ||
| 154 | - bb.push(unescape(encodeURIComponent(data))); | ||
| 155 | - } | ||
| 156 | - }; | ||
| 157 | - FBB_proto.getBlob = function(type) { | ||
| 158 | - if (!arguments.length) { | ||
| 159 | - type = null; | ||
| 160 | - } | ||
| 161 | - return new FakeBlob(this.data.join(""), type, "raw"); | ||
| 162 | - }; | ||
| 163 | - FBB_proto.toString = function() { | ||
| 164 | - return "[object BlobBuilder]"; | ||
| 165 | - }; | ||
| 166 | - FB_proto.slice = function(start, end, type) { | ||
| 167 | - var args = arguments.length; | ||
| 168 | - if (args < 3) { | ||
| 169 | - type = null; | ||
| 170 | - } | ||
| 171 | - return new FakeBlob( | ||
| 172 | - this.data.slice(start, args > 1 ? end : this.data.length) | ||
| 173 | - , type | ||
| 174 | - , this.encoding | ||
| 175 | - ); | ||
| 176 | - }; | ||
| 177 | - FB_proto.toString = function() { | ||
| 178 | - return "[object Blob]"; | ||
| 179 | - }; | ||
| 180 | - FB_proto.close = function() { | ||
| 181 | - this.size = 0; | ||
| 182 | - delete this.data; | ||
| 183 | - }; | ||
| 184 | - return FakeBlobBuilder; | ||
| 185 | - }(view)); | ||
| 186 | - | ||
| 187 | - view.Blob = function(blobParts, options) { | ||
| 188 | - var type = options ? (options.type || "") : ""; | ||
| 189 | - var builder = new BlobBuilder(); | ||
| 190 | - if (blobParts) { | ||
| 191 | - for (var i = 0, len = blobParts.length; i < len; i++) { | ||
| 192 | - builder.append(blobParts[i]); | ||
| 193 | - } | ||
| 194 | - } | ||
| 195 | - return builder.getBlob(type); | ||
| 196 | - }; | ||
| 197 | -}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this)); | 1 | +/* Blob.js |
| 2 | + * A Blob implementation. | ||
| 3 | + * 2014-07-24 | ||
| 4 | + * | ||
| 5 | + * By Eli Grey, http://eligrey.com | ||
| 6 | + * By Devin Samarin, https://github.com/dsamarin | ||
| 7 | + * License: X11/MIT | ||
| 8 | + * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md | ||
| 9 | + */ | ||
| 10 | + | ||
| 11 | +/*global self, unescape */ | ||
| 12 | +/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, | ||
| 13 | + plusplus: true */ | ||
| 14 | + | ||
| 15 | +/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */ | ||
| 16 | + | ||
| 17 | +(function (view) { | ||
| 18 | + "use strict"; | ||
| 19 | + | ||
| 20 | + view.URL = view.URL || view.webkitURL; | ||
| 21 | + | ||
| 22 | + if (view.Blob && view.URL) { | ||
| 23 | + try { | ||
| 24 | + new Blob; | ||
| 25 | + return; | ||
| 26 | + } catch (e) {} | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + // Internally we use a BlobBuilder implementation to base Blob off of | ||
| 30 | + // in order to support older browsers that only have BlobBuilder | ||
| 31 | + var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) { | ||
| 32 | + var | ||
| 33 | + get_class = function(object) { | ||
| 34 | + return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1]; | ||
| 35 | + } | ||
| 36 | + , FakeBlobBuilder = function BlobBuilder() { | ||
| 37 | + this.data = []; | ||
| 38 | + } | ||
| 39 | + , FakeBlob = function Blob(data, type, encoding) { | ||
| 40 | + this.data = data; | ||
| 41 | + this.size = data.length; | ||
| 42 | + this.type = type; | ||
| 43 | + this.encoding = encoding; | ||
| 44 | + } | ||
| 45 | + , FBB_proto = FakeBlobBuilder.prototype | ||
| 46 | + , FB_proto = FakeBlob.prototype | ||
| 47 | + , FileReaderSync = view.FileReaderSync | ||
| 48 | + , FileException = function(type) { | ||
| 49 | + this.code = this[this.name = type]; | ||
| 50 | + } | ||
| 51 | + , file_ex_codes = ( | ||
| 52 | + "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " | ||
| 53 | + + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR" | ||
| 54 | + ).split(" ") | ||
| 55 | + , file_ex_code = file_ex_codes.length | ||
| 56 | + , real_URL = view.URL || view.webkitURL || view | ||
| 57 | + , real_create_object_URL = real_URL.createObjectURL | ||
| 58 | + , real_revoke_object_URL = real_URL.revokeObjectURL | ||
| 59 | + , URL = real_URL | ||
| 60 | + , btoa = view.btoa | ||
| 61 | + , atob = view.atob | ||
| 62 | + | ||
| 63 | + , ArrayBuffer = view.ArrayBuffer | ||
| 64 | + , Uint8Array = view.Uint8Array | ||
| 65 | + | ||
| 66 | + , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/ | ||
| 67 | + ; | ||
| 68 | + FakeBlob.fake = FB_proto.fake = true; | ||
| 69 | + while (file_ex_code--) { | ||
| 70 | + FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1; | ||
| 71 | + } | ||
| 72 | + // Polyfill URL | ||
| 73 | + if (!real_URL.createObjectURL) { | ||
| 74 | + URL = view.URL = function(uri) { | ||
| 75 | + var | ||
| 76 | + uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a") | ||
| 77 | + , uri_origin | ||
| 78 | + ; | ||
| 79 | + uri_info.href = uri; | ||
| 80 | + if (!("origin" in uri_info)) { | ||
| 81 | + if (uri_info.protocol.toLowerCase() === "data:") { | ||
| 82 | + uri_info.origin = null; | ||
| 83 | + } else { | ||
| 84 | + uri_origin = uri.match(origin); | ||
| 85 | + uri_info.origin = uri_origin && uri_origin[1]; | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + return uri_info; | ||
| 89 | + }; | ||
| 90 | + } | ||
| 91 | + URL.createObjectURL = function(blob) { | ||
| 92 | + var | ||
| 93 | + type = blob.type | ||
| 94 | + , data_URI_header | ||
| 95 | + ; | ||
| 96 | + if (type === null) { | ||
| 97 | + type = "application/octet-stream"; | ||
| 98 | + } | ||
| 99 | + if (blob instanceof FakeBlob) { | ||
| 100 | + data_URI_header = "data:" + type; | ||
| 101 | + if (blob.encoding === "base64") { | ||
| 102 | + return data_URI_header + ";base64," + blob.data; | ||
| 103 | + } else if (blob.encoding === "URI") { | ||
| 104 | + return data_URI_header + "," + decodeURIComponent(blob.data); | ||
| 105 | + } if (btoa) { | ||
| 106 | + return data_URI_header + ";base64," + btoa(blob.data); | ||
| 107 | + } else { | ||
| 108 | + return data_URI_header + "," + encodeURIComponent(blob.data); | ||
| 109 | + } | ||
| 110 | + } else if (real_create_object_URL) { | ||
| 111 | + return real_create_object_URL.call(real_URL, blob); | ||
| 112 | + } | ||
| 113 | + }; | ||
| 114 | + URL.revokeObjectURL = function(object_URL) { | ||
| 115 | + if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) { | ||
| 116 | + real_revoke_object_URL.call(real_URL, object_URL); | ||
| 117 | + } | ||
| 118 | + }; | ||
| 119 | + FBB_proto.append = function(data/*, endings*/) { | ||
| 120 | + var bb = this.data; | ||
| 121 | + // decode data to a binary string | ||
| 122 | + if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) { | ||
| 123 | + var | ||
| 124 | + str = "" | ||
| 125 | + , buf = new Uint8Array(data) | ||
| 126 | + , i = 0 | ||
| 127 | + , buf_len = buf.length | ||
| 128 | + ; | ||
| 129 | + for (; i < buf_len; i++) { | ||
| 130 | + str += String.fromCharCode(buf[i]); | ||
| 131 | + } | ||
| 132 | + bb.push(str); | ||
| 133 | + } else if (get_class(data) === "Blob" || get_class(data) === "File") { | ||
| 134 | + if (FileReaderSync) { | ||
| 135 | + var fr = new FileReaderSync; | ||
| 136 | + bb.push(fr.readAsBinaryString(data)); | ||
| 137 | + } else { | ||
| 138 | + // async FileReader won't work as BlobBuilder is sync | ||
| 139 | + throw new FileException("NOT_READABLE_ERR"); | ||
| 140 | + } | ||
| 141 | + } else if (data instanceof FakeBlob) { | ||
| 142 | + if (data.encoding === "base64" && atob) { | ||
| 143 | + bb.push(atob(data.data)); | ||
| 144 | + } else if (data.encoding === "URI") { | ||
| 145 | + bb.push(decodeURIComponent(data.data)); | ||
| 146 | + } else if (data.encoding === "raw") { | ||
| 147 | + bb.push(data.data); | ||
| 148 | + } | ||
| 149 | + } else { | ||
| 150 | + if (typeof data !== "string") { | ||
| 151 | + data += ""; // convert unsupported types to strings | ||
| 152 | + } | ||
| 153 | + // decode UTF-16 to binary string | ||
| 154 | + bb.push(unescape(encodeURIComponent(data))); | ||
| 155 | + } | ||
| 156 | + }; | ||
| 157 | + FBB_proto.getBlob = function(type) { | ||
| 158 | + if (!arguments.length) { | ||
| 159 | + type = null; | ||
| 160 | + } | ||
| 161 | + return new FakeBlob(this.data.join(""), type, "raw"); | ||
| 162 | + }; | ||
| 163 | + FBB_proto.toString = function() { | ||
| 164 | + return "[object BlobBuilder]"; | ||
| 165 | + }; | ||
| 166 | + FB_proto.slice = function(start, end, type) { | ||
| 167 | + var args = arguments.length; | ||
| 168 | + if (args < 3) { | ||
| 169 | + type = null; | ||
| 170 | + } | ||
| 171 | + return new FakeBlob( | ||
| 172 | + this.data.slice(start, args > 1 ? end : this.data.length) | ||
| 173 | + , type | ||
| 174 | + , this.encoding | ||
| 175 | + ); | ||
| 176 | + }; | ||
| 177 | + FB_proto.toString = function() { | ||
| 178 | + return "[object Blob]"; | ||
| 179 | + }; | ||
| 180 | + FB_proto.close = function() { | ||
| 181 | + this.size = 0; | ||
| 182 | + delete this.data; | ||
| 183 | + }; | ||
| 184 | + return FakeBlobBuilder; | ||
| 185 | + }(view)); | ||
| 186 | + | ||
| 187 | + view.Blob = function(blobParts, options) { | ||
| 188 | + var type = options ? (options.type || "") : ""; | ||
| 189 | + var builder = new BlobBuilder(); | ||
| 190 | + if (blobParts) { | ||
| 191 | + for (var i = 0, len = blobParts.length; i < len; i++) { | ||
| 192 | + builder.append(blobParts[i]); | ||
| 193 | + } | ||
| 194 | + } | ||
| 195 | + return builder.getBlob(type); | ||
| 196 | + }; | ||
| 197 | +}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this)); |
src/main/resources/static/pages/report/inoutstation/js/FileSaver.js
| 1 | -/* FileSaver.js | ||
| 2 | - * A saveAs() FileSaver implementation. | ||
| 3 | - * 2014-08-29 | ||
| 4 | - * | ||
| 5 | - * By Eli Grey, http://eligrey.com | ||
| 6 | - * License: X11/MIT | ||
| 7 | - * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md | ||
| 8 | - */ | ||
| 9 | - | ||
| 10 | -/*global self */ | ||
| 11 | -/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ | ||
| 12 | - | ||
| 13 | -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ | ||
| 14 | - | ||
| 15 | -var saveAs = saveAs | ||
| 16 | - // IE 10+ (native saveAs) | ||
| 17 | - || (typeof navigator !== "undefined" && | ||
| 18 | - navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator)) | ||
| 19 | - // Everyone else | ||
| 20 | - || (function(view) { | ||
| 21 | - "use strict"; | ||
| 22 | - // IE <10 is explicitly unsupported | ||
| 23 | - if (typeof navigator !== "undefined" && | ||
| 24 | - /MSIE [1-9]\./.test(navigator.userAgent)) { | ||
| 25 | - return; | ||
| 26 | - } | ||
| 27 | - var | ||
| 28 | - doc = view.document | ||
| 29 | - // only get URL when necessary in case Blob.js hasn't overridden it yet | ||
| 30 | - , get_URL = function() { | ||
| 31 | - return view.URL || view.webkitURL || view; | ||
| 32 | - } | ||
| 33 | - , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") | ||
| 34 | - , can_use_save_link = "download" in save_link | ||
| 35 | - , click = function(node) { | ||
| 36 | - var event = doc.createEvent("MouseEvents"); | ||
| 37 | - event.initMouseEvent( | ||
| 38 | - "click", true, false, view, 0, 0, 0, 0, 0 | ||
| 39 | - , false, false, false, false, 0, null | ||
| 40 | - ); | ||
| 41 | - node.dispatchEvent(event); | ||
| 42 | - } | ||
| 43 | - , webkit_req_fs = view.webkitRequestFileSystem | ||
| 44 | - , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem | ||
| 45 | - , throw_outside = function(ex) { | ||
| 46 | - (view.setImmediate || view.setTimeout)(function() { | ||
| 47 | - throw ex; | ||
| 48 | - }, 0); | ||
| 49 | - } | ||
| 50 | - , force_saveable_type = "application/octet-stream" | ||
| 51 | - , fs_min_size = 0 | ||
| 52 | - // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 for | ||
| 53 | - // the reasoning behind the timeout and revocation flow | ||
| 54 | - , arbitrary_revoke_timeout = 10 | ||
| 55 | - , revoke = function(file) { | ||
| 56 | - var revoker = function() { | ||
| 57 | - if (typeof file === "string") { // file is an object URL | ||
| 58 | - get_URL().revokeObjectURL(file); | ||
| 59 | - } else { // file is a File | ||
| 60 | - file.remove(); | ||
| 61 | - } | ||
| 62 | - }; | ||
| 63 | - if (view.chrome) { | ||
| 64 | - revoker(); | ||
| 65 | - } else { | ||
| 66 | - setTimeout(revoker, arbitrary_revoke_timeout); | ||
| 67 | - } | ||
| 68 | - } | ||
| 69 | - , dispatch = function(filesaver, event_types, event) { | ||
| 70 | - event_types = [].concat(event_types); | ||
| 71 | - var i = event_types.length; | ||
| 72 | - while (i--) { | ||
| 73 | - var listener = filesaver["on" + event_types[i]]; | ||
| 74 | - if (typeof listener === "function") { | ||
| 75 | - try { | ||
| 76 | - listener.call(filesaver, event || filesaver); | ||
| 77 | - } catch (ex) { | ||
| 78 | - throw_outside(ex); | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - } | ||
| 82 | - } | ||
| 83 | - , FileSaver = function(blob, name) { | ||
| 84 | - // First try a.download, then web filesystem, then object URLs | ||
| 85 | - var | ||
| 86 | - filesaver = this | ||
| 87 | - , type = blob.type | ||
| 88 | - , blob_changed = false | ||
| 89 | - , object_url | ||
| 90 | - , target_view | ||
| 91 | - , dispatch_all = function() { | ||
| 92 | - dispatch(filesaver, "writestart progress write writeend".split(" ")); | ||
| 93 | - } | ||
| 94 | - // on any filesys errors revert to saving with object URLs | ||
| 95 | - , fs_error = function() { | ||
| 96 | - // don't create more object URLs than needed | ||
| 97 | - if (blob_changed || !object_url) { | ||
| 98 | - object_url = get_URL().createObjectURL(blob); | ||
| 99 | - } | ||
| 100 | - if (target_view) { | ||
| 101 | - target_view.location.href = object_url; | ||
| 102 | - } else { | ||
| 103 | - var new_tab = view.open(object_url, "_blank"); | ||
| 104 | - if (new_tab == undefined && typeof safari !== "undefined") { | ||
| 105 | - //Apple do not allow window.open, see http://bit.ly/1kZffRI | ||
| 106 | - view.location.href = object_url | ||
| 107 | - } | ||
| 108 | - } | ||
| 109 | - filesaver.readyState = filesaver.DONE; | ||
| 110 | - dispatch_all(); | ||
| 111 | - revoke(object_url); | ||
| 112 | - } | ||
| 113 | - , abortable = function(func) { | ||
| 114 | - return function() { | ||
| 115 | - if (filesaver.readyState !== filesaver.DONE) { | ||
| 116 | - return func.apply(this, arguments); | ||
| 117 | - } | ||
| 118 | - }; | ||
| 119 | - } | ||
| 120 | - , create_if_not_found = {create: true, exclusive: false} | ||
| 121 | - , slice | ||
| 122 | - ; | ||
| 123 | - filesaver.readyState = filesaver.INIT; | ||
| 124 | - if (!name) { | ||
| 125 | - name = "download"; | ||
| 126 | - } | ||
| 127 | - if (can_use_save_link) { | ||
| 128 | - object_url = get_URL().createObjectURL(blob); | ||
| 129 | - save_link.href = object_url; | ||
| 130 | - save_link.download = name; | ||
| 131 | - click(save_link); | ||
| 132 | - filesaver.readyState = filesaver.DONE; | ||
| 133 | - dispatch_all(); | ||
| 134 | - revoke(object_url); | ||
| 135 | - return; | ||
| 136 | - } | ||
| 137 | - // Object and web filesystem URLs have a problem saving in Google Chrome when | ||
| 138 | - // viewed in a tab, so I force save with application/octet-stream | ||
| 139 | - // http://code.google.com/p/chromium/issues/detail?id=91158 | ||
| 140 | - // Update: Google errantly closed 91158, I submitted it again: | ||
| 141 | - // https://code.google.com/p/chromium/issues/detail?id=389642 | ||
| 142 | - if (view.chrome && type && type !== force_saveable_type) { | ||
| 143 | - slice = blob.slice || blob.webkitSlice; | ||
| 144 | - blob = slice.call(blob, 0, blob.size, force_saveable_type); | ||
| 145 | - blob_changed = true; | ||
| 146 | - } | ||
| 147 | - // Since I can't be sure that the guessed media type will trigger a download | ||
| 148 | - // in WebKit, I append .download to the filename. | ||
| 149 | - // https://bugs.webkit.org/show_bug.cgi?id=65440 | ||
| 150 | - if (webkit_req_fs && name !== "download") { | ||
| 151 | - name += ".download"; | ||
| 152 | - } | ||
| 153 | - if (type === force_saveable_type || webkit_req_fs) { | ||
| 154 | - target_view = view; | ||
| 155 | - } | ||
| 156 | - if (!req_fs) { | ||
| 157 | - fs_error(); | ||
| 158 | - return; | ||
| 159 | - } | ||
| 160 | - fs_min_size += blob.size; | ||
| 161 | - req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) { | ||
| 162 | - fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) { | ||
| 163 | - var save = function() { | ||
| 164 | - dir.getFile(name, create_if_not_found, abortable(function(file) { | ||
| 165 | - file.createWriter(abortable(function(writer) { | ||
| 166 | - writer.onwriteend = function(event) { | ||
| 167 | - target_view.location.href = file.toURL(); | ||
| 168 | - filesaver.readyState = filesaver.DONE; | ||
| 169 | - dispatch(filesaver, "writeend", event); | ||
| 170 | - revoke(file); | ||
| 171 | - }; | ||
| 172 | - writer.onerror = function() { | ||
| 173 | - var error = writer.error; | ||
| 174 | - if (error.code !== error.ABORT_ERR) { | ||
| 175 | - fs_error(); | ||
| 176 | - } | ||
| 177 | - }; | ||
| 178 | - "writestart progress write abort".split(" ").forEach(function(event) { | ||
| 179 | - writer["on" + event] = filesaver["on" + event]; | ||
| 180 | - }); | ||
| 181 | - writer.write(blob); | ||
| 182 | - filesaver.abort = function() { | ||
| 183 | - writer.abort(); | ||
| 184 | - filesaver.readyState = filesaver.DONE; | ||
| 185 | - }; | ||
| 186 | - filesaver.readyState = filesaver.WRITING; | ||
| 187 | - }), fs_error); | ||
| 188 | - }), fs_error); | ||
| 189 | - }; | ||
| 190 | - dir.getFile(name, {create: false}, abortable(function(file) { | ||
| 191 | - // delete file if it already exists | ||
| 192 | - file.remove(); | ||
| 193 | - save(); | ||
| 194 | - }), abortable(function(ex) { | ||
| 195 | - if (ex.code === ex.NOT_FOUND_ERR) { | ||
| 196 | - save(); | ||
| 197 | - } else { | ||
| 198 | - fs_error(); | ||
| 199 | - } | ||
| 200 | - })); | ||
| 201 | - }), fs_error); | ||
| 202 | - }), fs_error); | ||
| 203 | - } | ||
| 204 | - , FS_proto = FileSaver.prototype | ||
| 205 | - , saveAs = function(blob, name) { | ||
| 206 | - return new FileSaver(blob, name); | ||
| 207 | - } | ||
| 208 | - ; | ||
| 209 | - FS_proto.abort = function() { | ||
| 210 | - var filesaver = this; | ||
| 211 | - filesaver.readyState = filesaver.DONE; | ||
| 212 | - dispatch(filesaver, "abort"); | ||
| 213 | - }; | ||
| 214 | - FS_proto.readyState = FS_proto.INIT = 0; | ||
| 215 | - FS_proto.WRITING = 1; | ||
| 216 | - FS_proto.DONE = 2; | ||
| 217 | - | ||
| 218 | - FS_proto.error = | ||
| 219 | - FS_proto.onwritestart = | ||
| 220 | - FS_proto.onprogress = | ||
| 221 | - FS_proto.onwrite = | ||
| 222 | - FS_proto.onabort = | ||
| 223 | - FS_proto.onerror = | ||
| 224 | - FS_proto.onwriteend = | ||
| 225 | - null; | ||
| 226 | - | ||
| 227 | - return saveAs; | ||
| 228 | -}( | ||
| 229 | - typeof self !== "undefined" && self | ||
| 230 | - || typeof window !== "undefined" && window | ||
| 231 | - || this.content | ||
| 232 | -)); | ||
| 233 | -// `self` is undefined in Firefox for Android content script context | ||
| 234 | -// while `this` is nsIContentFrameMessageManager | ||
| 235 | -// with an attribute `content` that corresponds to the window | ||
| 236 | - | ||
| 237 | -if (typeof module !== "undefined" && module !== null) { | ||
| 238 | - module.exports = saveAs; | ||
| 239 | -} else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) { | ||
| 240 | - define([], function() { | ||
| 241 | - return saveAs; | ||
| 242 | - }); | ||
| 243 | -} | 1 | +/* FileSaver.js |
| 2 | + * A saveAs() FileSaver implementation. | ||
| 3 | + * 2014-08-29 | ||
| 4 | + * | ||
| 5 | + * By Eli Grey, http://eligrey.com | ||
| 6 | + * License: X11/MIT | ||
| 7 | + * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +/*global self */ | ||
| 11 | +/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ | ||
| 12 | + | ||
| 13 | +/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ | ||
| 14 | + | ||
| 15 | +var saveAs = saveAs | ||
| 16 | + // IE 10+ (native saveAs) | ||
| 17 | + || (typeof navigator !== "undefined" && | ||
| 18 | + navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator)) | ||
| 19 | + // Everyone else | ||
| 20 | + || (function(view) { | ||
| 21 | + "use strict"; | ||
| 22 | + // IE <10 is explicitly unsupported | ||
| 23 | + if (typeof navigator !== "undefined" && | ||
| 24 | + /MSIE [1-9]\./.test(navigator.userAgent)) { | ||
| 25 | + return; | ||
| 26 | + } | ||
| 27 | + var | ||
| 28 | + doc = view.document | ||
| 29 | + // only get URL when necessary in case Blob.js hasn't overridden it yet | ||
| 30 | + , get_URL = function() { | ||
| 31 | + return view.URL || view.webkitURL || view; | ||
| 32 | + } | ||
| 33 | + , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") | ||
| 34 | + , can_use_save_link = "download" in save_link | ||
| 35 | + , click = function(node) { | ||
| 36 | + var event = doc.createEvent("MouseEvents"); | ||
| 37 | + event.initMouseEvent( | ||
| 38 | + "click", true, false, view, 0, 0, 0, 0, 0 | ||
| 39 | + , false, false, false, false, 0, null | ||
| 40 | + ); | ||
| 41 | + node.dispatchEvent(event); | ||
| 42 | + } | ||
| 43 | + , webkit_req_fs = view.webkitRequestFileSystem | ||
| 44 | + , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem | ||
| 45 | + , throw_outside = function(ex) { | ||
| 46 | + (view.setImmediate || view.setTimeout)(function() { | ||
| 47 | + throw ex; | ||
| 48 | + }, 0); | ||
| 49 | + } | ||
| 50 | + , force_saveable_type = "application/octet-stream" | ||
| 51 | + , fs_min_size = 0 | ||
| 52 | + // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 for | ||
| 53 | + // the reasoning behind the timeout and revocation flow | ||
| 54 | + , arbitrary_revoke_timeout = 10 | ||
| 55 | + , revoke = function(file) { | ||
| 56 | + var revoker = function() { | ||
| 57 | + if (typeof file === "string") { // file is an object URL | ||
| 58 | + get_URL().revokeObjectURL(file); | ||
| 59 | + } else { // file is a File | ||
| 60 | + file.remove(); | ||
| 61 | + } | ||
| 62 | + }; | ||
| 63 | + if (view.chrome) { | ||
| 64 | + revoker(); | ||
| 65 | + } else { | ||
| 66 | + setTimeout(revoker, arbitrary_revoke_timeout); | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | + , dispatch = function(filesaver, event_types, event) { | ||
| 70 | + event_types = [].concat(event_types); | ||
| 71 | + var i = event_types.length; | ||
| 72 | + while (i--) { | ||
| 73 | + var listener = filesaver["on" + event_types[i]]; | ||
| 74 | + if (typeof listener === "function") { | ||
| 75 | + try { | ||
| 76 | + listener.call(filesaver, event || filesaver); | ||
| 77 | + } catch (ex) { | ||
| 78 | + throw_outside(ex); | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + , FileSaver = function(blob, name) { | ||
| 84 | + // First try a.download, then web filesystem, then object URLs | ||
| 85 | + var | ||
| 86 | + filesaver = this | ||
| 87 | + , type = blob.type | ||
| 88 | + , blob_changed = false | ||
| 89 | + , object_url | ||
| 90 | + , target_view | ||
| 91 | + , dispatch_all = function() { | ||
| 92 | + dispatch(filesaver, "writestart progress write writeend".split(" ")); | ||
| 93 | + } | ||
| 94 | + // on any filesys errors revert to saving with object URLs | ||
| 95 | + , fs_error = function() { | ||
| 96 | + // don't create more object URLs than needed | ||
| 97 | + if (blob_changed || !object_url) { | ||
| 98 | + object_url = get_URL().createObjectURL(blob); | ||
| 99 | + } | ||
| 100 | + if (target_view) { | ||
| 101 | + target_view.location.href = object_url; | ||
| 102 | + } else { | ||
| 103 | + var new_tab = view.open(object_url, "_blank"); | ||
| 104 | + if (new_tab == undefined && typeof safari !== "undefined") { | ||
| 105 | + //Apple do not allow window.open, see http://bit.ly/1kZffRI | ||
| 106 | + view.location.href = object_url | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + filesaver.readyState = filesaver.DONE; | ||
| 110 | + dispatch_all(); | ||
| 111 | + revoke(object_url); | ||
| 112 | + } | ||
| 113 | + , abortable = function(func) { | ||
| 114 | + return function() { | ||
| 115 | + if (filesaver.readyState !== filesaver.DONE) { | ||
| 116 | + return func.apply(this, arguments); | ||
| 117 | + } | ||
| 118 | + }; | ||
| 119 | + } | ||
| 120 | + , create_if_not_found = {create: true, exclusive: false} | ||
| 121 | + , slice | ||
| 122 | + ; | ||
| 123 | + filesaver.readyState = filesaver.INIT; | ||
| 124 | + if (!name) { | ||
| 125 | + name = "download"; | ||
| 126 | + } | ||
| 127 | + if (can_use_save_link) { | ||
| 128 | + object_url = get_URL().createObjectURL(blob); | ||
| 129 | + save_link.href = object_url; | ||
| 130 | + save_link.download = name; | ||
| 131 | + click(save_link); | ||
| 132 | + filesaver.readyState = filesaver.DONE; | ||
| 133 | + dispatch_all(); | ||
| 134 | + revoke(object_url); | ||
| 135 | + return; | ||
| 136 | + } | ||
| 137 | + // Object and web filesystem URLs have a problem saving in Google Chrome when | ||
| 138 | + // viewed in a tab, so I force save with application/octet-stream | ||
| 139 | + // http://code.google.com/p/chromium/issues/detail?id=91158 | ||
| 140 | + // Update: Google errantly closed 91158, I submitted it again: | ||
| 141 | + // https://code.google.com/p/chromium/issues/detail?id=389642 | ||
| 142 | + if (view.chrome && type && type !== force_saveable_type) { | ||
| 143 | + slice = blob.slice || blob.webkitSlice; | ||
| 144 | + blob = slice.call(blob, 0, blob.size, force_saveable_type); | ||
| 145 | + blob_changed = true; | ||
| 146 | + } | ||
| 147 | + // Since I can't be sure that the guessed media type will trigger a download | ||
| 148 | + // in WebKit, I append .download to the filename. | ||
| 149 | + // https://bugs.webkit.org/show_bug.cgi?id=65440 | ||
| 150 | + if (webkit_req_fs && name !== "download") { | ||
| 151 | + name += ".download"; | ||
| 152 | + } | ||
| 153 | + if (type === force_saveable_type || webkit_req_fs) { | ||
| 154 | + target_view = view; | ||
| 155 | + } | ||
| 156 | + if (!req_fs) { | ||
| 157 | + fs_error(); | ||
| 158 | + return; | ||
| 159 | + } | ||
| 160 | + fs_min_size += blob.size; | ||
| 161 | + req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) { | ||
| 162 | + fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) { | ||
| 163 | + var save = function() { | ||
| 164 | + dir.getFile(name, create_if_not_found, abortable(function(file) { | ||
| 165 | + file.createWriter(abortable(function(writer) { | ||
| 166 | + writer.onwriteend = function(event) { | ||
| 167 | + target_view.location.href = file.toURL(); | ||
| 168 | + filesaver.readyState = filesaver.DONE; | ||
| 169 | + dispatch(filesaver, "writeend", event); | ||
| 170 | + revoke(file); | ||
| 171 | + }; | ||
| 172 | + writer.onerror = function() { | ||
| 173 | + var error = writer.error; | ||
| 174 | + if (error.code !== error.ABORT_ERR) { | ||
| 175 | + fs_error(); | ||
| 176 | + } | ||
| 177 | + }; | ||
| 178 | + "writestart progress write abort".split(" ").forEach(function(event) { | ||
| 179 | + writer["on" + event] = filesaver["on" + event]; | ||
| 180 | + }); | ||
| 181 | + writer.write(blob); | ||
| 182 | + filesaver.abort = function() { | ||
| 183 | + writer.abort(); | ||
| 184 | + filesaver.readyState = filesaver.DONE; | ||
| 185 | + }; | ||
| 186 | + filesaver.readyState = filesaver.WRITING; | ||
| 187 | + }), fs_error); | ||
| 188 | + }), fs_error); | ||
| 189 | + }; | ||
| 190 | + dir.getFile(name, {create: false}, abortable(function(file) { | ||
| 191 | + // delete file if it already exists | ||
| 192 | + file.remove(); | ||
| 193 | + save(); | ||
| 194 | + }), abortable(function(ex) { | ||
| 195 | + if (ex.code === ex.NOT_FOUND_ERR) { | ||
| 196 | + save(); | ||
| 197 | + } else { | ||
| 198 | + fs_error(); | ||
| 199 | + } | ||
| 200 | + })); | ||
| 201 | + }), fs_error); | ||
| 202 | + }), fs_error); | ||
| 203 | + } | ||
| 204 | + , FS_proto = FileSaver.prototype | ||
| 205 | + , saveAs = function(blob, name) { | ||
| 206 | + return new FileSaver(blob, name); | ||
| 207 | + } | ||
| 208 | + ; | ||
| 209 | + FS_proto.abort = function() { | ||
| 210 | + var filesaver = this; | ||
| 211 | + filesaver.readyState = filesaver.DONE; | ||
| 212 | + dispatch(filesaver, "abort"); | ||
| 213 | + }; | ||
| 214 | + FS_proto.readyState = FS_proto.INIT = 0; | ||
| 215 | + FS_proto.WRITING = 1; | ||
| 216 | + FS_proto.DONE = 2; | ||
| 217 | + | ||
| 218 | + FS_proto.error = | ||
| 219 | + FS_proto.onwritestart = | ||
| 220 | + FS_proto.onprogress = | ||
| 221 | + FS_proto.onwrite = | ||
| 222 | + FS_proto.onabort = | ||
| 223 | + FS_proto.onerror = | ||
| 224 | + FS_proto.onwriteend = | ||
| 225 | + null; | ||
| 226 | + | ||
| 227 | + return saveAs; | ||
| 228 | +}( | ||
| 229 | + typeof self !== "undefined" && self | ||
| 230 | + || typeof window !== "undefined" && window | ||
| 231 | + || this.content | ||
| 232 | +)); | ||
| 233 | +// `self` is undefined in Firefox for Android content script context | ||
| 234 | +// while `this` is nsIContentFrameMessageManager | ||
| 235 | +// with an attribute `content` that corresponds to the window | ||
| 236 | + | ||
| 237 | +if (typeof module !== "undefined" && module !== null) { | ||
| 238 | + module.exports = saveAs; | ||
| 239 | +} else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) { | ||
| 240 | + define([], function() { | ||
| 241 | + return saveAs; | ||
| 242 | + }); | ||
| 243 | +} |
src/main/resources/static/pages/report/inoutstation/js/tableExport.js
| 1 | - | ||
| 2 | - | ||
| 3 | -(function(view){ | ||
| 4 | - "use strict"; | ||
| 5 | - var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; | ||
| 6 | - var fromCharCode = String.fromCharCode; | ||
| 7 | - var INVALID_CHARACTER_ERR = ( function() { | ||
| 8 | - // fabricate a suitable error object | ||
| 9 | - try { | ||
| 10 | - document.createElement('$'); | ||
| 11 | - } catch (error) { | ||
| 12 | - return error; | ||
| 13 | - } | ||
| 14 | - }()); | ||
| 15 | - | ||
| 16 | - // encoder | ||
| 17 | - var btoa = function(string) { | ||
| 18 | - var a, b, b1, b2, b3, b4, c, i = 0, len = string.length, max = Math.max, result = ''; | ||
| 19 | - | ||
| 20 | - while (i < len) { | ||
| 21 | - a = string.charCodeAt(i++) || 0; | ||
| 22 | - b = string.charCodeAt(i++) || 0; | ||
| 23 | - c = string.charCodeAt(i++) || 0; | ||
| 24 | - | ||
| 25 | - if (max(a, b, c) > 0xFF) { | ||
| 26 | - throw INVALID_CHARACTER_ERR; | ||
| 27 | - } | ||
| 28 | - | ||
| 29 | - b1 = (a >> 2) & 0x3F; | ||
| 30 | - b2 = ((a & 0x3) << 4) | ((b >> 4) & 0xF); | ||
| 31 | - b3 = ((b & 0xF) << 2) | ((c >> 6) & 0x3); | ||
| 32 | - b4 = c & 0x3F; | ||
| 33 | - | ||
| 34 | - if (!b) { | ||
| 35 | - b3 = b4 = 64; | ||
| 36 | - } else if (!c) { | ||
| 37 | - b4 = 64; | ||
| 38 | - } | ||
| 39 | - result += characters.charAt(b1) + characters.charAt(b2) + characters.charAt(b3) + characters.charAt(b4); | ||
| 40 | - } | ||
| 41 | - return result; | ||
| 42 | - }; | ||
| 43 | - | ||
| 44 | - //获取dom文本 | ||
| 45 | - var getText = function( el ){ | ||
| 46 | - var s = el.textContent || el.innerText; | ||
| 47 | - return s == null ? "" : s.replace( /^\s*(.*?)\s+$/, "$1"); | ||
| 48 | - }; | ||
| 49 | - view.tableExport = function(tableId, filename, type){ | ||
| 50 | - var doc = view.document, | ||
| 51 | - table = doc.getElementById(tableId), | ||
| 52 | - charSet = doc.characterSet | ||
| 53 | - | ||
| 54 | - var uri = { | ||
| 55 | - json: 'application/json;charset='+charSet, | ||
| 56 | - txt: 'csv/txt;charset='+charSet, | ||
| 57 | - csv: 'csv/txt;charset='+charSet, | ||
| 58 | - doc: 'application/vnd.ms-doc', | ||
| 59 | - excel: 'application/vnd.ms-excel' | ||
| 60 | - }; | ||
| 61 | - | ||
| 62 | - var base64 = function(s) { | ||
| 63 | - return btoa(unescape(encodeURIComponent(s))); | ||
| 64 | - }; | ||
| 65 | - var template = function(s, c) { | ||
| 66 | - return s.replace(/{(\w+)}/g, function(m, p) { | ||
| 67 | - return c[p]; | ||
| 68 | - }); | ||
| 69 | - }; | ||
| 70 | - | ||
| 71 | - var get_blob = function() { | ||
| 72 | - return view.Blob; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - var fixCSVField = function(value) { | ||
| 76 | - var fixedValue = value; | ||
| 77 | - var addQuotes = (value.indexOf(',') !== -1) || (value.indexOf('\r') !== -1) || (value.indexOf('\n') !== -1); | ||
| 78 | - var replaceDoubleQuotes = (value.indexOf('"') !== -1); | ||
| 79 | - | ||
| 80 | - if (replaceDoubleQuotes) { | ||
| 81 | - fixedValue = fixedValue.replace(/"/g, '""'); | ||
| 82 | - } | ||
| 83 | - if (addQuotes || replaceDoubleQuotes) { | ||
| 84 | - fixedValue = '"' + fixedValue + '"'; | ||
| 85 | - } | ||
| 86 | - return fixedValue; | ||
| 87 | - }; | ||
| 88 | - | ||
| 89 | - var saveData = function(data){ | ||
| 90 | - var BB = get_blob(); | ||
| 91 | - saveAs(new BB([data], {type: uri[type]}), filename + "."+type); | ||
| 92 | - }; | ||
| 93 | - | ||
| 94 | - var toCSV = function(){ | ||
| 95 | - var data = "\ufeff"; | ||
| 96 | - for (var i = 0, row; row = table.rows[i]; i++) { | ||
| 97 | - for (var j = 0, col; col = row.cells[j]; j++) { | ||
| 98 | - data = data + (j ? ',' : '') + fixCSVField(getText(col)); | ||
| 99 | - } | ||
| 100 | - data = data + "\r\n"; | ||
| 101 | - } | ||
| 102 | - saveData(data); | ||
| 103 | - }; | ||
| 104 | - | ||
| 105 | - var toJson = function(){ | ||
| 106 | - var jsonHeaderArray = []; | ||
| 107 | - | ||
| 108 | - if(table.tHead){ | ||
| 109 | - for(var i =0,col; col = table.tHead.rows[0].cells[i]; i++){ | ||
| 110 | - jsonHeaderArray.push(getText(col)); | ||
| 111 | - } | ||
| 112 | - } | ||
| 113 | - | ||
| 114 | - var jsonArray = []; | ||
| 115 | - if(table.tBodies){ | ||
| 116 | - for(var j=0,tbody; tbody = table.tBodies[j]; j++){ | ||
| 117 | - for(var k =0, rowb; rowb= tbody.rows[k]; k++){ | ||
| 118 | - var len = jsonArray.length; | ||
| 119 | - jsonArray[len] = []; | ||
| 120 | - for (var g = 0, colb; colb = rowb.cells[g]; g++) { | ||
| 121 | - jsonArray[len].push(getText(colb)); | ||
| 122 | - } | ||
| 123 | - } | ||
| 124 | - } | ||
| 125 | - } | ||
| 126 | - | ||
| 127 | - var jsonExportArray = { | ||
| 128 | - header: jsonHeaderArray, | ||
| 129 | - data: jsonArray | ||
| 130 | - }; | ||
| 131 | - saveData(JSON.stringify(jsonExportArray)); | ||
| 132 | - }; | ||
| 133 | - | ||
| 134 | - var toOffice = function(){ | ||
| 135 | - var tmpl = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:'+type+'" xmlns="http://www.w3.org/TR/REC-html40">'; | ||
| 136 | - tmpl += '<head><meta charset="'+charSet+'" /><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>'; | ||
| 137 | - tmpl += '{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->'; | ||
| 138 | - tmpl += '</head><body><table>{table}</table></body></html>'; | ||
| 139 | - var office = '', | ||
| 140 | - maph = [['<thead><tr>', '</tr></thead>'], ['<tbody><tr>', '</tr></tbody>'], ['<tr>', '</tr>']], | ||
| 141 | - mapb = [['<th>', '</th>'],['<td>', '</td>']], | ||
| 142 | - flag = +!table.tHead, | ||
| 143 | - com = 1 - flag; | ||
| 144 | - | ||
| 145 | - for(var i=0, row; row = table.rows[i]; i++){ | ||
| 146 | - flag = i > com ? 2 : flag; | ||
| 147 | - office += maph[flag][0]; | ||
| 148 | - for(var j =0, col; col = row.cells[j]; j++){ | ||
| 149 | - office += mapb[+!!flag][0]+ getText(col) +mapb[+!!flag][1]; | ||
| 150 | - } | ||
| 151 | - office += maph[flag][1]; | ||
| 152 | - flag++; | ||
| 153 | - } | ||
| 154 | - saveData(template(tmpl, {worksheet: 'Worksheet', table: office})); | ||
| 155 | - }; | ||
| 156 | - | ||
| 157 | - var typeMap = { | ||
| 158 | - json : toJson, | ||
| 159 | - txt: toCSV, | ||
| 160 | - csv: toCSV, | ||
| 161 | - doc: toOffice, | ||
| 162 | - docx: toOffice, | ||
| 163 | - xls: toOffice, | ||
| 164 | - xlsx: toOffice | ||
| 165 | - }; | ||
| 166 | - | ||
| 167 | - typeMap[type](); | ||
| 168 | - }; | ||
| 169 | - | 1 | + |
| 2 | + | ||
| 3 | +(function(view){ | ||
| 4 | + "use strict"; | ||
| 5 | + var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; | ||
| 6 | + var fromCharCode = String.fromCharCode; | ||
| 7 | + var INVALID_CHARACTER_ERR = ( function() { | ||
| 8 | + // fabricate a suitable error object | ||
| 9 | + try { | ||
| 10 | + document.createElement('$'); | ||
| 11 | + } catch (error) { | ||
| 12 | + return error; | ||
| 13 | + } | ||
| 14 | + }()); | ||
| 15 | + | ||
| 16 | + // encoder | ||
| 17 | + var btoa = function(string) { | ||
| 18 | + var a, b, b1, b2, b3, b4, c, i = 0, len = string.length, max = Math.max, result = ''; | ||
| 19 | + | ||
| 20 | + while (i < len) { | ||
| 21 | + a = string.charCodeAt(i++) || 0; | ||
| 22 | + b = string.charCodeAt(i++) || 0; | ||
| 23 | + c = string.charCodeAt(i++) || 0; | ||
| 24 | + | ||
| 25 | + if (max(a, b, c) > 0xFF) { | ||
| 26 | + throw INVALID_CHARACTER_ERR; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + b1 = (a >> 2) & 0x3F; | ||
| 30 | + b2 = ((a & 0x3) << 4) | ((b >> 4) & 0xF); | ||
| 31 | + b3 = ((b & 0xF) << 2) | ((c >> 6) & 0x3); | ||
| 32 | + b4 = c & 0x3F; | ||
| 33 | + | ||
| 34 | + if (!b) { | ||
| 35 | + b3 = b4 = 64; | ||
| 36 | + } else if (!c) { | ||
| 37 | + b4 = 64; | ||
| 38 | + } | ||
| 39 | + result += characters.charAt(b1) + characters.charAt(b2) + characters.charAt(b3) + characters.charAt(b4); | ||
| 40 | + } | ||
| 41 | + return result; | ||
| 42 | + }; | ||
| 43 | + | ||
| 44 | + //获取dom文本 | ||
| 45 | + var getText = function( el ){ | ||
| 46 | + var s = el.textContent || el.innerText; | ||
| 47 | + return s == null ? "" : s.replace( /^\s*(.*?)\s+$/, "$1"); | ||
| 48 | + }; | ||
| 49 | + view.tableExport = function(tableId, filename, type){ | ||
| 50 | + var doc = view.document, | ||
| 51 | + table = doc.getElementById(tableId), | ||
| 52 | + charSet = doc.characterSet | ||
| 53 | + | ||
| 54 | + var uri = { | ||
| 55 | + json: 'application/json;charset='+charSet, | ||
| 56 | + txt: 'csv/txt;charset='+charSet, | ||
| 57 | + csv: 'csv/txt;charset='+charSet, | ||
| 58 | + doc: 'application/vnd.ms-doc', | ||
| 59 | + excel: 'application/vnd.ms-excel' | ||
| 60 | + }; | ||
| 61 | + | ||
| 62 | + var base64 = function(s) { | ||
| 63 | + return btoa(unescape(encodeURIComponent(s))); | ||
| 64 | + }; | ||
| 65 | + var template = function(s, c) { | ||
| 66 | + return s.replace(/{(\w+)}/g, function(m, p) { | ||
| 67 | + return c[p]; | ||
| 68 | + }); | ||
| 69 | + }; | ||
| 70 | + | ||
| 71 | + var get_blob = function() { | ||
| 72 | + return view.Blob; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + var fixCSVField = function(value) { | ||
| 76 | + var fixedValue = value; | ||
| 77 | + var addQuotes = (value.indexOf(',') !== -1) || (value.indexOf('\r') !== -1) || (value.indexOf('\n') !== -1); | ||
| 78 | + var replaceDoubleQuotes = (value.indexOf('"') !== -1); | ||
| 79 | + | ||
| 80 | + if (replaceDoubleQuotes) { | ||
| 81 | + fixedValue = fixedValue.replace(/"/g, '""'); | ||
| 82 | + } | ||
| 83 | + if (addQuotes || replaceDoubleQuotes) { | ||
| 84 | + fixedValue = '"' + fixedValue + '"'; | ||
| 85 | + } | ||
| 86 | + return fixedValue; | ||
| 87 | + }; | ||
| 88 | + | ||
| 89 | + var saveData = function(data){ | ||
| 90 | + var BB = get_blob(); | ||
| 91 | + saveAs(new BB([data], {type: uri[type]}), filename + "."+type); | ||
| 92 | + }; | ||
| 93 | + | ||
| 94 | + var toCSV = function(){ | ||
| 95 | + var data = "\ufeff"; | ||
| 96 | + for (var i = 0, row; row = table.rows[i]; i++) { | ||
| 97 | + for (var j = 0, col; col = row.cells[j]; j++) { | ||
| 98 | + data = data + (j ? ',' : '') + fixCSVField(getText(col)); | ||
| 99 | + } | ||
| 100 | + data = data + "\r\n"; | ||
| 101 | + } | ||
| 102 | + saveData(data); | ||
| 103 | + }; | ||
| 104 | + | ||
| 105 | + var toJson = function(){ | ||
| 106 | + var jsonHeaderArray = []; | ||
| 107 | + | ||
| 108 | + if(table.tHead){ | ||
| 109 | + for(var i =0,col; col = table.tHead.rows[0].cells[i]; i++){ | ||
| 110 | + jsonHeaderArray.push(getText(col)); | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + var jsonArray = []; | ||
| 115 | + if(table.tBodies){ | ||
| 116 | + for(var j=0,tbody; tbody = table.tBodies[j]; j++){ | ||
| 117 | + for(var k =0, rowb; rowb= tbody.rows[k]; k++){ | ||
| 118 | + var len = jsonArray.length; | ||
| 119 | + jsonArray[len] = []; | ||
| 120 | + for (var g = 0, colb; colb = rowb.cells[g]; g++) { | ||
| 121 | + jsonArray[len].push(getText(colb)); | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + var jsonExportArray = { | ||
| 128 | + header: jsonHeaderArray, | ||
| 129 | + data: jsonArray | ||
| 130 | + }; | ||
| 131 | + saveData(JSON.stringify(jsonExportArray)); | ||
| 132 | + }; | ||
| 133 | + | ||
| 134 | + var toOffice = function(){ | ||
| 135 | + var tmpl = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:'+type+'" xmlns="http://www.w3.org/TR/REC-html40">'; | ||
| 136 | + tmpl += '<head><meta charset="'+charSet+'" /><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>'; | ||
| 137 | + tmpl += '{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->'; | ||
| 138 | + tmpl += '</head><body><table>{table}</table></body></html>'; | ||
| 139 | + var office = '', | ||
| 140 | + maph = [['<thead><tr>', '</tr></thead>'], ['<tbody><tr>', '</tr></tbody>'], ['<tr>', '</tr>']], | ||
| 141 | + mapb = [['<th>', '</th>'],['<td>', '</td>']], | ||
| 142 | + flag = +!table.tHead, | ||
| 143 | + com = 1 - flag; | ||
| 144 | + | ||
| 145 | + for(var i=0, row; row = table.rows[i]; i++){ | ||
| 146 | + flag = i > com ? 2 : flag; | ||
| 147 | + office += maph[flag][0]; | ||
| 148 | + for(var j =0, col; col = row.cells[j]; j++){ | ||
| 149 | + office += mapb[+!!flag][0]+ getText(col) +mapb[+!!flag][1]; | ||
| 150 | + } | ||
| 151 | + office += maph[flag][1]; | ||
| 152 | + flag++; | ||
| 153 | + } | ||
| 154 | + saveData(template(tmpl, {worksheet: 'Worksheet', table: office})); | ||
| 155 | + }; | ||
| 156 | + | ||
| 157 | + var typeMap = { | ||
| 158 | + json : toJson, | ||
| 159 | + txt: toCSV, | ||
| 160 | + csv: toCSV, | ||
| 161 | + doc: toOffice, | ||
| 162 | + docx: toOffice, | ||
| 163 | + xls: toOffice, | ||
| 164 | + xlsx: toOffice | ||
| 165 | + }; | ||
| 166 | + | ||
| 167 | + typeMap[type](); | ||
| 168 | + }; | ||
| 169 | + | ||
| 170 | })(window); | 170 | })(window); |
| 171 | \ No newline at end of file | 171 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/Gruntfile.js
| @@ -87,8 +87,10 @@ module.exports = function (grunt) { | @@ -87,8 +87,10 @@ module.exports = function (grunt) { | ||
| 87 | 'module/common/dts2/guideboardGroup/saGuideboardgroup.js', // 路牌选择整合指令 | 87 | 'module/common/dts2/guideboardGroup/saGuideboardgroup.js', // 路牌选择整合指令 |
| 88 | 'module/common/dts2/employeeGroup/saEmployeegroup.js', // 人员选饿整合指令 | 88 | 'module/common/dts2/employeeGroup/saEmployeegroup.js', // 人员选饿整合指令 |
| 89 | 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令 | 89 | 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令 |
| 90 | - 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令 | ||
| 91 | - 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令 | 90 | + 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令(编辑模式) |
| 91 | + 'module/common/dts2/ttinfotable/saTimeTablePreView.js', // 时刻表显示指令(预览模式) | ||
| 92 | + 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令(编辑模式) | ||
| 93 | + 'module/common/dts2/ttinfotable/saTimeTableScrolly2.js', // 时刻表滚动2显示指令(预览模式) | ||
| 92 | 'module/common/dts2/queryOption/saOrderOption.js', // saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的) | 94 | 'module/common/dts2/queryOption/saOrderOption.js', // saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的) |
| 93 | 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用) | 95 | 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用) |
| 94 | 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用) | 96 | 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用) |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreView.js
0 → 100644
| 1 | +/** | ||
| 2 | + * saTimetablePreview指令,时刻表预览模式视图。 | ||
| 3 | + */ | ||
| 4 | +angular.module("ScheduleApp").directive( | ||
| 5 | + "saTimetable2", | ||
| 6 | + [ | ||
| 7 | + '$timeout', | ||
| 8 | + function($timeout) { | ||
| 9 | + return { | ||
| 10 | + restrict : 'E', | ||
| 11 | + templateUrl : '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html', | ||
| 12 | + scope : { // 独立作用域 | ||
| 13 | + // 使用外部数据源,内部重新组合显示 | ||
| 14 | + ds : "=ngModel" | ||
| 15 | + }, | ||
| 16 | + controllerAs : "$saTimeTablePreviewCtrl", | ||
| 17 | + bindToController: true, | ||
| 18 | + controller : function() { | ||
| 19 | + var self = this; | ||
| 20 | + | ||
| 21 | + // 内部班次时刻模型 | ||
| 22 | + self.internalBcModel = { | ||
| 23 | + up_qdz_name : "", // 上行起点站名字 | ||
| 24 | + down_qdz_name : "", // 下行起点站名字 | ||
| 25 | + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序) | ||
| 26 | + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序) | ||
| 27 | + }; | ||
| 28 | + | ||
| 29 | + // 内部各个路牌block车次链模型 | ||
| 30 | + self.internalLpBlockModel = { | ||
| 31 | + // key:路牌名字 | ||
| 32 | + // value: 数组(按照发车时间排序) | ||
| 33 | + // value 数据内对象 {fcsj:发车时间,isUp:是否上行,fcno:发车顺序号,index:对应的班次列表索引} | ||
| 34 | + }; | ||
| 35 | + | ||
| 36 | + // TODO: | ||
| 37 | + }, | ||
| 38 | + | ||
| 39 | + /**, | ||
| 40 | + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom | ||
| 41 | + * @param tElem | ||
| 42 | + * @param tAttrs | ||
| 43 | + * @returns {{pre: Function, post: Function}} | ||
| 44 | + */ | ||
| 45 | + compile : function(tElem, tAttrs) { | ||
| 46 | + // 获取属性 | ||
| 47 | + var $attr_name = tAttrs["name"]; // 控件的名字 | ||
| 48 | + if (!$attr_name) { | ||
| 49 | + throw new Error("saTimeTablePreview指令 name属性required"); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + // 内部controlAs名字 | ||
| 53 | + var ctrlAs = "$saTimeTablePreviewCtrl"; | ||
| 54 | + | ||
| 55 | + // TODO: | ||
| 56 | + | ||
| 57 | + //------------------ 内部方法 --------------------// | ||
| 58 | + var date_wrap_prefix = "2000-01-01 "; // 包装日期的前缀 | ||
| 59 | + var date_wrap_format = "YYYY-MM-DD HH:mm"; // 日期格式 | ||
| 60 | + /** | ||
| 61 | + * 将时间包装成日期,方便计算。 | ||
| 62 | + * @param timeStr 时间格式,如 06:30 | ||
| 63 | + * @returns moment对象 | ||
| 64 | + */ | ||
| 65 | + var _fun_WrapTime = function(timeStr) { | ||
| 66 | + return moment( | ||
| 67 | + date_wrap_prefix + timeStr, | ||
| 68 | + date_wrap_format | ||
| 69 | + ); | ||
| 70 | + }; | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * 点击班次html元素(dl),触发班次移动,如下: | ||
| 74 | + * 1、点击上行班次,下一个下行班次在下行班次列表中移到中间位置 | ||
| 75 | + * 2、点击下行班次,下一个上行班次在上行班次列表中移到中间位置 | ||
| 76 | + * @param ctrl 内部控制器 | ||
| 77 | + * @param index 班次索引 | ||
| 78 | + * @param isUp 是否上行 | ||
| 79 | + * @private | ||
| 80 | + */ | ||
| 81 | + var _fun_bcDDViewMove = function(ctrl, index, isUp) { | ||
| 82 | + // 获取当前点击班次对象 | ||
| 83 | + var oBc; | ||
| 84 | + if (isUp) { | ||
| 85 | + oBc = ctrl.internalBcModel.up_bc_list_asc[index]; | ||
| 86 | + } else { | ||
| 87 | + oBc = ctrl.internalBcModel.down_bc_list_asc[index]; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + // 找出车次链中的下一个班次索引,没有就undefined | ||
| 91 | + var nextIndex = undefined; | ||
| 92 | + var nextBlockBc = undefined; | ||
| 93 | + var currentBlockBcIndex = undefined; | ||
| 94 | + angular.forEach(ctrl.internalLpBlockModel[oBc.lpName], function(data, i) { | ||
| 95 | + if (data.fcsj == oBc.fcsj) { | ||
| 96 | + currentBlockBcIndex = i; | ||
| 97 | + } | ||
| 98 | + }); | ||
| 99 | + if (currentBlockBcIndex != undefined && | ||
| 100 | + currentBlockBcIndex < (ctrl.internalLpBlockModel[oBc.lpName].length - 1)) { | ||
| 101 | + nextBlockBc = ctrl.internalLpBlockModel[oBc.lpName][currentBlockBcIndex + 1]; | ||
| 102 | + nextIndex = nextBlockBc.index; | ||
| 103 | + } | ||
| 104 | + // 先删除click标记,再添加 | ||
| 105 | + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data) { | ||
| 106 | + delete data["isClick"]; | ||
| 107 | + }); | ||
| 108 | + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data) { | ||
| 109 | + delete data["isClick"]; | ||
| 110 | + }); | ||
| 111 | + oBc.isClick = true; | ||
| 112 | + if (nextIndex) { | ||
| 113 | + if (nextBlockBc.isUp) { | ||
| 114 | + ctrl.internalBcModel.up_bc_list_asc[nextIndex].isClick = true; | ||
| 115 | + } else { | ||
| 116 | + ctrl.internalBcModel.down_bc_list_asc[nextIndex].isClick = true; | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + // 移动,同方向不移动 | ||
| 121 | + var clientHeight = angular.element("#temp").height() - 34; | ||
| 122 | + if (nextBlockBc && isUp != nextBlockBc.isUp) { | ||
| 123 | + if (isUp) { // 移动下行 | ||
| 124 | + angular.element(".ttpv_table_scrollbar:eq(1)").animate( | ||
| 125 | + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400); | ||
| 126 | + } else { // 移动上行 | ||
| 127 | + angular.element(".ttpv_table_scrollbar:eq(0)").animate( | ||
| 128 | + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400); | ||
| 129 | + } | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + }; | ||
| 133 | + | ||
| 134 | + /** | ||
| 135 | + * 刷新内部数据。 | ||
| 136 | + * @param ctrl 内部控制器对象($saTimeTablePreviewCtrl) | ||
| 137 | + * @private | ||
| 138 | + */ | ||
| 139 | + var _fun_refreshInternalModel = function(ctrl) { | ||
| 140 | + // 初始化内部数据 | ||
| 141 | + ctrl.internalBcModel = { | ||
| 142 | + up_qdz_name : "", // 上行起点站名字 | ||
| 143 | + up_zdz_name : "", // 上行终点站名字 | ||
| 144 | + down_qdz_name : "", // 下行起点站名字 | ||
| 145 | + down_zdz_name : "", // 下行终点站名字 | ||
| 146 | + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序) | ||
| 147 | + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序) | ||
| 148 | + }; | ||
| 149 | + ctrl.internalLpBlockModel = { | ||
| 150 | + | ||
| 151 | + }; | ||
| 152 | + | ||
| 153 | + // ngModel传入的数据 | ||
| 154 | + var dataSource = ctrl.ds.bcList; | ||
| 155 | + | ||
| 156 | + // 构造上下行班次列表,并确定上下行的首发站点 | ||
| 157 | + angular.forEach(dataSource, function(bcObj) { | ||
| 158 | + var _internalBcObj = {}; | ||
| 159 | + // 构造内部班次对象 | ||
| 160 | + _internalBcObj.lpName = bcObj.lp.lpName; // 路牌 | ||
| 161 | + _internalBcObj.fcsj = bcObj.fcsj; // 发车时间 | ||
| 162 | + _internalBcObj.ddsj = _fun_WrapTime(bcObj.fcsj).add(bcObj.bcsj, "m").format("HH:mm"); | ||
| 163 | + _internalBcObj.qdzName = bcObj.qdzName; // 起点站名字 | ||
| 164 | + _internalBcObj.zdzName = bcObj.zdzName; // 终点站名字 | ||
| 165 | + _internalBcObj.bcType = bcObj.bcType; // 班次类型 | ||
| 166 | + _internalBcObj.isTs = bcObj.isTS; // 是否停驶 | ||
| 167 | + _internalBcObj.isFb = bcObj.isFB; // 是否分班 | ||
| 168 | + _internalBcObj.remark = bcObj.remark; // 备注 | ||
| 169 | + _internalBcObj._fcno = bcObj.fcno; // 发车顺序号 | ||
| 170 | + | ||
| 171 | + if (bcObj.xlDir == "0") { // 上行 | ||
| 172 | + ctrl.internalBcModel.up_bc_list_asc.push(_internalBcObj); | ||
| 173 | + // 确定起点站 | ||
| 174 | + if (ctrl.internalBcModel.up_qdz_name == "") { | ||
| 175 | + if (bcObj.bcType == "normal") { | ||
| 176 | + ctrl.internalBcModel.up_qdz_name = bcObj.qdzName; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + // 确定终点站 | ||
| 180 | + if (ctrl.internalBcModel.up_zdz_name == "") { | ||
| 181 | + if (bcObj.bcType == "normal") { | ||
| 182 | + ctrl.internalBcModel.up_zdz_name = bcObj.zdzName; | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + if (bcObj.xlDir == "1") { // 下行 | ||
| 187 | + ctrl.internalBcModel.down_bc_list_asc.push(_internalBcObj); | ||
| 188 | + // 确定起点站 | ||
| 189 | + if (ctrl.internalBcModel.down_qdz_name == "") { | ||
| 190 | + if (bcObj.bcType == "normal") { | ||
| 191 | + ctrl.internalBcModel.down_qdz_name = bcObj.qdzName; | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + // 确定终点站 | ||
| 195 | + if (ctrl.internalBcModel.down_zdz_name == "") { | ||
| 196 | + if (bcObj.bcType == "normal") { | ||
| 197 | + ctrl.internalBcModel.down_zdz_name = bcObj.zdzName; | ||
| 198 | + } | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + }); | ||
| 203 | + | ||
| 204 | + // 发车时间升序排序上行班次 | ||
| 205 | + ctrl.internalBcModel.up_bc_list_asc.sort(function(a, b) { | ||
| 206 | + var a_wrapTime = _fun_WrapTime(a.fcsj); | ||
| 207 | + var b_wrapTime = _fun_WrapTime(b.fcsj); | ||
| 208 | + | ||
| 209 | + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定 | ||
| 210 | + // TODO:以后要配合首班车的发车时间判定 | ||
| 211 | + if (a.fcsj.indexOf("00:") == 0 || | ||
| 212 | + a.fcsj.indexOf("01:") == 0 || | ||
| 213 | + a.fcsj.indexOf("02:") == 0) { | ||
| 214 | + a_wrapTime.add(1, "day"); | ||
| 215 | + } | ||
| 216 | + if (b.fcsj.indexOf("00:") == 0 || | ||
| 217 | + b.fcsj.indexOf("01:") == 0 || | ||
| 218 | + b.fcsj.indexOf("02:") == 0) { | ||
| 219 | + b_wrapTime.add(1, "day"); | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + if (a_wrapTime.isBefore(b_wrapTime)) { | ||
| 223 | + return -1; | ||
| 224 | + } else if (a_wrapTime.isAfter(b_wrapTime)) { | ||
| 225 | + return 1; | ||
| 226 | + } else { | ||
| 227 | + return 0; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + }); | ||
| 231 | + // 发车时间升序排序下行班次 | ||
| 232 | + ctrl.internalBcModel.down_bc_list_asc.sort(function(a, b) { | ||
| 233 | + var a_wrapTime = _fun_WrapTime(a.fcsj); | ||
| 234 | + var b_wrapTime = _fun_WrapTime(b.fcsj); | ||
| 235 | + | ||
| 236 | + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定 | ||
| 237 | + // TODO:以后要配合首班车的发车时间判定 | ||
| 238 | + if (a.fcsj.indexOf("00:") == 0 || | ||
| 239 | + a.fcsj.indexOf("01:") == 0 || | ||
| 240 | + a.fcsj.indexOf("02:") == 0) { | ||
| 241 | + a_wrapTime.add(1, "day"); | ||
| 242 | + } | ||
| 243 | + if (b.fcsj.indexOf("00:") == 0 || | ||
| 244 | + b.fcsj.indexOf("01:") == 0 || | ||
| 245 | + b.fcsj.indexOf("02:") == 0) { | ||
| 246 | + b_wrapTime.add(1, "day"); | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + if (a_wrapTime.isBefore(b_wrapTime)) { | ||
| 250 | + return -1; | ||
| 251 | + } else if (a_wrapTime.isAfter(b_wrapTime)) { | ||
| 252 | + return 1; | ||
| 253 | + } else { | ||
| 254 | + return 0; | ||
| 255 | + } | ||
| 256 | + }); | ||
| 257 | + | ||
| 258 | + // 构造路牌block车次链,按照发车顺序排序 | ||
| 259 | + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data, index) { | ||
| 260 | + if (!ctrl.internalLpBlockModel[data.lpName]) { | ||
| 261 | + ctrl.internalLpBlockModel[data.lpName] = []; | ||
| 262 | + } | ||
| 263 | + ctrl.internalLpBlockModel[data.lpName].push({ | ||
| 264 | + fcsj : data.fcsj, | ||
| 265 | + isUp : true, | ||
| 266 | + fcno : data._fcno, | ||
| 267 | + index : index | ||
| 268 | + }); | ||
| 269 | + }); | ||
| 270 | + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data, index) { | ||
| 271 | + if (!ctrl.internalLpBlockModel[data.lpName]) { | ||
| 272 | + ctrl.internalLpBlockModel[data.lpName] = []; | ||
| 273 | + } | ||
| 274 | + ctrl.internalLpBlockModel[data.lpName].push({ | ||
| 275 | + fcsj : data.fcsj, | ||
| 276 | + isUp : false, | ||
| 277 | + fcno : data._fcno, | ||
| 278 | + index : index | ||
| 279 | + }); | ||
| 280 | + }); | ||
| 281 | + angular.forEach(ctrl.internalLpBlockModel, function(value, key) { | ||
| 282 | + value.sort(function (a, b) { | ||
| 283 | + if (a.fcno < b.fcno) { | ||
| 284 | + return -1; | ||
| 285 | + } else if (a.fcno > b.fcno) { | ||
| 286 | + return 1; | ||
| 287 | + } else { | ||
| 288 | + return 0; | ||
| 289 | + } | ||
| 290 | + }); | ||
| 291 | + }); | ||
| 292 | + | ||
| 293 | + | ||
| 294 | + }; | ||
| 295 | + | ||
| 296 | + return { | ||
| 297 | + pre : function(scope, element, attr) { | ||
| 298 | + // TODO: | ||
| 299 | + }, | ||
| 300 | + post : function(scope, element, attr) { | ||
| 301 | + // 班次html点击事件 | ||
| 302 | + scope[ctrlAs].$$bcDD_Click = function(index, xlDir) { | ||
| 303 | + _fun_bcDDViewMove(scope[ctrlAs], index, xlDir); | ||
| 304 | + }; | ||
| 305 | + | ||
| 306 | + // 监控ngModel绑定的外部数据源的刷新状态变化 | ||
| 307 | + scope.$watch( | ||
| 308 | + function() { | ||
| 309 | + return scope[ctrlAs].ds.refreshInfos; | ||
| 310 | + }, | ||
| 311 | + function(newValue, oldValue) { | ||
| 312 | + if (newValue === undefined && oldValue === undefined) { | ||
| 313 | + return; | ||
| 314 | + } | ||
| 315 | + console.log("saTimetable2 refresh"); | ||
| 316 | + _fun_refreshInternalModel(scope[ctrlAs]); | ||
| 317 | + }, | ||
| 318 | + true | ||
| 319 | + ); | ||
| 320 | + } | ||
| 321 | + }; | ||
| 322 | + } | ||
| 323 | + }; | ||
| 324 | + } | ||
| 325 | + ] | ||
| 326 | +); | ||
| 0 | \ No newline at end of file | 327 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html
0 → 100644
| 1 | +<style> | ||
| 2 | + .ttpv_detail { | ||
| 3 | + height: 100%; | ||
| 4 | + } | ||
| 5 | + .ttpv_detail .container-fluid { | ||
| 6 | + height: 100%; | ||
| 7 | + margin-left: 0; | ||
| 8 | + } | ||
| 9 | + .ttpv_detail .container-fluid>* { | ||
| 10 | + padding: 0; | ||
| 11 | + } | ||
| 12 | + .ttpv_detail .container-fluid.top-container { | ||
| 13 | + margin-top: 5px; | ||
| 14 | + padding: 0; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + .ttpv_detail .detail-panel { | ||
| 18 | + padding: 0; | ||
| 19 | + height: 100%; | ||
| 20 | + border: 1px solid #ddd; | ||
| 21 | + background: #fafafa; | ||
| 22 | + border-radius: 10px !important; | ||
| 23 | + moz-user-select: -moz-none; | ||
| 24 | + -moz-user-select: none; | ||
| 25 | + -o-user-select: none; | ||
| 26 | + -khtml-user-select: none; | ||
| 27 | + -webkit-user-select: none; | ||
| 28 | + -ms-user-select: none; | ||
| 29 | + user-select: none; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + .ttpv_detail .detail-panel .detail-wrap { | ||
| 33 | + height: calc(100% - 1px); | ||
| 34 | + padding: 0; | ||
| 35 | + | ||
| 36 | + font-size: 14px; | ||
| 37 | + color: #cccaca; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + .ttpv_detail .detail-panel .detail-wrap .detail-title { | ||
| 41 | + margin: 7px 0 5px; | ||
| 42 | + text-indent: 5px; | ||
| 43 | + margin: 0; | ||
| 44 | + height: 31px; | ||
| 45 | + line-height: 31px; | ||
| 46 | + color: #2765A7; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + .ttpv_detail .detail-panel .detail-wrap .detail-body { | ||
| 50 | + height: calc(100% - 37px); | ||
| 51 | + background: #fff; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + .ttpv_detail .detail-panel .detail-wrap .detail-body .ttpv_table_wrap { | ||
| 55 | + width: 100%; | ||
| 56 | + height: 100%; | ||
| 57 | + border-left: 0; | ||
| 58 | + border-bottom: 0; | ||
| 59 | + overflow: auto; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | +</style> | ||
| 63 | + | ||
| 64 | +<style> | ||
| 65 | + /** 表格样式 */ | ||
| 66 | + .ttpv_table { | ||
| 67 | + position: relative; | ||
| 68 | + padding-top: 34px; | ||
| 69 | + font-size: 13px; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + .ttpv_table dl { | ||
| 73 | + display: block; | ||
| 74 | + /*width: 100%;*/ | ||
| 75 | + margin: 0; | ||
| 76 | + /*border-bottom: 1px solid;*/ | ||
| 77 | + cursor: default; | ||
| 78 | + } | ||
| 79 | + .ttpv_table dl { | ||
| 80 | + font-size: 0; | ||
| 81 | + white-space: nowrap; | ||
| 82 | + } | ||
| 83 | + .ttpv_table dl { | ||
| 84 | + transition: all .1s ease; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + .ttpv_table dl dd, .ttpv_table dl dt { | ||
| 88 | + display: inline-block; | ||
| 89 | + white-space: nowrap; | ||
| 90 | + overflow: hidden; | ||
| 91 | + text-overflow: ellipsis; | ||
| 92 | + height: 100%; | ||
| 93 | + line-height: 34px; | ||
| 94 | + border-right: 1px solid; | ||
| 95 | + text-indent: 5px; | ||
| 96 | + } | ||
| 97 | + .ttpv_table dl dd, .ttpv_table dl dt { | ||
| 98 | + border-right-color: #dedede; | ||
| 99 | + font-size: 13px; | ||
| 100 | + /*border-bottom: 1px solid #dedede;*/ | ||
| 101 | + border-top: 1px solid #dedede; | ||
| 102 | + text-align: center; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + .ttpv_table > .ttpv_table_head { | ||
| 106 | + position: absolute; | ||
| 107 | + top: 0; | ||
| 108 | + height: 34px; | ||
| 109 | + background: #f5f5f5; | ||
| 110 | + /*width: 100%;*/ | ||
| 111 | + line-height: 34px; | ||
| 112 | + z-index: 1; | ||
| 113 | + } | ||
| 114 | + .ttpv_table_head dl { | ||
| 115 | + border-bottom: 2px solid #96b9d7; | ||
| 116 | + color: #333333; | ||
| 117 | + height: 34px; | ||
| 118 | + background-color: #f5f5f5; | ||
| 119 | + } | ||
| 120 | + .ttpv_table_head dl dt { | ||
| 121 | + font-weight: normal; | ||
| 122 | + font-size: 12px; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + .ttpv_table_head dl dt:nth-of-type(1) { | ||
| 126 | + width: 50px; | ||
| 127 | + height: 34px; | ||
| 128 | + } | ||
| 129 | + .ttpv_table_head dl dt:nth-of-type(2) { | ||
| 130 | + width: 55px; | ||
| 131 | + height: 34px; | ||
| 132 | + } | ||
| 133 | + .ttpv_table_head dl dt:nth-of-type(3) { | ||
| 134 | + width: 120px; | ||
| 135 | + height: 34px; | ||
| 136 | + } | ||
| 137 | + .ttpv_table_head dl dt:nth-of-type(4) { | ||
| 138 | + width: 100px; | ||
| 139 | + height: 34px; | ||
| 140 | + } | ||
| 141 | + .ttpv_table_head dl dt:nth-of-type(5) { | ||
| 142 | + width: 200px; | ||
| 143 | + height: 34px; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + .ttpv_table > .ttpv_table_body { | ||
| 147 | + /*width: 100%;*/ | ||
| 148 | + position: absolute; | ||
| 149 | + border-bottom: 1px solid #dedede; | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + .ttpv_table_body dd.ists { | ||
| 153 | + background: #105383 !important; | ||
| 154 | + color: white !important; | ||
| 155 | + } | ||
| 156 | + .ttpv_table_body dd.region { | ||
| 157 | + background: #686d7b !important; | ||
| 158 | + color: white !important; | ||
| 159 | + } | ||
| 160 | + .ttpv_table_body dd.isfb { | ||
| 161 | + background: #adff00 !important; | ||
| 162 | + color: #501a1a !important; | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + .ttpv_table_body dd.istsClick { | ||
| 166 | + background: linear-gradient(to right,#8baabf,#105383,#808086)!important; | ||
| 167 | + } | ||
| 168 | + .ttpv_table_body dd.regionClick { | ||
| 169 | + background: linear-gradient(to right,#8baabf,#686d7b,#a09997)!important; | ||
| 170 | + } | ||
| 171 | + .ttpv_table_body dd.isfbClick { | ||
| 172 | + background: linear-gradient(to right,#8baabf,#adff00,#a09997)!important; | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + .ttpv_table_body dl dd:nth-of-type(1) { | ||
| 176 | + width: 50px; | ||
| 177 | + height: 30px; | ||
| 178 | + } | ||
| 179 | + .ttpv_table_body dl dd:nth-of-type(2) { | ||
| 180 | + width: 55px; | ||
| 181 | + height: 30px; | ||
| 182 | + } | ||
| 183 | + .ttpv_table_body dl dd:nth-of-type(3) { | ||
| 184 | + width: 120px; | ||
| 185 | + height: 30px; | ||
| 186 | + text-align: left; | ||
| 187 | + } | ||
| 188 | + .ttpv_table_body dl dd:nth-of-type(4) { | ||
| 189 | + width: 100px; | ||
| 190 | + height: 30px; | ||
| 191 | + } | ||
| 192 | + .ttpv_table_body dl dd:nth-of-type(5) { | ||
| 193 | + width: 200px; | ||
| 194 | + height: 30px; | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + .ttpv_table_body dd:nth-of-type(1) { | ||
| 198 | + color: #2765A7; | ||
| 199 | + background: #eae8e8; | ||
| 200 | + /*border-bottom: 1px solid #b3b3b3;*/ | ||
| 201 | + border-right: 1px solid #b3b3b3; | ||
| 202 | + text-indent: -3px; | ||
| 203 | + } | ||
| 204 | + .ttpv_table_body dd:nth-of-type(n + 2) { | ||
| 205 | + color: #2765A7; | ||
| 206 | + } | ||
| 207 | + .ttpv_table_body dl:hover { | ||
| 208 | + box-shadow: 0 0 4px #656c71; | ||
| 209 | + background: #f5fbff; | ||
| 210 | + } | ||
| 211 | + .ttpv_table_body dl:hover dd:nth-of-type(1) { | ||
| 212 | + background: #fafafa; | ||
| 213 | + background: linear-gradient(to right, #fafafa, #f5fbff); | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + .isClick { | ||
| 217 | + background: #8baabf!important; | ||
| 218 | + color: #fff!important; | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | +</style> | ||
| 222 | + | ||
| 223 | +<style> | ||
| 224 | + /** 滚动条css样式 */ | ||
| 225 | + | ||
| 226 | + .ttpv_table_scrollbar::-webkit-scrollbar { | ||
| 227 | + width: 18px; | ||
| 228 | + height: 18px; | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + .ttpv_table_scrollbar::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb { | ||
| 232 | + border-radius: 999px; | ||
| 233 | + border: 5px solid transparent; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + .ttpv_table_scrollbar::-webkit-scrollbar-track { | ||
| 237 | + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset; | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + .ttpv_table_scrollbar::-webkit-scrollbar-thumb { | ||
| 241 | + min-height: 20px; | ||
| 242 | + background-clip: content-box; | ||
| 243 | + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset; | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + .ttpv_table_scrollbar::-webkit-scrollbar-corner { | ||
| 247 | + background: transparent; | ||
| 248 | + } | ||
| 249 | +</style> | ||
| 250 | + | ||
| 251 | +<div class="ttpv_detail"> | ||
| 252 | + <div class="container-fluid top-container"> | ||
| 253 | + <div class="col-md-12 container-fluid"> | ||
| 254 | + <div class="col-md-6" style="height: 100%; padding-right: 3px;"> | ||
| 255 | + <div class="detail-panel"> | ||
| 256 | + <div class="detail-wrap" > | ||
| 257 | + <h3 class="detail-title"> | ||
| 258 | + 上行: | ||
| 259 | + {{$saTimeTablePreviewCtrl.internalBcModel.up_qdz_name}} | ||
| 260 | + <i class="fa fa-angle-double-right" aria-hidden="true"></i> | ||
| 261 | + {{$saTimeTablePreviewCtrl.internalBcModel.up_zdz_name}} | ||
| 262 | + </h3> | ||
| 263 | + <div id="temp" class="detail-body"> | ||
| 264 | + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".upFixHead"> | ||
| 265 | + <div class="ttpv_table"> | ||
| 266 | + <div class="ttpv_table_head upFixHead"> | ||
| 267 | + <dl> | ||
| 268 | + <dt>序号</dt> | ||
| 269 | + <dt>路牌</dt> | ||
| 270 | + <dt>发车时间</dt> | ||
| 271 | + <dt>到达时间</dt> | ||
| 272 | + <dt>备注</dt> | ||
| 273 | + </dl> | ||
| 274 | + </div> | ||
| 275 | + <div class="ttpv_table_body"> | ||
| 276 | + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.internalBcModel.up_bc_list_asc track by $index" | ||
| 277 | + ng-click="$saTimeTablePreviewCtrl.$$bcDD_Click($index, true)"> | ||
| 278 | + <dd>{{$index + 1}}</dd> | ||
| 279 | + <dd ng-class="{isClick : bc.isClick}"> | ||
| 280 | + {{bc.lpName}} | ||
| 281 | + </dd> | ||
| 282 | + <dd ng-class="{ | ||
| 283 | + ists: (bc.isTs && !bc.isClick), | ||
| 284 | + istsClick: (bc.isTs && bc.isClick), | ||
| 285 | + region: (bc.bcType == 'region' && !bc.isClick), | ||
| 286 | + regionClick : (bc.bcType == 'region' && bc.isClick), | ||
| 287 | + isfb: (bc.isFb && !bc.isClick), | ||
| 288 | + isfbClick : (bc.isFb && bc.isClick), | ||
| 289 | + isClick: bc.isClick}"> | ||
| 290 | + {{bc.fcsj}} | ||
| 291 | + <span class="badge" | ||
| 292 | + style="border-radius: 2px !important; background-color: #f9a124;" | ||
| 293 | + ng-show="bc.bcType == 'out'">出场</span> | ||
| 294 | + <span class="badge" | ||
| 295 | + style="border-radius: 2px !important; background-color: #f9a124;" | ||
| 296 | + ng-show="bc.bcType == 'in'">进场</span> | ||
| 297 | + </dd> | ||
| 298 | + <dd ng-class="{isClick : bc.isClick}"> | ||
| 299 | + {{bc.ddsj}} | ||
| 300 | + </dd> | ||
| 301 | + <dd ng-class="{isClick : bc.isClick}">{{bc.remark}}</dd> | ||
| 302 | + </dl> | ||
| 303 | + </div> | ||
| 304 | + </div> | ||
| 305 | + </div> | ||
| 306 | + </div> | ||
| 307 | + </div> | ||
| 308 | + </div> | ||
| 309 | + </div> | ||
| 310 | + | ||
| 311 | + <div class="col-md-6" style="height: 100%; padding-left: 3px;"> | ||
| 312 | + <div class="detail-panel"> | ||
| 313 | + <div class="detail-wrap" > | ||
| 314 | + <h3 class="detail-title"> | ||
| 315 | + 下行: | ||
| 316 | + {{$saTimeTablePreviewCtrl.internalBcModel.down_qdz_name}} | ||
| 317 | + <i class="fa fa-angle-double-right" aria-hidden="true"></i> | ||
| 318 | + {{$saTimeTablePreviewCtrl.internalBcModel.down_zdz_name}} | ||
| 319 | + </h3> | ||
| 320 | + <div class="detail-body"> | ||
| 321 | + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".downFixHead"> | ||
| 322 | + <div class="ttpv_table"> | ||
| 323 | + <div class="ttpv_table_head downFixHead"> | ||
| 324 | + <dl> | ||
| 325 | + <dt>序号</dt> | ||
| 326 | + <dt>路牌</dt> | ||
| 327 | + <dt>发车时间</dt> | ||
| 328 | + <dt>到达时间</dt> | ||
| 329 | + <dt>备注</dt> | ||
| 330 | + </dl> | ||
| 331 | + </div> | ||
| 332 | + <div class="ttpv_table_body"> | ||
| 333 | + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.internalBcModel.down_bc_list_asc track by $index" | ||
| 334 | + ng-click="$saTimeTablePreviewCtrl.$$bcDD_Click($index, false)"> | ||
| 335 | + <dd>{{$index + 1}}</dd> | ||
| 336 | + <dd ng-class="{isClick : bc.isClick}"> | ||
| 337 | + {{bc.lpName}} | ||
| 338 | + </dd> | ||
| 339 | + <dd ng-class="{ | ||
| 340 | + ists: (bc.isTs && !bc.isClick), | ||
| 341 | + istsClick: (bc.isTs && bc.isClick), | ||
| 342 | + region: (bc.bcType == 'region' && !bc.isClick), | ||
| 343 | + regionClick : (bc.bcType == 'region' && bc.isClick), | ||
| 344 | + isfb: (bc.isFb && !bc.isClick), | ||
| 345 | + isfbClick : (bc.isFb && bc.isClick), | ||
| 346 | + isClick: bc.isClick}"> | ||
| 347 | + {{bc.fcsj}} | ||
| 348 | + <span class="badge" | ||
| 349 | + style="border-radius: 2px !important; background-color: #f9a124;" | ||
| 350 | + ng-show="bc.bcType == 'out'">出场</span> | ||
| 351 | + <span class="badge" | ||
| 352 | + style="border-radius: 2px !important; background-color: #f9a124;" | ||
| 353 | + ng-show="bc.bcType == 'in'">进场</span> | ||
| 354 | + </dd> | ||
| 355 | + <dd ng-class="{isClick : bc.isClick}"> | ||
| 356 | + {{bc.ddsj}} | ||
| 357 | + </dd> | ||
| 358 | + <dd ng-class="{isClick : bc.isClick}">{{bc.remark}}</dd> | ||
| 359 | + </dl> | ||
| 360 | + </div> | ||
| 361 | + </div> | ||
| 362 | + </div> | ||
| 363 | + </div> | ||
| 364 | + </div> | ||
| 365 | + </div> | ||
| 366 | + </div> | ||
| 367 | + | ||
| 368 | + </div> | ||
| 369 | + </div> | ||
| 370 | +</div> | ||
| 371 | + | ||
| 372 | + | ||
| 373 | + | ||
| 374 | + | ||
| 375 | + | ||
| 376 | + | ||
| 377 | + | ||
| 378 | + | ||
| 379 | + | ||
| 380 | + | ||
| 381 | + |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableScrolly2.js
0 → 100644
| 1 | +/** | ||
| 2 | + * 滚动事件控制指令。 | ||
| 3 | + */ | ||
| 4 | +angular.module('ScheduleApp').directive( | ||
| 5 | + 'saTscrolly2', | ||
| 6 | + [ | ||
| 7 | + function() { | ||
| 8 | + return { | ||
| 9 | + restrict: 'A', | ||
| 10 | + | ||
| 11 | + compile: function(tElem, tAttrs) { | ||
| 12 | + | ||
| 13 | + return { | ||
| 14 | + pre: function(scope, element, attr) { | ||
| 15 | + // TODO: | ||
| 16 | + //alert(element.find("#tooltipTest").html()); | ||
| 17 | + //$compile(element.find("#tooltipTest"))(scope); | ||
| 18 | + | ||
| 19 | + }, | ||
| 20 | + | ||
| 21 | + post: function(scope, element, attr) { | ||
| 22 | + //var head = element[0]; | ||
| 23 | + | ||
| 24 | + //console.log("llllllllload"); | ||
| 25 | + //console.log(element.name); | ||
| 26 | + | ||
| 27 | + element.bind('scroll', function() { | ||
| 28 | + //console.log("top=", angular.element(".tt_table_head").css("top")); | ||
| 29 | + //console.log("left=", angular.element(".tt_table_head").css("left")); | ||
| 30 | + //console.log("s top=" + element.scrollTop()); | ||
| 31 | + | ||
| 32 | + angular.element(attr.scrclass).css("top", element.scrollTop()); | ||
| 33 | + // angular.element(".tt_table_head:eq(0)").css("left", element.scrollLeft()); | ||
| 34 | + // angular.element(".tt_table_body:eq(0)").css("left", element.scrollLeft()); | ||
| 35 | + | ||
| 36 | + }); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + }; | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + ] | ||
| 44 | +); | ||
| 0 | \ No newline at end of file | 45 | \ No newline at end of file |