Commit d46f797fb38b3c8024506ed4cdf48964fb4bcb75

Authored by ljq
1 parent 5b80c8d1

1

README.md
1 -上海交通职业技术学院智慧交通系 2023  
2 -新型高职建设“公共交通运营调度教学  
3 -资源”项目  
4 \ No newline at end of file 1 \ No newline at end of file
  2 +
5 \ No newline at end of file 3 \ No newline at end of file
src/main/java/com/bsth/XDApplication.java
@@ -147,18 +147,18 @@ public class XDApplication implements CommandLineRunner { @@ -147,18 +147,18 @@ public class XDApplication implements CommandLineRunner {
147 //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点 147 //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
148 //sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据 148 //sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
149 //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据 149 //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
150 - sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码 150 + //sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
151 151
152 //sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线 152 //sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
153 sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程 153 sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
154 sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库 154 sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
155 sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库 155 sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
156 sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) 156 sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
157 - sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 157 + //sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
158 sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 158 sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
159 - sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 159 + //sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
160 //DirectivePushQueue.start();//消息队列 -指令,系统下发的 160 //DirectivePushQueue.start();//消息队列 -指令,系统下发的
161 - WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 161 + //WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
162 162
163 /** 线调为其他程序提供的数据 --写入数据库 */ 163 /** 线调为其他程序提供的数据 --写入数据库 */
164 //sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布) 164 //sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
src/main/java/com/bsth/repository/StationRouteStRepository.java
@@ -36,7 +36,7 @@ import java.util.Map; @@ -36,7 +36,7 @@ import java.util.Map;
36 public interface StationRouteStRepository extends BaseRepository<StationRouteSt, Integer> { 36 public interface StationRouteStRepository extends BaseRepository<StationRouteSt, Integer> {
37 37
38 38
39 - @Query("select r from StationRouteSt r where r.lineCode=?1 and r.destroy=0 order by r.stationRouteCode") 39 + @Query("select r from StationRouteSt r where r.lineCode=?1 and r.destroy=0 order by r.stationRouteCode")
40 List<StationRouteSt> findByLine(String lineCode); 40 List<StationRouteSt> findByLine(String lineCode);
41 41
42 } 42 }
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -239,8 +239,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -239,8 +239,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
239 239
240 @Query(value="select count(*) from ScheduleRealInfo s where s.scheduleDateStr = ?1 and s.xlBm = ?2") 240 @Query(value="select count(*) from ScheduleRealInfo s where s.scheduleDateStr = ?1 and s.xlBm = ?2")
241 int selectCountAll(String scheduleDateStr,String lineCode); 241 int selectCountAll(String scheduleDateStr,String lineCode);
242 - 242 +
  243 + @Transactional
243 @Modifying 244 @Modifying
244 - @Query(value = "delete from ScheduleRealInfo sr where sr.xlBm in ( ?1 )")  
245 - void deleteScheduleRealInfoBylineCodes(List<String> lineCodes); 245 + @Query(value = "delete from ScheduleRealInfo sr where sr.xlBm in ( ?1 ) and sr.scheduleDateStr= ?2")
  246 + void deleteScheduleRealInfoBylineCodes(List<String> lineCodes,String rq);
246 } 247 }
src/main/java/com/bsth/repository/subject/SubjectUserRepository.java
@@ -30,6 +30,7 @@ public interface SubjectUserRepository extends BaseRepository&lt;SubjectUser, Integ @@ -30,6 +30,7 @@ public interface SubjectUserRepository extends BaseRepository&lt;SubjectUser, Integ
30 + " order by su.user_id",nativeQuery=true) 30 + " order by su.user_id",nativeQuery=true)
31 List<Object[]> searchSubjectUserDetail(String rq, String userId); 31 List<Object[]> searchSubjectUserDetail(String rq, String userId);
32 32
  33 + @Transactional
