Commit abb0cfd1eb2b0991a44f74aabd3b96611e9a9030
1 parent
82486e28
运管处接口
Showing
5 changed files
with
121 additions
and
1 deletions
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
0 → 100644
| 1 | +package com.bsth.controller.schedule; | |
| 2 | + | |
| 3 | +import com.bsth.service.TrafficManageService; | |
| 4 | + | |
| 5 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 7 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 8 | +import org.springframework.web.bind.annotation.RestController; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * | |
| 12 | + * @author BSTH | |
| 13 | + * | |
| 14 | + */ | |
| 15 | +@RestController | |
| 16 | +@RequestMapping("trmg") | |
| 17 | +public class TrafficManageController { | |
| 18 | + | |
| 19 | + @Autowired | |
| 20 | + private TrafficManageService trManageService; | |
| 21 | + | |
| 22 | + | |
| 23 | + @RequestMapping(value = "/setXL", method = RequestMethod.GET) | |
| 24 | + public String setXL() throws Exception { | |
| 25 | + try { | |
| 26 | + return trManageService.setXL(); | |
| 27 | + } catch (Exception exp) { | |
| 28 | + throw new Exception(exp.getCause()); | |
| 29 | + } | |
| 30 | + } | |
| 31 | +} | ... | ... |
src/main/java/com/bsth/service/TrafficManageService.java
0 → 100644
| 1 | +package com.bsth.service; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Line; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * | |
| 7 | + * @Interface: LineService(线路service业务层实现接口) | |
| 8 | + * | |
| 9 | + * @extends : BaseService | |
| 10 | + * | |
| 11 | + * @Description: TODO(线路service业务层实现接口) | |
| 12 | + * | |
| 13 | + * @Author bsth@lq | |
| 14 | + * | |
| 15 | + * @Date 2016年4月28日 上午9:21:17 | |
| 16 | + * | |
| 17 | + * @Version 公交调度系统BS版 0.1 | |
| 18 | + * | |
| 19 | + */ | |
| 20 | +public interface TrafficManageService { | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 获取线路编码 | |
| 24 | + * | |
| 25 | + * @return long <lineCode:线路编码> | |
| 26 | + */ | |
| 27 | + String setXL(); | |
| 28 | + | |
| 29 | +} | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.impl; | |
| 2 | + | |
| 3 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 4 | +import org.springframework.stereotype.Service; | |
| 5 | + | |
| 6 | +import com.bsth.entity.Line; | |
| 7 | +import com.bsth.repository.LineRepository; | |
| 8 | +import com.bsth.service.LineService; | |
| 9 | +import com.bsth.service.TrafficManageService; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * | |
| 13 | + * @ClassName: LineServiceImpl(线路service业务层实现类) | |
| 14 | + * | |
| 15 | + * @Extends : BaseService | |
| 16 | + * | |
| 17 | + * @Description: TODO(线路service业务层) | |
| 18 | + * | |
| 19 | + * @Author bsth@lq | |
| 20 | + * | |
| 21 | + * @Date 2016年4月28日 上午9:21:17 | |
| 22 | + * | |
| 23 | + * @Version 公交调度系统BS版 0.1 | |
| 24 | + * | |
| 25 | + */ | |
| 26 | + | |
| 27 | +@Service | |
| 28 | +public class TrafficManageServiceImpl implements TrafficManageService{ | |
| 29 | + | |
| 30 | + @Autowired | |
| 31 | + private LineRepository repository; | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 获取线路编码 | |
| 35 | + * | |
| 36 | + * @return int <lineCode:线路编码> | |
| 37 | + */ | |
| 38 | + public String setXL() { | |
| 39 | + String result = "abc"; | |
| 40 | + System.out.println("abdfedddddddddddddddddddddddddddd"); | |
| 41 | + return result; | |
| 42 | + } | |
| 43 | + | |
| 44 | +} | ... | ... |
src/main/resources/static/pages/trafficManage/js/timeTempletUpload.js
| ... | ... | @@ -148,4 +148,20 @@ |
| 148 | 148 | obj.ttInfo.qyrq = moment(obj.ttInfo.qyrq).format(fs); |
| 149 | 149 | }); |
| 150 | 150 | } |
| 151 | + | |
| 152 | + // 绑定查询事件 | |
| 153 | + $("#setXL").click(setXLF); | |
| 154 | + var params = {}; | |
| 155 | + function setXLF() { | |
| 156 | + $.ajax({ | |
| 157 | + type: 'get',url: '/trmg/setXL', | |
| 158 | + data: params ,dataType:'text', | |
| 159 | + success:function(data) { | |
| 160 | + alert(data); | |
| 161 | + }, error : function() { | |
| 162 | + alert("操作失败"); | |
| 163 | + } | |
| 164 | + | |
| 165 | + }); | |
| 166 | + } | |
| 151 | 167 | })(); |
| 152 | 168 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/trafficManage/timeTempletUpload.html
| 1 | 1 | <link href="css/trafficManage.css" rel="stylesheet" type="text/css" /> |
| 2 | -<link href="css/autocompleter.css" rel="stylesheet" type="text/css" /> | |
| 3 | 2 | <ul class="page-breadcrumb breadcrumb"> |
| 4 | 3 | <li><a href="/pages/home.html" data-pjax>首页</a> <i |
| 5 | 4 | class="fa fa-circle"></i></li> |
| ... | ... | @@ -17,6 +16,7 @@ |
| 17 | 16 | name="ttInfo.name_like" maxlength="40" /></li> |
| 18 | 17 | <li><a class="btn btn-circle blue" id="search">查询</a></li> |
| 19 | 18 | <li><a class="btn btn-circle red" id="upload">上传</a></li> |
| 19 | + <li><a class="btn btn-circle red" id="setXL">上传线路</a></li> | |
| 20 | 20 | </ul> |
| 21 | 21 | </div> |
| 22 | 22 | <!-- Begin: left-div --> | ... | ... |