Commit c0288e96d59e3ec06ee95bac5a50283353f267e8

Authored by 徐烜
1 parent 3ee4a802

update

src/main/java/com/bsth/Application.java
1 package com.bsth; 1 package com.bsth;
2 2
3 -import com.fasterxml.jackson.databind.ObjectMapper;  
4 -import com.fasterxml.jackson.databind.SerializationFeature;  
5 import org.springframework.boot.SpringApplication; 3 import org.springframework.boot.SpringApplication;
6 -import org.springframework.boot.autoconfigure.*;  
7 -import org.springframework.context.annotation.Bean;  
8 -import org.springframework.context.annotation.Primary; 4 +import org.springframework.boot.autoconfigure.SpringBootApplication;
9 5
10 @SpringBootApplication 6 @SpringBootApplication
11 public class Application{ 7 public class Application{
12 8
13 - @Bean  
14 - @Primary  
15 - public ObjectMapper objectMapper() {  
16 - ObjectMapper objectMapper = new ObjectMapper();  
17 - objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);  
18 -  
19 - return objectMapper;  
20 - } 9 +// @Bean
  10 +// @Primary
  11 +// public ObjectMapper objectMapper() {
  12 +// ObjectMapper objectMapper = new ObjectMapper();
  13 +// objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
  14 +//
  15 +// return objectMapper;
  16 +// }
21 17
22 public static void main(String[] args) throws Exception { 18 public static void main(String[] args) throws Exception {
23 SpringApplication.run(Application.class, args); 19 SpringApplication.run(Application.class, args);
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
@@ -73,12 +73,16 @@ public class SchedulePlanInfo { @@ -73,12 +73,16 @@ public class SchedulePlanInfo {
73 /** 起点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */ 73 /** 起点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */
74 @Column(nullable = false) 74 @Column(nullable = false)
75 private Integer qdz; 75 private Integer qdz;
  76 + /** 起点站code */
  77 + private String qdzCode;
76 /** 起点站名字 */ 78 /** 起点站名字 */
77 @Column(nullable = false) 79 @Column(nullable = false)
78 private String qdzName; 80 private String qdzName;
79 /** 终点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */ 81 /** 终点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */
80 @Column(nullable = false) 82 @Column(nullable = false)
81 private Integer zdz; 83 private Integer zdz;
  84 + /** 终点站code */
  85 + private String zdzCode;
82 /** 终点站名字 */ 86 /** 终点站名字 */
83 @Column(nullable = false) 87 @Column(nullable = false)
84 private String zdzName; 88 private String zdzName;
@@ -365,4 +369,20 @@ public class SchedulePlanInfo { @@ -365,4 +369,20 @@ public class SchedulePlanInfo {
365 public void setUpdateDate(Date updateDate) { 369 public void setUpdateDate(Date updateDate) {
366 this.updateDate = updateDate; 370 this.updateDate = updateDate;
367 } 371 }
  372 +
  373 + public String getQdzCode() {
  374 + return qdzCode;
  375 + }
  376 +
  377 + public void setQdzCode(String qdzCode) {
  378 + this.qdzCode = qdzCode;
  379 + }
  380 +
  381 + public String getZdzCode() {
  382 + return zdzCode;
  383 + }
  384 +
  385 + public void setZdzCode(String zdzCode) {
  386 + this.zdzCode = zdzCode;
  387 + }
368 } 388 }
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/detail.html
@@ -218,48 +218,28 @@ @@ -218,48 +218,28 @@
218 <div class="form-group"> 218 <div class="form-group">
219 <label class="col-md-2 control-label">是否空调车:</label> 219 <label class="col-md-2 control-label">是否空调车:</label>
220 <div class="col-md-3"> 220 <div class="col-md-3">
221 - <label class="radio-inline">  
222 - <input type="radio" name="hvacCar" ng-value="true" ng-model="ctrl.busInfoForDetail.hvacCar" disabled/>是  
223 - </label>  
224 - <label class="radio-inline">  
225 - <input type="radio" name="hvacCar" ng-value="false" ng-model="ctrl.busInfoForDetail.hvacCar" disabled/>否  
226 - </label> 221 + <truefalse-Dic model="ctrl.busInfoForDetail.hvacCar" disabled="true" dicgroup="truefalseType" name="hvacCar"></truefalse-Dic>
227 </div> 222 </div>
228 </div> 223 </div>
229 224
230 <div class="form-group"> 225 <div class="form-group">
231 <label class="col-md-2 control-label">有无人售票:</label> 226 <label class="col-md-2 control-label">有无人售票:</label>
232 <div class="col-md-3"> 227 <div class="col-md-3">
233 - <label class="radio-inline">  
234 - <input type="radio" name="ticketType" ng-value="true" ng-model="ctrl.busInfoForDetail.ticketType" disabled/>是  
235 - </label>  
236 - <label class="radio-inline">  
237 - <input type="radio" name="ticketType" ng-value="false" ng-model="ctrl.busInfoForDetail.ticketType" disabled/>否  
238 - </label> 228 + <truefalse-Dic model="ctrl.busInfoForDetail.ticketType" disabled="true" dicgroup="truefalseType" name="ticketType"></truefalse-Dic>
239 </div> 229 </div>
240 </div> 230 </div>
241 231
242 <div class="form-group"> 232 <div class="form-group">
243 <label class="col-md-2 control-label">是否有LED服务屏:</label> 233 <label class="col-md-2 control-label">是否有LED服务屏:</label>
244 <div class="col-md-3"> 234 <div class="col-md-3">
245 - <label class="radio-inline">  
246 - <input type="radio" name="ledScreen" ng-value="true" ng-model="ctrl.busInfoForDetail.ledScreen" disabled/>是  
247 - </label>  
248 - <label class="radio-inline">  
249 - <input type="radio" name="ledScreen" ng-value="false" ng-model="ctrl.busInfoForDetail.ledScreen" disabled/>否  
250 - </label> 235 + <truefalse-Dic model="ctrl.busInfoForDetail.ledScreen" disabled="true" dicgroup="truefalseType" name="ledScreen"></truefalse-Dic>
251 </div> 236 </div>
252 </div> 237 </div>
253 238
254 <div class="form-group"> 239 <div class="form-group">
255 <label class="col-md-2 control-label">是否有TV视屏:</label> 240 <label class="col-md-2 control-label">是否有TV视屏:</label>
256 <div class="col-md-3"> 241 <div class="col-md-3">
257 - <label class="radio-inline">  
258 - <input type="radio" name="tvVideoType" ng-value="true" ng-model="ctrl.busInfoForDetail.tvVideoType" disabled/>是  
259 - </label>  
260 - <label class="radio-inline">  
261 - <input type="radio" name="tvVideoType" ng-value="false" ng-model="ctrl.busInfoForDetail.tvVideoType" disabled/>否  
262 - </label> 242 + <truefalse-Dic model="ctrl.busInfoForDetail.tvVideoType" disabled="true" dicgroup="truefalseType" name="tvVideoType"></truefalse-Dic>
263 </div> 243 </div>
264 </div> 244 </div>
265 245
@@ -299,12 +279,7 @@ @@ -299,12 +279,7 @@
299 <div class="form-group"> 279 <div class="form-group">
300 <label class="col-md-2 control-label">是否电车:</label> 280 <label class="col-md-2 control-label">是否电车:</label>
301 <div class="col-md-3"> 281 <div class="col-md-3">
302 - <label class="radio-inline">  
303 - <input type="radio" name="sfdc" ng-value="true" ng-model="ctrl.busInfoForDetail.sfdc" disabled/>是  
304 - </label>  
305 - <label class="radio-inline">  
306 - <input type="radio" name="sfdc" ng-value="true" ng-model="ctrl.busInfoForDetail.sfdc" disabled/>否  
307 - </label> 282 + <truefalse-Dic model="ctrl.busInfoForDetail.sfdc" disabled="true" dicgroup="truefalseType" name="sfdc"></truefalse-Dic>
308 </div> 283 </div>
309 </div> 284 </div>
310 285
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/edit.html
@@ -320,56 +320,28 @@ @@ -320,56 +320,28 @@
320 <div class="form-group"> 320 <div class="form-group">
321 <label class="col-md-2 control-label">是否空调车:</label> 321 <label class="col-md-2 control-label">是否空调车:</label>
322 <div class="col-md-3"> 322 <div class="col-md-3">
323 - <label class="radio-inline">  
324 - <input type="radio" name="hvacCar"  
325 - ng-value="true" ng-model="ctrl.busInfoForSave.hvacCar"/>是  
326 - </label>  
327 - <label class="radio-inline">  
328 - <input type="radio" name="hvacCar"  
329 - ng-value="false" ng-model="ctrl.busInfoForSave.hvacCar"/>否  
330 - </label> 323 + <truefalse-Dic model="ctrl.busInfoForSave.hvacCar" dicgroup="truefalseType" name="hvacCar"></truefalse-Dic>
331 </div> 324 </div>
332 </div> 325 </div>
333 326
334 <div class="form-group"> 327 <div class="form-group">
335 <label class="col-md-2 control-label">有无人售票:</label> 328 <label class="col-md-2 control-label">有无人售票:</label>
336 <div class="col-md-3"> 329 <div class="col-md-3">
337 - <label class="radio-inline">  
338 - <input type="radio" name="ticketType"  
339 - ng-value="true" ng-model="ctrl.busInfoForSave.ticketType"/>是  
340 - </label>  
341 - <label class="radio-inline">  
342 - <input type="radio" name="ticketType"  
343 - ng-value="false" ng-model="ctrl.busInfoForSave.ticketType"/>否  
344 - </label> 330 + <truefalse-Dic model="ctrl.busInfoForSave.ticketType" dicgroup="truefalseType" name="ticketType"></truefalse-Dic>
345 </div> 331 </div>
346 </div> 332 </div>
347 333
348 <div class="form-group"> 334 <div class="form-group">
349 <label class="col-md-2 control-label">是否有LED服务屏:</label> 335 <label class="col-md-2 control-label">是否有LED服务屏:</label>
350 <div class="col-md-3"> 336 <div class="col-md-3">
351 - <label class="radio-inline">  
352 - <input type="radio" name="ledScreen"  
353 - ng-value="true" ng-model="ctrl.busInfoForSave.ledScreen"/>是  
354 - </label>  
355 - <label class="radio-inline">  
356 - <input type="radio" name="ledScreen"  
357 - ng-value="false" ng-model="ctrl.busInfoForSave.ledScreen"/>否  
358 - </label> 337 + <truefalse-Dic model="ctrl.busInfoForSave.ledScreen" dicgroup="truefalseType" name="ledScreen"></truefalse-Dic>
359 </div> 338 </div>
360 </div> 339 </div>
361 340
362 <div class="form-group"> 341 <div class="form-group">
363 <label class="col-md-2 control-label">是否有TV视屏:</label> 342 <label class="col-md-2 control-label">是否有TV视屏:</label>
364 <div class="col-md-3"> 343 <div class="col-md-3">
365 - <label class="radio-inline">  
366 - <input type="radio" name="tvVideoType"  
367 - ng-value="true" ng-model="ctrl.busInfoForSave.tvVideoType"/>是  
368 - </label>  
369 - <label class="radio-inline">  
370 - <input type="radio" name="tvVideoType"  
371 - ng-value="false" ng-model="ctrl.busInfoForSave.tvVideoType"/>否  
372 - </label> 344 + <truefalse-Dic model="ctrl.busInfoForSave.tvVideoType" dicgroup="truefalseType" name="tvVideoType"></truefalse-Dic>
373 </div> 345 </div>
374 </div> 346 </div>
375 347
@@ -439,14 +411,7 @@ @@ -439,14 +411,7 @@
439 <div class="form-group"> 411 <div class="form-group">
440 <label class="col-md-2 control-label">是否电车:</label> 412 <label class="col-md-2 control-label">是否电车:</label>
441 <div class="col-md-3"> 413 <div class="col-md-3">
442 - <label class="radio-inline">  
443 - <input type="radio" name="sfdc"  
444 - ng-value="true" ng-model="ctrl.busInfoForSave.sfdc"/>是  
445 - </label>  
446 - <label class="radio-inline">  
447 - <input type="radio" name="sfdc"  
448 - ng-value="false" ng-model="ctrl.busInfoForSave.sfdc"/>否  
449 - </label> 414 + <truefalse-Dic model="ctrl.busInfoForSave.sfdc" dicgroup="truefalseType" name="sfdc"></truefalse-Dic>
450 </div> 415 </div>
451 </div> 416 </div>
452 417
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/form.html
@@ -45,7 +45,8 @@ @@ -45,7 +45,8 @@
45 <div class="col-md-3"> 45 <div class="col-md-3">
46 <input type="text" class="form-control" 46 <input type="text" class="form-control"
47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode" 47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode"
48 - required ng-maxlength="8" placeholder="请输入车辆内部编码"/> 48 + required ng-maxlength="8" remote-Validaton rvtype="zbh"
  49 + placeholder="请输入车辆内部编码"/>
49 </div> 50 </div>
50 <!-- 隐藏块,显示验证信息 --> 51 <!-- 隐藏块,显示验证信息 -->
51 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.required"> 52 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.required">
@@ -54,6 +55,9 @@ @@ -54,6 +55,9 @@
54 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength"> 55 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength">
55 内部编号长度不能超过8位 56 内部编号长度不能超过8位
56 </div> 57 </div>
  58 + <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote">
  59 + 内部编号不能重复
  60 + </div>
57 </div> 61 </div>
58 62
59 <div class="form-group has-success has-feedback"> 63 <div class="form-group has-success has-feedback">
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 <span ng-bind="info.brancheCompany"></span> 91 <span ng-bind="info.brancheCompany"></span>
92 </td> 92 </td>
93 <td> 93 <td>
94 - <span ng-bind="info.sfdc"></span> 94 + <span ng-bind="info.sfdc | dict:'truefalseType':'未知' "></span>
95 </td> 95 </td>
96 <td> 96 <td>
97 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> 97 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
src/main/resources/static/pages/scheduleApp/module/main.js
@@ -657,6 +657,10 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi @@ -657,6 +657,10 @@ ScheduleApp.config([&#39;$stateProvider&#39;, &#39;$urlRouterProvider&#39;, function($stateProvi
657 ; 657 ;
658 }]); 658 }]);
659 659
  660 +// 自定义的一些指令
  661 +
  662 +
  663 +
660 // 全局service放置在此处, 664 // 全局service放置在此处,
661 // 一般这种服务会被其他模块调用的,所以干脆放到main.js里 665 // 一般这种服务会被其他模块调用的,所以干脆放到main.js里
662 666
@@ -875,6 +879,88 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusLineInfoStatService_g&#39;, [&#39;$resource&#39;, @@ -875,6 +879,88 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusLineInfoStatService_g&#39;, [&#39;$resource&#39;,
875 }]); 879 }]);
876 880
877 881
  882 +//--------------------------- 通用filter和directive -----------------------------//
  883 +angular.module('ScheduleApp').filter("dict", [function() {
  884 + /**
  885 + * 字典过滤器,将后台的字典编码转换成文字说明。
  886 + * code,过滤的值,group,过滤的参数(字典group类型),dv没有匹配到的默认值
  887 + * 用例:sfdc | dict:'dctype'
  888 + */
  889 + return function(code, group, dv) {
  890 + if (code == null) {
  891 + return dv;
  892 + } else {
  893 + return dictionaryUtils.transformCode(group, code);
  894 + }
  895 + };
  896 +}]);
  897 +
  898 +angular.module('ScheduleApp').directive("truefalseDic", [function() {
  899 + /**
  900 + * true,false组合的单元按钮组的指令。
  901 + * 指令名称:truefalse-Dic
  902 + */
  903 + return {
  904 + restrict: 'E',
  905 + templateUrl: '/pages/scheduleApp/module/other/truefalseRadioGroupTemplate.html',
  906 + scope: {
  907 + model: "="
  908 + },
  909 + /**
  910 + * model 是绑定外部值。
  911 + * disabled 说明是否不能修改
  912 + * dicgroup 字典组的类型
  913 + */
  914 + link: function(scope, element, attr) {
  915 + if (attr["name"]) {
  916 + scope["nv"] = attr["name"];
  917 + }
  918 +
  919 + if (attr["disabled"]) {
  920 + element.find("input").attr("disabled", "");
  921 + }
  922 + if (attr["dicgroup"]) {
  923 + var obj = dictionaryUtils.getByGroup(attr['dicgroup']);
  924 + if (obj["true"])
  925 + scope["trueDesc"] = obj["true"];
  926 + else
  927 + scope["trueDesc"] = "未知true";
  928 +
  929 + if (obj["false"])
  930 + scope["falseDesc"] = obj["false"];
  931 + else
  932 + scope["falseDesc"] = "未知false";
  933 + } else {
  934 + scope["trueDesc"] = "未知true";
  935 + scope["falseDesc"] = "未知false";
  936 + }
  937 + }
  938 + };
  939 +}]);
  940 +
  941 +angular.module('ScheduleApp').directive("remoteValidaton", [function() {
  942 + /**
  943 + * 远端验证指令,依赖于ngModel
  944 + * 指令名称 remote-Validation
  945 + * 需要属性 rvtype 表示验证类型
  946 + */
  947 + return {
  948 + restrict: "A",
  949 + require: "ngModel",
  950 + link: function(scope, element, attr, ngModelCtrl) {
  951 + element.bind("keyup", function() {
  952 + if (attr["rvtype"]) {
  953 + // 根据rvtype的值,确定使用那个远端验证的url,
  954 + // 这个貌似没法通用,根据业务变换
  955 + console.log(attr['rvtype']);
  956 + } else {
  957 + // 没有rvtype,就不用远端验证了
  958 + ngModelCtrl.$setValidity('remote', true);
  959 + }
  960 + });
  961 + }
  962 + };
  963 +}]);
878 964
879 965
880 966
src/main/resources/static/pages/scheduleApp/module/other/truefalseRadioGroupTemplate.html 0 → 100644
  1 +<div>
  2 + <label class="radio-inline">
  3 + <input type="radio" name="{{nv}}"
  4 + ng-value="true" ng-model="model" {{disabled}}/>{{trueDesc}}
  5 + </label>
  6 + <label class="radio-inline">
  7 + <input type="radio" name="{{nv}}"
  8 + ng-value="false" ng-model="model" {{disabled}}/>{{falseDesc}}
  9 + </label>
  10 +</div>
0 \ No newline at end of file 11 \ No newline at end of file