Commit 63a058e84e0ab4200a40c9d58676a5065555e043
1 parent
2f440df5
update
Showing
15 changed files
with
319 additions
and
299 deletions
src/main/java/com/bsth/controller/sys/DutyEmployeeController.java
0 → 100644
| 1 | +package com.bsth.controller.sys; | ||
| 2 | + | ||
| 3 | +import com.bsth.controller.BaseController; | ||
| 4 | +import com.bsth.entity.sys.DutyEmployee; | ||
| 5 | +import com.bsth.service.sys.DutyEmployeeService; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 9 | +import org.springframework.web.bind.annotation.RestController; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * Created by panzhao on 2017/1/5. | ||
| 15 | + */ | ||
| 16 | +@RestController | ||
| 17 | +@RequestMapping("dutyEmployee") | ||
| 18 | +public class DutyEmployeeController extends BaseController<DutyEmployee, Long> { | ||
| 19 | + | ||
| 20 | + @Autowired | ||
| 21 | + DutyEmployeeService dutyEmployeeService; | ||
| 22 | + | ||
| 23 | + @RequestMapping(value = "queryByLineAndTime") | ||
| 24 | + public List<DutyEmployee> getDutyEmployee(@RequestParam String lineCode, @RequestParam String startTime, @RequestParam String endTime) { | ||
| 25 | + return dutyEmployeeService.getDutyEmployee(lineCode, startTime, endTime); | ||
| 26 | + } | ||
| 27 | +} |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| @@ -84,6 +84,8 @@ public class PilotReport { | @@ -84,6 +84,8 @@ public class PilotReport { | ||
| 84 | 84 | ||
| 85 | //下发调度指令 | 85 | //下发调度指令 |
| 86 | directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); | 86 | directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); |
| 87 | + //下发线路切换指令 | ||
| 88 | + directiveService.lineChange(outSch.getClZbh(), outSch.getXlBm(), "请出@系统"); | ||
| 87 | /* d80.setRemarks("计划出场时间:" + outSch.getDfsj()); | 89 | /* d80.setRemarks("计划出场时间:" + outSch.getDfsj()); |
| 88 | //当前GPS位置 | 90 | //当前GPS位置 |
| 89 | GpsEntity gps = gpsRealData.get(d80.getDeviceId()); | 91 | GpsEntity gps = gpsRealData.get(d80.getDeviceId()); |
src/main/java/com/bsth/entity/sys/DutyEmployee.java
0 → 100644
| 1 | +package com.bsth.entity.sys; | ||
| 2 | + | ||
| 3 | +import javax.persistence.*; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * 当班调度员 | ||
| 7 | + * Created by panzhao on 2017/1/5. | ||
| 8 | + */ | ||
| 9 | +@Entity | ||
| 10 | +@Table(name = "bsth_c_sys_duty_employee") | ||
| 11 | +public class DutyEmployee { | ||
| 12 | + | ||
| 13 | + @Id | ||
| 14 | + @GeneratedValue | ||
| 15 | + private Long id; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 员工ID | ||
| 19 | + */ | ||
| 20 | + private Integer uId; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 员工姓名 | ||
| 24 | + */ | ||
| 25 | + private String uName; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 线路编码 ,号分割多个 | ||
| 29 | + */ | ||
| 30 | + private String codeIdx; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 登入线调时间 | ||
| 34 | + */ | ||
| 35 | + private Long ts; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 是否主调模式进入 | ||
| 39 | + */ | ||
| 40 | + private boolean main; | ||
| 41 | + | ||
| 42 | + public Integer getuId() { | ||
| 43 | + return uId; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public void setuId(Integer uId) { | ||
| 47 | + this.uId = uId; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public String getuName() { | ||
| 51 | + return uName; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public void setuName(String uName) { | ||
| 55 | + this.uName = uName; | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public String getCodeIdx() { | ||
| 59 | + return codeIdx; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + public void setCodeIdx(String codeIdx) { | ||
| 63 | + this.codeIdx = codeIdx; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + public Long getTs() { | ||
| 67 | + return ts; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public void setTs(Long ts) { | ||
| 71 | + this.ts = ts; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public boolean isMain() { | ||
| 75 | + return main; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + public void setMain(boolean main) { | ||
| 79 | + this.main = main; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + public Long getId() { | ||
| 83 | + return id; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + public void setId(Long id) { | ||
| 87 | + this.id = id; | ||
| 88 | + } | ||
| 89 | +} |
src/main/java/com/bsth/entity/sys/SessionLog.java deleted
100644 → 0
| 1 | -package com.bsth.entity.sys; | ||
| 2 | - | ||
| 3 | -import java.util.Date; | ||
| 4 | - | ||
| 5 | -import javax.persistence.Column; | ||
| 6 | -import javax.persistence.Entity; | ||
| 7 | -import javax.persistence.GeneratedValue; | ||
| 8 | -import javax.persistence.GenerationType; | ||
| 9 | -import javax.persistence.Id; | ||
| 10 | -import javax.persistence.ManyToOne; | ||
| 11 | -import javax.persistence.Table; | ||
| 12 | - | ||
| 13 | -/** | ||
| 14 | - * | ||
| 15 | - * @ClassName: SessionLog | ||
| 16 | - * @Description: TODO(session日志) | ||
| 17 | - * @author PanZhao | ||
| 18 | - * @date 2016年7月20日 下午4:46:27 | ||
| 19 | - * | ||
| 20 | - */ | ||
| 21 | -@Entity | ||
| 22 | -@Table(name = "bsth_c_sys_sessionlog") | ||
| 23 | -public class SessionLog { | ||
| 24 | - | ||
| 25 | - @Id | ||
| 26 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 27 | - private Integer id; | ||
| 28 | - | ||
| 29 | - @ManyToOne | ||
| 30 | - private SysUser user; | ||
| 31 | - | ||
| 32 | - /** 登录时间 */ | ||
| 33 | - private Date loginDate; | ||
| 34 | - | ||
| 35 | - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 36 | - private Date createDate; | ||
| 37 | - | ||
| 38 | - /** 登出时间 */ | ||
| 39 | - private Date logoutDate; | ||
| 40 | - | ||
| 41 | - /** 登出方式 0:主动登出, -1:其他 */ | ||
| 42 | - private int logoutType; | ||
| 43 | - | ||
| 44 | - /** 登录IP */ | ||
| 45 | - private String ip; | ||
| 46 | - | ||
| 47 | - public Integer getId() { | ||
| 48 | - return id; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - public void setId(Integer id) { | ||
| 52 | - this.id = id; | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - public SysUser getUser() { | ||
| 56 | - return user; | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - public void setUser(SysUser user) { | ||
| 60 | - this.user = user; | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - public Date getLoginDate() { | ||
| 64 | - return loginDate; | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - public void setLoginDate(Date loginDate) { | ||
| 68 | - this.loginDate = loginDate; | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - public Date getCreateDate() { | ||
| 72 | - return createDate; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - public void setCreateDate(Date createDate) { | ||
| 76 | - this.createDate = createDate; | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - public Date getLogoutDate() { | ||
| 80 | - return logoutDate; | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - public void setLogoutDate(Date logoutDate) { | ||
| 84 | - this.logoutDate = logoutDate; | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - public int getLogoutType() { | ||
| 88 | - return logoutType; | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - public void setLogoutType(int logoutType) { | ||
| 92 | - this.logoutType = logoutType; | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - public String getIp() { | ||
| 96 | - return ip; | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - public void setIp(String ip) { | ||
| 100 | - this.ip = ip; | ||
| 101 | - } | ||
| 102 | -} |
src/main/java/com/bsth/entity/sys/SignControl.java deleted
100644 → 0
| 1 | -package com.bsth.entity.sys; | ||
| 2 | - | ||
| 3 | -import java.util.Date; | ||
| 4 | - | ||
| 5 | -import javax.persistence.Entity; | ||
| 6 | -import javax.persistence.GeneratedValue; | ||
| 7 | -import javax.persistence.GenerationType; | ||
| 8 | -import javax.persistence.Id; | ||
| 9 | -import javax.persistence.ManyToOne; | ||
| 10 | -import javax.persistence.Table; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * | ||
| 14 | - * @ClassName: SignControl | ||
| 15 | - * @Description: TODO(进出线调记录) | ||
| 16 | - * @author PanZhao | ||
| 17 | - * @date 2016年7月20日 下午4:50:50 | ||
| 18 | - * | ||
| 19 | - */ | ||
| 20 | -@Entity | ||
| 21 | -@Table(name = "bsth_c_sys_sign") | ||
| 22 | -public class SignControl { | ||
| 23 | - | ||
| 24 | - @Id | ||
| 25 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 26 | - private Integer id; | ||
| 27 | - | ||
| 28 | - @ManyToOne | ||
| 29 | - private SessionLog session; | ||
| 30 | - | ||
| 31 | - /** 登出线调时间 */ | ||
| 32 | - private Date outDate; | ||
| 33 | - | ||
| 34 | - /** 在线时长 */ | ||
| 35 | - private Long onLineTimel; | ||
| 36 | - | ||
| 37 | - /** 0: 主调模式, 1:监控模式 */ | ||
| 38 | - private int signType; | ||
| 39 | - | ||
| 40 | - /** 用户名 */ | ||
| 41 | - private String userName; | ||
| 42 | - | ||
| 43 | - public Integer getId() { | ||
| 44 | - return id; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - public void setId(Integer id) { | ||
| 48 | - this.id = id; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - public SessionLog getSession() { | ||
| 52 | - return session; | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - public void setSession(SessionLog session) { | ||
| 56 | - this.session = session; | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - public Date getOutDate() { | ||
| 60 | - return outDate; | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - public void setOutDate(Date outDate) { | ||
| 64 | - this.outDate = outDate; | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - public Long getOnLineTimel() { | ||
| 68 | - return onLineTimel; | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - public void setOnLineTimel(Long onLineTimel) { | ||
| 72 | - this.onLineTimel = onLineTimel; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - public int getSignType() { | ||
| 76 | - return signType; | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - public void setSignType(int signType) { | ||
| 80 | - this.signType = signType; | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - public String getUserName() { | ||
| 84 | - return userName; | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - public void setUserName(String userName) { | ||
| 88 | - this.userName = userName; | ||
| 89 | - } | ||
| 90 | -} |
src/main/java/com/bsth/repository/sys/DutyEmployeeRepository.java
0 → 100644
| 1 | +package com.bsth.repository.sys; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.sys.DutyEmployee; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.data.jpa.repository.Query; | ||
| 6 | +import org.springframework.stereotype.Repository; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * Created by panzhao on 2017/1/5. | ||
| 12 | + */ | ||
| 13 | +@Repository | ||
| 14 | +public interface DutyEmployeeRepository extends BaseRepository<DutyEmployee, Long>{ | ||
| 15 | + | ||
| 16 | + @Query("select t from DutyEmployee t where t.codeIdx like %?1% and t.ts > ?2 and t.ts < ?3") | ||
| 17 | + List<DutyEmployee> findByLineAndTime(String lineCode, long st, long et); | ||
| 18 | +} |
src/main/java/com/bsth/repository/sys/SessionLogRepository.java deleted
100644 → 0
| 1 | -package com.bsth.repository.sys; | ||
| 2 | - | ||
| 3 | -import org.springframework.stereotype.Repository; | ||
| 4 | - | ||
| 5 | -import com.bsth.entity.sys.SessionLog; | ||
| 6 | -import com.bsth.repository.BaseRepository; | ||
| 7 | - | ||
| 8 | -@Repository | ||
| 9 | -public interface SessionLogRepository extends BaseRepository<SessionLog, Integer>{ | ||
| 10 | - | ||
| 11 | -} |
src/main/java/com/bsth/service/sys/DutyEmployeeService.java
0 → 100644
| 1 | +package com.bsth.service.sys; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.sys.DutyEmployee; | ||
| 4 | +import com.bsth.service.BaseService; | ||
| 5 | + | ||
| 6 | +import java.util.List; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * Created by panzhao on 2017/1/5. | ||
| 10 | + */ | ||
| 11 | +public interface DutyEmployeeService extends BaseService<DutyEmployee, Long> { | ||
| 12 | + | ||
| 13 | + List<DutyEmployee> getDutyEmployee(String lineCode, String startTime, String endTime); | ||
| 14 | +} |
src/main/java/com/bsth/service/sys/impl/DutyEmployeeServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.sys.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.sys.DutyEmployee; | ||
| 4 | +import com.bsth.repository.sys.DutyEmployeeRepository; | ||
| 5 | +import com.bsth.service.impl.BaseServiceImpl; | ||
| 6 | +import com.bsth.service.sys.DutyEmployeeService; | ||
| 7 | +import org.joda.time.format.DateTimeFormat; | ||
| 8 | +import org.joda.time.format.DateTimeFormatter; | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | + | ||
| 12 | +import java.util.List; | ||
| 13 | +import java.util.Map; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * Created by panzhao on 2017/1/5. | ||
| 17 | + */ | ||
| 18 | +@Service | ||
| 19 | +public class DutyEmployeeServiceImpl extends BaseServiceImpl<DutyEmployee, Long> implements DutyEmployeeService { | ||
| 20 | + | ||
| 21 | + @Autowired | ||
| 22 | + DutyEmployeeRepository dutyEmployeeRepository; | ||
| 23 | + | ||
| 24 | + @Override | ||
| 25 | + public Map<String, Object> save(DutyEmployee dutyEmployee) { | ||
| 26 | + //登入时间,当前时间 - 10分钟 | ||
| 27 | + dutyEmployee.setTs(System.currentTimeMillis() - (1000 * 60 * 10)); | ||
| 28 | + return super.save(dutyEmployee); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 获取当班调度 | ||
| 34 | + * | ||
| 35 | + * @param lineCode 线路编码 | ||
| 36 | + * @param startTime 开始时间 yyyy-MM-ddHH:mm | ||
| 37 | + * @param endTime 结束时间 yyyy-MM-ddHH:mm | ||
| 38 | + * @return | ||
| 39 | + */ | ||
| 40 | + public List<DutyEmployee> getDutyEmployee(String lineCode, String startTime, String endTime) { | ||
| 41 | + DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | ||
| 42 | + return dutyEmployeeRepository.findByLineAndTime(lineCode + ",", fmtyyyyMMddHHmm.parseMillis(startTime), fmtyyyyMMddHHmm.parseMillis(endTime)); | ||
| 43 | + } | ||
| 44 | +} |
src/main/resources/static/real_control_v2/js/data/data_gps.js
| @@ -15,12 +15,6 @@ var gb_data_gps = (function() { | @@ -15,12 +15,6 @@ var gb_data_gps = (function() { | ||
| 15 | }; | 15 | }; |
| 16 | 16 | ||
| 17 | var refresh = function(cb) { | 17 | var refresh = function(cb) { |
| 18 | - /*$.get('/gps/real/line', { | ||
| 19 | - lineCodes: gb_data_basic.line_idx | ||
| 20 | - }, function(rs) { | ||
| 21 | - refreshData(rs); | ||
| 22 | - cb(); | ||
| 23 | - });*/ | ||
| 24 | $.ajax({ | 18 | $.ajax({ |
| 25 | url: '/gps/real/line', | 19 | url: '/gps/real/line', |
| 26 | data:{lineCodes: gb_data_basic.line_idx}, | 20 | data:{lineCodes: gb_data_basic.line_idx}, |
| @@ -30,7 +24,7 @@ var gb_data_gps = (function() { | @@ -30,7 +24,7 @@ var gb_data_gps = (function() { | ||
| 30 | }, | 24 | }, |
| 31 | error: function (xr, t) { | 25 | error: function (xr, t) { |
| 32 | notify_err('刷新GPS失败,稍后重试' + t); | 26 | notify_err('刷新GPS失败,稍后重试' + t); |
| 33 | - //cb(); | 27 | + cb(); |
| 34 | } | 28 | } |
| 35 | }); | 29 | }); |
| 36 | }; | 30 | }; |
| @@ -50,9 +44,7 @@ var gb_data_gps = (function() { | @@ -50,9 +44,7 @@ var gb_data_gps = (function() { | ||
| 50 | upArr.push(this); | 44 | upArr.push(this); |
| 51 | } else | 45 | } else |
| 52 | addArr.push(this); | 46 | addArr.push(this); |
| 53 | - //起终点 拼接方向标识 | ||
| 54 | - /*if(this.sEPoint) | ||
| 55 | - this.stopNo=this.stopNo+'_'+this.upDown;*/ | 47 | + |
| 56 | //时间格式化 | 48 | //时间格式化 |
| 57 | this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | 49 | this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); |
| 58 | realData[this.deviceId] = this; | 50 | realData[this.deviceId] = this; |
| @@ -86,15 +78,15 @@ var gb_data_gps = (function() { | @@ -86,15 +78,15 @@ var gb_data_gps = (function() { | ||
| 86 | rs.push(realData[device]); | 78 | rs.push(realData[device]); |
| 87 | } | 79 | } |
| 88 | return rs; | 80 | return rs; |
| 89 | - } | 81 | + }; |
| 90 | 82 | ||
| 91 | var findOne = function(deviceId){ | 83 | var findOne = function(deviceId){ |
| 92 | return realData[deviceId]; | 84 | return realData[deviceId]; |
| 93 | - } | 85 | + }; |
| 94 | 86 | ||
| 95 | var findGpsByNbbm = function(nbbm){ | 87 | var findGpsByNbbm = function(nbbm){ |
| 96 | return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | 88 | return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; |
| 97 | - } | 89 | + }; |
| 98 | 90 | ||
| 99 | return { | 91 | return { |
| 100 | fixedTimeRefresh: fixedTimeRefresh, | 92 | fixedTimeRefresh: fixedTimeRefresh, |
src/main/resources/static/real_control_v2/js/data/gps_signal_state.js
0 → 100644
src/main/resources/static/real_control_v2/js/main.js
| 1 | -//主调和监控模式 | ||
| 2 | -var operationMode = window.localStorage.getItem('operationMode'); | ||
| 3 | -if (operationMode == 0) { | ||
| 4 | - $('body>.north').addClass('monitor'); | ||
| 5 | - $(document).on('ajaxSend', interceptPOST); | ||
| 6 | -} | ||
| 7 | -else | ||
| 8 | - $('body>.north').addClass('main'); | ||
| 9 | - | ||
| 10 | -//拦截POST请求 | ||
| 11 | -function interceptPOST(e, xhr, t) { | ||
| 12 | - if (t && (t.method == 'POST' || t.type == 'POST')) { | ||
| 13 | - console.log(e, xhr, t); | ||
| 14 | - xhr.abort(); | ||
| 15 | - notify_err('监控模式!'); | ||
| 16 | - } | ||
| 17 | -} | ||
| 18 | 1 | ||
| 19 | /* main js */ | 2 | /* main js */ |
| 20 | var gb_main_ep = new EventProxy(), | 3 | var gb_main_ep = new EventProxy(), |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| 1 | /* main.html north toolbar js */ | 1 | /* main.html north toolbar js */ |
| 2 | 2 | ||
| 3 | -var gb_northToolbar = (function() { | 3 | +var gb_northToolbar = (function () { |
| 4 | 4 | ||
| 5 | - var modal_opts={center: true,bgclose: false}; | ||
| 6 | - var currentUser; | 5 | + var modal_opts = {center: true, bgclose: false}; |
| 6 | + var currentUser; | ||
| 7 | 7 | ||
| 8 | - $.get('/real_control_v2/fragments/north/toolbar.html', function(temp){ | ||
| 9 | - ep.emit("template", temp); | ||
| 10 | - }); | 8 | + $.get('/real_control_v2/fragments/north/toolbar.html', function (temp) { |
| 9 | + ep.emit("template", temp); | ||
| 10 | + }); | ||
| 11 | + | ||
| 12 | + $.get('/real_control_v2/js/data/json/north_toolbar.json', function (data) { | ||
| 13 | + ep.emit("data", data); | ||
| 14 | + }); | ||
| 11 | 15 | ||
| 12 | - $.get('/real_control_v2/js/data/json/north_toolbar.json', function(data){ | ||
| 13 | - ep.emit("data", data); | ||
| 14 | - }); | 16 | + //当前用户信息 |
| 17 | + $.get('/user/currentUser', function (user) { | ||
| 18 | + ep.emit("user", user); | ||
| 19 | + }); | ||
| 15 | 20 | ||
| 16 | - //当前用户信息 | ||
| 17 | - $.get('/user/currentUser', function(user){ | ||
| 18 | - ep.emit("user", user); | ||
| 19 | - }); | 21 | + var ep = EventProxy.create("template", "data", "user", function (temp, data, user) { |
| 22 | + currentUser = user; | ||
| 23 | + var t = $('#north-toolbar-temp', temp).html() | ||
| 24 | + , htmlStr = template.render(t)({list: data, user: currentUser}); | ||
| 25 | + $('.north .north-toolbar').html(htmlStr); | ||
| 20 | 26 | ||
| 21 | - var ep = EventProxy.create("template", "data", "user" , function (temp, data, user) { | ||
| 22 | - currentUser=user; | ||
| 23 | - var t = $('#north-toolbar-temp', temp).html() | ||
| 24 | - ,htmlStr = template.render(t)({list: data, user: currentUser}); | ||
| 25 | - $('.north .north-toolbar').html(htmlStr); | 27 | + //exit |
| 28 | + $('.north .north-toolbar .exit-system').on('click', function () { | ||
| 29 | + //关闭websocket 连接 | ||
| 30 | + gb_sch_websocket.sock.close(); | ||
| 31 | + window.location.href = '/pages/control/lineallot/allot.html'; | ||
| 32 | + }); | ||
| 33 | + }); | ||
| 26 | 34 | ||
| 27 | - //exit | ||
| 28 | - $('.north .north-toolbar .exit-system').on('click', function(){ | ||
| 29 | - //关闭websocket 连接 | ||
| 30 | - gb_sch_websocket.sock.close(); | ||
| 31 | - window.location.href='/pages/control/lineallot/allot.html'; | 35 | + $(document).on('click', '#north_toolbar_panel li.event a', function () { |
| 36 | + var event = $(this).data('event'); | ||
| 37 | + handler[event] && handler[event](); | ||
| 32 | }); | 38 | }); |
| 33 | - }); | ||
| 34 | 39 | ||
| 35 | - $(document).on('click', '#north_toolbar_panel li.event a', function(){ | ||
| 36 | - var event = $(this).data('event'); | ||
| 37 | - handler[event] && handler[event](); | ||
| 38 | - }); | 40 | + var handler = { |
| 41 | + // device report list | ||
| 42 | + device_report: function () { | ||
| 43 | + open_modal('/real_control_v2/fragments/north/nav/report_80.html', {}, modal_opts); | ||
| 44 | + }, | ||
| 45 | + directive_history: function () { | ||
| 46 | + open_modal('/real_control_v2/fragments/north/nav/directive_history.html', {}, modal_opts); | ||
| 47 | + }, | ||
| 48 | + tts_config: function () { | ||
| 49 | + open_modal('/real_control_v2/fragments/north/nav/tts_config.html', {}, modal_opts); | ||
| 50 | + }, | ||
| 51 | + all_devices: function () { | ||
| 52 | + open_modal('/real_control_v2/fragments/north/nav/all_devices.html', {}, modal_opts); | ||
| 53 | + }, | ||
| 54 | + device_online_rate: function () { | ||
| 55 | + open_modal('/real_control_v2/fragments/north/nav/charts/device_online_rate.html', {}, modal_opts); | ||
| 56 | + }, | ||
| 57 | + turnout_rate: function () { | ||
| 58 | + open_modal('/real_control_v2/fragments/north/nav/charts/car_out_rate.html', {}, modal_opts); | ||
| 59 | + }, | ||
| 60 | + s_e_punctuality_rate: function () { | ||
| 61 | + open_modal('/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate.html', {}, modal_opts); | ||
| 62 | + }, | ||
| 63 | + s_e_punctuality_rate_line: function () { | ||
| 64 | + open_modal('/real_control_v2/fragments/north/nav/charts/s_e_punctuality_rate_line.html', {}, modal_opts); | ||
| 65 | + }, | ||
| 66 | + history_sch_maintain: function () { | ||
| 67 | + open_modal('/real_control_v2/fragments/north/nav/history_sch_maintain.html', {}, { | ||
| 68 | + center: false, | ||
| 69 | + bgclose: false | ||
| 70 | + }); | ||
| 71 | + }, | ||
| 72 | + sch_exec_rate: function () { | ||
| 73 | + open_modal('/real_control_v2/fragments/north/nav/charts/sch_exec_rate.html', {}, modal_opts); | ||
| 74 | + }, | ||
| 75 | + gps_play_back: function () { | ||
| 76 | + gb_map_play_back.initParams(); | ||
| 77 | + }, | ||
| 78 | + signal_state: function () { | ||
| 79 | + open_modal('/real_control_v2/fragments/north/nav/signal_state_config.html', {}, modal_opts); | ||
| 80 | + } | ||
| 81 | + } | ||
| 39 | 82 | ||
| 40 | - var handler = { | ||
| 41 | - // device report list | ||
| 42 | - device_report: function(){ | ||
| 43 | - open_modal('/real_control_v2/fragments/north/nav/report_80.html', {}, modal_opts); | ||
| 44 | - }, | ||
| 45 | - directive_history: function(){ | ||
| 46 | - open_modal('/real_control_v2/fragments/north/nav/directive_history.html', {}, modal_opts); | ||
| 47 | - }, | ||
| 48 | - tts_config: function(){ | ||
| 49 | - open_modal('/real_control_v2/fragments/north/nav/tts_config.html', {}, modal_opts); | ||
| 50 | - }, | ||
| 51 | - all_devices: function(){ | ||
| 52 | - open_modal('/real_control_v2/fragments/north/nav/all_devices.html', {}, modal_opts); | ||
| 53 | - }, | ||
| 54 | - device_online_rate: function(){ | ||
| 55 | - open_modal('/real_control_v2/fragments/north/nav/charts/device_online_rate.html', {}, modal_opts); | ||
| 56 | - }, | ||
| 57 | - turnout_rate: function () { | ||
| 58 | - open_modal('/real_control_v2/fragments/north/nav/charts/car_out_rate.html', {}, modal_opts); | ||
| 59 | - }, | ||
| 60 | - s_e_punctuality_rate: function () { | ||
| 61 | - open_modal('/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate.html', {}, modal_opts); | ||
| 62 | - }, | ||
| 63 | - s_e_punctuality_rate_line: function () { | ||
| 64 | - open_modal('/real_control_v2/fragments/north/nav/charts/s_e_punctuality_rate_line.html', {}, modal_opts); | ||
| 65 | - }, | ||
| 66 | - history_sch_maintain: function () { | ||
| 67 | - open_modal('/real_control_v2/fragments/north/nav/history_sch_maintain.html', {}, {center: false,bgclose: false}); | ||
| 68 | - }, | ||
| 69 | - sch_exec_rate: function () { | ||
| 70 | - open_modal('/real_control_v2/fragments/north/nav/charts/sch_exec_rate.html', {}, modal_opts); | ||
| 71 | - }, | ||
| 72 | - gps_play_back: function () { | ||
| 73 | - gb_map_play_back.initParams(); | ||
| 74 | - }, | ||
| 75 | - signal_state: function () { | ||
| 76 | - open_modal('/real_control_v2/fragments/north/nav/signal_state_config.html', {}, modal_opts); | 83 | + return { |
| 84 | + user: function () { | ||
| 85 | + return currentUser; | ||
| 86 | + } | ||
| 77 | } | 87 | } |
| 78 | - } | ||
| 79 | })(); | 88 | })(); |
src/main/resources/static/real_control_v2/js/utils/dispatch_pattern.js
0 → 100644
| 1 | +/** 调度模式 */ | ||
| 2 | + | ||
| 3 | +//主调和监控模式 | ||
| 4 | +var operationMode = window.localStorage.getItem('operationMode'); | ||
| 5 | +if (operationMode == 0) { | ||
| 6 | + $('body>.north').addClass('monitor'); | ||
| 7 | + $(document).on('ajaxSend', interceptPOST); | ||
| 8 | +} | ||
| 9 | +else | ||
| 10 | + $('body>.north').addClass('main'); | ||
| 11 | + | ||
| 12 | +//拦截POST请求 | ||
| 13 | +function interceptPOST(e, xhr, t) { | ||
| 14 | + if (t && (t.method == 'POST' || t.type == 'POST')) { | ||
| 15 | + console.log(e, xhr, t); | ||
| 16 | + xhr.abort(); | ||
| 17 | + notify_err('监控模式!'); | ||
| 18 | + } | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | + | ||
| 22 | +//10分钟后提交当班调度数据 | ||
| 23 | +setTimeout(function () { | ||
| 24 | + debugger | ||
| 25 | + var user = gb_northToolbar.user(); | ||
| 26 | + var data = { | ||
| 27 | + uId: user.id, | ||
| 28 | + uName: user.userName, | ||
| 29 | + codeIdx: gb_data_basic.line_idx + ',', | ||
| 30 | + main: operationMode | ||
| 31 | + }; | ||
| 32 | + | ||
| 33 | + gb_common.$post('/dutyEmployee', data); | ||
| 34 | +}, 1000 * 60 * 10); | ||
| 0 | \ No newline at end of file | 35 | \ No newline at end of file |
src/main/resources/static/real_control_v2/main.html
| @@ -144,6 +144,7 @@ | @@ -144,6 +144,7 @@ | ||
| 144 | <script src="/real_control_v2/geolib/geolib.js"></script> | 144 | <script src="/real_control_v2/geolib/geolib.js"></script> |
| 145 | 145 | ||
| 146 | <script src="/real_control_v2/js/signal_state/signal_state.js"></script> | 146 | <script src="/real_control_v2/js/signal_state/signal_state.js"></script> |
| 147 | + <script src="/real_control_v2/js/utils/dispatch_pattern.js"></script> | ||
| 147 | </body> | 148 | </body> |
| 148 | 149 | ||
| 149 | </html> | 150 | </html> |