Commit 1b8a5ac1c79a6b34a36b6d9335b4d1a7d357ae7c
Merge branch 'minhang' into pudong
Showing
21 changed files
with
2416 additions
and
1507 deletions
Too many changes to show.
To preserve performance only 21 of 64 files are displayed.
src/main/java/com/bsth/controller/report/ReportController.java
| ... | ... | @@ -48,5 +48,25 @@ public class ReportController { |
| 48 | 48 | @RequestParam String code) { |
| 49 | 49 | return service.historyMessageCount(line, date, code); |
| 50 | 50 | } |
| 51 | + | |
| 52 | + @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET) | |
| 53 | + public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String date) { | |
| 54 | + return service.tbodyTime1(line, date); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET) | |
| 58 | + public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String date) { | |
| 59 | + return service.tbodyTime2(line, date); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET) | |
| 63 | + public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String date) { | |
| 64 | + return service.tbodyTime3(line, date); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET) | |
| 68 | + public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String date) { | |
| 69 | + return service.tbodyTime5(line, date); | |
| 70 | + } | |
| 51 | 71 | |
| 52 | 72 | } | ... | ... |
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
| ... | ... | @@ -3,25 +3,24 @@ package com.bsth.controller.schedule; |
| 3 | 3 | import com.bsth.service.TrafficManageService; |
| 4 | 4 | |
| 5 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 7 | 6 | import org.springframework.web.bind.annotation.RequestMapping; |
| 8 | 7 | import org.springframework.web.bind.annotation.RequestMethod; |
| 9 | 8 | import org.springframework.web.bind.annotation.RequestParam; |
| 10 | 9 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 10 | |
| 12 | 11 | /** |
| 13 | - * | |
| 12 | + * | |
| 14 | 13 | * @author BSTH |
| 15 | 14 | * |
| 16 | 15 | */ |
| 17 | 16 | @RestController |
| 18 | 17 | @RequestMapping("trmg") |
| 19 | 18 | public class TrafficManageController { |
| 20 | - | |
| 19 | + | |
| 21 | 20 | @Autowired |
| 22 | - private TrafficManageService trManageService; | |
| 23 | - | |
| 24 | - | |
| 21 | + private TrafficManageService trManageService; | |
| 22 | + | |
| 23 | + | |
| 25 | 24 | @RequestMapping(value = "/setXL", method = RequestMethod.GET) |
| 26 | 25 | public String setXL() throws Exception { |
| 27 | 26 | try { |
| ... | ... | @@ -30,7 +29,7 @@ public class TrafficManageController { |
| 30 | 29 | throw new Exception(exp.getCause()); |
| 31 | 30 | } |
| 32 | 31 | } |
| 33 | - | |
| 32 | + | |
| 34 | 33 | @RequestMapping(value = "/setCL", method = RequestMethod.GET) |
| 35 | 34 | public String setCL() throws Exception { |
| 36 | 35 | try { |
| ... | ... | @@ -39,7 +38,7 @@ public class TrafficManageController { |
| 39 | 38 | throw new Exception(exp.getCause()); |
| 40 | 39 | } |
| 41 | 40 | } |
| 42 | - | |
| 41 | + | |
| 43 | 42 | @RequestMapping(value = "/setSJ", method = RequestMethod.GET) |
| 44 | 43 | public String setSJ() throws Exception { |
| 45 | 44 | try { |
| ... | ... | @@ -48,16 +47,43 @@ public class TrafficManageController { |
| 48 | 47 | throw new Exception(exp.getCause()); |
| 49 | 48 | } |
| 50 | 49 | } |
| 51 | - | |
| 52 | - @RequestMapping(value = "/setCS", method = RequestMethod.GET) | |
| 53 | - public String setCS() throws Exception { | |
| 50 | + | |
| 51 | + @RequestMapping(value = "/setLD", method = RequestMethod.GET) | |
| 52 | + public String setLD() throws Exception { | |
| 54 | 53 | try { |
| 55 | - return trManageService.setCS(); | |
| 54 | + return trManageService.setLD(); | |
| 55 | + } catch (Exception exp) { | |
| 56 | + throw new Exception(exp.getCause()); | |
| 57 | + } | |
| 58 | + } | |
| 59 | + | |
| 60 | + @RequestMapping(value = "/setLCYH", method = RequestMethod.GET) | |
| 61 | + public String setLCYH() throws Exception { | |
| 62 | + try { | |
| 63 | + return trManageService.setLCYH(); | |
| 64 | + } catch (Exception exp) { | |
| 65 | + throw new Exception(exp.getCause()); | |
| 66 | + } | |
| 67 | + } | |
| 68 | + | |
| 69 | + @RequestMapping(value = "/setDDRB", method = RequestMethod.GET) | |
| 70 | + public String setDDRB() throws Exception { | |
| 71 | + try { | |
| 72 | + return trManageService.setDDRB(); | |
| 56 | 73 | } catch (Exception exp) { |
| 57 | 74 | throw new Exception(exp.getCause()); |
| 58 | 75 | } |
| 59 | 76 | } |
| 60 | - | |
| 77 | + | |
| 78 | + @RequestMapping(value = "/setJHBC", method = RequestMethod.GET) | |
| 79 | + public String setJHBC() throws Exception { | |
| 80 | + try { | |
| 81 | + return trManageService.setJHBC(); | |
| 82 | + } catch (Exception exp) { | |
| 83 | + throw new Exception(exp.getCause()); | |
| 84 | + } | |
| 85 | + } | |
| 86 | + | |
| 61 | 87 | @RequestMapping(value = "/setSKB", method = RequestMethod.GET) |
| 62 | 88 | public String setSKB(@RequestParam("ids") String ids) throws Exception { |
| 63 | 89 | try { |
| ... | ... | @@ -66,7 +92,7 @@ public class TrafficManageController { |
| 66 | 92 | throw new Exception(exp.getCause()); |
| 67 | 93 | } |
| 68 | 94 | } |
| 69 | - | |
| 95 | + | |
| 70 | 96 | @RequestMapping(value = "/setXLPC", method = RequestMethod.GET) |
| 71 | 97 | public String setXLPC() throws Exception { |
| 72 | 98 | try { |
| ... | ... | @@ -75,13 +101,23 @@ public class TrafficManageController { |
| 75 | 101 | throw new Exception(exp.getCause()); |
| 76 | 102 | } |
| 77 | 103 | } |
| 78 | - | |
| 79 | - @RequestMapping(value = "/setJHBC", method = RequestMethod.GET) | |
| 80 | - public String setJHBC() throws Exception { | |
| 104 | + | |
| 105 | + @RequestMapping(value = "/setCS", method = RequestMethod.GET) | |
| 106 | + public String setCS() throws Exception { | |
| 81 | 107 | try { |
| 82 | - return trManageService.setDDRB(); | |
| 108 | + return trManageService.setCS(); | |
| 83 | 109 | } catch (Exception exp) { |
| 84 | 110 | throw new Exception(exp.getCause()); |
| 85 | 111 | } |
| 86 | 112 | } |
| 113 | + | |
| 114 | + @RequestMapping(value = "/getDownLoadAllDataFile", method = RequestMethod.GET) | |
| 115 | + public String getDownLoadAllDataFile() throws Exception { | |
| 116 | + try { | |
| 117 | + return trManageService.getDownLoadAllDataFile(); | |
| 118 | + } catch (Exception exp) { | |
| 119 | + throw new Exception(exp.getCause()); | |
| 120 | + } | |
| 121 | + } | |
| 122 | + | |
| 87 | 123 | } | ... | ... |
src/main/java/com/bsth/controller/sys/UserController.java
| ... | ... | @@ -73,9 +73,13 @@ public class UserController extends BaseController<SysUser, Integer> { |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | //解密RSA |
| 76 | - userName = RSAUtils.decryptBase64(userName); | |
| 77 | - password = RSAUtils.decryptBase64(password); | |
| 78 | - | |
| 76 | + try { | |
| 77 | + userName = RSAUtils.decryptBase64(userName); | |
| 78 | + password = RSAUtils.decryptBase64(password); | |
| 79 | + } catch (RuntimeException e) { | |
| 80 | + return put(rs, "msg", "decrypt RSA fail!可能页面已过期,尝试刷新页面。"); | |
| 81 | + } | |
| 82 | + | |
| 79 | 83 | SysUser user = sysUserService.findByUserName(userName); |
| 80 | 84 | if (null == user) |
| 81 | 85 | return put(rs, "msg", "不存在的用户"); | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -70,7 +70,7 @@ public class BasicData implements CommandLineRunner { |
| 70 | 70 | public static Map<String, String> allPerson; |
| 71 | 71 | |
| 72 | 72 | //站点名和运管处编号 对照 |
| 73 | - public static Map<String, Map<String, Map>> stationName2YgcNumber; | |
| 73 | + public static Map<String,Integer> stationName2YgcNumber; | |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | static Logger logger = LoggerFactory.getLogger(BasicData.class); |
| ... | ... | @@ -233,13 +233,6 @@ public class BasicData implements CommandLineRunner { |
| 233 | 233 | * @Description: TODO(加载线路相关信息) |
| 234 | 234 | */ |
| 235 | 235 | public void loadLineInfo(){ |
| 236 | - List<StationRoute> stationsList = null;// 站点路由集 | |
| 237 | - StationRoute stationRoute = null; | |
| 238 | - int size = 0; | |
| 239 | - Map<String, Integer> station2Number ; | |
| 240 | - Map<String, Map> dirs2Statioin ; | |
| 241 | - int[] dirs = {0,1};// 运行方向 上下行 | |
| 242 | - int num = 1; | |
| 243 | 236 | Iterator<Line> iterator = lineRepository.findAll().iterator(); |
| 244 | 237 | |
| 245 | 238 | Line line; |
| ... | ... | @@ -247,7 +240,7 @@ public class BasicData implements CommandLineRunner { |
| 247 | 240 | Map<String, String> code2name = new HashMap<>(); |
| 248 | 241 | Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); |
| 249 | 242 | Map<String, String> code2SHcode = new HashMap<String, String>(); |
| 250 | - Map<String, Map<String, Map>> tempStationName2YgcNumber = new HashMap<String, Map<String, Map>>(); | |
| 243 | + Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); | |
| 251 | 244 | |
| 252 | 245 | while(iterator.hasNext()){ |
| 253 | 246 | line = iterator.next(); |
| ... | ... | @@ -259,27 +252,26 @@ public class BasicData implements CommandLineRunner { |
| 259 | 252 | /** |
| 260 | 253 | * 加载运管处的站点及序号 |
| 261 | 254 | * 上行从1开始,下行顺序续编 |
| 262 | - | |
| 263 | - num = 1; | |
| 264 | - dirs2Statioin = new HashMap<String, Map>(); | |
| 265 | - for (int i = 0; i < dirs.length; i++) { | |
| 266 | - // 分别取得上下行的站点 | |
| 267 | - stationsList = stationRouteRepository.findByLine(line.getLineCode(), dirs[i]); | |
| 268 | - size = stationsList == null ? 0 :stationsList.size(); | |
| 269 | - if(size > 0 ){ | |
| 270 | - station2Number = new HashMap<String, Integer>(); | |
| 271 | - for (int j = 0; j < size; j++) { | |
| 272 | - stationRoute = stationsList.get(j); | |
| 273 | - // map保存为(站点名称 -->序号) | |
| 274 | - station2Number.put(stationRoute.getStationName(), num++); | |
| 255 | + */ | |
| 256 | + List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc(); | |
| 257 | + if(ygcLines != null && ygcLines.size() > 0){ | |
| 258 | + int size = ygcLines.size(); | |
| 259 | + Object[] tempArray ; | |
| 260 | + int num = 1; | |
| 261 | + String key; | |
| 262 | + String lineCode = ""; | |
| 263 | + for (int i = 0; i < size; i ++){ | |
| 264 | + tempArray = ygcLines.get(i); | |
| 265 | + if(lineCode.equals("")){ | |
| 266 | + lineCode = tempArray[0]+""; | |
| 267 | + }else if(!lineCode.equals(tempArray[0]+"")){ | |
| 268 | + num = 1; | |
| 269 | + lineCode = tempArray[0]+""; | |
| 275 | 270 | } |
| 276 | - // 保存两个数据,(0 --> station2Number)(1 --> station2Number) 0上行 1 下行 | |
| 277 | - dirs2Statioin.put(dirs[i]+"", station2Number); | |
| 271 | + key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; | |
| 272 | + tempStationName2YgcNumber.put(key,num++); | |
| 278 | 273 | } |
| 279 | 274 | } |
| 280 | - // 保存(站点编码 --> dirs2Statioin) | |
| 281 | - tempStationName2YgcNumber.put(line.getLineCode(), dirs2Statioin); | |
| 282 | - */ | |
| 283 | 275 | } |
| 284 | 276 | |
| 285 | 277 | lineId2CodeMap = biMap; | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| 1 | 1 | package com.bsth.data.schedule; |
| 2 | 2 | |
| 3 | -import java.text.ParseException; | |
| 4 | -import java.util.ArrayList; | |
| 5 | -import java.util.Collections; | |
| 6 | -import java.util.List; | |
| 7 | - | |
| 3 | +import com.bsth.data.LineConfigData; | |
| 4 | +import com.bsth.entity.realcontrol.LineConfig; | |
| 5 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 8 | 6 | import org.joda.time.format.DateTimeFormat; |
| 9 | 7 | import org.joda.time.format.DateTimeFormatter; |
| 10 | 8 | import org.slf4j.Logger; |
| ... | ... | @@ -12,9 +10,10 @@ import org.slf4j.LoggerFactory; |
| 12 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 11 | import org.springframework.stereotype.Component; |
| 14 | 12 | |
| 15 | -import com.bsth.data.LineConfigData; | |
| 16 | -import com.bsth.entity.realcontrol.LineConfig; | |
| 17 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 13 | +import java.text.ParseException; | |
| 14 | +import java.util.ArrayList; | |
| 15 | +import java.util.Collections; | |
| 16 | +import java.util.List; | |
| 18 | 17 | |
| 19 | 18 | /** |
| 20 | 19 | * |
| ... | ... | @@ -49,11 +48,30 @@ public class SchAttrCalculator { |
| 49 | 48 | if (null == sch.getFcsjT()) |
| 50 | 49 | calcFcsjTime(sch); |
| 51 | 50 | |
| 52 | - | |
| 51 | + //計發時間 | |
| 53 | 52 | if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){ |
| 54 | 53 | sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME); |
| 55 | 54 | } |
| 56 | - | |
| 55 | + | |
| 56 | + //待發時間 | |
| 57 | + if(sch.getDfsj().compareTo(conf.getStartOpt()) < 0){ | |
| 58 | + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj()) + DAY_TIME); | |
| 59 | + } | |
| 60 | + else | |
| 61 | + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj())); | |
| 62 | + | |
| 63 | + //實發時間 | |
| 64 | + if(sch.getFcsjActual() != null && | |
| 65 | + sch.getFcsjActual().compareTo(conf.getStartOpt()) < 0){ | |
| 66 | + sch.setFcsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsjActual()) + DAY_TIME); | |
| 67 | + } | |
| 68 | + | |
| 69 | + //實際終點時間 | |
| 70 | + if(sch.getZdsjActual() != null && | |
| 71 | + sch.getZdsjActual().compareTo(conf.getStartOpt()) < 0){ | |
| 72 | + sch.setZdsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getZdsjActual()) + DAY_TIME); | |
| 73 | + } | |
| 74 | + | |
| 57 | 75 | sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT())); |
| 58 | 76 | } catch (Exception e) { |
| 59 | 77 | logger.error("", e); | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -257,4 +257,15 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 257 | 257 | @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) |
| 258 | 258 | @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1") |
| 259 | 259 | List<StationRoute> findByLineCode(String lineCode); |
| 260 | + | |
| 261 | + @Query("SELECT " + | |
| 262 | + "lineCode,directions,stationName,stationRouteCode " + | |
| 263 | + "FROM " + | |
| 264 | + "StationRoute s " + | |
| 265 | + "WHERE " + | |
| 266 | + "s.destroy = 0 " + | |
| 267 | + "and s.lineCode in(select lineCode from Line where inUse = 1) " + | |
| 268 | + "ORDER BY " + | |
| 269 | + "lineCode,directions,stationRouteCode") | |
| 270 | + List<Object[]> findAllLineWithYgc(); | |
| 260 | 271 | } | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| 1 | 1 | package com.bsth.service.impl; |
| 2 | 2 | |
| 3 | -import java.io.BufferedOutputStream; | |
| 4 | -import java.io.File; | |
| 5 | -import java.io.FileOutputStream; | |
| 6 | -import java.io.IOException; | |
| 7 | -import java.sql.Connection; | |
| 8 | -import java.sql.PreparedStatement; | |
| 9 | -import java.sql.ResultSet; | |
| 10 | -import java.text.DecimalFormat; | |
| 11 | -import java.text.SimpleDateFormat; | |
| 12 | -import java.util.Date; | |
| 13 | -import java.util.HashMap; | |
| 14 | -import java.util.Iterator; | |
| 15 | -import java.util.List; | |
| 16 | -import java.util.Map; | |
| 17 | -import java.util.Set; | |
| 18 | - | |
| 19 | -import org.apache.commons.lang.time.DateUtils; | |
| 20 | -import org.slf4j.Logger; | |
| 21 | -import org.slf4j.LoggerFactory; | |
| 22 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 23 | -import org.springframework.data.domain.Sort; | |
| 24 | -import org.springframework.data.domain.Sort.Direction; | |
| 25 | -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | |
| 26 | -import org.springframework.stereotype.Service; | |
| 27 | - | |
| 28 | 3 | import com.bsth.data.BasicData; |
| 29 | -import com.bsth.entity.Cars; | |
| 30 | -import com.bsth.entity.Line; | |
| 31 | -import com.bsth.entity.LineInformation; | |
| 32 | -import com.bsth.entity.Personnel; | |
| 33 | -import com.bsth.entity.StationRoute; | |
| 4 | +import com.bsth.entity.*; | |
| 34 | 5 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 35 | 6 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 36 | 7 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 37 | 8 | import com.bsth.entity.schedule.TTInfo; |
| 38 | 9 | import com.bsth.entity.schedule.TTInfoDetail; |
| 39 | 10 | import com.bsth.entity.search.CustomerSpecs; |
| 40 | -import com.bsth.repository.CarsRepository; | |
| 41 | -import com.bsth.repository.LineInformationRepository; | |
| 42 | -import com.bsth.repository.LineRepository; | |
| 43 | -import com.bsth.repository.PersonnelRepository; | |
| 44 | -import com.bsth.repository.StationRouteRepository; | |
| 45 | -import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 46 | -import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 47 | -import com.bsth.repository.schedule.SchedulePlanInfoRepository; | |
| 48 | -import com.bsth.repository.schedule.TTInfoDetailRepository; | |
| 49 | -import com.bsth.repository.schedule.TTInfoRepository; | |
| 11 | +import com.bsth.repository.*; | |
| 12 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 13 | +import com.bsth.repository.schedule.*; | |
| 50 | 14 | import com.bsth.service.TrafficManageService; |
| 51 | 15 | import com.bsth.util.TimeUtils; |
| 52 | 16 | import com.bsth.util.db.DBUtils_MS; |
| ... | ... | @@ -54,7 +18,25 @@ import com.bsth.webService.trafficManage.geotool.services.Internal; |
| 54 | 18 | import com.bsth.webService.trafficManage.geotool.services.InternalPortType; |
| 55 | 19 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; |
| 56 | 20 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 57 | -import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 21 | +import org.apache.commons.lang.time.DateUtils; | |
| 22 | +import org.slf4j.Logger; | |
| 23 | +import org.slf4j.LoggerFactory; | |
| 24 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 25 | +import org.springframework.data.domain.Sort; | |
| 26 | +import org.springframework.data.domain.Sort.Direction; | |
| 27 | +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | |
| 28 | +import org.springframework.stereotype.Service; | |
| 29 | + | |
| 30 | +import java.io.BufferedOutputStream; | |
| 31 | +import java.io.File; | |
| 32 | +import java.io.FileOutputStream; | |
| 33 | +import java.io.IOException; | |
| 34 | +import java.sql.Connection; | |
| 35 | +import java.sql.PreparedStatement; | |
| 36 | +import java.sql.ResultSet; | |
| 37 | +import java.text.DecimalFormat; | |
| 38 | +import java.text.SimpleDateFormat; | |
| 39 | +import java.util.*; | |
| 58 | 40 | /** |
| 59 | 41 | * |
| 60 | 42 | * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) |
| ... | ... | @@ -63,7 +45,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 63 | 45 | * |
| 64 | 46 | * @Description: TODO(运管处接口service业务层) |
| 65 | 47 | * |
| 66 | - * @Author bsth@z | |
| 48 | + * @Author bsth@zq | |
| 67 | 49 | * |
| 68 | 50 | * @Date 2016年10月28日 上午9:21:17 |
| 69 | 51 | * |
| ... | ... | @@ -158,8 +140,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 158 | 140 | @Override |
| 159 | 141 | public String setXL() { |
| 160 | 142 | String result = "failure"; |
| 143 | + StringBuffer sBuffer = new StringBuffer(); | |
| 161 | 144 | try { |
| 162 | - StringBuffer sBuffer = new StringBuffer(); ; | |
| 163 | 145 | Iterator<Line> lineIterator = lineRepository.findAll().iterator(); |
| 164 | 146 | Line line = null; |
| 165 | 147 | List<StationRoute> stationsList = null;// 站点路由集 |
| ... | ... | @@ -168,7 +150,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 168 | 150 | sBuffer.append("<XLs>"); |
| 169 | 151 | while(lineIterator.hasNext()){ |
| 170 | 152 | line = lineIterator.next(); |
| 171 | - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ | |
| 153 | + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null | |
| 154 | + || line.getInUse() == 0){ | |
| 172 | 155 | continue; |
| 173 | 156 | } |
| 174 | 157 | sBuffer.append("<XL>"); |
| ... | ... | @@ -208,7 +191,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 208 | 191 | sBuffer.append("</XLs>"); |
| 209 | 192 | System.out.println(sBuffer.toString()); |
| 210 | 193 | if(sBuffer.indexOf("<XL>") != -1){ |
| 211 | - logger.info("setXL:"+sBuffer.toString()); | |
| 212 | 194 | String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString()); |
| 213 | 195 | String portArray[] = portResult.split("\n"); |
| 214 | 196 | if(portArray.length >= 4){ |
| ... | ... | @@ -224,8 +206,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 224 | 206 | } |
| 225 | 207 | } |
| 226 | 208 | } catch (Exception e) { |
| 209 | + logger.error("setXL:",e); | |
| 227 | 210 | e.printStackTrace(); |
| 228 | 211 | }finally{ |
| 212 | + logger.info("setXL:"+sBuffer.toString()); | |
| 229 | 213 | logger.info("setXL:"+result); |
| 230 | 214 | } |
| 231 | 215 | return result; |
| ... | ... | @@ -237,8 +221,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 237 | 221 | @Override |
| 238 | 222 | public String setCL() { |
| 239 | 223 | String result = "failure"; |
| 224 | + StringBuffer sBuffer =new StringBuffer(); | |
| 240 | 225 | try { |
| 241 | - StringBuffer sBuffer =new StringBuffer(); | |
| 242 | 226 | sBuffer.append("<CLs>"); |
| 243 | 227 | Cars cars = null; |
| 244 | 228 | String company; |
| ... | ... | @@ -258,13 +242,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 258 | 242 | sBuffer.append("</CL>"); |
| 259 | 243 | } |
| 260 | 244 | sBuffer.append("</CLs>"); |
| 261 | - logger.info("setCL:"+sBuffer.toString()); | |
| 262 | 245 | if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 263 | 246 | result = "success"; |
| 264 | 247 | } |
| 265 | 248 | } catch (Exception e) { |
| 249 | + logger.error("setCL:",e); | |
| 266 | 250 | e.printStackTrace(); |
| 267 | 251 | }finally{ |
| 252 | + logger.info("setCL:"+sBuffer.toString()); | |
| 268 | 253 | logger.info("setCL:"+result); |
| 269 | 254 | } |
| 270 | 255 | return result; |
| ... | ... | @@ -276,8 +261,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 276 | 261 | @Override |
| 277 | 262 | public String setSJ() { |
| 278 | 263 | String result = "failure"; |
| 264 | + StringBuffer sBuffer =new StringBuffer(); | |
| 279 | 265 | try { |
| 280 | - StringBuffer sBuffer =new StringBuffer(); | |
| 281 | 266 | sBuffer.append("<SJs>"); |
| 282 | 267 | Personnel personnel = null; |
| 283 | 268 | String company; |
| ... | ... | @@ -295,13 +280,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 295 | 280 | sBuffer.append("</SJ>"); |
| 296 | 281 | } |
| 297 | 282 | sBuffer.append("</SJs>"); |
| 298 | - logger.info("setSJ:"+sBuffer.toString()); | |
| 299 | 283 | if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 300 | 284 | result = "success"; |
| 301 | 285 | }; |
| 302 | 286 | } catch (Exception e) { |
| 287 | + logger.error("setSJ:",e); | |
| 303 | 288 | e.printStackTrace(); |
| 304 | 289 | }finally{ |
| 290 | + logger.info("setSJ:"+sBuffer.toString()); | |
| 305 | 291 | logger.info("setSJ:"+result); |
| 306 | 292 | } |
| 307 | 293 | return result; |
| ... | ... | @@ -309,15 +295,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 309 | 295 | |
| 310 | 296 | /** |
| 311 | 297 | * 上传路单 |
| 312 | - * @param date | |
| 313 | - * @return xml格式的字符串 | |
| 298 | + * @return 上传成功标识 | |
| 314 | 299 | */ |
| 315 | 300 | public String setLD(){ |
| 316 | 301 | String result = "failure"; |
| 317 | 302 | // 取昨天 的日期 |
| 318 | 303 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 304 | + StringBuffer sf = new StringBuffer(); | |
| 319 | 305 | try { |
| 320 | - StringBuffer sf = new StringBuffer(); | |
| 321 | 306 | sf.append("<DLDS>"); |
| 322 | 307 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); |
| 323 | 308 | List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date); |
| ... | ... | @@ -368,20 +353,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 368 | 353 | sf.append("</LD>"); |
| 369 | 354 | } |
| 370 | 355 | } |
| 371 | - | |
| 372 | 356 | sf.append("</LDList>"); |
| 373 | 357 | sf.append("</DLD>"); |
| 374 | 358 | } |
| 375 | 359 | } |
| 376 | - | |
| 377 | 360 | sf.append("</DLDS>"); |
| 378 | - logger.info("setLD:"+sf.toString()); | |
| 379 | 361 | if(ssop.setLD(userNameOther, passwordOther, sf.toString()).isSuccess()){ |
| 380 | 362 | result = "success"; |
| 381 | 363 | } |
| 382 | 364 | } catch (Exception e) { |
| 365 | + logger.error("setLD:",e); | |
| 383 | 366 | e.printStackTrace(); |
| 384 | 367 | }finally{ |
| 368 | + logger.info("setLD:"+sf.toString()); | |
| 385 | 369 | logger.info("setLD:"+result); |
| 386 | 370 | } |
| 387 | 371 | return result; |
| ... | ... | @@ -389,15 +373,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 389 | 373 | |
| 390 | 374 | /** |
| 391 | 375 | * 上传里程油耗 |
| 392 | - * @param date | |
| 393 | - * @return | |
| 376 | + * @return 上传成功标识 | |
| 394 | 377 | */ |
| 395 | 378 | public String setLCYH(){ |
| 396 | 379 | String result = "failure"; |
| 397 | 380 | // 取昨天 的日期 |
| 398 | 381 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 382 | + StringBuffer sf = new StringBuffer(); | |
| 399 | 383 | try { |
| 400 | - StringBuffer sf = new StringBuffer(); | |
| 401 | 384 | sf.append("<LCYHS>"); |
| 402 | 385 | List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); |
| 403 | 386 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| ... | ... | @@ -451,13 +434,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 451 | 434 | } |
| 452 | 435 | } |
| 453 | 436 | sf.append("</LCYHS>"); |
| 454 | - logger.info("setLCYH:"+sf.toString()); | |
| 455 | 437 | if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){ |
| 456 | 438 | result = "success"; |
| 457 | 439 | } |
| 458 | 440 | } catch (Exception e) { |
| 441 | + logger.error("setLCYH:",e); | |
| 459 | 442 | e.printStackTrace(); |
| 460 | 443 | }finally{ |
| 444 | + logger.info("setLCYH:"+sf.toString()); | |
| 461 | 445 | logger.info("setLCYH:"+result); |
| 462 | 446 | } |
| 463 | 447 | return result; |
| ... | ... | @@ -471,8 +455,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 471 | 455 | String result = "failure"; |
| 472 | 456 | // 取昨天 的日期 |
| 473 | 457 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 458 | + StringBuffer sf = new StringBuffer(); | |
| 474 | 459 | try { |
| 475 | - StringBuffer sf = new StringBuffer(); | |
| 476 | 460 | sf.append("<DDRBS>"); |
| 477 | 461 | List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); |
| 478 | 462 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| ... | ... | @@ -554,13 +538,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 554 | 538 | } |
| 555 | 539 | } |
| 556 | 540 | sf.append("</DDRBS>"); |
| 557 | - logger.info("setDDRB:"+sf.toString()); | |
| 558 | 541 | if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){ |
| 559 | 542 | result = "success"; |
| 560 | 543 | } |
| 561 | 544 | } catch (Exception e) { |
| 545 | + logger.error("setDDRB:",e); | |
| 562 | 546 | e.printStackTrace(); |
| 563 | 547 | }finally{ |
| 548 | + logger.info("setDDRB:"+sf.toString()); | |
| 564 | 549 | logger.info("setDDRB:"+result); |
| 565 | 550 | } |
| 566 | 551 | return result; |
| ... | ... | @@ -572,8 +557,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 572 | 557 | @Override |
| 573 | 558 | public String setJHBC() { |
| 574 | 559 | String result = "failure"; |
| 560 | + StringBuffer sBuffer =new StringBuffer(); | |
| 575 | 561 | try { |
| 576 | - StringBuffer sBuffer =new StringBuffer(); | |
| 577 | 562 | sBuffer.append("<JHBCs>"); |
| 578 | 563 | // 声明变量 |
| 579 | 564 | SchedulePlanInfo schedulePlanInfo = null; |
| ... | ... | @@ -633,13 +618,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 633 | 618 | } |
| 634 | 619 | } |
| 635 | 620 | sBuffer.append("</JHBCs>"); |
| 636 | - logger.info("setJHBC:"+sBuffer.toString()); | |
| 637 | 621 | if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 638 | 622 | result = "success"; |
| 639 | 623 | } |
| 640 | 624 | } catch (Exception e) { |
| 625 | + logger.error("setJHBC:",e); | |
| 641 | 626 | e.printStackTrace(); |
| 642 | 627 | }finally{ |
| 628 | + logger.info("setJHBC:"+sBuffer.toString()); | |
| 643 | 629 | logger.info("setJHBC:"+result); |
| 644 | 630 | } |
| 645 | 631 | return result; |
| ... | ... | @@ -651,14 +637,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 651 | 637 | @Override |
| 652 | 638 | public String setSKB(String ids) { |
| 653 | 639 | String result = "failure"; |
| 640 | + StringBuffer sBuffer = new StringBuffer(); | |
| 654 | 641 | try { |
| 655 | 642 | String[] idArray = ids.split(","); |
| 656 | - StringBuffer sBuffer = new StringBuffer(); | |
| 643 | + StringBuffer sBufferA; | |
| 644 | + StringBuffer sBufferB; | |
| 657 | 645 | TTInfo ttInfo; |
| 658 | - TTInfoDetail ttInfoDetail; | |
| 646 | + TTInfoDetail ttInfoDetail = null; | |
| 659 | 647 | Iterator<TTInfoDetail> ttInfoDetailIterator; |
| 660 | 648 | HashMap<String,Object> param = new HashMap<String, Object>(); |
| 661 | - String ttinfoJhlc = null;//计划总里程 | |
| 662 | 649 | String lineCode ; |
| 663 | 650 | sBuffer.append("<SKBs>"); |
| 664 | 651 | for (int i = 0; i < idArray.length; i++) { |
| ... | ... | @@ -668,57 +655,61 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 668 | 655 | param.put("ttinfo.id_eq", ttInfo.getId()); |
| 669 | 656 | ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), |
| 670 | 657 | new Sort(Direction.ASC, "xlDir")).iterator(); |
| 671 | - sBuffer.append("<SKB>"); | |
| 672 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId())) | |
| 673 | - .append("</XLBM>"); | |
| 674 | - ttinfoJhlc = new String(); | |
| 675 | - sBuffer.append("<JHZLC>").append(ttinfoJhlc).append("</JHZLC>"); | |
| 676 | - sBuffer.append("<JHYYLC>").append(ttinfoJhlc).append("</JHYYLC>"); | |
| 677 | - sBuffer.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | |
| 678 | - sBuffer.append("<JSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</JSRQ>");///////// | |
| 679 | - sBuffer.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>"); | |
| 680 | - sBuffer.append("<TBYY>").append("").append("</TBYY>"); | |
| 681 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | |
| 682 | - int num = 1; | |
| 683 | - // 加上<BCList> | |
| 684 | 658 | if(ttInfoDetailIterator.hasNext()){ |
| 685 | - sBuffer.append("<BCList>"); | |
| 686 | - } | |
| 687 | - while (ttInfoDetailIterator.hasNext()) { | |
| 688 | - ttInfoDetail = ttInfoDetailIterator.next(); | |
| 689 | - if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){ | |
| 690 | - continue; | |
| 659 | + sBuffer.append("<SKB>"); | |
| 660 | + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId())) | |
| 661 | + .append("</XLBM>"); | |
| 662 | + sBufferB = new StringBuffer(); | |
| 663 | + sBufferB.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | |
| 664 | + // 结束日期暂时不要,节假日的班次表才需要,如春节的班次表 | |
| 665 | + sBufferB.append("<JSRQ>").append("").append("</JSRQ>"); | |
| 666 | + sBufferB.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>"); | |
| 667 | + sBufferB.append("<TBYY>").append("").append("</TBYY>"); | |
| 668 | + sBufferB.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | |
| 669 | + sBufferB.append("<BCList>"); | |
| 670 | + int num = 1; | |
| 671 | + while (ttInfoDetailIterator.hasNext()) { | |
| 672 | + ttInfoDetail = ttInfoDetailIterator.next(); | |
| 673 | + if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){ | |
| 674 | + continue; | |
| 675 | + } | |
| 676 | + if(num++ == 1){ | |
| 677 | + sBufferA = new StringBuffer(); | |
| 678 | + sBufferA.append("<JHZLC>").append(ttInfoDetail.getJhlc()).append("</JHZLC>"); | |
| 679 | + sBufferA.append("<JHYYLC>").append(ttInfoDetail.getJhlc()).append("</JHYYLC>"); | |
| 680 | + sBuffer.append(sBufferA).append(sBufferB); | |
| 681 | + } | |
| 682 | + lineCode = ttInfoDetail.getXl().getLineCode(); | |
| 683 | + // 如果发车时间格式错误,忽略此条 | |
| 684 | + if(changeTimeFormat(ttInfoDetail) == null){ | |
| 685 | + continue; | |
| 686 | + } | |
| 687 | + sBuffer.append("<BC>"); | |
| 688 | + sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | |
| 689 | + sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); | |
| 690 | + sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>"); | |
| 691 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 692 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>"); | |
| 693 | + sBuffer.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>"); | |
| 694 | + sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>"); | |
| 695 | + sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 696 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</DDXH>"); | |
| 697 | + sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | |
| 698 | + sBuffer.append("</BC>"); | |
| 691 | 699 | } |
| 692 | - ttinfoJhlc = ttInfoDetail.getJhlc()+"";// 设置计划总里程 | |
| 693 | - lineCode = ttInfoDetail.getXl().getLineCode(); | |
| 694 | - sBuffer.append("<BC>"); | |
| 695 | - sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | |
| 696 | - sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); | |
| 697 | - sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>"); | |
| 698 | - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 699 | - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>"); | |
| 700 | - sBuffer.append("<JHFCSJ>").append(ttInfoDetail.getFcsj()).append("</JHFCSJ>"); | |
| 701 | - sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>"); | |
| 702 | - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 703 | - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</ZDXH>"); | |
| 704 | - sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | |
| 705 | - sBuffer.append("</BC>"); | |
| 706 | - | |
| 707 | - num++; | |
| 708 | - } | |
| 709 | - if(sBuffer.indexOf("<BCList>") != -1){ | |
| 710 | 700 | sBuffer.append("</BCList>"); |
| 701 | + sBuffer.append("</SKB>"); | |
| 711 | 702 | } |
| 712 | - sBuffer.append("</SKB>"); | |
| 713 | 703 | } |
| 714 | 704 | sBuffer.append("</SKBs>"); |
| 715 | - logger.info("setSKB:"+sBuffer.toString()); | |
| 716 | 705 | if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 717 | 706 | result = "success"; |
| 718 | 707 | } |
| 719 | 708 | } catch (Exception e) { |
| 709 | + logger.error("setSKB:", e); | |
| 720 | 710 | e.printStackTrace(); |
| 721 | 711 | }finally{ |
| 712 | + logger.info("setSKB:"+sBuffer.toString()); | |
| 722 | 713 | logger.info("setSKB:"+result); |
| 723 | 714 | } |
| 724 | 715 | return result; |
| ... | ... | @@ -730,8 +721,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 730 | 721 | @Override |
| 731 | 722 | public String setXLPC() { |
| 732 | 723 | String result = "failure"; |
| 724 | + StringBuffer sBuffer =new StringBuffer(); | |
| 733 | 725 | try { |
| 734 | - StringBuffer sBuffer =new StringBuffer(); | |
| 735 | 726 | sBuffer.append("<XLPCs>"); |
| 736 | 727 | // 声明变量 |
| 737 | 728 | Line line = null; |
| ... | ... | @@ -773,13 +764,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 773 | 764 | sBuffer.append("</XLPC>"); |
| 774 | 765 | } |
| 775 | 766 | sBuffer.append("</XLPCs>"); |
| 776 | - logger.info("setXLPC:"+sBuffer.toString()); | |
| 777 | 767 | if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 778 | 768 | result = "success"; |
| 779 | 769 | } |
| 780 | 770 | } catch (Exception e) { |
| 771 | + logger.error("setXLPC:",e); | |
| 781 | 772 | e.printStackTrace(); |
| 782 | 773 | }finally{ |
| 774 | + logger.info("setXLPC:"+sBuffer.toString()); | |
| 783 | 775 | logger.info("setXLPC:"+result); |
| 784 | 776 | } |
| 785 | 777 | return result; |
| ... | ... | @@ -832,13 +824,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 832 | 824 | sBuffer.append("</CS>"); |
| 833 | 825 | } |
| 834 | 826 | sBuffer.append("</CSs>"); |
| 835 | - logger.info("setCS:"+sBuffer.toString()); | |
| 836 | 827 | if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 837 | 828 | result = "success"; |
| 838 | 829 | } |
| 839 | 830 | } catch (Exception e) { |
| 831 | + logger.error("setCS:",e); | |
| 840 | 832 | e.printStackTrace(); |
| 841 | 833 | } finally { |
| 834 | + logger.info("setCS:"+sBuffer.toString()); | |
| 842 | 835 | logger.info("setCS:"+result); |
| 843 | 836 | DBUtils_MS.close(rs, ps, conn); |
| 844 | 837 | } |
| ... | ... | @@ -949,11 +942,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 949 | 942 | min = fullTime % 60; |
| 950 | 943 | sumHour = Integer.valueOf(fcsjArray[0])+hour; |
| 951 | 944 | if(sumHour >= 24){ |
| 952 | - result = sumHour - 24+":"; | |
| 945 | + result = String.format("%02d",sumHour - 24); | |
| 953 | 946 | }else{ |
| 954 | - result = sumHour +":"; | |
| 947 | + result = String.format("%02d",sumHour);; | |
| 955 | 948 | } |
| 956 | - result +=String.format("%02d", min); | |
| 949 | + result +=":"+String.format("%02d", min); | |
| 957 | 950 | }else{ |
| 958 | 951 | result = fcsj; |
| 959 | 952 | } |
| ... | ... | @@ -961,6 +954,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 961 | 954 | } |
| 962 | 955 | |
| 963 | 956 | /** |
| 957 | + * 改变时间格式 | |
| 958 | + * @param ttInfoDetail 时刻表详细 | |
| 959 | + * @return xx:yy | |
| 960 | + */ | |
| 961 | + private String changeTimeFormat(TTInfoDetail ttInfoDetail){ | |
| 962 | + String result = "00:00"; | |
| 963 | + String fcsj = ttInfoDetail.getFcsj(); | |
| 964 | + if(fcsj.indexOf(":") != -1){ | |
| 965 | + // 时和分隔开 | |
| 966 | + String[] fcsjArray = fcsj.split(":"); | |
| 967 | + result = String.format("%02d", Integer.valueOf(fcsjArray[0]))+":"; | |
| 968 | + result +=String.format("%02d", Integer.valueOf(fcsjArray[1])); | |
| 969 | + }else{ | |
| 970 | + result = null; | |
| 971 | + logger.info("setSKB:发车时间错误:ttInfoDetail.id="+ttInfoDetail.getId()); | |
| 972 | + } | |
| 973 | + return result; | |
| 974 | + } | |
| 975 | + | |
| 976 | + /** | |
| 964 | 977 | * 拼装线路计划班次表的XML |
| 965 | 978 | * @param sBuffer |
| 966 | 979 | * @param schedulePlanInfo |
| ... | ... | @@ -993,7 +1006,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 993 | 1006 | flag = 0; |
| 994 | 1007 | } |
| 995 | 1008 | result += flag; |
| 996 | - if(i !=ruleDayArray.length ){ | |
| 1009 | + if(i !=ruleDayArray.length -1){ | |
| 997 | 1010 | result +=","; |
| 998 | 1011 | } |
| 999 | 1012 | } |
| ... | ... | @@ -1017,15 +1030,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1017 | 1030 | } |
| 1018 | 1031 | } |
| 1019 | 1032 | /** |
| 1020 | - * @param stations 站点路由集 | |
| 1033 | + * @param stationsList 站点路由集 | |
| 1021 | 1034 | * @param sBuffer sBuffer |
| 1022 | - * @param StartId 站点序号起始ID | |
| 1035 | + * @param startId 站点序号起始ID | |
| 1023 | 1036 | * |
| 1024 | 1037 | * @return 站点序号累加后的ID |
| 1025 | 1038 | */ |
| 1026 | 1039 | private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){ |
| 1027 | 1040 | int size = stationsList.size(); |
| 1028 | - StationRoute srRoute = null; | |
| 1041 | + StationRoute srRoute; | |
| 1029 | 1042 | String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站 |
| 1030 | 1043 | for (int i = 0; i < size; i++) { |
| 1031 | 1044 | srRoute = stationsList.get(i); |
| ... | ... | @@ -1062,9 +1075,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1062 | 1075 | */ |
| 1063 | 1076 | private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationName){ |
| 1064 | 1077 | Integer number = 0; |
| 1065 | - Map<String, Map> dirs2Statioin = BasicData.stationName2YgcNumber.get(lineCode); | |
| 1066 | - Map<String, Integer> station2Number = dirs2Statioin.get(direction); | |
| 1067 | - number = station2Number.get(stationName); | |
| 1078 | + number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationName); | |
| 1068 | 1079 | return number; |
| 1069 | 1080 | } |
| 1070 | 1081 | } | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -373,7 +373,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 373 | 373 | if(t.getJcsx()==1){ |
| 374 | 374 | Double jcyl=t.getCzyl(); |
| 375 | 375 | zyl=jcyl+jzl-yl; |
| 376 | - Double yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 376 | + Double yh=0.0; | |
| 377 | + if(zlc>0&&t.getZlc()>0){ | |
| 378 | + yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); | |
| 379 | + } | |
| 377 | 380 | t.setYh(yh); |
| 378 | 381 | nextJzyl=t.getJzl()+t.getCzyl()-yh; |
| 379 | 382 | t.setJzyl(Double.parseDouble(df.format(nextJzyl))); | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
| ... | ... | @@ -40,7 +40,7 @@ public class RealMapServiceImpl implements RealMapService { |
| 40 | 40 | } |
| 41 | 41 | inStr = " (" + inStr.substring(1) + ")"; |
| 42 | 42 | |
| 43 | - String sql = "select R.LINE_CODE,R.STATION_NAME,R.STATION_CODE,R.STATION_MARK,R.DIRECTIONS,R.DISTANCES,R.TO_TIME, R.VERSIONS,S.G_LONX,S.G_LATY,S.RADIUS,S.SHAPES_TYPE,ST_AsText(S.G_POLYGON_GRID) as G_POLYGON_GRID, R.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in "+inStr+" and r.destroy=0"; | |
| 43 | + String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in "+inStr+" and r.destroy=0"; | |
| 44 | 44 | |
| 45 | 45 | List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class)); |
| 46 | 46 | rs.put("status", ResponseCode.SUCCESS); |
| ... | ... | @@ -59,7 +59,7 @@ public class RealMapServiceImpl implements RealMapService { |
| 59 | 59 | Map<String, Object> rs = new HashMap(); |
| 60 | 60 | |
| 61 | 61 | try { |
| 62 | - String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0"; | |
| 62 | + String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0 and shapes_type='d'"; | |
| 63 | 63 | |
| 64 | 64 | List<CarPark> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(CarPark.class)); |
| 65 | 65 | rs.put("status", ResponseCode.SUCCESS); | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1145,7 +1145,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1145 | 1145 | || scheduleRealInfo.getBcType().equals("venting")){ |
| 1146 | 1146 | ksgl += tempJhlc; |
| 1147 | 1147 | }else{ |
| 1148 | - yygl += tempJhlc; | |
| 1148 | + if(scheduleRealInfo.getStatus() != -1){ | |
| 1149 | + yygl += tempJhlc; | |
| 1150 | + } | |
| 1149 | 1151 | } |
| 1150 | 1152 | }else{ |
| 1151 | 1153 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| ... | ... | @@ -1154,7 +1156,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1154 | 1156 | if(childTaskPlan.getMileageType().equals("empty")){ |
| 1155 | 1157 | ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); |
| 1156 | 1158 | }else{ |
| 1157 | - yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1159 | + if(childTaskPlan.isDestroy()){ | |
| 1160 | + remMileage += tempJhlc; | |
| 1161 | + cjbc++; | |
| 1162 | + }else{ | |
| 1163 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1164 | + } | |
| 1158 | 1165 | } |
| 1159 | 1166 | } |
| 1160 | 1167 | } | ... | ... |
src/main/java/com/bsth/service/report/ReportService.java
| ... | ... | @@ -18,4 +18,12 @@ public interface ReportService { |
| 18 | 18 | List<Map<String, String>> sreachZd(String line,int zdlx,String zd); |
| 19 | 19 | |
| 20 | 20 | List<Object[]> historyMessageCount(String line, String date, String code); |
| 21 | + | |
| 22 | + Map<String, Object> tbodyTime1(String line ,String date); | |
| 23 | + | |
| 24 | + Map<String, Object> tbodyTime2(String line ,String date); | |
| 25 | + | |
| 26 | + List<Map<String, Object>> tbodyTime3(String line ,String date); | |
| 27 | + List<Map<String, Object>> tbodyTime5(String line ,String date); | |
| 28 | + | |
| 21 | 29 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -3,6 +3,7 @@ import java.sql.Connection; |
| 3 | 3 | import java.sql.PreparedStatement; |
| 4 | 4 | import java.sql.ResultSet; |
| 5 | 5 | import java.sql.SQLException; |
| 6 | +import java.text.DecimalFormat; | |
| 6 | 7 | import java.text.ParseException; |
| 7 | 8 | import java.text.SimpleDateFormat; |
| 8 | 9 | import java.util.ArrayList; |
| ... | ... | @@ -16,12 +17,15 @@ import org.slf4j.Logger; |
| 16 | 17 | import org.slf4j.LoggerFactory; |
| 17 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | 19 | import org.springframework.jdbc.core.JdbcTemplate; |
| 20 | +import org.springframework.jdbc.core.RowMapper; | |
| 19 | 21 | import org.springframework.stereotype.Service; |
| 20 | 22 | |
| 21 | 23 | import com.bsth.data.BasicData; |
| 22 | 24 | import com.bsth.entity.StationRoute; |
| 23 | 25 | import com.bsth.entity.excep.ArrivalInfo; |
| 26 | +import com.bsth.entity.oil.Ylb; | |
| 24 | 27 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 28 | +import com.bsth.entity.schedule.SchedulePlanInfo; | |
| 25 | 29 | import com.bsth.repository.StationRouteRepository; |
| 26 | 30 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 27 | 31 | import com.bsth.service.report.ReportService; |
| ... | ... | @@ -252,5 +256,515 @@ public class ReportServiceImpl implements ReportService{ |
| 252 | 256 | List<Object[]> list = scheduleRealInfoRepository.historyMessageCount(line, date, code); |
| 253 | 257 | return list; |
| 254 | 258 | } |
| 259 | + @Override | |
| 260 | + public Map<String, Object> tbodyTime1(String line, String date) { | |
| 261 | + DecimalFormat df = new DecimalFormat("#0.00"); | |
| 262 | + // TODO Auto-generated method stub | |
| 263 | + //查询配车 | |
| 264 | + String sqlPc=" SELECT cl_zbh FROM bsth_c_s_sp_info " | |
| 265 | + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' " | |
| 266 | + + " and xl_bm='"+line+"' and bc_type='normal' " | |
| 267 | + + " group by cl_zbh "; | |
| 268 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 269 | + List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc, | |
| 270 | + new RowMapper<Map<String, Object>>(){ | |
| 271 | + @Override | |
| 272 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 273 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 274 | + m.put("zbh", rs.getString("cl_zbh")); | |
| 275 | + return m; | |
| 276 | + } | |
| 277 | + }); | |
| 278 | + //配车 | |
| 279 | + int pcs=listPc.size(); | |
| 280 | + | |
| 281 | + | |
| 282 | + String sqlPlan="select jhlc, bc_type ,fcsj from bsth_c_s_sp_info " | |
| 283 | + + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"; | |
| 284 | + | |
| 285 | + //班次 | |
| 286 | + int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60; | |
| 287 | + int qcBc=0,qjBc=0,zqcBc=0,zqjBc=0,wqcBc=0,wqjBc=0; | |
| 288 | + double zlc = 0 , yylc = 0,kslc=0; | |
| 289 | + //查询班次 | |
| 290 | + List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan, | |
| 291 | + new RowMapper<Map<String, Object>>(){ | |
| 292 | + @Override | |
| 293 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 294 | + Map<String, Object> m2=new HashMap<String,Object>(); | |
| 295 | + m2.put("jhlc", rs.getDouble("jhlc")); | |
| 296 | + m2.put("bcType", rs.getString("bc_type")); | |
| 297 | + m2.put("fcsj", rs.getString("fcsj")); | |
| 298 | + return m2; | |
| 299 | + } | |
| 300 | + }); | |
| 301 | + | |
| 302 | + for (int i = 0; i < listPlan.size(); i++) { | |
| 303 | + Map<String, Object> m=listPlan.get(i); | |
| 304 | + double jhlc=Double.parseDouble(m.get("jhlc").toString()); | |
| 305 | + String bcType=m.get("bcType").toString(); | |
| 306 | + String fcsjs[]=m.get("fcsj").toString().split(":"); | |
| 307 | + | |
| 308 | + zlc +=jhlc; | |
| 309 | + if(bcType.equals("normal")){ | |
| 310 | + qcBc ++; | |
| 311 | + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0 | |
| 312 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){ | |
| 313 | + zqcBc++; | |
| 314 | + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0 | |
| 315 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){ | |
| 316 | + wqcBc++; | |
| 317 | + } | |
| 318 | + yylc +=jhlc; | |
| 319 | + }else if(bcType.equals("region")){ | |
| 320 | + qjBc++; | |
| 321 | + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0 | |
| 322 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){ | |
| 323 | + zqjBc++; | |
| 324 | + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0 | |
| 325 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){ | |
| 326 | + wqjBc++; | |
| 327 | + } | |
| 328 | + | |
| 329 | + yylc+=jhlc; | |
| 330 | + }else{ | |
| 331 | + kslc+=jhlc; | |
| 332 | + } | |
| 333 | + } | |
| 334 | + | |
| 335 | + map.put("pcs", pcs); | |
| 336 | + map.put("qcbc", qcBc); | |
| 337 | + map.put("qjbc", qjBc); | |
| 338 | + map.put("zqcbc", zqcBc); | |
| 339 | + map.put("zqjbc", zqjBc); | |
| 340 | + map.put("wqcbc", wqcBc); | |
| 341 | + map.put("wqjbc", wqjBc); | |
| 342 | + map.put("zlc", df.format( zlc)); | |
| 343 | + map.put("yylc", df.format(yylc)); | |
| 344 | + map.put("kslc",df.format( kslc)); | |
| 345 | + //查询里程 | |
| 346 | + return map; | |
| 347 | + } | |
| 348 | + @Override | |
| 349 | + public Map<String, Object> tbodyTime2(String line, String date) { | |
| 350 | + DecimalFormat df = new DecimalFormat("#0.00"); | |
| 351 | + // TODO Auto-generated method stub | |
| 352 | + //查询配车 | |
| 353 | + String sqlPc=" SELECT sum(bcsj) as yysj ,sum(jhlc) as yygl FROM bsth_c_s_sp_info " | |
| 354 | + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' " | |
| 355 | + + " and xl_bm='"+line+"' and bc_type in ('normal' ,'region' )"; | |
| 356 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 357 | + List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, | |
| 358 | + new RowMapper<Map<String, Object>>(){ | |
| 359 | + @Override | |
| 360 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 361 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 362 | + m.put("yysj", rs.getInt("yysj")); | |
| 363 | + m.put("yygl", rs.getString("yygl")==null?"0":rs.getString("yygl")); | |
| 364 | + return m; | |
| 365 | + } | |
| 366 | + }); | |
| 367 | + int yysj=0 ; | |
| 368 | + double yycs=0 ,yygl=0; | |
| 369 | + if(list.size()>0){ | |
| 370 | + Map<String, Object> m=list.get(0); | |
| 371 | + yysj=Integer.parseInt((m.get("yysj").toString())); | |
| 372 | + yygl=Double.parseDouble(m.get("yygl").toString()); | |
| 373 | + } | |
| 374 | + if(yysj>0){ | |
| 375 | + yycs =yygl/(yysj*1.0/60); | |
| 376 | + } | |
| 377 | + int hh=yysj/60; | |
| 378 | + int mm=yysj%60; | |
| 379 | + | |
| 380 | + map.put("yysj", hh+":"+mm); | |
| 381 | + map.put("yycs", df.format(yycs)+"公里/小时"); | |
| 382 | +// map.put(key, value) | |
| 383 | + return map; | |
| 384 | + } | |
| 255 | 385 | |
| 386 | + public static void main(String[] args) { | |
| 387 | + System.out.println(609360/60); | |
| 388 | + System.out.println(609360%60); | |
| 389 | + } | |
| 390 | + @Override | |
| 391 | + public List<Map<String, Object>> tbodyTime3(String line, String date) { | |
| 392 | + // TODO Auto-generated method stub | |
| 393 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | |
| 394 | + String sqlZd=" select qdz_name, count(cl_zbh) as cls , 'zqc' as lx from bsth_c_s_sp_info where " | |
| 395 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' and bc_type='normal' " | |
| 396 | + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | |
| 397 | + + " select qdz_name, count(cl_zbh) as cls , 'wqc' as lx from bsth_c_s_sp_info " | |
| 398 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 399 | + + " and bc_type='normal' and fcsj>'16:01' and fcsj<'18:00' group by qdz_name union " | |
| 400 | + + " select qdz_name, count(cl_zbh) as cls , 'zqj' as lx from bsth_c_s_sp_info " | |
| 401 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 402 | + + " and bc_type='region' and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | |
| 403 | + + " select qdz_name, count(cl_zbh) as cls , 'wqj' as lx from bsth_c_s_sp_info " | |
| 404 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 405 | + + " and bc_type='region' and fcsj>'16:01' and fcsj<'18:00'group by qdz_name"; | |
| 406 | + | |
| 407 | + List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd, | |
| 408 | + new RowMapper<Map<String, Object>>(){ | |
| 409 | + @Override | |
| 410 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 411 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 412 | + m.put("zdm", rs.getString("qdz_name")); | |
| 413 | + m.put("cls", rs.getString("cls")); | |
| 414 | + m.put("lx", rs.getString("lx")); | |
| 415 | + return m; | |
| 416 | + } | |
| 417 | + }); | |
| 418 | + int a=0; | |
| 419 | + int b=0; | |
| 420 | + int c=0; | |
| 421 | + int d=0; | |
| 422 | + for(int i=0;i<lists.size();i++){ | |
| 423 | + boolean fage=true; | |
| 424 | + Map<String, Object> newMap= new HashMap<String, Object>(); | |
| 425 | + list.add(newMap); | |
| 426 | + Map<String, Object> maps=lists.get(i); | |
| 427 | + if(maps.get("lx").equals("zqc")){ | |
| 428 | + list.get(a).put("zqcZm", maps.get("zdm")); | |
| 429 | + list.get(a).put("zqcCls", maps.get("cls")); | |
| 430 | + a++; | |
| 431 | + fage=false; | |
| 432 | + }else if(maps.get("lx").equals("wqc")){ | |
| 433 | + list.get(b).put("wqcZm", maps.get("zdm")); | |
| 434 | + list.get(b).put("wqcCls", maps.get("cls")); | |
| 435 | + b++; | |
| 436 | + fage=false; | |
| 437 | + }else if(maps.get("lx").equals("zqj")){ | |
| 438 | + list.get(c).put("zqjZm", maps.get("zdm")); | |
| 439 | + list.get(c).put("zqjCls", maps.get("cls")); | |
| 440 | + c++; | |
| 441 | + fage=false; | |
| 442 | + }else if(maps.get("lx").equals("wqj")){ | |
| 443 | + list.get(d).put("wqjZm", maps.get("zdm")); | |
| 444 | + list.get(d).put("wqjCls", maps.get("cls")); | |
| 445 | + d++; | |
| 446 | + fage=false; | |
| 447 | + } | |
| 448 | + if(fage){ | |
| 449 | + break; | |
| 450 | + } | |
| 451 | + } | |
| 452 | + boolean status=true; | |
| 453 | + while (status) { | |
| 454 | + for (int i = 0; i < list.size(); i++) { | |
| 455 | + if(list.get(i).isEmpty()){ | |
| 456 | + list.remove(i); | |
| 457 | + status=true; | |
| 458 | + }else{ | |
| 459 | + status=false; | |
| 460 | + } | |
| 461 | + } | |
| 462 | + | |
| 463 | + } | |
| 464 | + return list; | |
| 465 | + } | |
| 466 | + @Override | |
| 467 | + public List<Map<String, Object>> tbodyTime5(String line, String date) { | |
| 468 | + // TODO Auto-generated method stub | |
| 469 | + String sql="select min(fcsj) as fcsj,'lx0' as lx from bsth_c_s_sp_info where " | |
| 470 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 471 | + + " and bc_type='out' and xl_dir=0 union " | |
| 472 | + + " select min(fcsj) as fcsj,'lx1' as lx from bsth_c_s_sp_info where " | |
| 473 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 474 | + + " and bc_type='out' and xl_dir=1"; | |
| 475 | + List<Map<String, Object>> lists= jdbcTemplate.query(sql, | |
| 476 | + new RowMapper<Map<String, Object>>(){ | |
| 477 | + @Override | |
| 478 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 479 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 480 | + m.put("lx", rs.getString("lx")); | |
| 481 | + m.put("fcsj", rs.getString("fcsj")); | |
| 482 | + return m; | |
| 483 | + } | |
| 484 | + }); | |
| 485 | + | |
| 486 | + String sqlList="select * from bsth_c_s_sp_info where " | |
| 487 | + + "DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 488 | + + " and bc_type='normal' order by fcsj"; | |
| 489 | + List<SchedulePlanInfo> list= jdbcTemplate.query(sqlList, | |
| 490 | + new RowMapper<SchedulePlanInfo>(){ | |
| 491 | + @Override | |
| 492 | + public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 493 | + SchedulePlanInfo m=new SchedulePlanInfo(); | |
| 494 | + m.setBcsj(rs.getInt("bcsj")); | |
| 495 | + m.setXlDir(rs.getString("xl_dir")); | |
| 496 | + m.setFcsj(rs.getString("fcsj")); | |
| 497 | + return m; | |
| 498 | + } | |
| 499 | + }); | |
| 500 | + //上下行最早发车时间 (用于与夜班线 跨零点的班次进行比较) | |
| 501 | + String lx0=""; | |
| 502 | + String lx1=""; | |
| 503 | + for (int x = 0; x < lists.size(); x++) { | |
| 504 | + if(lists.get(x).get("lx").equals("lx0")){ | |
| 505 | + lx0=lists.get(x).get("fcsj").toString(); | |
| 506 | + }else{ | |
| 507 | + lx1=lists.get(x).get("fcsj").toString(); | |
| 508 | + } | |
| 509 | + } | |
| 510 | + | |
| 511 | + String[] lx0sj = lx0.split(":"); | |
| 512 | + int sxFc=Integer.parseInt(lx0sj[0])*60+Integer.parseInt(lx0sj[1]); | |
| 513 | + String[] lx1sj = lx1.split(":"); | |
| 514 | + int xxFc=Integer.parseInt(lx1sj[0])*60+Integer.parseInt(lx1sj[1]); | |
| 515 | + //班次 | |
| 516 | + int sj_0 = 6*60+31,sj_1 = 8*60+30,sj_2 = 16*60+1,sj_3 = 18*60; | |
| 517 | + | |
| 518 | + //顺序 出场--早高峰---中午---晚高峰---进场 | |
| 519 | + //实驶时间时间(分),0为上行,1为下行 | |
| 520 | + int ccsj0=0,ccsj1=0,zgf0=0,zgf1=0,zw0=0,zw1=0,wgf0=0,wgf1=0,jcsj0=0,jcsj1=0; | |
| 521 | + | |
| 522 | + //记录上一个发车时间(方便记录间距) | |
| 523 | + int cfc0=0,cfc1=0,zfc0=0,zfc1=0,zwfc0=0,zwfc1=0,wfc0=0,wfc1=0,jcfc0Z=0,jcfc1Z=0,jcfc0W=0,jcfc1W=0; | |
| 524 | + //车距 (发车时间的间距) i--MIN a--MAX | |
| 525 | + int iC=999,aC=-1,iZg=999,aZg=-1,iZw=999,aZw=-1,iWg=999,aWg=-1,iJcZ=999,aJcZ=-1,iJcW=999,aJcW=-1; | |
| 526 | + int iC1=999,aC1=-1,iZg1=999,aZg1=-1,iZw1=999,aZw1=-1,iWg1=999,aWg1=-1,iJc1Z=999,aJc1Z=-1,iJc1W=999,aJc1W=-1; | |
| 527 | +// List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | |
| 528 | + for(int i=0;i<list.size();i++){ | |
| 529 | + SchedulePlanInfo t=list.get(i); | |
| 530 | + String xlDir=t.getXlDir(); | |
| 531 | + int bcsj=t.getBcsj(); | |
| 532 | + String fcsj=t.getFcsj(); | |
| 533 | + String[] fcsjs=fcsj.split(":"); | |
| 534 | + int fcsjNum=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]); | |
| 535 | + | |
| 536 | + if(xlDir.equals("0")){ | |
| 537 | + if(fcsjNum>=sxFc && fcsjNum<sj_0){ | |
| 538 | + ccsj0 +=bcsj; | |
| 539 | + if(aC<0){ | |
| 540 | + cfc0 =fcsjNum; | |
| 541 | + aC=0; | |
| 542 | + }else{ | |
| 543 | + if(fcsjNum-cfc0<iC){ | |
| 544 | + iC=fcsjNum-cfc0; | |
| 545 | + } | |
| 546 | + if(fcsjNum-cfc0>aC){ | |
| 547 | + aC=fcsjNum-cfc0; | |
| 548 | + } | |
| 549 | + | |
| 550 | + cfc0=fcsjNum; | |
| 551 | + } | |
| 552 | + | |
| 553 | + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | |
| 554 | + zgf0 +=bcsj; | |
| 555 | + if(aZg<0){ | |
| 556 | + zfc0 =fcsjNum; | |
| 557 | + aZg=0; | |
| 558 | + }else{ | |
| 559 | + if(fcsjNum-zfc0<iZg){ | |
| 560 | + iZg=fcsjNum-zfc0; | |
| 561 | + } | |
| 562 | + | |
| 563 | + if(fcsjNum-zfc0>aZg){ | |
| 564 | + aZg=fcsjNum-zfc0; | |
| 565 | + } | |
| 566 | + | |
| 567 | + zfc0=fcsjNum; | |
| 568 | + } | |
| 569 | + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | |
| 570 | + zw0 +=bcsj; | |
| 571 | + if(aZw<0){ | |
| 572 | + zwfc0 =fcsjNum; | |
| 573 | + aZw=0; | |
| 574 | + }else{ | |
| 575 | + if(fcsjNum-zwfc0<iZw){ | |
| 576 | + iZw=fcsjNum-zwfc0; | |
| 577 | + } | |
| 578 | + if(fcsjNum-zwfc0>aZw){ | |
| 579 | + aZw=fcsjNum-zwfc0; | |
| 580 | + } | |
| 581 | + zwfc0=fcsjNum; | |
| 582 | + } | |
| 583 | + | |
| 584 | + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | |
| 585 | + wgf0 +=bcsj; | |
| 586 | + if(aWg<0){ | |
| 587 | + wfc0=fcsjNum; | |
| 588 | + aWg=0; | |
| 589 | + }else{ | |
| 590 | + if(fcsjNum-wfc0<iWg){ | |
| 591 | + iWg=fcsjNum-wfc0; | |
| 592 | + } | |
| 593 | + if(fcsjNum-wfc0>aWg){ | |
| 594 | + aWg=fcsjNum-wfc0; | |
| 595 | + } | |
| 596 | + wfc0=fcsjNum; | |
| 597 | + } | |
| 598 | + }else if(fcsjNum>sj_3){ | |
| 599 | + jcsj0 +=bcsj; | |
| 600 | + if(aJcW<0){ | |
| 601 | + jcfc0W=fcsjNum; | |
| 602 | + aJcW=0; | |
| 603 | + }else{ | |
| 604 | + if(fcsjNum-jcfc0W<iJcW){ | |
| 605 | + iJcW=fcsjNum-jcfc0W; | |
| 606 | + } | |
| 607 | + if(fcsjNum-jcfc0W>aJcW){ | |
| 608 | + aJcW=fcsjNum-jcfc0W; | |
| 609 | + } | |
| 610 | + jcfc0W=fcsjNum; | |
| 611 | + } | |
| 612 | + }else if(fcsjNum<sxFc){ | |
| 613 | + jcsj0 +=bcsj; | |
| 614 | + if(aJcZ<0){ | |
| 615 | + jcfc0Z=fcsjNum; | |
| 616 | + aJcZ=0; | |
| 617 | + }else{ | |
| 618 | + if(fcsjNum-jcfc0Z<iJcZ){ | |
| 619 | + iJcZ=fcsjNum-jcfc0Z; | |
| 620 | + } | |
| 621 | + if(fcsjNum-jcfc0Z>aJcZ){ | |
| 622 | + aJcZ=fcsjNum-jcfc0Z; | |
| 623 | + } | |
| 624 | + jcfc0Z=fcsjNum; | |
| 625 | + } | |
| 626 | + } | |
| 627 | + | |
| 628 | + | |
| 629 | + }else{ | |
| 630 | + if(fcsjNum>=xxFc && fcsjNum<sj_0){ | |
| 631 | + ccsj1 +=bcsj; | |
| 632 | + if(aC1<0){ | |
| 633 | + cfc1=fcsjNum; | |
| 634 | + aC1=0; | |
| 635 | + }else{ | |
| 636 | + if(fcsjNum-cfc1<iC1){ | |
| 637 | + iC1=fcsjNum-cfc1; | |
| 638 | + } | |
| 639 | + if(fcsjNum-cfc1>aC1){ | |
| 640 | + aC1=fcsjNum-cfc1; | |
| 641 | + } | |
| 642 | + cfc1=fcsjNum; | |
| 643 | + } | |
| 644 | + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | |
| 645 | + zgf1 +=bcsj; | |
| 646 | + if(aZg1<0){ | |
| 647 | + zfc1=fcsjNum; | |
| 648 | + aZg1=0; | |
| 649 | + }else{ | |
| 650 | + if(fcsjNum-zfc1<iZg1){ | |
| 651 | + iZg1=fcsjNum-zfc1; | |
| 652 | + } | |
| 653 | + if(fcsjNum-zfc1>aZg1){ | |
| 654 | + aZg1=fcsjNum-zfc1; | |
| 655 | + } | |
| 656 | + | |
| 657 | + zfc1=fcsjNum; | |
| 658 | + } | |
| 659 | + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | |
| 660 | + zw1 +=bcsj; | |
| 661 | + if(aZw1<0){ | |
| 662 | + zwfc1=fcsjNum; | |
| 663 | + aZw1=0; | |
| 664 | + }else{ | |
| 665 | + if(fcsjNum-zwfc1<iZw1){ | |
| 666 | + iZw1=fcsjNum-zwfc1; | |
| 667 | + } | |
| 668 | + if(fcsjNum-zwfc1>aZw1){ | |
| 669 | + aZw1=fcsjNum-zwfc1; | |
| 670 | + } | |
| 671 | + zwfc1=fcsjNum; | |
| 672 | + } | |
| 673 | + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | |
| 674 | + wgf1 +=bcsj; | |
| 675 | + if(aWg1<0){ | |
| 676 | + wfc1=fcsjNum; | |
| 677 | + aWg1=0; | |
| 678 | + }else{ | |
| 679 | + if(fcsjNum-wfc1<iWg1){ | |
| 680 | + iWg1=fcsjNum-wfc1; | |
| 681 | + } | |
| 682 | + if(fcsjNum-wfc1<aWg1){ | |
| 683 | + aWg1=fcsjNum-wfc1; | |
| 684 | + } | |
| 685 | + wfc1=fcsjNum; | |
| 686 | + } | |
| 687 | + }else if(fcsjNum>sj_3){ | |
| 688 | + jcsj1 +=bcsj; | |
| 689 | + if(aJc1W<0){ | |
| 690 | + jcfc1W=fcsjNum; | |
| 691 | + aJc1W=0; | |
| 692 | + }else{ | |
| 693 | + if(fcsjNum-jcfc1W<iJc1W){ | |
| 694 | + aJc1W=fcsjNum-jcfc1W; | |
| 695 | + } | |
| 696 | + if(fcsjNum-jcfc1W>aJc1W){ | |
| 697 | + aJc1W=fcsjNum-jcfc1W; | |
| 698 | + } | |
| 699 | + | |
| 700 | + jcfc1W=fcsjNum; | |
| 701 | + } | |
| 702 | + }else if(fcsjNum<xxFc){ | |
| 703 | + jcsj1 +=bcsj; | |
| 704 | + if(aJc1Z<0){ | |
| 705 | + jcfc1Z=fcsjNum; | |
| 706 | + aJc1Z=0; | |
| 707 | + }else{ | |
| 708 | + if(fcsjNum-jcfc1Z<iJc1Z){ | |
| 709 | + aJc1Z=fcsjNum-jcfc1Z; | |
| 710 | + } | |
| 711 | + if(fcsjNum-jcfc1Z>aJc1Z){ | |
| 712 | + aJc1Z=fcsjNum-jcfc1Z; | |
| 713 | + } | |
| 714 | + | |
| 715 | + jcfc1Z=fcsjNum; | |
| 716 | + } | |
| 717 | + } | |
| 718 | + } | |
| 719 | + | |
| 720 | + } | |
| 721 | + | |
| 722 | + | |
| 723 | + List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>(); | |
| 724 | + Map<String, Object> newmap1=new HashMap<String,Object>(); | |
| 725 | + Map<String, Object> newmap2=new HashMap<String,Object>(); | |
| 726 | + Map<String, Object> newmap3=new HashMap<String,Object>(); | |
| 727 | + Map<String, Object> newmap4=new HashMap<String,Object>(); | |
| 728 | + Map<String, Object> newmap5=new HashMap<String,Object>(); | |
| 729 | + newmap1.put("sjd", "(首)——6:30"); | |
| 730 | + newmap1.put("sxsj", ccsj0); | |
| 731 | + newmap1.put("xxsj", ccsj1); | |
| 732 | + newmap1.put("fqsj", ccsj0+ccsj1); | |
| 733 | + newmap1.put("cj", (iC-iC1>0?iC1:iC)+"——"+(aC-aC1>0?aC:aC1)); | |
| 734 | + | |
| 735 | + newmap2.put("sjd", "6:31——8:30"); | |
| 736 | + newmap2.put("sxsj", zgf0); | |
| 737 | + newmap2.put("xxsj", zgf1); | |
| 738 | + newmap2.put("fqsj", zgf1+zgf0); | |
| 739 | + newmap2.put("cj", (iZg-iZg1>0?iZg1:iZg)+"——"+(aZg-aZg1>0?aZg:aZg1)); | |
| 740 | + | |
| 741 | + newmap3.put("sjd", "8:30——16:00"); | |
| 742 | + newmap3.put("sxsj", zw0); | |
| 743 | + newmap3.put("xxsj", zw1); | |
| 744 | + newmap3.put("fqsj", zw0+zw1); | |
| 745 | + newmap3.put("cj", (iZw-iZw1>0?iZw1:iZw)+"——"+(aZw-aZw1>0?aZw:aZw1)); | |
| 746 | + | |
| 747 | + newmap4.put("sjd", "16:01——18:00"); | |
| 748 | + newmap4.put("sxsj", wgf0); | |
| 749 | + newmap4.put("xxsj", wgf1); | |
| 750 | + newmap4.put("fqsj", wgf0+wgf1); | |
| 751 | + newmap4.put("cj", (iWg-iWg1>0?iWg1:iWg)+"——"+(aWg-aWg1>0?aWg:aWg1)); | |
| 752 | + | |
| 753 | + newmap5.put("sjd", "18:00——(末)"); | |
| 754 | + newmap5.put("sxsj", jcsj0); | |
| 755 | + newmap5.put("xxsj", jcsj1); | |
| 756 | + newmap5.put("fqsj", jcsj0+jcsj1); | |
| 757 | + int min0=iJcZ-iJcW>0?iJcW:iJcZ; | |
| 758 | + int max0=aJcZ-aJcW>0?aJcZ:aJcW; | |
| 759 | + int min1=iJc1Z-iJc1W>0?iJc1W:iJc1Z; | |
| 760 | + int max1=aJc1Z-aJc1W>0?aJc1Z:aJc1W; | |
| 761 | + newmap5.put("cj", (min0-min1>0?min1:min0)+"——"+(max0-max1>0?max0:max1)); | |
| 762 | + | |
| 763 | + newList.add(newmap1); | |
| 764 | + newList.add(newmap2); | |
| 765 | + newList.add(newmap3); | |
| 766 | + newList.add(newmap4); | |
| 767 | + newList.add(newmap5); | |
| 768 | + return newList; | |
| 769 | + } | |
| 256 | 770 | } | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 8 | 8 | spring.jpa.database= MYSQL |
| 9 | 9 | spring.jpa.show-sql= false |
| 10 | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://192.168.168.201/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 11 | +spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 12 | 12 | spring.datasource.username= root |
| 13 | 13 | spring.datasource.password= 123456 |
| 14 | 14 | #DATASOURCE | ... | ... |
src/main/resources/static/pages/forms/statement/changetochange.html
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | |
| 29 | 29 | <div class="page-head"> |
| 30 | 30 | <div class="page-title"> |
| 31 | - <h1>换人换车情况统计表</h1> | |
| 31 | + <h1>鎹汉鎹㈣溅鎯呭喌缁熻琛</h1> | |
| 32 | 32 | </div> |
| 33 | 33 | </div> |
| 34 | 34 | |
| ... | ... | @@ -38,28 +38,28 @@ |
| 38 | 38 | <div class="portlet-title"> |
| 39 | 39 | <form class="form-inline" action="" method="post"> |
| 40 | 40 | <div style="display: inline-block;"> |
| 41 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 41 | + <span class="item-label" style="width: 80px;">绾胯矾: </span> | |
| 42 | 42 | <select class="form-control" name="line" id="line" style="width: 120px;"></select> |
| 43 | 43 | </div> |
| 44 | 44 | <div style="display: inline-block;margin-left: 15px;"> |
| 45 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 45 | + <span class="item-label" style="width: 80px;">寮濮嬫椂闂: </span> | |
| 46 | 46 | <input class="form-control" type="text" id="startDate" style="width: 120px;"/> |
| 47 | 47 | </div> |
| 48 | 48 | <div style="display: inline-block;margin-left: 15px;"> |
| 49 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 49 | + <span class="item-label" style="width: 80px;">缁撴潫鏃堕棿: </span> | |
| 50 | 50 | <input class="form-control" type="text" id="endDate" style="width: 120px;"/> |
| 51 | 51 | </div> |
| 52 | 52 | <div style="display: inline-block;"> |
| 53 | - <span class="item-label" style="width: 120px;">类型: </span> | |
| 53 | + <span class="item-label" style="width: 120px;">绫诲瀷: </span> | |
| 54 | 54 | <select class="form-control" id="sel"> |
| 55 | - <option value="">请选择</option> | |
| 56 | - <option value="1">换人</option> | |
| 57 | - <option value="2">换车</option> | |
| 55 | + <option value="">璇烽夋嫨</option> | |
| 56 | + <option value="1">鎹汉</option> | |
| 57 | + <option value="2">鎹㈣溅</option> | |
| 58 | 58 | </select> |
| 59 | 59 | </div> |
| 60 | 60 | <div class="form-group"> |
| 61 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 62 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 61 | + <input class="btn btn-default" type="button" id="query" value="绛涢"/> | |
| 62 | + <input class="btn btn-default" type="button" id="export" value="瀵煎嚭"/> | |
| 63 | 63 | </div> |
| 64 | 64 | </form> |
| 65 | 65 | </div> |
| ... | ... | @@ -68,35 +68,35 @@ |
| 68 | 68 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 69 | 69 | <thead> |
| 70 | 70 | <tr> |
| 71 | - <th colspan="15">换人换车情况统计表</th> | |
| 71 | + <th colspan="15">鎹汉鎹㈣溅鎯呭喌缁熻琛</th> | |
| 72 | 72 | </tr> |
| 73 | 73 | <tr> |
| 74 | - <td rowspan="3" style=" padding-top: 50px;">日期</td> | |
| 75 | - <td rowspan="3" style=" padding-top: 50px;">公司</td> | |
| 76 | - <td rowspan="3" style=" padding-top: 50px;">分公司</td> | |
| 77 | - <td rowspan="3" style=" padding-top: 50px;">线路</td> | |
| 78 | - <td rowspan="3" style=" padding-top: 50px;">路牌</td> | |
| 79 | - <td rowspan="3" style=" padding-top: 50px;">发生时间</td> | |
| 80 | - <td rowspan="3" style=" padding-top: 50px;">修改时间</td> | |
| 81 | - <td colspan="2">配车</td> | |
| 82 | - <td colspan="4">人员</td> | |
| 83 | - <td rowspan="3" style=" padding-top: 50px;">原因</td> | |
| 84 | - <td rowspan="3" style=" padding-top: 50px;">修改人</td> | |
| 74 | + <td rowspan="3" style=" padding-top: 50px;">鏃ユ湡</td> | |
| 75 | + <td rowspan="3" style=" padding-top: 50px;">鍏徃</td> | |
| 76 | + <td rowspan="3" style=" padding-top: 50px;">鍒嗗叕鍙</td> | |
| 77 | + <td rowspan="3" style=" padding-top: 50px;">绾胯矾</td> | |
| 78 | + <td rowspan="3" style=" padding-top: 50px;">璺墝</td> | |
| 79 | + <td rowspan="3" style=" padding-top: 50px;">鍙戠敓鏃堕棿</td> | |
| 80 | + <td rowspan="3" style=" padding-top: 50px;">淇敼鏃堕棿</td> | |
| 81 | + <td colspan="2">閰嶈溅</td> | |
| 82 | + <td colspan="4">浜哄憳</td> | |
| 83 | + <td rowspan="3" style=" padding-top: 50px;">鍘熷洜</td> | |
| 84 | + <td rowspan="3" style=" padding-top: 50px;">淇敼浜</td> | |
| 85 | 85 | </tr> |
| 86 | 86 | <tr> |
| 87 | - <td>计划</td> | |
| 88 | - <td>实际</td> | |
| 89 | - <td colspan="2">计划</td> | |
| 90 | - <td colspan="2">实际</td> | |
| 87 | + <td>璁″垝</td> | |
| 88 | + <td>瀹為檯</td> | |
| 89 | + <td colspan="2">璁″垝</td> | |
| 90 | + <td colspan="2">瀹為檯</td> | |
| 91 | 91 | |
| 92 | 92 | </tr> |
| 93 | 93 | <tr> |
| 94 | - <td>车号</td> | |
| 95 | - <td>车号</td> | |
| 96 | - <td>工号</td> | |
| 97 | - <td>人员</td> | |
| 98 | - <td>工号</td> | |
| 99 | - <td>人员</td> | |
| 94 | + <td>杞﹀彿</td> | |
| 95 | + <td>杞﹀彿</td> | |
| 96 | + <td>宸ュ彿</td> | |
| 97 | + <td>浜哄憳</td> | |
| 98 | + <td>宸ュ彿</td> | |
| 99 | + <td>浜哄憳</td> | |
| 100 | 100 | </tr> |
| 101 | 101 | </thead> |
| 102 | 102 | <tbody> |
| ... | ... | @@ -111,7 +111,7 @@ |
| 111 | 111 | |
| 112 | 112 | <script> |
| 113 | 113 | $(function(){ |
| 114 | - // 关闭左侧栏 | |
| 114 | + // 鍏抽棴宸︿晶鏍 | |
| 115 | 115 | if (!$('body').hasClass('page-sidebar-closed')) |
| 116 | 116 | $('.menu-toggler.sidebar-toggler').click(); |
| 117 | 117 | |
| ... | ... | @@ -148,13 +148,13 @@ |
| 148 | 148 | }, |
| 149 | 149 | language: { |
| 150 | 150 | noResults: function(){ |
| 151 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 151 | + return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒扮嚎璺紒</span>'; | |
| 152 | 152 | }, |
| 153 | 153 | inputTooShort : function(e) { |
| 154 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 154 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆绾胯矾鎼滅储绾胯矾</span>'; | |
| 155 | 155 | }, |
| 156 | 156 | searching : function() { |
| 157 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 157 | + return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储绾胯矾...</span>'; | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | }); |
| ... | ... | @@ -182,20 +182,20 @@ |
| 182 | 182 | } |
| 183 | 183 | obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); |
| 184 | 184 | }); |
| 185 | - // 把数据填充到模版中 | |
| 185 | + // 鎶婃暟鎹~鍏呭埌妯$増涓 | |
| 186 | 186 | var tbodyHtml = template('changetochange',{list:result}); |
| 187 | - // 把渲染好的模版html文本追加到表格中 | |
| 187 | + // 鎶婃覆鏌撳ソ鐨勬ā鐗坔tml鏂囨湰杩藉姞鍒拌〃鏍间腑 | |
| 188 | 188 | $('#forms tbody').html(tbodyHtml); |
| 189 | 189 | }) |
| 190 | 190 | |
| 191 | 191 | }else{ |
| 192 | - alert("请选择时间范围!"); | |
| 192 | + alert("璇烽夋嫨鏃堕棿鑼冨洿!"); | |
| 193 | 193 | } |
| 194 | 194 | }); |
| 195 | 195 | |
| 196 | 196 | $("#export").on("click",function(){ |
| 197 | 197 | $post('/mcy_export/changetochangeExport',{startDate:startDate,endDate:endDate,type:'export'},function(result){ |
| 198 | - window.open("/downloadFile/download?fileName=换人换车情况日统计"+moment(startDate).format("YYYYMMDD")); | |
| 198 | + window.open("/downloadFile/download?fileName=鎹汉鎹㈣溅鎯呭喌鏃ョ粺璁"+moment(startDate).format("YYYYMMDD")); | |
| 199 | 199 | }); |
| 200 | 200 | }); |
| 201 | 201 | }); |
| ... | ... | @@ -222,7 +222,7 @@ |
| 222 | 222 | {{/each}} |
| 223 | 223 | {{if list.length == 0}} |
| 224 | 224 | <tr> |
| 225 | - <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | |
| 225 | + <td colspan="15"><h6 class="muted">娌℃湁鎵惧埌鐩稿叧鏁版嵁</h6></td> | |
| 226 | 226 | </tr> |
| 227 | 227 | {{/if}} |
| 228 | 228 | </script> | ... | ... |
src/main/resources/static/pages/oil/list.html
| 1 | 1 | <div class="page-head"> |
| 2 | - <div class="page-title"> | |
| 3 | - <h1>进出场存油量</h1> | |
| 4 | - </div> | |
| 2 | + <div class="page-title"> | |
| 3 | + <h1>进出场存油量</h1> | |
| 4 | + </div> | |
| 5 | 5 | </div> |
| 6 | 6 | |
| 7 | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | - <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 9 | - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li> | |
| 10 | - <li><span class="active">进出场存油量</span></li> | |
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 9 | + <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li> | |
| 10 | + <li><span class="active">进出场存油量</span></li> | |
| 11 | 11 | </ul> |
| 12 | 12 | |
| 13 | -<div class="row"> | |
| 14 | - <div class="col-md-12"> | |
| 15 | - <!-- Begin: life time stats --> | |
| 16 | - <div class="portlet light portlet-fit portlet-datatable bordered"> | |
| 17 | - <div class="portlet-title"> | |
| 18 | - <div class="caption"> | |
| 19 | - <i class="fa fa-fire-extinguisher"></i> <span | |
| 20 | - class="caption-subject font-dark sbold uppercase">进出场存油量表</span> | |
| 21 | - </div> | |
| 22 | - <div class="actions"> | |
| 23 | - <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a> | |
| 24 | -<!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> --> | |
| 25 | - <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i> 拆分/保存</button> | |
| 26 | - <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> --> | |
| 27 | - <div class="btn-group"> | |
| 28 | - <a class="btn red btn-outline btn-circle" href="javascript:;" | |
| 29 | - data-toggle="dropdown"> <i class="fa fa-share"></i> <span | |
| 30 | - class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i> | |
| 31 | - </a> | |
| 32 | - <ul class="dropdown-menu pull-right" id="datatable_ajax_tools"> | |
| 33 | - <li><a href="javascript:;" data-action="0" | |
| 34 | - class="tool-action" id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息 | |
| 35 | - </a></li> | |
| 36 | - <li><a href="javascript:;" data-action="1" | |
| 37 | - class="tool-action" id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场) | |
| 38 | - </a></li> | |
| 39 | - <li><a href="javascript:;" id="checkYl" data-action="3" | |
| 40 | - class="tool-action"> <i class="fa fa-gg-circle"></i> | |
| 41 | - 核对加注量(有加油无里程) | |
| 42 | - </a></li> | |
| 43 | - <li class="divider"></li> | |
| 44 | - <li><a href="javascript:;" data-action="3" | |
| 45 | - class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i> | |
| 46 | - 导出Excel | |
| 47 | - </a></li> | |
| 48 | - </ul> | |
| 49 | - </div> | |
| 50 | - </div> | |
| 51 | - </div> | |
| 52 | - <div class="portlet-body"> | |
| 53 | - <div class="table-container" style="margin-top: 10px"> | |
| 54 | - <table | |
| 55 | - class="table table-striped table-bordered table-hover table-checkable" | |
| 56 | - id="datatable_ylb"> | |
| 57 | - <thead> | |
| 58 | - <tr role="row" class="filter"> | |
| 59 | - <td colspan="3"> | |
| 60 | - <!-- 公司: | |
| 61 | - <select name="ssgsdm" id="ssgsdm"> | |
| 62 | - <option value="">请选择...</option> | |
| 63 | - <option value="1">可用</option> | |
| 64 | - <option value="0">禁用</option> | |
| 65 | - </select> --> | |
| 13 | +<div class="row" id="ll_oil_list"> | |
| 14 | + <div class="col-md-12"> | |
| 15 | + <!-- Begin: life time stats --> | |
| 16 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | |
| 17 | + <div class="portlet-title"> | |
| 18 | + <div class="caption"> | |
| 19 | + <i class="fa fa-fire-extinguisher"></i> <span | |
| 20 | + class="caption-subject font-dark sbold uppercase">进出场存油量表</span> | |
| 21 | + </div> | |
| 22 | + <div class="actions"> | |
| 23 | + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a> | |
| 24 | + <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> --> | |
| 25 | + <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i> | |
| 26 | + 拆分/保存 | |
| 27 | + </button> | |
| 28 | + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> --> | |
| 29 | + <div class="btn-group"> | |
| 30 | + <a class="btn red btn-outline btn-circle" href="javascript:;" | |
| 31 | + data-toggle="dropdown"> <i class="fa fa-share"></i> <span | |
| 32 | + class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i> | |
| 33 | + </a> | |
| 34 | + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools"> | |
| 35 | + <li><a href="javascript:;" data-action="0" | |
| 36 | + class="tool-action" id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息 | |
| 37 | + </a></li> | |
| 38 | + <li><a href="javascript:;" data-action="1" | |
| 39 | + class="tool-action" id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场) | |
| 40 | + </a></li> | |
| 41 | + <li><a href="javascript:;" id="checkYl" data-action="3" | |
| 42 | + class="tool-action"> <i class="fa fa-gg-circle"></i> | |
| 43 | + 核对加注量(有加油无里程) | |
| 44 | + </a></li> | |
| 45 | + <li class="divider"></li> | |
| 46 | + <li><a href="javascript:;" data-action="3" | |
| 47 | + class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i> | |
| 48 | + 导出Excel | |
| 49 | + </a></li> | |
| 50 | + </ul> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + <div class="portlet-body"> | |
| 55 | + <div class="table-container" style="margin-top: 10px"> | |
| 56 | + <table | |
| 57 | + class="table table-striped table-bordered table-hover table-checkable" | |
| 58 | + id="datatable_ylb"> | |
| 59 | + <thead> | |
| 60 | + <tr role="row" class="filter"> | |
| 61 | + <td colspan="3"> | |
| 62 | + <!-- 公司: | |
| 63 | + <select name="ssgsdm" id="ssgsdm"> | |
| 64 | + <option value="">请选择...</option> | |
| 65 | + <option value="1">可用</option> | |
| 66 | + <option value="0">禁用</option> | |
| 67 | + </select> --> | |
| 66 | 68 | </td> |
| 67 | - <td > | |
| 68 | -<!-- <select name="fgsdm"> --> | |
| 69 | -<!-- <option value="">请选择...</option> --> | |
| 70 | -<!-- <option value="1">可用</option> --> | |
| 71 | -<!-- <option value="0">禁用</option> --> | |
| 72 | -<!-- </select> --> | |
| 73 | - | |
| 74 | - 日期: | |
| 75 | - </td> | |
| 76 | - <td colspan="2"> | |
| 77 | - <input type="text" style="width: 80px" name="rq" id="rq"/> | |
| 78 | - </td> | |
| 79 | - <td colspan="2"> | |
| 80 | - 线路: | |
| 81 | - </td> | |
| 82 | - <td colspan="3"> | |
| 83 | - <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> | |
| 84 | - | |
| 85 | - </td> | |
| 86 | - <td colspan="2"> | |
| 87 | - 内部编码: | |
| 88 | - </td> | |
| 89 | - <td colspan="3"> | |
| 90 | - <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;" ></select> | |
| 91 | - </td> | |
| 92 | - <td colspan="4"> | |
| 93 | - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | |
| 94 | - <i class="fa fa-search"></i> 搜索</button> | |
| 95 | - | |
| 96 | - <button class="btn btn-sm red btn-outline filter-cancel"> | |
| 97 | - <i class="fa fa-times"></i> 重置</button> | |
| 98 | - | |
| 99 | - </td> | |
| 100 | - </tr> | |
| 101 | - <tr role="row" class="heading"> | |
| 102 | - <th width="2%">#</th> | |
| 103 | - <th width="8%">日期</th> | |
| 104 | - <th width="5%">公司</th> | |
| 105 | - <th width="8%">线路</th> | |
| 106 | - <th width="5%">自编号</th> | |
| 107 | - <th width="6%">驾驶员</th> | |
| 108 | - <th width="4%">加油量</th> | |
| 109 | - <th width="5%">出场公里</th> | |
| 110 | - <th width="4%">进场公里</th> | |
| 111 | - <th width="4%">出场存油</th> | |
| 112 | - <th width="4%">进场存油</th> | |
| 113 | - <th width="5%">油耗</th> | |
| 114 | - <th width="5%">燃油类型</th> | |
| 115 | - <th width="4%">尿素</th> | |
| 116 | - <th width="5%">耗损原因</th> | |
| 117 | - <th width="5%">耗损油量</th> | |
| 118 | - <th width="5%">当日总里程</th> | |
| 119 | - <th width="5%">数据类型</th> | |
| 120 | - <th width="5%">百公里油耗</th> | |
| 121 | -<!-- <th width="5%">操作</th> --> | |
| 122 | - </tr> | |
| 123 | - </thead> | |
| 124 | - <tbody></tbody> | |
| 125 | - </table> | |
| 126 | - <div style="text-align: right;"> | |
| 127 | - <ul id="pagination" class="pagination"></ul> | |
| 128 | - </div> | |
| 129 | - </div> | |
| 130 | - </div> | |
| 131 | - </div> | |
| 132 | - </div> | |
| 69 | + <td> | |
| 70 | + <!-- <select name="fgsdm"> --> | |
| 71 | + <!-- <option value="">请选择...</option> --> | |
| 72 | + <!-- <option value="1">可用</option> --> | |
| 73 | + <!-- <option value="0">禁用</option> --> | |
| 74 | + <!-- </select> --> | |
| 75 | + | |
| 76 | + 日期: | |
| 77 | + </td> | |
| 78 | + <td colspan="2"> | |
| 79 | + <input type="text" style="width: 80px" name="rq" id="rq"/> | |
| 80 | + </td> | |
| 81 | + <td colspan="2"> | |
| 82 | + 线路: | |
| 83 | + </td> | |
| 84 | + <td colspan="3"> | |
| 85 | + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> | |
| 86 | + | |
| 87 | + </td> | |
| 88 | + <td colspan="2"> | |
| 89 | + 内部编码: | |
| 90 | + </td> | |
| 91 | + <td colspan="3"> | |
| 92 | + <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select> | |
| 93 | + </td> | |
| 94 | + <td colspan="4"> | |
| 95 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom"> | |
| 96 | + <i class="fa fa-search"></i> 搜索 | |
| 97 | + </button> | |
| 98 | + | |
| 99 | + <button class="btn btn-sm red btn-outline filter-cancel"> | |
| 100 | + <i class="fa fa-times"></i> 重置 | |
| 101 | + </button> | |
| 102 | + | |
| 103 | + </td> | |
| 104 | + </tr> | |
| 105 | + <tr role="row" class="heading"> | |
| 106 | + <th width="2%">#</th> | |
| 107 | + <th width="8%">日期</th> | |
| 108 | + <th width="5%">公司</th> | |
| 109 | + <th width="8%">线路</th> | |
| 110 | + <th width="5%">自编号</th> | |
| 111 | + <th width="6%">驾驶员</th> | |
| 112 | + <th width="4%">加油量</th> | |
| 113 | + <th width="5%">出场公里</th> | |
| 114 | + <th width="4%">进场公里</th> | |
| 115 | + <th width="4%">出场存油</th> | |
| 116 | + <th width="4%">进场存油</th> | |
| 117 | + <th width="5%">油耗</th> | |
| 118 | + <th width="5%">燃油类型</th> | |
| 119 | + <th width="4%">尿素</th> | |
| 120 | + <th width="5%">耗损原因</th> | |
| 121 | + <th width="5%">耗损油量</th> | |
| 122 | + <th width="5%">当日总里程</th> | |
| 123 | + <th width="5%">数据类型</th> | |
| 124 | + <th width="5%">百公里油耗</th> | |
| 125 | + <!-- <th width="5%">操作</th> --> | |
| 126 | + </tr> | |
| 127 | + </thead> | |
| 128 | + <tbody></tbody> | |
| 129 | + </table> | |
| 130 | + <div style="text-align: right;"> | |
| 131 | + <ul id="pagination" class="pagination"></ul> | |
| 132 | + </div> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + </div> | |
| 133 | 137 | </div> |
| 134 | 138 | |
| 135 | 139 | <script id="ylb_list_temp" type="text/html"> |
| 136 | -{{each list as obj i}} | |
| 137 | -<tr> | |
| 138 | - <td style="vertical-align: middle;"> | |
| 139 | - <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> | |
| 140 | - </td> | |
| 141 | - | |
| 142 | - <td> | |
| 143 | -{{obj.rq}} | |
| 144 | - </td> | |
| 145 | - <td> | |
| 146 | - {{obj.gsname}} | |
| 147 | - </td> | |
| 148 | - <td> | |
| 149 | - {{obj.xlname}} | |
| 150 | - </td> | |
| 151 | - <td> | |
| 152 | - {{obj.nbbm}} | |
| 153 | - </td> | |
| 154 | - <td> | |
| 155 | - {{obj.jsy}} | |
| 156 | - </td> | |
| 157 | - <td> | |
| 158 | - {{obj.jzl}} | |
| 159 | - </td> | |
| 160 | - <td> | |
| 161 | - {{obj.czlc}} | |
| 162 | - </td> | |
| 163 | - <td> | |
| 164 | - {{obj.jzlc}} | |
| 165 | - </td> | |
| 166 | - <td> | |
| 167 | - {{obj.czyl}} | |
| 168 | - </td> | |
| 169 | - <td> | |
| 170 | -<a href="javascript:startOptJzylLink('jzyl{{obj.id}}')" id="jzyl{{obj.id}}" > | |
| 171 | - {{obj.jzyl}} | |
| 172 | -</a> | |
| 173 | - </td> | |
| 174 | - <td> | |
| 175 | - {{obj.yh}} | |
| 176 | - </td> | |
| 177 | - <td> | |
| 178 | - {{obj.rylx}} | |
| 179 | - </td> | |
| 180 | - <td> | |
| 181 | - {{obj.ns}} | |
| 182 | - </td> | |
| 183 | - <td> | |
| 184 | - {{obj.shyy}} | |
| 185 | - </td> | |
| 186 | - <td> | |
| 187 | - {{obj.sh}} | |
| 188 | - </td> | |
| 189 | - <td> | |
| 190 | - {{obj.zlc}} | |
| 191 | - </td> | |
| 192 | - <td> | |
| 193 | - {{obj.yhlx}} | |
| 194 | - </td> | |
| 195 | - <td> | |
| 196 | - {{obj.bglyh}} | |
| 197 | - </td> | |
| 198 | - <td> | |
| 199 | - <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> | |
| 200 | - </td> | |
| 201 | -</tr> | |
| 202 | -{{/each}} | |
| 203 | -{{if list.length == 0}} | |
| 204 | -<tr> | |
| 205 | - <td colspan=20><h6 class="muted">没有找到相关数据</h6></td> | |
| 206 | -</tr> | |
| 207 | -{{/if}} | |
| 140 | + {{each list as obj i}} | |
| 141 | + <tr> | |
| 142 | + <td style="vertical-align: middle;"> | |
| 143 | + <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> | |
| 144 | + </td> | |
| 145 | + | |
| 146 | + <td> | |
| 147 | + {{obj.rq}} | |
| 148 | + </td> | |
| 149 | + <td> | |
| 150 | + {{obj.gsname}} | |
| 151 | + </td> | |
| 152 | + <td> | |
| 153 | + {{obj.xlname}} | |
| 154 | + </td> | |
| 155 | + <td> | |
| 156 | + {{obj.nbbm}} | |
| 157 | + </td> | |
| 158 | + <td> | |
| 159 | + {{obj.jsy}} | |
| 160 | + </td> | |
| 161 | + <td> | |
| 162 | + {{obj.jzl}} | |
| 163 | + </td> | |
| 164 | + <td> | |
| 165 | + {{obj.czlc}} | |
| 166 | + </td> | |
| 167 | + <td> | |
| 168 | + {{obj.jzlc}} | |
| 169 | + </td> | |
| 170 | + <td> | |
| 171 | + {{obj.czyl}} | |
| 172 | + </td> | |
| 173 | + <td> | |
| 174 | + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl"> | |
| 175 | + {{obj.jzyl}} | |
| 176 | + </a> | |
| 177 | + </td> | |
| 178 | + <td> | |
| 179 | + {{obj.yh}} | |
| 180 | + </td> | |
| 181 | + <td> | |
| 182 | + {{obj.rylx}} | |
| 183 | + </td> | |
| 184 | + <td> | |
| 185 | + {{obj.ns}} | |
| 186 | + </td> | |
| 187 | + <td> | |
| 188 | + {{obj.shyy}} | |
| 189 | + </td> | |
| 190 | + <td> | |
| 191 | + {{obj.sh}} | |
| 192 | + </td> | |
| 193 | + <td> | |
| 194 | + {{obj.zlc}} | |
| 195 | + </td> | |
| 196 | + <td> | |
| 197 | + {{obj.yhlx}} | |
| 198 | + </td> | |
| 199 | + <td> | |
| 200 | + {{obj.bglyh}} | |
| 201 | + </td> | |
| 202 | + <td> | |
| 203 | + <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>--> | |
| 204 | + </td> | |
| 205 | + </tr> | |
| 206 | + {{/each}} | |
| 207 | + {{if list.length == 0}} | |
| 208 | + <tr> | |
| 209 | + <td colspan=20><h6 class="muted">没有找到相关数据</h6></td> | |
| 210 | + </tr> | |
| 211 | + {{/if}} | |
| 208 | 212 | </script> |
| 209 | 213 | |
| 210 | 214 | <script> |
| 211 | -$(function(){ | |
| 212 | - $("#checkYl").on('click',function(){ | |
| 213 | - console.log("核对加注量"); | |
| 214 | - if($("#rq").val()!=""){ | |
| 215 | - var cells = $('tr.filter')[0].cells | |
| 216 | - ,params = {} | |
| 217 | - ,name; | |
| 218 | - $.each(cells, function(i, cell){ | |
| 219 | - var items = $('input,select', cell); | |
| 220 | - for(var j = 0, item; item = items[j++];){ | |
| 221 | - name = $(item).attr('name'); | |
| 222 | - if(name){ | |
| 223 | - params[name] = $(item).val(); | |
| 224 | - } | |
| 225 | - } | |
| 226 | - }); | |
| 227 | - $get('/ylb/checkYl', params, function(){ | |
| 228 | - jsDoQuery(null,true); | |
| 229 | - }); | |
| 230 | - }else{ | |
| 231 | - layer.msg('请选择日期.'); | |
| 232 | - } | |
| 233 | - }) | |
| 234 | - | |
| 235 | - //进场等于出场 | |
| 236 | - $("#outAndIn").on('click',function(){ | |
| 237 | - console.log("进场油量等于出场油量"); | |
| 238 | - if($("#rq").val()!=""){ | |
| 239 | - var cells = $('tr.filter')[0].cells | |
| 240 | - ,params = {} | |
| 241 | - ,name; | |
| 242 | - $.each(cells, function(i, cell){ | |
| 243 | - var items = $('input,select', cell); | |
| 244 | - for(var j = 0, item; item = items[j++];){ | |
| 245 | - name = $(item).attr('name'); | |
| 246 | - if(name){ | |
| 247 | - params[name] = $(item).val(); | |
| 248 | - } | |
| 249 | - } | |
| 250 | - }); | |
| 251 | - $get('/ylb/outAndIn', params, function(){ | |
| 252 | - jsDoQuery(null,true); | |
| 253 | - }); | |
| 254 | - }else{ | |
| 255 | - layer.msg('请选择日期.'); | |
| 256 | - } | |
| 257 | - }) | |
| 258 | - //拆分 | |
| 259 | - $("#sortButton").on('click',function(){ | |
| 260 | - console.log("拆分油量"); | |
| 261 | - if($("#rq").val()!=""){ | |
| 262 | - var id = $('input.icheck:checked').data('id'); | |
| 263 | - if(typeof(id)=='undefined'){ | |
| 264 | - layer.msg("请选择一行进行拆分"); | |
| 265 | - }else{ | |
| 266 | - //获取输入的进场存油 | |
| 267 | - var jzyl=$("#jzyl"+id).html(); | |
| 268 | - var params = {}; | |
| 269 | - params['jzyl']=jzyl; | |
| 270 | - params['id']=id; | |
| 271 | - $get('/ylb/sort', params, function(){ | |
| 272 | - jsDoQuery(null,true); | |
| 273 | - }); | |
| 274 | - | |
| 275 | - } | |
| 276 | - }else{ | |
| 277 | - layer.msg('请选择日期.'); | |
| 278 | - } | |
| 279 | - }) | |
| 280 | - //获取加存信息 | |
| 281 | - $("#obtain").on('click', function(){ | |
| 282 | - console.log("获取加存"); | |
| 283 | - if($("#rq").val()!=""){ | |
| 284 | - var cells = $('tr.filter')[0].cells | |
| 285 | - ,params = {} | |
| 286 | - ,name; | |
| 287 | - $.each(cells, function(i, cell){ | |
| 288 | - var items = $('input,select', cell); | |
| 289 | - for(var j = 0, item; item = items[j++];){ | |
| 290 | - name = $(item).attr('name'); | |
| 291 | - if(name){ | |
| 292 | - params[name] = $(item).val(); | |
| 293 | - } | |
| 294 | - } | |
| 295 | - }); | |
| 296 | - $get('/ylb/obtain', params, function(){ | |
| 297 | - jsDoQuery(params,true); | |
| 298 | - }); | |
| 299 | - }else{ | |
| 300 | - layer.msg('请选择日期.'); | |
| 301 | - } | |
| 302 | - | |
| 303 | - }) | |
| 304 | - $("#rq").datetimepicker({ | |
| 305 | - format : 'YYYY-MM-DD', | |
| 306 | - locale : 'zh-cn' | |
| 307 | - }); | |
| 308 | - | |
| 309 | - if($("#rq").val()!=""){ | |
| 310 | - jsDoQuery(null,true); | |
| 311 | - } | |
| 312 | - var page = 0, initPagination; | |
| 313 | - var icheckOptions = { | |
| 314 | - radioClass: 'iradio_square-blue icheck', | |
| 315 | - increaseArea: '20%' | |
| 316 | - } | |
| 317 | - | |
| 318 | - //重置 | |
| 319 | - $('tr.filter .filter-cancel').on('click', function(){ | |
| 320 | - $('tr.filter input, select').val('').change(); | |
| 321 | - }); | |
| 322 | - | |
| 323 | - //提交 | |
| 324 | - $('tr.filter .filter-submit').on('click', function(){ | |
| 325 | - if($("#rq").val()!=""){ | |
| 326 | - var cells = $('tr.filter')[0].cells | |
| 327 | - ,params = {} | |
| 328 | - ,name; | |
| 329 | - $.each(cells, function(i, cell){ | |
| 330 | - var items = $('input,select', cell); | |
| 331 | - for(var j = 0, item; item = items[j++];){ | |
| 332 | - name = $(item).attr('name'); | |
| 333 | - if(name){ | |
| 334 | - params[name] = $(item).val(); | |
| 335 | - } | |
| 336 | - } | |
| 337 | - }); | |
| 338 | - page = 0; | |
| 339 | - jsDoQuery(params, true); | |
| 340 | - }else{ | |
| 341 | - layer.msg('请选择日期.'); | |
| 342 | - } | |
| 343 | - }); | |
| 344 | - | |
| 345 | - /* | |
| 346 | - * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | |
| 347 | - */ | |
| 348 | - function jsDoQuery(p, pagination){ | |
| 349 | - var params = {}; | |
| 350 | - if(p) | |
| 351 | - params = p; | |
| 352 | - //更新时间排序 | |
| 353 | - console.log(params); | |
| 354 | - params['order'] = 'nbbm'; | |
| 355 | - params['page'] = page; | |
| 356 | - params['rq']=$("#rq").val(); | |
| 357 | - var i = layer.load(2); | |
| 358 | - console.log(params); | |
| 359 | - $get('/ylb' ,params, function(data){ | |
| 360 | - $.each(data.content, function(i, obj) { | |
| 361 | - obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | |
| 215 | + $(function () { | |
| 216 | + //var id = 15; | |
| 217 | + //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list') | |
| 218 | + | |
| 219 | + $("#checkYl").on('click', function () { | |
| 220 | + console.log("核对加注量"); | |
| 221 | + if ($("#rq").val() != "") { | |
| 222 | + var cells = $('tr.filter')[0].cells | |
| 223 | + , params = {} | |
| 224 | + , name; | |
| 225 | + $.each(cells, function (i, cell) { | |
| 226 | + var items = $('input,select', cell); | |
| 227 | + for (var j = 0, item; item = items[j++];) { | |
| 228 | + name = $(item).attr('name'); | |
| 229 | + if (name) { | |
| 230 | + params[name] = $(item).val(); | |
| 231 | + } | |
| 232 | + } | |
| 233 | + }); | |
| 234 | + $get('/ylb/checkYl', params, function () { | |
| 235 | + jsDoQuery(null, true); | |
| 236 | + }); | |
| 237 | + } else { | |
| 238 | + layer.msg('请选择日期.'); | |
| 239 | + } | |
| 240 | + }) | |
| 241 | + | |
| 242 | + //进场等于出场 | |
| 243 | + $("#outAndIn").on('click', function () { | |
| 244 | + console.log("进场油量等于出场油量"); | |
| 245 | + if ($("#rq").val() != "") { | |
| 246 | + var cells = $('tr.filter')[0].cells | |
| 247 | + , params = {} | |
| 248 | + , name; | |
| 249 | + $.each(cells, function (i, cell) { | |
| 250 | + var items = $('input,select', cell); | |
| 251 | + for (var j = 0, item; item = items[j++];) { | |
| 252 | + name = $(item).attr('name'); | |
| 253 | + if (name) { | |
| 254 | + params[name] = $(item).val(); | |
| 255 | + } | |
| 256 | + } | |
| 257 | + }); | |
| 258 | + $get('/ylb/outAndIn', params, function () { | |
| 259 | + jsDoQuery(null, true); | |
| 260 | + }); | |
| 261 | + } else { | |
| 262 | + layer.msg('请选择日期.'); | |
| 263 | + } | |
| 264 | + }) | |
| 265 | + //拆分 | |
| 266 | + $("#sortButton").on('click', function () { | |
| 267 | + if ($("#rq").val() != "") { | |
| 268 | + var id = $('input.icheck:checked').data('id'); | |
| 269 | + | |
| 270 | + if (typeof(id) == 'undefined') { | |
| 271 | + layer.msg("请选择一行进行拆分"); | |
| 272 | + } else { | |
| 273 | + //获取输入的进场存油 | |
| 274 | + var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html(); | |
| 275 | + // $("#jzyl" + id).html(); | |
| 276 | + console.log(jzyl); | |
| 277 | + var params = {}; | |
| 278 | + params['jzyl'] = jzyl; | |
| 279 | + params['id'] = id; | |
| 280 | + $get('/ylb/sort', params, function () { | |
| 281 | + jsDoQuery(null, true); | |
| 282 | + }); | |
| 283 | + | |
| 284 | + } | |
| 285 | + } else { | |
| 286 | + layer.msg('请选择日期.'); | |
| 287 | + } | |
| 288 | + }) | |
| 289 | + //获取加存信息 | |
| 290 | + $("#obtain").on('click', function () { | |
| 291 | + console.log("获取加存"); | |
| 292 | + if ($("#rq").val() != "") { | |
| 293 | + var cells = $('tr.filter')[0].cells | |
| 294 | + , params = {} | |
| 295 | + , name; | |
| 296 | + $.each(cells, function (i, cell) { | |
| 297 | + var items = $('input,select', cell); | |
| 298 | + for (var j = 0, item; item = items[j++];) { | |
| 299 | + name = $(item).attr('name'); | |
| 300 | + if (name) { | |
| 301 | + params[name] = $(item).val(); | |
| 302 | + } | |
| 303 | + } | |
| 304 | + }); | |
| 305 | + $get('/ylb/obtain', params, function () { | |
| 306 | + jsDoQuery(params, true); | |
| 307 | + }); | |
| 308 | + } else { | |
| 309 | + layer.msg('请选择日期.'); | |
| 310 | + } | |
| 311 | + | |
| 312 | + }) | |
| 313 | + $("#rq").datetimepicker({ | |
| 314 | + format: 'YYYY-MM-DD', | |
| 315 | + locale: 'zh-cn' | |
| 316 | + }); | |
| 317 | + | |
| 318 | + if ($("#rq").val() != "") { | |
| 319 | + jsDoQuery(null, true); | |
| 320 | + } | |
| 321 | + var page = 0, initPagination; | |
| 322 | + var icheckOptions = { | |
| 323 | + radioClass: 'iradio_square-blue icheck', | |
| 324 | + increaseArea: '20%' | |
| 325 | + } | |
| 326 | + | |
| 327 | + //重置 | |
| 328 | + $('tr.filter .filter-cancel').on('click', function () { | |
| 329 | + $('tr.filter input, select').val('').change(); | |
| 330 | + }); | |
| 331 | + | |
| 332 | + //提交 | |
| 333 | + $('tr.filter .filter-submit').on('click', function () { | |
| 334 | + if ($("#rq").val() != "") { | |
| 335 | + var cells = $('tr.filter')[0].cells | |
| 336 | + , params = {} | |
| 337 | + , name; | |
| 338 | + $.each(cells, function (i, cell) { | |
| 339 | + var items = $('input,select', cell); | |
| 340 | + for (var j = 0, item; item = items[j++];) { | |
| 341 | + name = $(item).attr('name'); | |
| 342 | + if (name) { | |
| 343 | + params[name] = $(item).val(); | |
| 344 | + } | |
| 345 | + } | |
| 346 | + }); | |
| 347 | + page = 0; | |
| 348 | + jsDoQuery(params, true); | |
| 349 | + } else { | |
| 350 | + layer.msg('请选择日期.'); | |
| 351 | + } | |
| 352 | + }); | |
| 353 | + | |
| 354 | + /* | |
| 355 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | |
| 356 | + */ | |
| 357 | + function jsDoQuery(p, pagination) { | |
| 358 | + var params = {}; | |
| 359 | + if (p) | |
| 360 | + params = p; | |
| 361 | + //更新时间排序 | |
| 362 | + params['order'] = 'nbbm'; | |
| 363 | + params['page'] = page; | |
| 364 | + params['rq'] = $("#rq").val(); | |
| 365 | + var i = layer.load(2); | |
| 366 | + $get('/ylb', params, function (data) { | |
| 367 | + $.each(data.content, function (i, obj) { | |
| 368 | + obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | |
| 369 | + }); | |
| 370 | + var bodyHtm = template('ylb_list_temp', {list: data.content}); | |
| 371 | + | |
| 372 | + $('#datatable_ylb tbody').html(bodyHtm) | |
| 373 | + .find('.icheck').iCheck(icheckOptions) | |
| 374 | + .on('ifChanged', iCheckChange); | |
| 375 | + if (pagination && data.content.length > 0) { | |
| 376 | + //重新分页 | |
| 377 | + initPagination = true; | |
| 378 | + showPagination(data); | |
| 379 | + } | |
| 380 | + layer.close(i); | |
| 381 | + | |
| 382 | + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | |
| 383 | + }); | |
| 384 | + } | |
| 385 | + | |
| 386 | + //改变状态 | |
| 387 | + function startOptJzylLink(es) { | |
| 388 | + es.editable({ | |
| 389 | + type: 'text', | |
| 390 | + placement: 'right', | |
| 391 | + width: 100, | |
| 392 | + display: false, | |
| 393 | + validate: function (value) { | |
| 394 | + if (!value) | |
| 395 | + return '值不能为空!'; | |
| 396 | + if (isNaN(value)) | |
| 397 | + return '只能为数字!'; | |
| 398 | + if (value < 0) | |
| 399 | + return '值不能小于0!'; | |
| 400 | + }, | |
| 401 | + inputclass: 'form-control input-medium input-edtable-sm' | |
| 402 | + }) | |
| 403 | + .on('save', function (e, params) { | |
| 404 | + $(this).text(params.newValue); | |
| 405 | + }); | |
| 406 | + } | |
| 407 | + | |
| 408 | + function iCheckChange() { | |
| 409 | + var tr = $(this).parents('tr'); | |
| 410 | + if (this.checked) | |
| 411 | + tr.addClass('row-active'); | |
| 412 | + else | |
| 413 | + tr.removeClass('row-active'); | |
| 414 | + | |
| 415 | + /* if($('#datatable_resource input.icheck:checked').length == 1) | |
| 416 | + $('#removeButton').removeAttr('disabled'); | |
| 417 | + else | |
| 418 | + $('#removeButton').attr('disabled', 'disabled'); */ | |
| 419 | + } | |
| 420 | + | |
| 421 | + function showPagination(data) { | |
| 422 | + //分页 | |
| 423 | + $('#pagination').jqPaginator({ | |
| 424 | + totalPages: data.totalPages, | |
| 425 | + visiblePages: 6, | |
| 426 | + currentPage: page + 1, | |
| 427 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 428 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 429 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 430 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 431 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 432 | + onPageChange: function (num, type) { | |
| 433 | + if (initPagination) { | |
| 434 | + initPagination = false; | |
| 435 | + return; | |
| 436 | + } | |
| 437 | + | |
| 438 | + var cells = $('tr.filter')[0].cells | |
| 439 | + , params = {} | |
| 440 | + , name; | |
| 441 | + $.each(cells, function (i, cell) { | |
| 442 | + var items = $('input,select', cell); | |
| 443 | + for (var j = 0, item; item = items[j++];) { | |
| 444 | + name = $(item).attr('name'); | |
| 445 | + if (name) { | |
| 446 | + params[name] = $(item).val(); | |
| 447 | + } | |
| 448 | + } | |
| 449 | + }); | |
| 450 | + page = num - 1; | |
| 451 | + jsDoQuery(params, true); | |
| 452 | + } | |
| 453 | + }); | |
| 454 | + } | |
| 455 | + | |
| 456 | + | |
| 457 | + //删除 | |
| 458 | + $('#removeButton').on('click', function () { | |
| 459 | + if ($(this).attr('disabled')) | |
| 460 | + return; | |
| 461 | + | |
| 462 | + var id = $('input.icheck:checked').data('id'); | |
| 463 | + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () { | |
| 464 | + $('tr.filter .filter-submit').click(); | |
| 362 | 465 | }); |
| 363 | - var bodyHtm = template('ylb_list_temp', {list: data.content}); | |
| 466 | + }); | |
| 467 | + | |
| 468 | + //搜索线路 | |
| 469 | + $.get('/basic/lineCode2Name',function(result){ | |
| 470 | + var data=[]; | |
| 364 | 471 | |
| 365 | - $('#datatable_ylb tbody').html(bodyHtm) | |
| 366 | - .find('.icheck').iCheck(icheckOptions) | |
| 367 | - .on('ifChanged', iCheckChange); | |
| 368 | - if(pagination && data.content.length > 0){ | |
| 369 | - //重新分页 | |
| 370 | - initPagination = true; | |
| 371 | - showPagination(data); | |
| 472 | + for(var code in result){ | |
| 473 | + data.push({id: code, text: result[code]}); | |
| 372 | 474 | } |
| 373 | - layer.close(i); | |
| 374 | - }); | |
| 375 | - } | |
| 376 | - | |
| 377 | - function iCheckChange(){ | |
| 378 | - var tr = $(this).parents('tr'); | |
| 379 | - if(this.checked) | |
| 380 | - tr.addClass('row-active'); | |
| 381 | - else | |
| 382 | - tr.removeClass('row-active'); | |
| 383 | - | |
| 384 | - /* if($('#datatable_resource input.icheck:checked').length == 1) | |
| 385 | - $('#removeButton').removeAttr('disabled'); | |
| 386 | - else | |
| 387 | - $('#removeButton').attr('disabled', 'disabled'); */ | |
| 388 | - } | |
| 389 | - | |
| 390 | - function showPagination(data){ | |
| 391 | - //分页 | |
| 392 | - $('#pagination').jqPaginator({ | |
| 393 | - totalPages: data.totalPages, | |
| 394 | - visiblePages: 6, | |
| 395 | - currentPage: page + 1, | |
| 396 | - first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 397 | - prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 398 | - next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 399 | - last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 400 | - page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 401 | - onPageChange: function (num, type) { | |
| 402 | - if(initPagination){ | |
| 403 | - initPagination = false; | |
| 404 | - return; | |
| 405 | - } | |
| 406 | - | |
| 407 | - var cells = $('tr.filter')[0].cells | |
| 408 | - ,params = {} | |
| 409 | - ,name; | |
| 410 | - $.each(cells, function(i, cell){ | |
| 411 | - var items = $('input,select', cell); | |
| 412 | - for(var j = 0, item; item = items[j++];){ | |
| 413 | - name = $(item).attr('name'); | |
| 414 | - if(name){ | |
| 415 | - params[name] = $(item).val(); | |
| 416 | - } | |
| 417 | - } | |
| 418 | - }); | |
| 419 | - page = num - 1; | |
| 420 | - jsDoQuery(params, true); | |
| 421 | - } | |
| 422 | - }); | |
| 423 | - } | |
| 424 | - | |
| 425 | - | |
| 426 | - //删除 | |
| 427 | - $('#removeButton').on('click', function(){ | |
| 428 | - if($(this).attr('disabled')) | |
| 429 | - return; | |
| 430 | - | |
| 431 | - var id = $('input.icheck:checked').data('id'); | |
| 432 | - removeConfirm('确定要删除选中的数据?', '/resource/' + id ,function(){ | |
| 433 | - $('tr.filter .filter-submit').click(); | |
| 434 | - }); | |
| 435 | - }); | |
| 436 | - | |
| 437 | - //搜索线路 | |
| 438 | - $('#xlbm').select2({ | |
| 439 | - placeholder: '搜索线路...', | |
| 440 | - ajax: { | |
| 441 | - url: '/realSchedule/findLine', | |
| 442 | - type: 'post', | |
| 443 | - dataType: 'json', | |
| 444 | - delay: 150, | |
| 445 | - data: function(params){ | |
| 446 | - return{line: params.term}; | |
| 447 | - }, | |
| 448 | - processResults: function (data) { | |
| 449 | - return { | |
| 450 | - results: data | |
| 451 | - }; | |
| 452 | - }, | |
| 453 | - cache: true | |
| 454 | - }, | |
| 455 | - templateResult: function(repo){ | |
| 456 | - if (repo.loading) return repo.text; | |
| 457 | - var h = '<span>'+repo.text+'</span>'; | |
| 458 | - return h; | |
| 459 | - }, | |
| 460 | - escapeMarkup: function (markup) { return markup; }, | |
| 461 | - minimumInputLength: 1, | |
| 462 | - templateSelection: function(repo){ | |
| 463 | - return repo.text; | |
| 464 | - }, | |
| 465 | - language: { | |
| 466 | - noResults: function(){ | |
| 467 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 468 | - }, | |
| 469 | - inputTooShort : function(e) { | |
| 470 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 471 | - }, | |
| 472 | - searching : function() { | |
| 473 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 474 | - } | |
| 475 | - } | |
| 476 | - }); | |
| 477 | - | |
| 478 | - $('#nbbm').select2({ | |
| 479 | - placeholder: '搜索车辆...', | |
| 480 | - ajax: { | |
| 481 | - url: '/realSchedule/sreachVehic', | |
| 482 | - dataType: 'json', | |
| 483 | - delay: 150, | |
| 484 | - data: function(params){ | |
| 485 | - return{nbbm: params.term}; | |
| 486 | - }, | |
| 487 | - processResults: function (data) { | |
| 488 | - return { | |
| 489 | - results: data | |
| 490 | - }; | |
| 491 | - }, | |
| 492 | - cache: true | |
| 493 | - }, | |
| 494 | - templateResult: function(repo){ | |
| 495 | - if (repo.loading) return repo.text; | |
| 496 | - var h = '<span>'+repo.text+'</span>'; | |
| 497 | - h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | |
| 498 | - return h; | |
| 499 | - }, | |
| 500 | - escapeMarkup: function (markup) { return markup; }, | |
| 501 | - minimumInputLength: 1, | |
| 502 | - templateSelection: function(repo){ | |
| 503 | - return repo.text; | |
| 504 | - }, | |
| 505 | - language: { | |
| 506 | - noResults: function(){ | |
| 507 | - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 508 | - }, | |
| 509 | - inputTooShort : function(e) { | |
| 510 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 511 | - }, | |
| 512 | - searching : function() { | |
| 513 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 514 | - } | |
| 515 | - } | |
| 516 | - }) | |
| 517 | - | |
| 518 | - | |
| 475 | + console.log(data); | |
| 476 | + initPinYinSelect2('#xlbm',data,''); | |
| 477 | + | |
| 478 | + }) | |
| 479 | + | |
| 480 | + $('#nbbm').select2({ | |
| 481 | + placeholder: '搜索车辆...', | |
| 482 | + ajax: { | |
| 483 | + url: '/realSchedule/sreachVehic', | |
| 484 | + dataType: 'json', | |
| 485 | + delay: 150, | |
| 486 | + data: function (params) { | |
| 487 | + return {nbbm: params.term}; | |
| 488 | + }, | |
| 489 | + processResults: function (data) { | |
| 490 | + return { | |
| 491 | + results: data | |
| 492 | + }; | |
| 493 | + }, | |
| 494 | + cache: true | |
| 495 | + }, | |
| 496 | + templateResult: function (repo) { | |
| 497 | + if (repo.loading) return repo.text; | |
| 498 | + var h = '<span>' + repo.text + '</span>'; | |
| 499 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | |
| 500 | + return h; | |
| 501 | + }, | |
| 502 | + escapeMarkup: function (markup) { | |
| 503 | + return markup; | |
| 504 | + }, | |
| 505 | + minimumInputLength: 1, | |
| 506 | + templateSelection: function (repo) { | |
| 507 | + return repo.text; | |
| 508 | + }, | |
| 509 | + language: { | |
| 510 | + noResults: function () { | |
| 511 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 512 | + }, | |
| 513 | + inputTooShort: function (e) { | |
| 514 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 515 | + }, | |
| 516 | + searching: function () { | |
| 517 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 518 | + } | |
| 519 | + } | |
| 520 | + }) | |
| 521 | + | |
| 522 | + | |
| 519 | 523 | //导出 |
| 520 | - | |
| 521 | - $("#export").on("click",function(){ | |
| 522 | - if($("#rq").val()!=""){ | |
| 523 | - var cells = $('tr.filter')[0].cells | |
| 524 | - ,params = {} | |
| 525 | - ,name; | |
| 526 | - $.each(cells, function(i, cell){ | |
| 527 | - var items = $('input,select', cell); | |
| 528 | - for(var j = 0, item; item = items[j++];){ | |
| 529 | - name = $(item).attr('name'); | |
| 530 | - if(name){ | |
| 531 | - params[name] = $(item).val(); | |
| 532 | - } | |
| 533 | - } | |
| 534 | - }); | |
| 535 | - console.log(params); | |
| 536 | - $post('/ylb/listExport',params,function(result){ | |
| 537 | - console.log(result); | |
| 538 | - window.open("/downloadFile/download?fileName=进出场存油量"+moment($("#rq").val()).format("YYYYMMDD")); | |
| 539 | - }); | |
| 540 | - }else{ | |
| 541 | - layer.msg('请选择日期.'); | |
| 542 | - } | |
| 543 | - }); | |
| 544 | - | |
| 545 | -}); | |
| 546 | -//改变状态 | |
| 547 | -function startOptJzylLink(id){ | |
| 548 | - $('#'+id).editable({ | |
| 549 | - type: 'text', | |
| 550 | - placement: 'right', | |
| 551 | - width:100, | |
| 552 | - display: false, | |
| 553 | - validate: function(value){ | |
| 554 | - if(!value) | |
| 555 | - return '值不能为空!'; | |
| 556 | - if(isNaN(value)) | |
| 557 | - return '只能为数字!'; | |
| 558 | - if(value<0) | |
| 559 | - return '值不能小于0!'; | |
| 560 | - }, | |
| 561 | - inputclass: 'form-control input-medium input-edtable-sm' | |
| 562 | - }) | |
| 563 | - .on('save', function(e, params) { | |
| 564 | - $('#'+id).text(params.newValue); | |
| 565 | - }); | |
| 566 | - | |
| 567 | - | |
| 568 | - | |
| 569 | -} | |
| 524 | + | |
| 525 | + $("#export").on("click", function () { | |
| 526 | + if ($("#rq").val() != "") { | |
| 527 | + var cells = $('tr.filter')[0].cells | |
| 528 | + , params = {} | |
| 529 | + , name; | |
| 530 | + $.each(cells, function (i, cell) { | |
| 531 | + var items = $('input,select', cell); | |
| 532 | + for (var j = 0, item; item = items[j++];) { | |
| 533 | + name = $(item).attr('name'); | |
| 534 | + if (name) { | |
| 535 | + params[name] = $(item).val(); | |
| 536 | + } | |
| 537 | + } | |
| 538 | + }); | |
| 539 | + console.log(params); | |
| 540 | + $post('/ylb/listExport', params, function (result) { | |
| 541 | + console.log(result); | |
| 542 | + window.open("/downloadFile/download?fileName=进出场存油量" + moment($("#rq").val()).format("YYYYMMDD")); | |
| 543 | + }); | |
| 544 | + } else { | |
| 545 | + layer.msg('请选择日期.'); | |
| 546 | + } | |
| 547 | + }); | |
| 548 | + | |
| 549 | + }); | |
| 570 | 550 | </script> |
| 571 | 551 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/report/timetable/timetable.html
0 → 100644
| 1 | +<style type="text/css"> | |
| 2 | + .table-bordered { | |
| 3 | + border: 1px solid; } | |
| 4 | + .table-bordered > thead > tr > th, | |
| 5 | + .table-bordered > thead > tr > td, | |
| 6 | + .table-bordered > tbody > tr > th, | |
| 7 | + .table-bordered > tbody > tr > td, | |
| 8 | + .table-bordered > tfoot > tr > th, | |
| 9 | + .table-bordered > tfoot > tr > td { | |
| 10 | + border: 1px solid; } | |
| 11 | + .table-bordered > thead > tr > th, | |
| 12 | + .table-bordered > thead > tr > td { | |
| 13 | + border-bottom-width: 2px; } | |
| 14 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>行车时刻表统计表</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | |
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 37 | + </div> | |
| 38 | + <div class="form-group"> | |
| 39 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | |
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 41 | + </div> | |
| 42 | + </form> | |
| 43 | + </div> | |
| 44 | + <div class="portlet-body"> | |
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 46 | + <label id="xlxq"></label> | |
| 47 | + <table class="table table-bordered table-hover table-checkable" style="margin-bottom:5p" id="formsTime1"> | |
| 48 | + <thead> | |
| 49 | + <tr> | |
| 50 | + <th colspan="10">行车时刻表统计表</th> | |
| 51 | + </tr> | |
| 52 | + <tr> | |
| 53 | + <td align="center">配车</td> | |
| 54 | + <td colspan="6" align="center">全日班次</td> | |
| 55 | + <td colspan="3" align="center">计划里程</td> | |
| 56 | + </tr> | |
| 57 | + <tr> | |
| 58 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">合计</td> | |
| 59 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">全程 班次</td> | |
| 60 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">区间 班次</td> | |
| 61 | + <td colspan="2" align="center">6:31-8:30</td> | |
| 62 | + <td colspan="2" align="center">16:01-18:00</td> | |
| 63 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">总里程</td> | |
| 64 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">营业里程</td> | |
| 65 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">空驶里程</td> | |
| 66 | + </tr> | |
| 67 | + <tr> | |
| 68 | + <td >全程</td> | |
| 69 | + <td >区间</td> | |
| 70 | + <td >全程</td> | |
| 71 | + <td >区间</td> | |
| 72 | + </tr> | |
| 73 | + </thead> | |
| 74 | + | |
| 75 | + <tbody class="tbody_time_1"> | |
| 76 | + | |
| 77 | + </tbody> | |
| 78 | + </table> | |
| 79 | + | |
| 80 | + <div class="portlet-body"> | |
| 81 | + <div class="row"> | |
| 82 | + <div class="col-md-4" id="divTime2"> | |
| 83 | + <table class="table table-bordered table-hover table-checkable pre-scrollable" id="formsTime2"> | |
| 84 | + <tr> | |
| 85 | + <td colspan="2"> 营运车时 (计划班次的营运时间/公里)</td> | |
| 86 | + </tr> | |
| 87 | + <tr> | |
| 88 | + <td colspan="2">营业里程/营运时间(小时)</td> | |
| 89 | + | |
| 90 | + </tr> | |
| 91 | + <tr> | |
| 92 | + <td align="center" width="50%"> | |
| 93 | + 营运时间(时:分) | |
| 94 | + </td> | |
| 95 | + <td align="center"> | |
| 96 | + 营运车速 | |
| 97 | + </td> | |
| 98 | + </tr> | |
| 99 | + <tbody class="tbody_time_2"> | |
| 100 | + | |
| 101 | + </tbody> | |
| 102 | + </table> | |
| 103 | + | |
| 104 | + </div> | |
| 105 | + | |
| 106 | + <div class="col-md-8" id="divTime3" > | |
| 107 | + <table class="table table-bordered table-checkable" id="formsTime3"> | |
| 108 | + <tr> | |
| 109 | + <td colspan="8">站点配车</td> | |
| 110 | + </tr> | |
| 111 | + <tr> | |
| 112 | + <td colspan="4" align="center">6:31—8:30</td> | |
| 113 | + <td colspan="4" align="center">16:01—18:00</td> | |
| 114 | + </tr> | |
| 115 | + <tr> | |
| 116 | + <td width="18%">全程站名</td> | |
| 117 | + <td>配车</td> | |
| 118 | + <td width="18%">区间站名</td> | |
| 119 | + <td>配车</td> | |
| 120 | + <td width="18%">全程站名</td> | |
| 121 | + <td>配车</td> | |
| 122 | + <td width="18%">区间站名</td> | |
| 123 | + <td>配车</td> | |
| 124 | + </tr> | |
| 125 | + <tbody class="tbody_time_3"> | |
| 126 | + | |
| 127 | + </tbody> | |
| 128 | + </table> | |
| 129 | + </div> | |
| 130 | + | |
| 131 | + </div> | |
| 132 | + </div> | |
| 133 | + <div class="portlet-body"> | |
| 134 | + <div class="row"> | |
| 135 | + <div class="col-md-6" > | |
| 136 | + <table class="table table-bordered table-checkable"> | |
| 137 | + <tr> | |
| 138 | + <td colspan="6">调度形式</td> | |
| 139 | + </tr> | |
| 140 | + <tr> | |
| 141 | + <td colspan="3" align="center">上行向()站</td> | |
| 142 | + <td colspan="3" align="center">下行向()站</td> | |
| 143 | + </tr> | |
| 144 | + <tr> | |
| 145 | + <td>起讫站</td> | |
| 146 | + <td>起讫时间</td> | |
| 147 | + <td>班次</td> | |
| 148 | + <td>起讫站</td> | |
| 149 | + <td>起讫时间</td> | |
| 150 | + <td>班次</td> | |
| 151 | + </tr> | |
| 152 | + <tbody class="tbody_time_4"> | |
| 153 | + | |
| 154 | + </tbody> | |
| 155 | + </table> | |
| 156 | + </div> | |
| 157 | + <div class="col-md-6" > | |
| 158 | + <table class="table table-bordered table-checkable" id="formsTime5"> | |
| 159 | + <tr> | |
| 160 | + <td colspan="5">全日分组行驶时间(区间除外)</td> | |
| 161 | + </tr> | |
| 162 | + <tr> | |
| 163 | + <td width="25%" rowspan="2" style="text-align:center;vertical-align:middle;w">分组 时间</td> | |
| 164 | + <td width="30%" colspan="2" style="text-align:center;vertical-align:middle;">实驶(分)</td> | |
| 165 | + <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">分圈 时间</td> | |
| 166 | + <td width="25%" rowspan="2" style="text-align:center;vertical-align:middle;">车距</td> | |
| 167 | + </tr> | |
| 168 | + <tr> | |
| 169 | + <td>上行</td> | |
| 170 | + <td>下行</td> | |
| 171 | + </tr> | |
| 172 | + <tbody class="tbody_time_5"> | |
| 173 | + | |
| 174 | + </tbody> | |
| 175 | + </table> | |
| 176 | + </div> | |
| 177 | + </div> | |
| 178 | + </div> | |
| 179 | + </div> | |
| 180 | + </div> | |
| 181 | + </div> | |
| 182 | + </div> | |
| 183 | +</div> | |
| 184 | + | |
| 185 | +<script> | |
| 186 | + $(function(){ | |
| 187 | + // 关闭左侧栏 | |
| 188 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 189 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 190 | + | |
| 191 | + $("#date").datetimepicker({ | |
| 192 | + format : 'YYYY-MM-DD', | |
| 193 | + locale : 'zh-cn' | |
| 194 | + }); | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + $.get('/basic/lineCode2Name',function(result){ | |
| 199 | + var data=[]; | |
| 200 | + | |
| 201 | + for(var code in result){ | |
| 202 | + data.push({id: code, text: result[code]}); | |
| 203 | + } | |
| 204 | + initPinYinSelect2('#line',data,''); | |
| 205 | + | |
| 206 | + }) | |
| 207 | + //查询 | |
| 208 | + $("#query").on('click',function(){ | |
| 209 | + var line = $("#line").val(); | |
| 210 | + var xlName = $("#select2-line-container").html(); | |
| 211 | + var date = $("#date").val(); | |
| 212 | + if(date==null|| date==""){ | |
| 213 | + layer.msg('请选择日期.'); | |
| 214 | + }else if(line==null || line ==""){ | |
| 215 | + layer.msg('请选择线路.'); | |
| 216 | + }else{ | |
| 217 | + $get('/report/tbodyTime1',{line:line,date:date},function(result){ | |
| 218 | + var tbodyTime1 = template('tbodyTime1',{result}); | |
| 219 | + $('#formsTime1 .tbody_time_1').html(tbodyTime1); | |
| 220 | + }); | |
| 221 | + $.get('/report/tbodyTime2',{line:line,date:date},function(result){ | |
| 222 | + var tbodyTime2 = template('tbodyTime2',{result}); | |
| 223 | + $('#formsTime2 .tbody_time_2').html(tbodyTime2); | |
| 224 | + }); | |
| 225 | + $.get('/report/tbodyTime3',{line:line,date:date},function(result){ | |
| 226 | + | |
| 227 | + var tbodyTime3 = template('tbodyTime3',{list:result}); | |
| 228 | + $('#formsTime3 .tbody_time_3').html(tbodyTime3); | |
| 229 | + var divTime3 = window.document.getElementById('formsTime3'); | |
| 230 | + var divTime2 = window.document.getElementById('formsTime2'); | |
| 231 | + console.log(divTime3.offsetHeight); | |
| 232 | + divTime2.style.height=divTime3.offsetHeight+"px"; | |
| 233 | + });/* | |
| 234 | + $.get('/report/tbodyTime4',{line:line,date:date},function(result){ | |
| 235 | + var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); | |
| 236 | + $('#forms .scheduleDaily_3').html(scheduleDaily_3); | |
| 237 | + });*/ | |
| 238 | + $.get('/report/tbodyTime5',{line:line,date:date},function(result){ | |
| 239 | + var tbodyTime5 = template('tbodyTime5',{list:result}); | |
| 240 | + $('#formsTime5 .tbody_time_5').html(tbodyTime5); | |
| 241 | + }); | |
| 242 | + } | |
| 243 | + | |
| 244 | + | |
| 245 | + }); | |
| 246 | + }); | |
| 247 | +</script> | |
| 248 | +<script type="text/html" id="tbodyTime1"> | |
| 249 | + <tr> | |
| 250 | + <td>{{result.pcs}}</td> | |
| 251 | + <td>{{result.qcbc}}</td> | |
| 252 | + <td>{{result.qjbc}}</td> | |
| 253 | + <td>{{result.zqcbc}}</td> | |
| 254 | + <td>{{result.zqjbc}}</td> | |
| 255 | + <td>{{result.wqcbc}}</td> | |
| 256 | + <td>{{result.wqjbc}}</td> | |
| 257 | + <td>{{result.zlc}}</td> | |
| 258 | + <td>{{result.yylc}}</td> | |
| 259 | + <td>{{result.kslc}}</td> | |
| 260 | + </tr> | |
| 261 | +</script> | |
| 262 | + | |
| 263 | +<script type="text/html" id="tbodyTime2"> | |
| 264 | + <tr> | |
| 265 | + <td align="center">{{result.yysj}}</td> | |
| 266 | + <td align="center">{{result.yycs}}</td> | |
| 267 | + </tr> | |
| 268 | +</script> | |
| 269 | + | |
| 270 | +<script type="text/html" id="tbodyTime3"> | |
| 271 | +{{each list as result i}} | |
| 272 | + <tr> | |
| 273 | + <td align="center">{{result.zqcZm}}</td> | |
| 274 | + <td align="center">{{result.zqcCls}}</td> | |
| 275 | + <td align="center">{{result.zqjZm}}</td> | |
| 276 | + <td align="center">{{result.zqjCls}}</td> | |
| 277 | + <td align="center">{{result.wqcZm}}</td> | |
| 278 | + <td align="center">{{result.wqcCls}}</td> | |
| 279 | + <td align="center">{{result.wqjZm}}</td> | |
| 280 | + <td align="center">{{result.wqjCls}}</td> | |
| 281 | + </tr> | |
| 282 | +{{/each}} | |
| 283 | +{{if list.length == 0}} | |
| 284 | + <tr> | |
| 285 | + <td colspan="8"><h6 class="muted">没有找到相关数据</h6></td> | |
| 286 | + </tr> | |
| 287 | + {{/if}} | |
| 288 | +</script> | |
| 289 | + | |
| 290 | + | |
| 291 | +<script type="text/html" id="tbodyTime5"> | |
| 292 | +{{each list as result i}} | |
| 293 | + <tr> | |
| 294 | + <td align="center">{{result.sjd}}</td> | |
| 295 | + <td align="center">{{result.sxsj}}</td> | |
| 296 | + <td align="center">{{result.xxsj}}</td> | |
| 297 | + <td align="center">{{result.fqsj}}</td> | |
| 298 | + <td align="center">{{result.cj}}</td> | |
| 299 | + </tr> | |
| 300 | +{{/each}} | |
| 301 | +{{if list.length == 0}} | |
| 302 | + <tr> | |
| 303 | + <td colspan="5"><h6 class="muted">没有找到相关数据</h6></td> | |
| 304 | + </tr> | |
| 305 | + {{/if}} | |
| 306 | +</script> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
| 1 | -// 车辆基础信息维护 service controller等写在一起 | |
| 2 | - | |
| 3 | -angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) { | |
| 4 | - | |
| 5 | - /** 当前的查询条件信息 */ | |
| 6 | - var currentSearchCondition = { | |
| 7 | - "carCode_like" : "", | |
| 8 | - "insideCode_like" : "", | |
| 9 | - "equipmentCode_like" : "", | |
| 10 | - "carPlate_like" : "" | |
| 11 | - }; | |
| 12 | - | |
| 13 | - /** 当前第几页 */ | |
| 14 | - var currentPageNo = 1; | |
| 15 | - return { | |
| 16 | - /** | |
| 17 | - * 获取查询条件信息, | |
| 18 | - * 用于给controller用来和页面数据绑定。 | |
| 19 | - */ | |
| 20 | - getSearchCondition: function() { | |
| 21 | - return currentSearchCondition; | |
| 22 | - }, | |
| 23 | - /** | |
| 24 | - * 重置查询条件信息。 | |
| 25 | - */ | |
| 26 | - resetSearchCondition: function() { | |
| 27 | - var key; | |
| 28 | - for (key in currentSearchCondition) { | |
| 29 | - currentSearchCondition[key] = undefined; | |
| 30 | - } | |
| 31 | - currentPageNo = 1; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 设置当前页码。 | |
| 35 | - * @param cpn 从1开始,后台是从0开始的 | |
| 36 | - */ | |
| 37 | - setCurrentPageNo: function(cpn) { | |
| 38 | - currentPageNo = cpn; | |
| 39 | - }, | |
| 40 | - /** | |
| 41 | - * 组装查询参数,返回一个promise查询结果。 | |
| 42 | - * @param params 查询参数 | |
| 43 | - * @return 返回一个 promise | |
| 44 | - */ | |
| 45 | - getPage: function() { | |
| 46 | - var params = currentSearchCondition; // 查询条件 | |
| 47 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 48 | - return service.rest.list(params).$promise; | |
| 49 | - }, | |
| 50 | - /** | |
| 51 | - * 获取明细信息。 | |
| 52 | - * @param id 车辆id | |
| 53 | - * @return 返回一个 promise | |
| 54 | - */ | |
| 55 | - getDetail: function(id) { | |
| 56 | - var params = {id: id}; | |
| 57 | - return service.rest.get(params).$promise; | |
| 58 | - }, | |
| 59 | - /** | |
| 60 | - * 保存信息。 | |
| 61 | - * @param obj 车辆详细信息 | |
| 62 | - * @return 返回一个 promise | |
| 63 | - */ | |
| 64 | - saveDetail: function(obj) { | |
| 65 | - return service.rest.save(obj).$promise; | |
| 66 | - }, | |
| 67 | - /** | |
| 68 | - * 数据导出。 | |
| 69 | - * @returns {*|Function|promise|n} | |
| 70 | - */ | |
| 71 | - dataExport: function() { | |
| 72 | - return service.dataTools.dataExport().$promise; | |
| 73 | - } | |
| 74 | - }; | |
| 75 | -}]); | |
| 76 | - | |
| 77 | -angular.module('ScheduleApp').controller('BusInfoManageCtrl', [ | |
| 78 | - 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g', | |
| 79 | - function(busInfoManageService, $state, $uibModal, fileDownload) { | |
| 80 | - var self = this; | |
| 81 | - | |
| 82 | - // 切换到form状态 | |
| 83 | - self.goForm = function() { | |
| 84 | - //alert("切换"); | |
| 85 | - $state.go("busInfoManage_form"); | |
| 86 | - }; | |
| 87 | - | |
| 88 | - // 导入excel | |
| 89 | - self.importData = function() { | |
| 90 | - // large方式弹出模态对话框 | |
| 91 | - var modalInstance = $uibModal.open({ | |
| 92 | - templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html', | |
| 93 | - size: "lg", | |
| 94 | - animation: true, | |
| 95 | - backdrop: 'static', | |
| 96 | - resolve: { | |
| 97 | - // 可以传值给controller | |
| 98 | - }, | |
| 99 | - windowClass: 'center-modal', | |
| 100 | - controller: "BusInfoManageToolsCtrl", | |
| 101 | - controllerAs: "ctrl", | |
| 102 | - bindToController: true | |
| 103 | - }); | |
| 104 | - modalInstance.result.then( | |
| 105 | - function() { | |
| 106 | - console.log("dataImport.html打开"); | |
| 107 | - }, | |
| 108 | - function() { | |
| 109 | - console.log("dataImport.html消失"); | |
| 110 | - } | |
| 111 | - ); | |
| 112 | - }; | |
| 113 | - | |
| 114 | - // 导出excel | |
| 115 | - self.exportData = function() { | |
| 116 | - busInfoManageService.dataExport().then( | |
| 117 | - function(result) { | |
| 118 | - fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls"); | |
| 119 | - }, | |
| 120 | - function(result) { | |
| 121 | - console.log("exportData failed:" + result); | |
| 122 | - } | |
| 123 | - ); | |
| 124 | - }; | |
| 125 | - }]); | |
| 126 | - | |
| 127 | -angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 128 | - var self = this; | |
| 129 | - self.data = "TODO"; | |
| 130 | - | |
| 131 | - // 关闭窗口 | |
| 132 | - self.close = function() { | |
| 133 | - $modalInstance.dismiss("cancel"); | |
| 134 | - }; | |
| 135 | - | |
| 136 | - self.clearInputFile = function() { | |
| 137 | - angular.element("input[type='file']").val(null); | |
| 138 | - }; | |
| 139 | - | |
| 140 | - // 上传文件组件 | |
| 141 | - self.uploader = new FileUploader({ | |
| 142 | - url: "/cars/dataImport", | |
| 143 | - filters: [] // 用于过滤文件,比如只允许导入excel | |
| 144 | - }); | |
| 145 | - self.uploader.onAfterAddingFile = function(fileItem) | |
| 146 | - { | |
| 147 | - console.info('onAfterAddingFile', fileItem); | |
| 148 | - console.log(self.uploader.queue.length); | |
| 149 | - if (self.uploader.queue.length > 1) | |
| 150 | - self.uploader.removeFromQueue(0); | |
| 151 | - }; | |
| 152 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 153 | - { | |
| 154 | - console.info('onSuccessItem', fileItem, response, status, headers); | |
| 155 | - }; | |
| 156 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 157 | - { | |
| 158 | - console.info('onErrorItem', fileItem, response, status, headers); | |
| 159 | - }; | |
| 160 | - | |
| 161 | -}]); | |
| 162 | - | |
| 163 | - | |
| 164 | -angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) { | |
| 165 | - var self = this; | |
| 166 | - self.pageInfo = { | |
| 167 | - totalItems : 0, | |
| 168 | - currentPage : 1, | |
| 169 | - infos: [] | |
| 170 | - }; | |
| 171 | - | |
| 172 | - // 初始创建的时候,获取一次列表数据 | |
| 173 | - busInfoManageService.getPage().then( | |
| 174 | - function(result) { | |
| 175 | - self.pageInfo.totalItems = result.totalElements; | |
| 176 | - self.pageInfo.currentPage = result.number + 1; | |
| 177 | - self.pageInfo.infos = result.content; | |
| 178 | - busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 179 | - }, | |
| 180 | - function(result) { | |
| 181 | - alert("出错啦!"); | |
| 182 | - } | |
| 183 | - ); | |
| 184 | - | |
| 185 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 186 | - // alert("dfdfdf"); | |
| 187 | - //}); | |
| 188 | - | |
| 189 | - // 翻页的时候调用 | |
| 190 | - self.pageChanaged = function() { | |
| 191 | - busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 192 | - busInfoManageService.getPage().then( | |
| 193 | - function(result) { | |
| 194 | - self.pageInfo.totalItems = result.totalElements; | |
| 195 | - self.pageInfo.currentPage = result.number + 1; | |
| 196 | - self.pageInfo.infos = result.content; | |
| 197 | - busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 198 | - }, | |
| 199 | - function(result) { | |
| 200 | - alert("出错啦!"); | |
| 201 | - } | |
| 202 | - ); | |
| 203 | - }; | |
| 204 | - // 获取查询条件数据 | |
| 205 | - self.searchCondition = function() { | |
| 206 | - return busInfoManageService.getSearchCondition(); | |
| 207 | - }; | |
| 208 | - // 重置查询条件 | |
| 209 | - self.resetSearchCondition = function() { | |
| 210 | - busInfoManageService.resetSearchCondition(); | |
| 211 | - self.pageInfo.currentPage = 1; | |
| 212 | - self.pageChanaged(); | |
| 213 | - }; | |
| 214 | -}]); | |
| 215 | - | |
| 216 | -angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) { | |
| 217 | - var self = this; | |
| 218 | - | |
| 219 | - // 报废日期 日期控件开关 | |
| 220 | - self.scrapDateOpen = false; | |
| 221 | - self.scrapDate_open = function() { | |
| 222 | - self.scrapDateOpen = true; | |
| 223 | - }; | |
| 224 | - | |
| 225 | - // 启用日期 日期控件开关 | |
| 226 | - self.openDateOpen = false; | |
| 227 | - self.openDate_open = function() { | |
| 228 | - self.openDateOpen = true; | |
| 229 | - }; | |
| 230 | - // 取消日期 日期控件开关 | |
| 231 | - self.closeDateOpen = false; | |
| 232 | - self.closeDate_open = function() { | |
| 233 | - self.closeDateOpen = true; | |
| 234 | - }; | |
| 235 | - | |
| 236 | - // 欲保存的busInfo信息,绑定 | |
| 237 | - self.busInfoForSave = {}; | |
| 238 | - | |
| 239 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 240 | - var id = $stateParams.id; | |
| 241 | - if (id) { | |
| 242 | - self.busInfoForSave.id = id; | |
| 243 | - busInfoManageService.getDetail(id).then( | |
| 244 | - function(result) { | |
| 245 | - var key; | |
| 246 | - for (key in result) { | |
| 247 | - self.busInfoForSave[key] = result[key]; | |
| 248 | - } | |
| 249 | - }, | |
| 250 | - function(result) { | |
| 251 | - alert("出错啦!"); | |
| 252 | - } | |
| 253 | - ); | |
| 254 | - } | |
| 255 | - | |
| 256 | - // 提交方法 | |
| 257 | - self.submit = function() { | |
| 258 | - console.log(self.busInfoForSave); | |
| 259 | - //if (self.busInfoForSave) { | |
| 260 | - // delete $stateParams.id; | |
| 261 | - //} | |
| 262 | - busInfoManageService.saveDetail(self.busInfoForSave).then( | |
| 263 | - function(result) { | |
| 264 | - // TODO:弹出框方式以后改 | |
| 265 | - if (result.status == 'SUCCESS') { | |
| 266 | - alert("保存成功!"); | |
| 267 | - $state.go("busInfoManage"); | |
| 268 | - } else { | |
| 269 | - alert("保存异常!"); | |
| 270 | - } | |
| 271 | - }, | |
| 272 | - function(result) { | |
| 273 | - // TODO:弹出框方式以后改 | |
| 274 | - alert("出错啦!"); | |
| 275 | - } | |
| 276 | - ); | |
| 277 | - }; | |
| 278 | - | |
| 279 | -}]); | |
| 280 | - | |
| 281 | -angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) { | |
| 282 | - var self = this; | |
| 283 | - self.title = ""; | |
| 284 | - self.busInfoForDetail = {}; | |
| 285 | - self.busInfoForDetail.id = $stateParams.id; | |
| 286 | - | |
| 287 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 288 | - busInfoManageService.getDetail($stateParams.id).then( | |
| 289 | - function(result) { | |
| 290 | - var key; | |
| 291 | - for (key in result) { | |
| 292 | - self.busInfoForDetail[key] = result[key]; | |
| 293 | - } | |
| 294 | - | |
| 295 | - self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息"; | |
| 296 | - }, | |
| 297 | - function(result) { | |
| 298 | - // TODO:弹出框方式以后改 | |
| 299 | - alert("出错啦!"); | |
| 300 | - } | |
| 301 | - ); | |
| 1 | +// 车辆基础信息维护 service controller等写在一起 | |
| 2 | + | |
| 3 | +angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) { | |
| 4 | + | |
| 5 | + /** 当前的查询条件信息 */ | |
| 6 | + var currentSearchCondition = { | |
| 7 | + "carCode_like" : "", | |
| 8 | + "insideCode_like" : "", | |
| 9 | + "equipmentCode_like" : "", | |
| 10 | + "carPlate_like" : "" | |
| 11 | + }; | |
| 12 | + | |
| 13 | + /** 当前第几页 */ | |
| 14 | + var currentPageNo = 1; | |
| 15 | + return { | |
| 16 | + /** | |
| 17 | + * 获取查询条件信息, | |
| 18 | + * 用于给controller用来和页面数据绑定。 | |
| 19 | + */ | |
| 20 | + getSearchCondition: function() { | |
| 21 | + return currentSearchCondition; | |
| 22 | + }, | |
| 23 | + /** | |
| 24 | + * 重置查询条件信息。 | |
| 25 | + */ | |
| 26 | + resetSearchCondition: function() { | |
| 27 | + var key; | |
| 28 | + for (key in currentSearchCondition) { | |
| 29 | + currentSearchCondition[key] = undefined; | |
| 30 | + } | |
| 31 | + currentPageNo = 1; | |
| 32 | + }, | |
| 33 | + /** | |
| 34 | + * 设置当前页码。 | |
| 35 | + * @param cpn 从1开始,后台是从0开始的 | |
| 36 | + */ | |
| 37 | + setCurrentPageNo: function(cpn) { | |
| 38 | + currentPageNo = cpn; | |
| 39 | + }, | |
| 40 | + /** | |
| 41 | + * 组装查询参数,返回一个promise查询结果。 | |
| 42 | + * @param params 查询参数 | |
| 43 | + * @return 返回一个 promise | |
| 44 | + */ | |
| 45 | + getPage: function() { | |
| 46 | + var params = currentSearchCondition; // 查询条件 | |
| 47 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 48 | + return service.rest.list(params).$promise; | |
| 49 | + }, | |
| 50 | + /** | |
| 51 | + * 获取明细信息。 | |
| 52 | + * @param id 车辆id | |
| 53 | + * @return 返回一个 promise | |
| 54 | + */ | |
| 55 | + getDetail: function(id) { | |
| 56 | + var params = {id: id}; | |
| 57 | + return service.rest.get(params).$promise; | |
| 58 | + }, | |
| 59 | + /** | |
| 60 | + * 保存信息。 | |
| 61 | + * @param obj 车辆详细信息 | |
| 62 | + * @return 返回一个 promise | |
| 63 | + */ | |
| 64 | + saveDetail: function(obj) { | |
| 65 | + return service.rest.save(obj).$promise; | |
| 66 | + }, | |
| 67 | + /** | |
| 68 | + * 数据导出。 | |
| 69 | + * @returns {*|Function|promise|n} | |
| 70 | + */ | |
| 71 | + dataExport: function() { | |
| 72 | + return service.dataTools.dataExport().$promise; | |
| 73 | + } | |
| 74 | + }; | |
| 75 | +}]); | |
| 76 | + | |
| 77 | +angular.module('ScheduleApp').controller('BusInfoManageCtrl', [ | |
| 78 | + 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g', | |
| 79 | + function(busInfoManageService, $state, $uibModal, fileDownload) { | |
| 80 | + var self = this; | |
| 81 | + | |
| 82 | + // 切换到form状态 | |
| 83 | + self.goForm = function() { | |
| 84 | + //alert("切换"); | |
| 85 | + $state.go("busInfoManage_form"); | |
| 86 | + }; | |
| 87 | + | |
| 88 | + // 导入excel | |
| 89 | + self.importData = function() { | |
| 90 | + // large方式弹出模态对话框 | |
| 91 | + var modalInstance = $uibModal.open({ | |
| 92 | + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html', | |
| 93 | + size: "lg", | |
| 94 | + animation: true, | |
| 95 | + backdrop: 'static', | |
| 96 | + resolve: { | |
| 97 | + // 可以传值给controller | |
| 98 | + }, | |
| 99 | + windowClass: 'center-modal', | |
| 100 | + controller: "BusInfoManageToolsCtrl", | |
| 101 | + controllerAs: "ctrl", | |
| 102 | + bindToController: true | |
| 103 | + }); | |
| 104 | + modalInstance.result.then( | |
| 105 | + function() { | |
| 106 | + console.log("dataImport.html打开"); | |
| 107 | + }, | |
| 108 | + function() { | |
| 109 | + console.log("dataImport.html消失"); | |
| 110 | + } | |
| 111 | + ); | |
| 112 | + }; | |
| 113 | + | |
| 114 | + // 导出excel | |
| 115 | + self.exportData = function() { | |
| 116 | + busInfoManageService.dataExport().then( | |
| 117 | + function(result) { | |
| 118 | + fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls"); | |
| 119 | + }, | |
| 120 | + function(result) { | |
| 121 | + console.log("exportData failed:" + result); | |
| 122 | + } | |
| 123 | + ); | |
| 124 | + }; | |
| 125 | + }]); | |
| 126 | + | |
| 127 | +angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 128 | + var self = this; | |
| 129 | + self.data = "TODO"; | |
| 130 | + | |
| 131 | + // 关闭窗口 | |
| 132 | + self.close = function() { | |
| 133 | + $modalInstance.dismiss("cancel"); | |
| 134 | + }; | |
| 135 | + | |
| 136 | + self.clearInputFile = function() { | |
| 137 | + angular.element("input[type='file']").val(null); | |
| 138 | + }; | |
| 139 | + | |
| 140 | + // 上传文件组件 | |
| 141 | + self.uploader = new FileUploader({ | |
| 142 | + url: "/cars/dataImport", | |
| 143 | + filters: [] // 用于过滤文件,比如只允许导入excel | |
| 144 | + }); | |
| 145 | + self.uploader.onAfterAddingFile = function(fileItem) | |
| 146 | + { | |
| 147 | + console.info('onAfterAddingFile', fileItem); | |
| 148 | + console.log(self.uploader.queue.length); | |
| 149 | + if (self.uploader.queue.length > 1) | |
| 150 | + self.uploader.removeFromQueue(0); | |
| 151 | + }; | |
| 152 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 153 | + { | |
| 154 | + console.info('onSuccessItem', fileItem, response, status, headers); | |
| 155 | + }; | |
| 156 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 157 | + { | |
| 158 | + console.info('onErrorItem', fileItem, response, status, headers); | |
| 159 | + }; | |
| 160 | + | |
| 161 | +}]); | |
| 162 | + | |
| 163 | + | |
| 164 | +angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) { | |
| 165 | + var self = this; | |
| 166 | + self.pageInfo = { | |
| 167 | + totalItems : 0, | |
| 168 | + currentPage : 1, | |
| 169 | + infos: [] | |
| 170 | + }; | |
| 171 | + | |
| 172 | + // 初始创建的时候,获取一次列表数据 | |
| 173 | + busInfoManageService.getPage().then( | |
| 174 | + function(result) { | |
| 175 | + self.pageInfo.totalItems = result.totalElements; | |
| 176 | + self.pageInfo.currentPage = result.number + 1; | |
| 177 | + self.pageInfo.infos = result.content; | |
| 178 | + busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 179 | + }, | |
| 180 | + function(result) { | |
| 181 | + alert("出错啦!"); | |
| 182 | + } | |
| 183 | + ); | |
| 184 | + | |
| 185 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 186 | + // alert("dfdfdf"); | |
| 187 | + //}); | |
| 188 | + | |
| 189 | + // 翻页的时候调用 | |
| 190 | + self.pageChanaged = function() { | |
| 191 | + busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 192 | + busInfoManageService.getPage().then( | |
| 193 | + function(result) { | |
| 194 | + self.pageInfo.totalItems = result.totalElements; | |
| 195 | + self.pageInfo.currentPage = result.number + 1; | |
| 196 | + self.pageInfo.infos = result.content; | |
| 197 | + busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 198 | + }, | |
| 199 | + function(result) { | |
| 200 | + alert("出错啦!"); | |
| 201 | + } | |
| 202 | + ); | |
| 203 | + }; | |
| 204 | + // 获取查询条件数据 | |
| 205 | + self.searchCondition = function() { | |
| 206 | + return busInfoManageService.getSearchCondition(); | |
| 207 | + }; | |
| 208 | + // 重置查询条件 | |
| 209 | + self.resetSearchCondition = function() { | |
| 210 | + busInfoManageService.resetSearchCondition(); | |
| 211 | + self.pageInfo.currentPage = 1; | |
| 212 | + self.pageChanaged(); | |
| 213 | + }; | |
| 214 | +}]); | |
| 215 | + | |
| 216 | +angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) { | |
| 217 | + var self = this; | |
| 218 | + | |
| 219 | + // 报废日期 日期控件开关 | |
| 220 | + self.scrapDateOpen = false; | |
| 221 | + self.scrapDate_open = function() { | |
| 222 | + self.scrapDateOpen = true; | |
| 223 | + }; | |
| 224 | + | |
| 225 | + // 启用日期 日期控件开关 | |
| 226 | + self.openDateOpen = false; | |
| 227 | + self.openDate_open = function() { | |
| 228 | + self.openDateOpen = true; | |
| 229 | + }; | |
| 230 | + // 取消日期 日期控件开关 | |
| 231 | + self.closeDateOpen = false; | |
| 232 | + self.closeDate_open = function() { | |
| 233 | + self.closeDateOpen = true; | |
| 234 | + }; | |
| 235 | + | |
| 236 | + // 欲保存的busInfo信息,绑定 | |
| 237 | + self.busInfoForSave = {}; | |
| 238 | + | |
| 239 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 240 | + var id = $stateParams.id; | |
| 241 | + if (id) { | |
| 242 | + self.busInfoForSave.id = id; | |
| 243 | + busInfoManageService.getDetail(id).then( | |
| 244 | + function(result) { | |
| 245 | + var key; | |
| 246 | + for (key in result) { | |
| 247 | + self.busInfoForSave[key] = result[key]; | |
| 248 | + } | |
| 249 | + }, | |
| 250 | + function(result) { | |
| 251 | + alert("出错啦!"); | |
| 252 | + } | |
| 253 | + ); | |
| 254 | + } | |
| 255 | + | |
| 256 | + // 提交方法 | |
| 257 | + self.submit = function() { | |
| 258 | + console.log(self.busInfoForSave); | |
| 259 | + //if (self.busInfoForSave) { | |
| 260 | + // delete $stateParams.id; | |
| 261 | + //} | |
| 262 | + busInfoManageService.saveDetail(self.busInfoForSave).then( | |
| 263 | + function(result) { | |
| 264 | + // TODO:弹出框方式以后改 | |
| 265 | + if (result.status == 'SUCCESS') { | |
| 266 | + alert("保存成功!"); | |
| 267 | + $state.go("busInfoManage"); | |
| 268 | + } else { | |
| 269 | + alert("保存异常!"); | |
| 270 | + } | |
| 271 | + }, | |
| 272 | + function(result) { | |
| 273 | + // TODO:弹出框方式以后改 | |
| 274 | + alert("出错啦!"); | |
| 275 | + } | |
| 276 | + ); | |
| 277 | + }; | |
| 278 | + | |
| 279 | +}]); | |
| 280 | + | |
| 281 | +angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) { | |
| 282 | + var self = this; | |
| 283 | + self.title = ""; | |
| 284 | + self.busInfoForDetail = {}; | |
| 285 | + self.busInfoForDetail.id = $stateParams.id; | |
| 286 | + | |
| 287 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 288 | + busInfoManageService.getDetail($stateParams.id).then( | |
| 289 | + function(result) { | |
| 290 | + var key; | |
| 291 | + for (key in result) { | |
| 292 | + self.busInfoForDetail[key] = result[key]; | |
| 293 | + } | |
| 294 | + | |
| 295 | + self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息"; | |
| 296 | + }, | |
| 297 | + function(result) { | |
| 298 | + // TODO:弹出框方式以后改 | |
| 299 | + alert("出错啦!"); | |
| 300 | + } | |
| 301 | + ); | |
| 302 | 302 | }]); |
| 303 | 303 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 车辆基础信息模块配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("busInfoManage", { // index页面 | |
| 13 | - url: '/busInfoManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html' | |
| 17 | - }, | |
| 18 | - "busInfoManage_list@busInfoManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'busInfoManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 33 | - ] | |
| 34 | - }); | |
| 35 | - }] | |
| 36 | - } | |
| 37 | - }) | |
| 38 | - .state("busInfoManage_form", { // 添加车辆form | |
| 39 | - url: '/busInfoManage_form', | |
| 40 | - views: { | |
| 41 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'} | |
| 42 | - }, | |
| 43 | - resolve: { | |
| 44 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | - return $ocLazyLoad.load({ | |
| 46 | - name: 'busInfoManage_form_module', | |
| 47 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | - files: [ | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 52 | - ] | |
| 53 | - }); | |
| 54 | - }] | |
| 55 | - } | |
| 56 | - }) | |
| 57 | - .state("busInfoManage_edit", { // 修改车辆form | |
| 58 | - url: '/busInfoManage_edit/:id', | |
| 59 | - views: { | |
| 60 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'} | |
| 61 | - }, | |
| 62 | - resolve: { | |
| 63 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | - return $ocLazyLoad.load({ | |
| 65 | - name: 'busInfoManage_edit_module', | |
| 66 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | - files: [ | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 71 | - ] | |
| 72 | - }); | |
| 73 | - }] | |
| 74 | - } | |
| 75 | - }) | |
| 76 | - .state("busInfoManage_detail", { // 车辆详细信息 | |
| 77 | - url: '/busInfoManage_detail/:id', | |
| 78 | - views: { | |
| 79 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'} | |
| 80 | - }, | |
| 81 | - resolve: { | |
| 82 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | - return $ocLazyLoad.load({ | |
| 84 | - name: 'busInfoManage_detail_module', | |
| 85 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | - files: [ | |
| 87 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 88 | - ] | |
| 89 | - }); | |
| 90 | - }] | |
| 91 | - } | |
| 92 | - }) | |
| 93 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 车辆基础信息模块配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("busInfoManage", { // index页面 | |
| 13 | + url: '/busInfoManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html' | |
| 17 | + }, | |
| 18 | + "busInfoManage_list@busInfoManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'busInfoManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 33 | + ] | |
| 34 | + }); | |
| 35 | + }] | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + .state("busInfoManage_form", { // 添加车辆form | |
| 39 | + url: '/busInfoManage_form', | |
| 40 | + views: { | |
| 41 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'} | |
| 42 | + }, | |
| 43 | + resolve: { | |
| 44 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | + return $ocLazyLoad.load({ | |
| 46 | + name: 'busInfoManage_form_module', | |
| 47 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | + files: [ | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 52 | + ] | |
| 53 | + }); | |
| 54 | + }] | |
| 55 | + } | |
| 56 | + }) | |
| 57 | + .state("busInfoManage_edit", { // 修改车辆form | |
| 58 | + url: '/busInfoManage_edit/:id', | |
| 59 | + views: { | |
| 60 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'} | |
| 61 | + }, | |
| 62 | + resolve: { | |
| 63 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | + return $ocLazyLoad.load({ | |
| 65 | + name: 'busInfoManage_edit_module', | |
| 66 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | + files: [ | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 71 | + ] | |
| 72 | + }); | |
| 73 | + }] | |
| 74 | + } | |
| 75 | + }) | |
| 76 | + .state("busInfoManage_detail", { // 车辆详细信息 | |
| 77 | + url: '/busInfoManage_detail/:id', | |
| 78 | + views: { | |
| 79 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'} | |
| 80 | + }, | |
| 81 | + resolve: { | |
| 82 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | + return $ocLazyLoad.load({ | |
| 84 | + name: 'busInfoManage_detail_module', | |
| 85 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | + files: [ | |
| 87 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 88 | + ] | |
| 89 | + }); | |
| 90 | + }] | |
| 91 | + } | |
| 92 | + }) | |
| 93 | + } | |
| 94 | 94 | ]); |
| 95 | 95 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
| 1 | -// 设备信息维护 service controller 等写在一起 | |
| 2 | - | |
| 3 | -angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) { | |
| 4 | - /** 当前的查询条件信息 */ | |
| 5 | - var currentSearchCondition = {}; | |
| 6 | - | |
| 7 | - /** 当前第几页 */ | |
| 8 | - var currentPageNo = 1; | |
| 9 | - | |
| 10 | - return { | |
| 11 | - /** | |
| 12 | - * 获取查询条件信息, | |
| 13 | - * 用于给controller用来和页面数据绑定。 | |
| 14 | - */ | |
| 15 | - getSearchCondition: function() { | |
| 16 | - return currentSearchCondition; | |
| 17 | - }, | |
| 18 | - /** | |
| 19 | - * 重置查询条件信息。 | |
| 20 | - */ | |
| 21 | - resetSearchCondition: function() { | |
| 22 | - var key; | |
| 23 | - for (key in currentSearchCondition) { | |
| 24 | - currentSearchCondition[key] = ""; | |
| 25 | - } | |
| 26 | - }, | |
| 27 | - /** | |
| 28 | - * 设置当前页码。 | |
| 29 | - * @param cpn 从1开始,后台是从0开始的 | |
| 30 | - */ | |
| 31 | - setCurrentPageNo: function(cpn) { | |
| 32 | - currentPageNo = cpn; | |
| 33 | - }, | |
| 34 | - /** | |
| 35 | - * 组装查询参数,返回一个promise查询结果。 | |
| 36 | - * @param params 查询参数 | |
| 37 | - * @return 返回一个 promise | |
| 38 | - */ | |
| 39 | - getPage: function() { | |
| 40 | - var params = currentSearchCondition; // 查询条件 | |
| 41 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | - return service.list(params).$promise; | |
| 43 | - }, | |
| 44 | - /** | |
| 45 | - * 获取明细信息。 | |
| 46 | - * @param id 车辆id | |
| 47 | - * @return 返回一个 promise | |
| 48 | - */ | |
| 49 | - getDetail: function(id) { | |
| 50 | - var params = {id: id}; | |
| 51 | - return service.get(params).$promise; | |
| 52 | - }, | |
| 53 | - /** | |
| 54 | - * 保存信息。 | |
| 55 | - * @param obj 车辆详细信息 | |
| 56 | - * @return 返回一个 promise | |
| 57 | - */ | |
| 58 | - saveDetail: function(obj) { | |
| 59 | - return service.save(obj).$promise; | |
| 60 | - }, | |
| 61 | - /** | |
| 62 | - * 删除信息。 | |
| 63 | - * @param id 主键id | |
| 64 | - * @returns {*|Function|promise|n} | |
| 65 | - */ | |
| 66 | - deleteDetail: function(id) { | |
| 67 | - return service.delete({id: id}).$promise; | |
| 68 | - } | |
| 69 | - }; | |
| 70 | - | |
| 71 | -}]); | |
| 72 | - | |
| 73 | -angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) { | |
| 74 | - var self = this; | |
| 75 | - | |
| 76 | - // 切换到form状态 | |
| 77 | - self.goForm = function() { | |
| 78 | - //alert("切换"); | |
| 79 | - $state.go("deviceInfoManage_form"); | |
| 80 | - } | |
| 81 | - | |
| 82 | - | |
| 83 | -}]); | |
| 84 | - | |
| 85 | -angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { | |
| 86 | - var self = this; | |
| 87 | - self.pageInfo = { | |
| 88 | - totalItems : 0, | |
| 89 | - currentPage : 1, | |
| 90 | - infos: [] | |
| 91 | - }; | |
| 92 | - | |
| 93 | - // 初始创建的时候,获取一次列表数据 | |
| 94 | - deviceInfoManageService.getPage().then( | |
| 95 | - function(result) { | |
| 96 | - self.pageInfo.totalItems = result.totalElements; | |
| 97 | - self.pageInfo.currentPage = result.number + 1; | |
| 98 | - self.pageInfo.infos = result.content; | |
| 99 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 100 | - }, | |
| 101 | - function(result) { | |
| 102 | - alert("出错啦!"); | |
| 103 | - } | |
| 104 | - ); | |
| 105 | - | |
| 106 | - // 翻页的时候调用 | |
| 107 | - self.pageChanaged = function() { | |
| 108 | - deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 109 | - deviceInfoManageService.getPage().then( | |
| 110 | - function(result) { | |
| 111 | - self.pageInfo.totalItems = result.totalElements; | |
| 112 | - self.pageInfo.currentPage = result.number + 1; | |
| 113 | - self.pageInfo.infos = result.content; | |
| 114 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 115 | - }, | |
| 116 | - function(result) { | |
| 117 | - alert("出错啦!"); | |
| 118 | - } | |
| 119 | - ); | |
| 120 | - }; | |
| 121 | - // 获取查询条件数据 | |
| 122 | - self.searchCondition = function() { | |
| 123 | - return deviceInfoManageService.getSearchCondition(); | |
| 124 | - }; | |
| 125 | - // 重置查询条件 | |
| 126 | - self.resetSearchCondition = function() { | |
| 127 | - deviceInfoManageService.resetSearchCondition(); | |
| 128 | - self.pageInfo.currentPage = 1; | |
| 129 | - self.pageChanaged(); | |
| 130 | - }; | |
| 131 | - | |
| 132 | - // 作废/撤销 | |
| 133 | - self.toggleCde = function(id) { | |
| 134 | - // TODO: | |
| 135 | - deviceInfoManageService.deleteDetail(id).then( | |
| 136 | - function(result) { | |
| 137 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 138 | - alert("失败:" + result.message); | |
| 139 | - } else { | |
| 140 | - alert("成功!"); | |
| 141 | - | |
| 142 | - deviceInfoManageService.getPage().then( | |
| 143 | - function(result) { | |
| 144 | - self.pageInfo.totalItems = result.totalElements; | |
| 145 | - self.pageInfo.currentPage = result.number + 1; | |
| 146 | - self.pageInfo.infos = result.content; | |
| 147 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 148 | - }, | |
| 149 | - function(result) { | |
| 150 | - alert("出错啦!"); | |
| 151 | - } | |
| 152 | - ); | |
| 153 | - } | |
| 154 | - | |
| 155 | - }, | |
| 156 | - function(result) { | |
| 157 | - alert("出错啦!" + result); | |
| 158 | - } | |
| 159 | - ); | |
| 160 | - }; | |
| 161 | - | |
| 162 | -}]); | |
| 163 | - | |
| 164 | -angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) { | |
| 165 | - var self = this; | |
| 166 | - | |
| 167 | - // 启用日期 日期控件开关 | |
| 168 | - self.qyrqOpen = false; | |
| 169 | - self.qyrq_open = function() { | |
| 170 | - self.qyrqOpen = true; | |
| 171 | - }; | |
| 172 | - | |
| 173 | - // 欲保存的busInfo信息,绑定 | |
| 174 | - self.deviceInfoForSave = {}; | |
| 175 | - | |
| 176 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 177 | - var id = $stateParams.id; | |
| 178 | - if (id) { | |
| 179 | - self.deviceInfoForSave.id = id; | |
| 180 | - deviceInfoManageService.getDetail(id).then( | |
| 181 | - function(result) { | |
| 182 | - var key; | |
| 183 | - for (key in result) { | |
| 184 | - self.deviceInfoForSave[key] = result[key]; | |
| 185 | - } | |
| 186 | - // 填写所有的 select 控件选中框数据 | |
| 187 | - // 公司字典 | |
| 188 | - if (self.deviceInfoForSave.gsName) { | |
| 189 | - angular.forEach(self.gses, function(data) { | |
| 190 | - if (self.deviceInfoForSave.gsName == data.gsmc) { | |
| 191 | - self.deviceInfoForSave.gs_selected = data; | |
| 192 | - } | |
| 193 | - }); | |
| 194 | - } | |
| 195 | - }, | |
| 196 | - function(result) { | |
| 197 | - alert("出错啦!"); | |
| 198 | - } | |
| 199 | - ); | |
| 200 | - } | |
| 201 | - | |
| 202 | - // 提交方法 | |
| 203 | - self.submit = function() { | |
| 204 | - console.log(self.deviceInfoForSave); | |
| 205 | - deviceInfoManageService.saveDetail(self.deviceInfoForSave).then( | |
| 206 | - function(result) { | |
| 207 | - // TODO:弹出框方式以后改 | |
| 208 | - if (result.status == 'SUCCESS') { | |
| 209 | - alert("保存成功!"); | |
| 210 | - $state.go("deviceInfoManage"); | |
| 211 | - } else { | |
| 212 | - alert("保存异常!"); | |
| 213 | - } | |
| 214 | - }, | |
| 215 | - function(result) { | |
| 216 | - // TODO:弹出框方式以后改 | |
| 217 | - alert("出错啦!"); | |
| 218 | - } | |
| 219 | - ); | |
| 220 | - }; | |
| 221 | - | |
| 222 | -}]); | |
| 223 | - | |
| 224 | -angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) { | |
| 225 | - var self = this; | |
| 226 | - self.title = ""; | |
| 227 | - self.deviceInfoForDetail = {}; | |
| 228 | - self.deviceInfoForDetail.id = $stateParams.id; | |
| 229 | - | |
| 230 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 231 | - deviceInfoManageService.getDetail($stateParams.id).then( | |
| 232 | - function(result) { | |
| 233 | - var key; | |
| 234 | - for (key in result) { | |
| 235 | - self.deviceInfoForDetail[key] = result[key]; | |
| 236 | - } | |
| 237 | - | |
| 238 | - self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息"; | |
| 239 | - }, | |
| 240 | - function(result) { | |
| 241 | - // TODO:弹出框方式以后改 | |
| 242 | - alert("出错啦!"); | |
| 243 | - } | |
| 244 | - ); | |
| 1 | +// 设备信息维护 service controller 等写在一起 | |
| 2 | + | |
| 3 | +angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) { | |
| 4 | + /** 当前的查询条件信息 */ | |
| 5 | + var currentSearchCondition = {}; | |
| 6 | + | |
| 7 | + /** 当前第几页 */ | |
| 8 | + var currentPageNo = 1; | |
| 9 | + | |
| 10 | + return { | |
| 11 | + /** | |
| 12 | + * 获取查询条件信息, | |
| 13 | + * 用于给controller用来和页面数据绑定。 | |
| 14 | + */ | |
| 15 | + getSearchCondition: function() { | |
| 16 | + return currentSearchCondition; | |
| 17 | + }, | |
| 18 | + /** | |
| 19 | + * 重置查询条件信息。 | |
| 20 | + */ | |
| 21 | + resetSearchCondition: function() { | |
| 22 | + var key; | |
| 23 | + for (key in currentSearchCondition) { | |
| 24 | + currentSearchCondition[key] = ""; | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + /** | |
| 28 | + * 设置当前页码。 | |
| 29 | + * @param cpn 从1开始,后台是从0开始的 | |
| 30 | + */ | |
| 31 | + setCurrentPageNo: function(cpn) { | |
| 32 | + currentPageNo = cpn; | |
| 33 | + }, | |
| 34 | + /** | |
| 35 | + * 组装查询参数,返回一个promise查询结果。 | |
| 36 | + * @param params 查询参数 | |
| 37 | + * @return 返回一个 promise | |
| 38 | + */ | |
| 39 | + getPage: function() { | |
| 40 | + var params = currentSearchCondition; // 查询条件 | |
| 41 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | + return service.list(params).$promise; | |
| 43 | + }, | |
| 44 | + /** | |
| 45 | + * 获取明细信息。 | |
| 46 | + * @param id 车辆id | |
| 47 | + * @return 返回一个 promise | |
| 48 | + */ | |
| 49 | + getDetail: function(id) { | |
| 50 | + var params = {id: id}; | |
| 51 | + return service.get(params).$promise; | |
| 52 | + }, | |
| 53 | + /** | |
| 54 | + * 保存信息。 | |
| 55 | + * @param obj 车辆详细信息 | |
| 56 | + * @return 返回一个 promise | |
| 57 | + */ | |
| 58 | + saveDetail: function(obj) { | |
| 59 | + return service.save(obj).$promise; | |
| 60 | + }, | |
| 61 | + /** | |
| 62 | + * 删除信息。 | |
| 63 | + * @param id 主键id | |
| 64 | + * @returns {*|Function|promise|n} | |
| 65 | + */ | |
| 66 | + deleteDetail: function(id) { | |
| 67 | + return service.delete({id: id}).$promise; | |
| 68 | + } | |
| 69 | + }; | |
| 70 | + | |
| 71 | +}]); | |
| 72 | + | |
| 73 | +angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) { | |
| 74 | + var self = this; | |
| 75 | + | |
| 76 | + // 切换到form状态 | |
| 77 | + self.goForm = function() { | |
| 78 | + //alert("切换"); | |
| 79 | + $state.go("deviceInfoManage_form"); | |
| 80 | + } | |
| 81 | + | |
| 82 | + | |
| 83 | +}]); | |
| 84 | + | |
| 85 | +angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { | |
| 86 | + var self = this; | |
| 87 | + self.pageInfo = { | |
| 88 | + totalItems : 0, | |
| 89 | + currentPage : 1, | |
| 90 | + infos: [] | |
| 91 | + }; | |
| 92 | + | |
| 93 | + // 初始创建的时候,获取一次列表数据 | |
| 94 | + deviceInfoManageService.getPage().then( | |
| 95 | + function(result) { | |
| 96 | + self.pageInfo.totalItems = result.totalElements; | |
| 97 | + self.pageInfo.currentPage = result.number + 1; | |
| 98 | + self.pageInfo.infos = result.content; | |
| 99 | + deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 100 | + }, | |
| 101 | + function(result) { | |
| 102 | + alert("出错啦!"); | |
| 103 | + } | |
| 104 | + ); | |
| 105 | + | |
| 106 | + // 翻页的时候调用 | |
| 107 | + self.pageChanaged = function() { | |
| 108 | + deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 109 | + deviceInfoManageService.getPage().then( | |
| 110 | + function(result) { | |
| 111 | + self.pageInfo.totalItems = result.totalElements; | |
| 112 | + self.pageInfo.currentPage = result.number + 1; | |
| 113 | + self.pageInfo.infos = result.content; | |
| 114 | + deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 115 | + }, | |
| 116 | + function(result) { | |
| 117 | + alert("出错啦!"); | |
| 118 | + } | |
| 119 | + ); | |
| 120 | + }; | |
| 121 | + // 获取查询条件数据 | |
| 122 | + self.searchCondition = function() { | |
| 123 | + return deviceInfoManageService.getSearchCondition(); | |
| 124 | + }; | |
| 125 | + // 重置查询条件 | |
| 126 | + self.resetSearchCondition = function() { | |
| 127 | + deviceInfoManageService.resetSearchCondition(); | |
| 128 | + self.pageInfo.currentPage = 1; | |
| 129 | + self.pageChanaged(); | |
| 130 | + }; | |
| 131 | + | |
| 132 | + // 作废/撤销 | |
| 133 | + self.toggleCde = function(id) { | |
| 134 | + // TODO: | |
| 135 | + deviceInfoManageService.deleteDetail(id).then( | |
| 136 | + function(result) { | |
| 137 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 138 | + alert("失败:" + result.message); | |
| 139 | + } else { | |
| 140 | + alert("成功!"); | |
| 141 | + | |
| 142 | + deviceInfoManageService.getPage().then( | |
| 143 | + function(result) { | |
| 144 | + self.pageInfo.totalItems = result.totalElements; | |
| 145 | + self.pageInfo.currentPage = result.number + 1; | |
| 146 | + self.pageInfo.infos = result.content; | |
| 147 | + deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 148 | + }, | |
| 149 | + function(result) { | |
| 150 | + alert("出错啦!"); | |
| 151 | + } | |
| 152 | + ); | |
| 153 | + } | |
| 154 | + | |
| 155 | + }, | |
| 156 | + function(result) { | |
| 157 | + alert("出错啦!" + result); | |
| 158 | + } | |
| 159 | + ); | |
| 160 | + }; | |
| 161 | + | |
| 162 | +}]); | |
| 163 | + | |
| 164 | +angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) { | |
| 165 | + var self = this; | |
| 166 | + | |
| 167 | + // 启用日期 日期控件开关 | |
| 168 | + self.qyrqOpen = false; | |
| 169 | + self.qyrq_open = function() { | |
| 170 | + self.qyrqOpen = true; | |
| 171 | + }; | |
| 172 | + | |
| 173 | + // 欲保存的busInfo信息,绑定 | |
| 174 | + self.deviceInfoForSave = {}; | |
| 175 | + | |
| 176 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 177 | + var id = $stateParams.id; | |
| 178 | + if (id) { | |
| 179 | + self.deviceInfoForSave.id = id; | |
| 180 | + deviceInfoManageService.getDetail(id).then( | |
| 181 | + function(result) { | |
| 182 | + var key; | |
| 183 | + for (key in result) { | |
| 184 | + self.deviceInfoForSave[key] = result[key]; | |
| 185 | + } | |
| 186 | + // 填写所有的 select 控件选中框数据 | |
| 187 | + // 公司字典 | |
| 188 | + if (self.deviceInfoForSave.gsName) { | |
| 189 | + angular.forEach(self.gses, function(data) { | |
| 190 | + if (self.deviceInfoForSave.gsName == data.gsmc) { | |
| 191 | + self.deviceInfoForSave.gs_selected = data; | |
| 192 | + } | |
| 193 | + }); | |
| 194 | + } | |
| 195 | + }, | |
| 196 | + function(result) { | |
| 197 | + alert("出错啦!"); | |
| 198 | + } | |
| 199 | + ); | |
| 200 | + } | |
| 201 | + | |
| 202 | + // 提交方法 | |
| 203 | + self.submit = function() { | |
| 204 | + console.log(self.deviceInfoForSave); | |
| 205 | + deviceInfoManageService.saveDetail(self.deviceInfoForSave).then( | |
| 206 | + function(result) { | |
| 207 | + // TODO:弹出框方式以后改 | |
| 208 | + if (result.status == 'SUCCESS') { | |
| 209 | + alert("保存成功!"); | |
| 210 | + $state.go("deviceInfoManage"); | |
| 211 | + } else { | |
| 212 | + alert("保存异常!"); | |
| 213 | + } | |
| 214 | + }, | |
| 215 | + function(result) { | |
| 216 | + // TODO:弹出框方式以后改 | |
| 217 | + alert("出错啦!"); | |
| 218 | + } | |
| 219 | + ); | |
| 220 | + }; | |
| 221 | + | |
| 222 | +}]); | |
| 223 | + | |
| 224 | +angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) { | |
| 225 | + var self = this; | |
| 226 | + self.title = ""; | |
| 227 | + self.deviceInfoForDetail = {}; | |
| 228 | + self.deviceInfoForDetail.id = $stateParams.id; | |
| 229 | + | |
| 230 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 231 | + deviceInfoManageService.getDetail($stateParams.id).then( | |
| 232 | + function(result) { | |
| 233 | + var key; | |
| 234 | + for (key in result) { | |
| 235 | + self.deviceInfoForDetail[key] = result[key]; | |
| 236 | + } | |
| 237 | + | |
| 238 | + self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息"; | |
| 239 | + }, | |
| 240 | + function(result) { | |
| 241 | + // TODO:弹出框方式以后改 | |
| 242 | + alert("出错啦!"); | |
| 243 | + } | |
| 244 | + ); | |
| 245 | 245 | }]); |
| 246 | 246 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 车辆设备信息模块配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("deviceInfoManage", { // index页面 | |
| 13 | - url: '/deviceInfoManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html' | |
| 17 | - }, | |
| 18 | - "deviceInfoManage_list@deviceInfoManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'deviceInfoManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 32 | - ] | |
| 33 | - }); | |
| 34 | - }] | |
| 35 | - } | |
| 36 | - }) | |
| 37 | - .state("deviceInfoManage_form", { // 添加设备信息form | |
| 38 | - url: '/deviceInfoManage_form', | |
| 39 | - views: { | |
| 40 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'} | |
| 41 | - }, | |
| 42 | - resolve: { | |
| 43 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | - return $ocLazyLoad.load({ | |
| 45 | - name: 'deviceInfoManage_form_module', | |
| 46 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | - files: [ | |
| 48 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 51 | - ] | |
| 52 | - }); | |
| 53 | - }] | |
| 54 | - } | |
| 55 | - }) | |
| 56 | - .state("deviceInfoManage_edit", { // 修改设备信息form | |
| 57 | - url: '/deviceInfoManage_edit/:id', | |
| 58 | - views: { | |
| 59 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'} | |
| 60 | - }, | |
| 61 | - resolve: { | |
| 62 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | - return $ocLazyLoad.load({ | |
| 64 | - name: 'deviceInfoManage_edit_module', | |
| 65 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | - files: [ | |
| 67 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 70 | - ] | |
| 71 | - }); | |
| 72 | - }] | |
| 73 | - } | |
| 74 | - }) | |
| 75 | - .state("deviceInfoManage_detail", { // 详细信息页面 | |
| 76 | - url: '/deviceInfoManage_detail/:id', | |
| 77 | - views: { | |
| 78 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'} | |
| 79 | - }, | |
| 80 | - resolve: { | |
| 81 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | - return $ocLazyLoad.load({ | |
| 83 | - name: 'deviceInfoManage_detail_module', | |
| 84 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | - files: [ | |
| 86 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 87 | - ] | |
| 88 | - }); | |
| 89 | - }] | |
| 90 | - } | |
| 91 | - }) | |
| 92 | - | |
| 93 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 车辆设备信息模块配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("deviceInfoManage", { // index页面 | |
| 13 | + url: '/deviceInfoManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html' | |
| 17 | + }, | |
| 18 | + "deviceInfoManage_list@deviceInfoManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'deviceInfoManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 32 | + ] | |
| 33 | + }); | |
| 34 | + }] | |
| 35 | + } | |
| 36 | + }) | |
| 37 | + .state("deviceInfoManage_form", { // 添加设备信息form | |
| 38 | + url: '/deviceInfoManage_form', | |
| 39 | + views: { | |
| 40 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'} | |
| 41 | + }, | |
| 42 | + resolve: { | |
| 43 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | + return $ocLazyLoad.load({ | |
| 45 | + name: 'deviceInfoManage_form_module', | |
| 46 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | + files: [ | |
| 48 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 51 | + ] | |
| 52 | + }); | |
| 53 | + }] | |
| 54 | + } | |
| 55 | + }) | |
| 56 | + .state("deviceInfoManage_edit", { // 修改设备信息form | |
| 57 | + url: '/deviceInfoManage_edit/:id', | |
| 58 | + views: { | |
| 59 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'} | |
| 60 | + }, | |
| 61 | + resolve: { | |
| 62 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | + return $ocLazyLoad.load({ | |
| 64 | + name: 'deviceInfoManage_edit_module', | |
| 65 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | + files: [ | |
| 67 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 70 | + ] | |
| 71 | + }); | |
| 72 | + }] | |
| 73 | + } | |
| 74 | + }) | |
| 75 | + .state("deviceInfoManage_detail", { // 详细信息页面 | |
| 76 | + url: '/deviceInfoManage_detail/:id', | |
| 77 | + views: { | |
| 78 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'} | |
| 79 | + }, | |
| 80 | + resolve: { | |
| 81 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | + return $ocLazyLoad.load({ | |
| 83 | + name: 'deviceInfoManage_detail_module', | |
| 84 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | + files: [ | |
| 86 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 87 | + ] | |
| 88 | + }); | |
| 89 | + }] | |
| 90 | + } | |
| 91 | + }) | |
| 92 | + | |
| 93 | + } | |
| 94 | 94 | ]); |
| 95 | 95 | \ No newline at end of file | ... | ... |