33 @Modifying 34 @Modifying
34 @Query(value = "delete from SubjectUser s where s.rq=?1 and s.userId.id in ( ?2 )") 35 @Query(value = "delete from SubjectUser s where s.rq=?1 and s.userId.id in ( ?2 )")
35 void deleteSubjectUserByUserIds(String date, List<Integer> userIds); 36 void deleteSubjectUserByUserIds(String date, List<Integer> userIds);
src/main/java/com/bsth/service/ddexam/impl/DdexamServiceImpl.java
@@ -95,7 +95,7 @@ public class DdexamServiceImpl implements DdexamService { @@ -95,7 +95,7 @@ public class DdexamServiceImpl implements DdexamService {
95 95
96 @Override 96 @Override
97 public int hftime(){ 97 public int hftime(){
98 - URLConnection url = null; 98 + /* URLConnection url = null;
99 try { 99 try {
100 java.net.URL baseUrl; 100 java.net.URL baseUrl;
101 baseUrl = com.bsth.webService.trafficManage.geotool.services.Internal.class.getResource("."); 101 baseUrl = com.bsth.webService.trafficManage.geotool.services.Internal.class.getResource(".");
@@ -105,10 +105,10 @@ public class DdexamServiceImpl implements DdexamService { @@ -105,10 +105,10 @@ public class DdexamServiceImpl implements DdexamService {
105 url.connect(); //发出连接 105 url.connect(); //发出连接
106 long ld = url.getDate(); //取得网站日期时间 106 long ld = url.getDate(); //取得网站日期时间
107 Date date = new Date(ld); //转换为标准时间对象 107 Date date = new Date(ld); //转换为标准时间对象
108 - /* Calendar calendar = Calendar.getInstance(); 108 + *//* Calendar calendar = Calendar.getInstance();
109 calendar.setTime(date); 109 calendar.setTime(date);
110 calendar.add(Calendar.YEAR, -1);//当前时间减去一年,即一年前的时间 110 calendar.add(Calendar.YEAR, -1);//当前时间减去一年,即一年前的时间
111 - //(时间校准网上快了一年,减去一年)*/ 111 + //(时间校准网上快了一年,减去一年)*//*
112 String data = sdfhms.format(date.getTime()); 112 String data = sdfhms.format(date.getTime());
113 String[] lk = data.split(" "); 113 String[] lk = data.split(" ");
114 if(lk.length == 2){ 114 if(lk.length == 2){
@@ -117,7 +117,7 @@ public class DdexamServiceImpl implements DdexamService { @@ -117,7 +117,7 @@ public class DdexamServiceImpl implements DdexamService {
117 } 117 }
118 } catch (IOException e) { 118 } catch (IOException e) {
119 e.printStackTrace(); 119 e.printStackTrace();
120 - } 120 + }*/
121 return 0; 121 return 0;
122 } 122 }
123 123
@@ -125,11 +125,11 @@ public class DdexamServiceImpl implements DdexamService { @@ -125,11 +125,11 @@ public class DdexamServiceImpl implements DdexamService {
125 125
126 @Override 126 @Override
127 public int initDate(String date) { 127 public int initDate(String date) {
128 - try { 128 + /*try {
129 Runtime.getRuntime().exec(ConfigUtil.get("jp.time") +" " +date);//Windows 系统 129 Runtime.getRuntime().exec(ConfigUtil.get("jp.time") +" " +date);//Windows 系统
130 }catch (Exception e){ 130 }catch (Exception e){
131 log.error("修改系统时间失败",e); 131 log.error("修改系统时间失败",e);
132 - } 132 + }*/
133 return 1; 133 return 1;
134 } 134 }
135 135
@@ -262,69 +262,6 @@ public class DdexamServiceImpl implements DdexamService { @@ -262,69 +262,6 @@ public class DdexamServiceImpl implements DdexamService {
262 return m; 262 return m;
263 263
264 } 264 }
265 - /*public void aa(){  
266 - Long start = System.currentTimeMillis();  
267 - Map m = new HashMap<>();  
268 - try { //用户当天分配完直接改状态 无二次分配的可能  
269 - List<SysUser> userList = sysUserRepository.findBySusUser(); //已有的用户 不考虑用户角色表 正常情况下创建必分配  
270 - if (userList.size() >= rs) { //满足考试人数 默认配置都是全的  
271 - new Thread() {  
272 - public synchronized void run() {  
273 - if(snt(rs,userList,0)){  
274 - log.info("考试初始化创建成功");  
275 - kk();  
276 - }  
277 - }  
278 - }.start();  
279 - } else {  
280 - if (userList.size() == 0) { //考试人数 全部重新创建  
281 - new Thread() {  
282 - public synchronized void run() {  
283 - if(usercreateType(rs)){  
284 - log.info("考试初始化创建成功");  
285 - kk();  
286 - }  
287 - }  
288 - }.start();  
289 -  
290 - } else { //已有的人检查分配线路 不够的创建  
291 -  
292 - new Thread() {  
293 - public synchronized void run() {  
294 - if(snt(rs,userList,1)){  
295 - kk();  
296 - }  
297 - }  
298 - }.start();  
299 -  
300 - int st = rs - userList.size(); //未创建考试人数  
301 - //* //未分配的创建线路并分配  
302 - if(usercreateType(st)){ //暂无问题  
303 - log.info("考试初始化创建成功");  
304 - kk();  
305 - }//*  
306 - new Thread() {  
307 - public synchronized void run() {  
308 - if(usercreateType(st)){  
309 - log.info("考试初始化创建成功");  
310 - kk();  
311 - }  
312 - }  
313 - }.start();  
314 -  
315 - }  
316 - }  
317 - }catch (Exception e){  
318 - log.error("-----考试初始化失败------",e);  
319 - m.put("code","创建失败");  
320 - return m;  
321 - }  
322 - //调用排班初始话功能  
323 - m.put("code","创建成功");  
324 - System.out.println("-------------本次执行时间-----------"+(System.currentTimeMillis() - start));  
325 - return m;  
326 - }  
327 - */  
328 public void kk(){ 265 public void kk(){
329 basicDataLoader.loadAllData(); //加载所有数据 266 basicDataLoader.loadAllData(); //加载所有数据
330 dayOfSchedule.lineAll(); //查询所有线路 267 dayOfSchedule.lineAll(); //查询所有线路
@@ -372,7 +309,7 @@ public class DdexamServiceImpl implements DdexamService { @@ -372,7 +309,7 @@ public class DdexamServiceImpl implements DdexamService {
372 if(t > 0) 309 if(t > 0)
373 return; 310 return;
374 //用旧线路code查出模板排班表 311 //用旧线路code查出模板排班表
375 - List<ScheduleRealInfoSt> sristList = ScheduleRealInfoStRepository.queryUserInfo(line.getCoLineCode(),"2021-11-18");//模板固定日期 312 + List<ScheduleRealInfoSt> sristList = ScheduleRealInfoStRepository.queryUserInfo(line.getCoLineCode(),"2024-06-02");//模板固定日期
376 List<ScheduleRealInfo> sriList = new ArrayList<>(); 313 List<ScheduleRealInfo> sriList = new ArrayList<>();
377 for(ScheduleRealInfoSt st : sristList){ 314 for(ScheduleRealInfoSt st : sristList){
378 ScheduleRealInfo sri = new ScheduleRealInfo(); 315 ScheduleRealInfo sri = new ScheduleRealInfo();
@@ -470,16 +407,18 @@ public class DdexamServiceImpl implements DdexamService { @@ -470,16 +407,18 @@ public class DdexamServiceImpl implements DdexamService {
470 userRoles.setRoles(73); //统一用73考生 407 userRoles.setRoles(73); //统一用73考生
471 bsthCSysUserRolesRepository.save(userRoles); //权限存库 408 bsthCSysUserRolesRepository.save(userRoles); //权限存库
472 List<LineConfigSt> lineConfigList = lineConfigStRepository.findAll(); //线调 线路相关配置信息 409 List<LineConfigSt> lineConfigList = lineConfigStRepository.findAll(); //线调 线路相关配置信息
473 - Integer linebumber = lineRepository.findAll().size(); //线路数量 线路code  
474 - String [] mtline = {"A线","B线","C线","D线","E线","F线"}; //对应模板6条线 换成线路name 410 + Integer linebumber = lineRepository.findAll().size() + 1; //线路数量 线路code
  411 + //String [] mtline = {"A线","B线","C线","D线","E线","F线"}; //对应模板6条线 换成线路name
475 List<LineInformationSt> litst = (List<LineInformationSt>) LineInformationStRepository.findAll(); //所有模板线路标准和线路 412 List<LineInformationSt> litst = (List<LineInformationSt>) LineInformationStRepository.findAll(); //所有模板线路标准和线路
476 - if(litst.size() != 6){ 413 + /* if(litst.size() != 6){
  414 + System.out.println("为满足6条线");
477 return false; 415 return false;
478 - } 416 + }*/
479 //让线路从1开始 部分功能0会异常 417 //让线路从1开始 部分功能0会异常
480 if(linebumber == 0){ 418 if(linebumber == 0){
481 linebumber = 1; 419 linebumber = 1;
482 } 420 }
  421 +
483 422
484 String lineCodeStr = ""; 423 String lineCodeStr = "";
485 for(int j = 0 ; j < litst.size() ; j++){ //6个 <6 424 for(int j = 0 ; j < litst.size() ; j++){ //6个 <6
@@ -490,7 +429,7 @@ public class DdexamServiceImpl implements DdexamService { @@ -490,7 +429,7 @@ public class DdexamServiceImpl implements DdexamService {
490 Integer linecodeId = linebumber++ ; 429 Integer linecodeId = linebumber++ ;
491 line.setId(linecodeId); 430 line.setId(linecodeId);
492 line.setLineCode(linecodeId.toString()); 431 line.setLineCode(linecodeId.toString());
493 - line.setName(mtline[j]+"-"+user.getUserName()); 432 + line.setName(line.getName()+"_"+user.getUserName());
494 line.setCoLineCode(linest.getLineCode()); 433 line.setCoLineCode(linest.getLineCode());
495 lineRepository.save(line); //线路添加 434 lineRepository.save(line); //线路添加
496 //----------------线路--------------------------// 435 //----------------线路--------------------------//
@@ -532,12 +471,13 @@ public class DdexamServiceImpl implements DdexamService { @@ -532,12 +471,13 @@ public class DdexamServiceImpl implements DdexamService {
532 return true; 471 return true;
533 } 472 }
534 473
535 - public synchronized void clearScheduleRealInfo(SysUser user){ 474 + public void clearScheduleRealInfo(SysUser user){
536 RealControAuthority hoit = realControAuthorityRepository.findByUserId(user.getId()); 475 RealControAuthority hoit = realControAuthorityRepository.findByUserId(user.getId());
537 String[] st = hoit.getLineCodeStr().split(","); 476 String[] st = hoit.getLineCodeStr().split(",");
538 List<String> lines=Arrays.asList(st); 477 List<String> lines=Arrays.asList(st);
  478 + String rq = sdf.format(new Date());
539 //bsth_c_s_sp_info_real 479 //bsth_c_s_sp_info_real
540 - scheduleRealInfoRepository.deleteScheduleRealInfoBylineCodes(lines); 480 + scheduleRealInfoRepository.deleteScheduleRealInfoBylineCodes(lines,rq);
541 } 481 }
542 482
543 } 483 }
src/main/java/com/bsth/service/subject/impl/SubjectUserServiceImpl.java
@@ -67,9 +67,9 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer @@ -67,9 +67,9 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer
67 Optional<SubjectUser> subjectUser = subjectUserRepository.findById(id); 67 Optional<SubjectUser> subjectUser = subjectUserRepository.findById(id);
68 SubjectUser sur = subjectUser.isPresent() ? subjectUser.get() : null; 68 SubjectUser sur = subjectUser.isPresent() ? subjectUser.get() : null;
69 69
70 - //线路编号 A线+用户id组成的 70 + //线路编号 1505路+用户id组成的
71 SysUser user = SecurityUtils.getCurrentUser(); 71 SysUser user = SecurityUtils.getCurrentUser();
72 - String xlName = "A线-"+user.getUserName(); 72 + String xlName = "1505路_"+user.getUserName();
73 Line line = lineRepository.findLineName(xlName); 73 Line line = lineRepository.findLineName(xlName);
74 //缓存查看排班 74 //缓存查看排班
75 List<ScheduleRealInfo> sch = dayOfSchedule.findByLineCode(line.getLineCode()); 75 List<ScheduleRealInfo> sch = dayOfSchedule.findByLineCode(line.getLineCode());
@@ -90,22 +90,22 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer @@ -90,22 +90,22 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer
90 List<ScheduleRealInfo> sh = sch.stream().filter(s -> s.getXlDir().equals(sur.getSubjectId().getDir())).collect(Collectors.toList()); 90 List<ScheduleRealInfo> sh = sch.stream().filter(s -> s.getXlDir().equals(sur.getSubjectId().getDir())).collect(Collectors.toList());
91 m = sjm.run(sur,sh); 91 m = sjm.run(sur,sh);
92 result = new Boolean(m.get("state").toString()) == true ? "0" : "1"; 92 result = new Boolean(m.get("state").toString()) == true ? "0" : "1";
93 -  
94 -  
95 }if (sur.getSubjectId().getSchStatus().equals("1")) {//全量的班次数据 93 }if (sur.getSubjectId().getSchStatus().equals("1")) {//全量的班次数据
96 //判断答题是否正确 94 //判断答题是否正确
97 subEnum sjm = subEnum.valueOf(type); 95 subEnum sjm = subEnum.valueOf(type);
98 m = sjm.run(sur,sch); 96 m = sjm.run(sur,sch);
99 result = new Boolean(m.get("state").toString()) == true ? "0" : "1"; 97 result = new Boolean(m.get("state").toString()) == true ? "0" : "1";
100 -  
101 }if (sur.getSubjectId().getSchStatus().equals("2")) { //与设备对接的 98 }if (sur.getSubjectId().getSchStatus().equals("2")) { //与设备对接的
102 subEnumDevice sjmdrivce = subEnumDevice.valueOf(type); 99 subEnumDevice sjmdrivce = subEnumDevice.valueOf(type);
103 -  
104 //运营指令 100 //运营指令
105 Collection<D60> yyArray = dayOfDirectives.all60();//查看当日缓存指令 101 Collection<D60> yyArray = dayOfDirectives.all60();//查看当日缓存指令
106 m = sjmdrivce.run(sur,yyArray,user); 102 m = sjmdrivce.run(sur,yyArray,user);
107 result = new Boolean(m.get("state").toString()) == true ? "0" : "1"; 103 result = new Boolean(m.get("state").toString()) == true ? "0" : "1";
108 } 104 }
  105 + if ((sur.getSubjectId().getSchStatus().equals("4")) ){
  106 + return "特殊题目";
  107 + }
  108 +
109 if (m.get("message") != null) 109 if (m.get("message") != null)
110 remark = m.get("message").toString(); 110 remark = m.get("message").toString();
111 111
@@ -237,7 +237,6 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer @@ -237,7 +237,6 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer
237 } 237 }
238 238
239 @Override 239 @Override
240 - @Transactional  
241 public void selectSubject(String[] ids,String[] fractions,String isOperate,String className) throws Exception{ 240 public void selectSubject(String[] ids,String[] fractions,String isOperate,String className) throws Exception{
242 SysUser loginUser = SecurityUtils.getCurrentUser(); 241 SysUser loginUser = SecurityUtils.getCurrentUser();
243 List<SysUser> userList; 242 List<SysUser> userList;
@@ -272,10 +271,10 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer @@ -272,10 +271,10 @@ public class SubjectUserServiceImpl extends BaseServiceImpl&lt;SubjectUser, Integer
272 subjectUserRepository.save(subjectUser); 271 subjectUserRepository.save(subjectUser);
273 } 272 }
274 } 273 }
275 - //初始化考生排班 只初始化A线 274 + //初始化考生排班 只初始化A线 --
276 new Thread() { 275 new Thread() {
277 public synchronized void run() { 276 public synchronized void run() {
278 - if (ddexamService.snt(userList,true)) { 277 + if (ddexamService.snt(userList,false)) {
279 ddexamService.kk(); 278 ddexamService.kk();
280 } 279 }
281 } 280 }
src/main/java/com/bsth/util/subject/subEnum.java
@@ -104,7 +104,7 @@ public enum subEnum { @@ -104,7 +104,7 @@ public enum subEnum {
104 s.getRemarks().contains(t[2])) { 104 s.getRemarks().contains(t[2])) {
105 su = i; 105 su = i;
106 } 106 }
107 - 107 + //青浦班次选择7:52会导致一个班次在前面
108 //判断后续三个班次的dfsj修改成功 n烂班 n-1 与 n+1 n+1与n+2 108 //判断后续三个班次的dfsj修改成功 n烂班 n-1 与 n+1 n+1与n+2
109 if (su != 0 && i > su && i <= su + 3){ 109 if (su != 0 && i > su && i <= su + 3){
110 if (i == su +1){ //烂班下第一个 110 if (i == su +1){ //烂班下第一个
@@ -497,7 +497,7 @@ public enum subEnum { @@ -497,7 +497,7 @@ public enum subEnum {
497 String[] t = answer.split(","); //0 497 String[] t = answer.split(","); //0
498 SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); 498 SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
499 //排序 499 //排序
500 - Collections.sort(sch, new ScheduleComparator.DFSJ2()); 500 + Collections.sort(sch, new ScheduleComparator.DFSJ());
501 int su = 0; 501 int su = 0;
502 try{ 502 try{
503 //判断结果是否合格 503 //判断结果是否合格
@@ -507,7 +507,7 @@ public enum subEnum { @@ -507,7 +507,7 @@ public enum subEnum {
507 if ( s.getFcsj().equals(sj)) { //当前排班 507 if ( s.getFcsj().equals(sj)) { //当前排班
508 su = i; 508 su = i;
509 } 509 }
510 - //后续个班次 510 + //后续个班次
511 if (su != 0 && i > su && i <= su + 3){ 511 if (su != 0 && i > su && i <= su + 3){
512 Long stn = sdf.parse(s.getDfsj()).getTime() - sdf.parse(s.getFcsj()).getTime(); 512 Long stn = sdf.parse(s.getDfsj()).getTime() - sdf.parse(s.getFcsj()).getTime();
513 int stg = stn.intValue() / 60 / 1000; 513 int stg = stn.intValue() / 60 / 1000;
src/main/resources/application-dev.properties
1 -server.port=9088 1 +server.port=9089
2 2
3 # dubbo服务化使用开关flag 3 # dubbo服务化使用开关flag
4 dubbo.use=false 4 dubbo.use=false
@@ -14,7 +14,7 @@ spring.jpa.show-sql= false @@ -14,7 +14,7 @@ spring.jpa.show-sql= false
14 14
15 #DATABASE 15 #DATABASE
16 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 16 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
17 -spring.datasource.url= jdbc:mysql://127.0.0.1/school_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 17 +spring.datasource.url= jdbc:mysql://127.0.0.1/school_control_qp?useUnicode=true&characterEncoding=utf-8&useSSL=false
18 #spring.datasource.url= jdbc:mysql://192.168.168.222/control?useUnicode=true&characterEncoding=utf-8&useSSL=false 18 #spring.datasource.url= jdbc:mysql://192.168.168.222/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
19 spring.datasource.username= root 19 spring.datasource.username= root
20 spring.datasource.password= root 20 spring.datasource.password= root
src/main/resources/application-test.properties
1 server.port=9088 1 server.port=9088
2 2
3 -# dubbo服务化使用开关flag 3 +# dubbo锟斤拷锟斤拷使锟矫匡拷锟斤拷flag
4 dubbo.use=false 4 dubbo.use=false
5 5
6 #JPA 6 #JPA
src/main/resources/application.properties
1 -spring.profiles.active = prod 1 +spring.profiles.active = dev
2 2
3 spring.view.suffix=.html 3 spring.view.suffix=.html
4 server.session-timeout=-1 4 server.session-timeout=-1
src/main/resources/control-jdbc.properties
1 -#station.mysql.driver= com.mysql.jdbc.Driver  
2 -#station.mysql.url= jdbc:mysql://127.0.0.1/school_control?useUnicode=true&characterEncoding=utf-8&useSSL=false  
3 -#station.mysql.username= root  
4 -#station.mysql.password= root  
5 -  
6 station.mysql.driver= com.mysql.jdbc.Driver 1 station.mysql.driver= com.mysql.jdbc.Driver
7 -station.mysql.url= jdbc:mysql://172.29.0.14/school_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 2 +station.mysql.url= jdbc:mysql://127.0.0.1/school_control_qp?useUnicode=true&characterEncoding=utf-8&useSSL=false
8 station.mysql.username= root 3 station.mysql.username= root
9 station.mysql.password= root 4 station.mysql.password= root
10 5
11 #station.mysql.driver= com.mysql.jdbc.Driver 6 #station.mysql.driver= com.mysql.jdbc.Driver
  7 +#station.mysql.url= jdbc:mysql://127.0.0.1/school_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  8 +#station.mysql.username= root
  9 +#station.mysql.password= root2jsp
  10 +
  11 +#station.mysql.driver= com.mysql.jdbc.Driver
12 #station.mysql.url= jdbc:mysql://10.10.200.148:3306/station?useUnicode=true&characterEncoding=utf-8 12 #station.mysql.url= jdbc:mysql://10.10.200.148:3306/station?useUnicode=true&characterEncoding=utf-8
13 #station.mysql.username= station 13 #station.mysql.username= station
14 #station.mysql.password= station@jsp 14 #station.mysql.password= station@jsp
src/main/resources/datatools/config-prod.properties
@@ -5,7 +5,7 @@ datatools.kettle_properties=/datatools/kettle.properties @@ -5,7 +5,7 @@ datatools.kettle_properties=/datatools/kettle.properties
5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) 5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正)
6 6
7 #数据库ip地址 7 #数据库ip地址
8 -datatools.kvars_dbip=172.29.0.14 8 +datatools.kvars_dbip=127.0.0.1
9 #数据库用户名 9 #数据库用户名
10 datatools.kvars_dbuname=root 10 datatools.kvars_dbuname=root
11 #数据库密码 11 #数据库密码
src/main/resources/ms-jdbc.properties
@@ -4,6 +4,6 @@ @@ -4,6 +4,6 @@
4 #ms.mysql.password= root 4 #ms.mysql.password= root
5 5
6 ms.mysql.driver= com.mysql.jdbc.Driver 6 ms.mysql.driver= com.mysql.jdbc.Driver
7 -ms.mysql.url= jdbc:mysql://172.29.0.14:3306/ms?useUnicode=true&characterEncoding=utf-8 7 +ms.mysql.url= jdbc:mysql://127.0.0.1:3306/ms?useUnicode=true&characterEncoding=utf-8
8 ms.mysql.username= root 8 ms.mysql.username= root
9 ms.mysql.password= root 9 ms.mysql.password= root
10 \ No newline at end of file 10 \ No newline at end of file
src/main/resources/static/index.html
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta name="renderer" content="webkit" /> 4 <meta name="renderer" content="webkit" />
5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
6 <meta charset="UTF-8"> 6 <meta charset="UTF-8">
7 - <title>调度系统</title> 7 + <title>练兵比武系统</title>
8 8
9 <meta http-equiv="Pragma" content="no-cache"> 9 <meta http-equiv="Pragma" content="no-cache">
10 <meta http-equiv="Cache-control" content="no-cache"> 10 <meta http-equiv="Cache-control" content="no-cache">
src/main/resources/static/login.html
@@ -181,7 +181,7 @@ @@ -181,7 +181,7 @@
181 <div class="wrapper ng-scope"> 181 <div class="wrapper ng-scope">
182 <div id="loginPanel" class="dialog dialog-shadow"> 182 <div id="loginPanel" class="dialog dialog-shadow">
183 <br> 183 <br>
184 - <h3 class="logo-text">公交运营调度系统</h3> 184 + <h3 class="logo-text">练兵比武系统</h3>
185 <hr> 185 <hr>
186 <form style="padding: 0px 35px;"> 186 <form style="padding: 0px 35px;">
187 <div class="form-group" style="margin-bottom: 0"> 187 <div class="form-group" style="margin-bottom: 0">
src/main/resources/static/pages/forms/mould/waybill.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/waybill_minhang.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/waybill_minhang_dl.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/waybill.html
@@ -435,10 +435,10 @@ @@ -435,10 +435,10 @@
435 </script> 435 </script>
436 <script type="text/html" id="ludan_1"> 436 <script type="text/html" id="ludan_1">
437 <tr> 437 <tr>
438 - <td colspan="14">行车路单</td> 438 + <td colspan="15">行车路单</td>
439 </tr> 439 </tr>
440 <tr> 440 <tr>
441 - <td colspan="14">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}}({{plate}}) 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:{{dbdp}} 日期:{{scheduleDate}}</td> 441 + <td colspan="15">路别:{{xlName}} 路牌:{{lpName}} 车号:{{clZbh}}({{plate}}) 出场时间:{{fcsjActual}} 到达站名:{{zdzName}} 当班调派:{{dbdp}} 日期:{{scheduleDate}}</td>
442 </tr> 442 </tr>
443 <tr> 443 <tr>
444 {{if type==0}} 444 {{if type==0}}
@@ -492,7 +492,7 @@ @@ -492,7 +492,7 @@
492 <td colspan="2">工号</td> 492 <td colspan="2">工号</td>
493 <td rowspan="2">公里耗油</td> 493 <td rowspan="2">公里耗油</td>
494 <td colspan="2">起讫站</td> 494 <td colspan="2">起讫站</td>
495 - <td colspan="4">时间</td> 495 + <td colspan="5">时间</td>
496 <td colspan="2">误点</td> 496 <td colspan="2">误点</td>
497 <td rowspan="2" width="66px">里程(公里)计划</td> 497 <td rowspan="2" width="66px">里程(公里)计划</td>
498 <td rowspan="2">备注</td> 498 <td rowspan="2">备注</td>
@@ -503,6 +503,7 @@ @@ -503,6 +503,7 @@
503 <td colspan="1">起点</td> 503 <td colspan="1">起点</td>
504 <td colspan="1">终点</td> 504 <td colspan="1">终点</td>
505 <td colspan="1">计发</td> 505 <td colspan="1">计发</td>
  506 + <td colspan="1">待发</td>
506 <td colspan="1">实发</td> 507 <td colspan="1">实发</td>
507 <td colspan="1">应到</td> 508 <td colspan="1">应到</td>
508 <td colspan="1">实到</td> 509 <td colspan="1">实到</td>
@@ -523,6 +524,7 @@ @@ -523,6 +524,7 @@
523 <td>{{obj.qdzName}}</td> 524 <td>{{obj.qdzName}}</td>
524 <td>{{obj.zdzName}}</td> 525 <td>{{obj.zdzName}}</td>
525 <td>{{obj.fcsj}}</td> 526 <td>{{obj.fcsj}}</td>
  527 + <td>{{obj.dfsj}}</td>
526 <td>{{obj.fcsjActual}}</td> 528 <td>{{obj.fcsjActual}}</td>
527 <td>{{obj.zdsj}}</td> 529 <td>{{obj.zdsj}}</td>
528 <td>{{obj.zdsjActual}}</td> 530 <td>{{obj.zdsjActual}}</td>
@@ -547,7 +549,7 @@ @@ -547,7 +549,7 @@
547 <script type="text/html" id="ludan_3"> 549 <script type="text/html" id="ludan_3">
548 <tr> 550 <tr>
549 <td colspan="2">计划班次</td> 551 <td colspan="2">计划班次</td>
550 - <td>{{jhbc}}</td> 552 + <td colspan="2">{{jhbc}}</td>
551 <td colspan="2">计划公里</td> 553 <td colspan="2">计划公里</td>
552 <td>{{jhlc}}</td> 554 <td>{{jhlc}}</td>
553 <td colspan="2">烂班班次</td> 555 <td colspan="2">烂班班次</td>
@@ -557,7 +559,7 @@ @@ -557,7 +559,7 @@
557 </tr> 559 </tr>
558 <tr> 560 <tr>
559 <td colspan="2">临加班次</td> 561 <td colspan="2">临加班次</td>
560 - <td>{{ljbc}}</td> 562 + <td colspan="2">{{ljbc}}</td>
561 <td colspan="2">临加公里</td> 563 <td colspan="2">临加公里</td>
562 <td>{{addMileage}}</td> 564 <td>{{addMileage}}</td>
563 <td colspan="2">实际班次</td> 565 <td colspan="2">实际班次</td>
@@ -567,7 +569,7 @@ @@ -567,7 +569,7 @@
567 </tr> 569 </tr>
568 <tr> 570 <tr>
569 <td colspan="2">空驶公里</td> 571 <td colspan="2">空驶公里</td>
570 - <td>{{zkslc}}</td> 572 + <td colspan="2">{{zkslc}}</td>
571 <td colspan="2">总公里</td> 573 <td colspan="2">总公里</td>
572 <td>{{realMileage}}</td> 574 <td>{{realMileage}}</td>
573 <td colspan="2"></td> 575 <td colspan="2"></td>
src/main/resources/static/pages/subjectUser/selectSubject.html
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 if(s.id==i){ 85 if(s.id==i){
86 subjectTextStr+='题'+index+':'+s.subjectText+'\n'; 86 subjectTextStr+='题'+index+':'+s.subjectText+'\n';
87 operateTestStr+='题'+index+':'+s.operateTest+'\n'; 87 operateTestStr+='题'+index+':'+s.operateTest+'\n';
88 - htmlSrt+='<row style="display: inline-block"><span class="col-md-1" className="item-label" style="width: 80px">题'+index+': </span><input class="col-md-1" class="" type="text" oninput="value=value.replace(/[^\\d]/g,\'\')" name="fraction" style="border: 1px solid #c2cad8;width: 50px;"/></row>' 88 + htmlSrt+='<row style="display: inline-block"><span class="col-md-1" className="item-label" style="width: 80px">题'+index+': </span><input class="col-md-1" class="" type="text" oninput="value=value.replace(/[^\\d]/g,\'\')" name="fraction" value="10" style="border: 1px solid #c2cad8;width: 50px;"/></row>'
89 } 89 }
90 index++; 90 index++;
91 } 91 }
src/main/resources/static/real_control_v2/css/line_schedule.css
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 23
24 .line_schedule .uk-grid.top-container { 24 .line_schedule .uk-grid.top-container {
25 height: calc(100% - 250px); 25 height: calc(100% - 250px);
26 - margin-top: 5px; 26 + margin-top: -1px;
27 overflow: hidden; 27 overflow: hidden;
28 } 28 }
29 29
src/main/resources/static/real_control_v2/js/subject/subject.js
@@ -62,12 +62,13 @@ var su_subject = (function () { @@ -62,12 +62,13 @@ var su_subject = (function () {
62 //判断答题是否正确 返回参数 返回下一题的情况 62 //判断答题是否正确 返回参数 返回下一题的情况
63 gb_common.$get('/subjectUser/determine', {id: id},function (rs) { 63 gb_common.$get('/subjectUser/determine', {id: id},function (rs) {
64 if (rs == 0){ //提示答题正确 64 if (rs == 0){ //提示答题正确
65 - notify_succ('答题正确!'); 65 + //notify_succ('答题正确!');
66 }else if(rs == 1){ //提示答题失败 66 }else if(rs == 1){ //提示答题失败
67 - notify_err('答题错误!'); 67 + //notify_err('答题错误!');
68 }else { //系统出错 68 }else { //系统出错
69 69
70 } 70 }
  71 + notify_succ('已提交!');
71 ks(); 72 ks();
72 }); 73 });
73 74
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
@@ -9,19 +9,19 @@ var gb_sch_websocket = (function () { @@ -9,19 +9,19 @@ var gb_sch_websocket = (function () {
9 var recInterval = null; 9 var recInterval = null;
10 var reConnSpace = 1500;//重连间隔 10 var reConnSpace = 1500;//重连间隔
11 var reConnCount; //重连次数 11 var reConnCount; //重连次数
12 - var maxReConn = 6; //最多重连次数 12 + var maxReConn = 0; //最多重连次数
13 var new_conn = function () { 13 var new_conn = function () {
14 schSock = new SockJS('/sockjs/realcontrol'); 14 schSock = new SockJS('/sockjs/realcontrol');
15 schSock.onopen = function (e) { 15 schSock.onopen = function (e) {
16 if(reConnCount && reConnCount > 1){ 16 if(reConnCount && reConnCount > 1){
17 - gb_schedule_table.refreshAll(); 17 + //gb_schedule_table.refreshAll();
18 console.log('重新连接,刷新班次'); 18 console.log('重新连接,刷新班次');
19 } 19 }
20 reConnCount = 1; 20 reConnCount = 1;
21 - clearInterval(recInterval); 21 + //clearInterval(recInterval);
22 console.log('webSocket[realcontrol] onopen'); 22 console.log('webSocket[realcontrol] onopen');
23 - $('body>.north').removeClass('scok-colse');  
24 - setTimeout(regListen, 500); 23 + //$('body>.north').removeClass('scok-colse');
  24 + //setTimeout(regListen, 500);
25 }; 25 };
26 26
27 //接收消息 27 //接收消息
@@ -39,17 +39,17 @@ var gb_sch_websocket = (function () { @@ -39,17 +39,17 @@ var gb_sch_websocket = (function () {
39 //断开 39 //断开
40 schSock.onclose = function (e) { 40 schSock.onclose = function (e) {
41 console.log('和服务器连接断开....', e); 41 console.log('和服务器连接断开....', e);
42 - $('body>.north').addClass('scok-colse'); 42 + //$('body>.north').addClass('scok-colse');
43 //1.5秒后重新连接 43 //1.5秒后重新连接
44 - recInterval = setTimeout(function () { 44 + /* recInterval = setTimeout(function () {
45 reConnCount++; 45 reConnCount++;
46 if(reConnCount > maxReConn){ 46 if(reConnCount > maxReConn){
47 $('body>.north').addClass('re_conn_error'); 47 $('body>.north').addClass('re_conn_error');
48 clearInterval(recInterval); 48 clearInterval(recInterval);
49 return; 49 return;
50 } 50 }
51 - new_conn();  
52 - }, reConnSpace * reConnCount); 51 + //new_conn();
  52 + }, reConnSpace * reConnCount);*/
53 }; 53 };
54 }; 54 };
55 55
src/main/resources/static/real_control_v2/main.html
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 <div class="uk-width-4-10"> 55 <div class="uk-width-4-10">
56 <div class="uk-panel"> 56 <div class="uk-panel">
57 <h2 class="north-logo"> 57 <h2 class="north-logo">
58 - <!--<i class="uk-icon-life-ring"></i>--> 公共交通运营调度教学资源系统 58 + <!--<i class="uk-icon-life-ring"></i>--> 练兵比武系统
59 </h2> 59 </h2>
60 </div> 60 </div>
61 </div> 61 </div>
@@ -74,16 +74,16 @@ @@ -74,16 +74,16 @@
74 74
75 <!-- #### 考试 start ### --> 75 <!-- #### 考试 start ### -->
76 <script id="suject_pop_wrap" type="text/html"> 76 <script id="suject_pop_wrap" type="text/html">
77 - <div class="north_suject" style="margin-top: -20px"> 77 + <div class="north_suject" style="margin-top: -35px">
78 78
79 79
80 <div class="north-tmx"> 80 <div class="north-tmx">
81 &nbsp;&nbsp;&nbsp; 81 &nbsp;&nbsp;&nbsp;
82 当前状态: 82 当前状态:
83 {{if result== 0 }} 83 {{if result== 0 }}
84 - 答题正确 84 + 已答题
85 {{else if result== 1}} 85 {{else if result== 1}}
86 - 答题错误 86 + 已答题
87 {{else}} 87 {{else}}
88 未答题 88 未答题
89 {{/if}} 89 {{/if}}
@@ -96,19 +96,25 @@ @@ -96,19 +96,25 @@
96 </div> 96 </div>
97 97
98 <div class="north-tm"> 98 <div class="north-tm">
99 - 场景:{{subjectId.subjectText}} 99 + 场景: {{subjectId.schStatus == 4 ? '':'(1505路)'}}{{subjectId.subjectText}}
100 </div> 100 </div>
101 <div class="north-tm"> 101 <div class="north-tm">
102 - 操作:{{subjectId.reason}} 102 + 操作:
  103 + {{if subjectId.dir == 0}}
  104 + (上行)
  105 + {{else if subjectId.dir == 1}}
  106 + (下行)
  107 + {{/if}}
  108 + {{subjectId.reason}}
103 </div> 109 </div>
104 <div class="north-tmx" style="visibility: {{isOperateTest == 1 ? 'hidden':'visible'}}" > 110 <div class="north-tmx" style="visibility: {{isOperateTest == 1 ? 'hidden':'visible'}}" >
105 - 答案:({{subjectId.dir == 0 ? '上行':'下行'}}){{subjectId.operateTest}} 111 + 答案:{{subjectId.operateTest}}
106 </div> 112 </div>
107 <button id="submitUp" class="north-buttonUp" style="margin-left: 32%;" data-index="{{index}}">上一题</button> 113 <button id="submitUp" class="north-buttonUp" style="margin-left: 32%;" data-index="{{index}}">上一题</button>
108 114
109 <button id="submitDown" class="north-buttonDown" data-index="{{index}}" data-number="{{number}}">下一题</button> 115 <button id="submitDown" class="north-buttonDown" data-index="{{index}}" data-number="{{number}}">下一题</button>
110 116
111 - <div class="north-button"> 117 + <div class="north-button" disabled="">
112 <button id="submit" class="subject_button" data-id="{{id}}">提交</button> 118 <button id="submit" class="subject_button" data-id="{{id}}">提交</button>
113 </div> 119 </div>
114 </div> 120 </div>