Commit 9044b857af94badda2acf9dc58d45a9ffec2aac7

Authored by 廖磊
2 parents 16a877b3 f10a219b

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing 20 changed files with 158 additions and 25 deletions
src/main/java/com/bsth/entity/Line.java
1 1 package com.bsth.entity;
2 2  
3 3 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +import org.hibernate.annotations.Formula;
4 5 import org.springframework.format.annotation.DateTimeFormat;
5 6  
6 7 import javax.persistence.*;
... ... @@ -69,6 +70,10 @@ public class Line implements Serializable {
69 70 /** 分公司 varchar length(50)*/
70 71 private String brancheCompany;
71 72  
  73 + /** 组合公司分公司编码 */
  74 + @Formula(" concat(company, '_', branche_company) ")
  75 + private String cgsbm;
  76 +
72 77 /** 性质(线路类型) varchar length(50) */
73 78 private String nature;
74 79  
... ... @@ -457,4 +462,12 @@ public class Line implements Serializable {
457 462 public Integer getInUse() { return inUse; }
458 463  
459 464 public void setInUse(Integer inUse) { this.inUse = inUse; }
  465 +
  466 + public String getCgsbm() {
  467 + return cgsbm;
  468 + }
  469 +
  470 + public void setCgsbm(String cgsbm) {
  471 + this.cgsbm = cgsbm;
  472 + }
460 473 }
... ...
src/main/java/com/bsth/repository/schedule/CarConfigInfoRepository.java
... ... @@ -19,7 +19,9 @@ import org.springframework.stereotype.Repository;
19 19 @Repository
20 20 public interface CarConfigInfoRepository extends BaseRepository<CarConfigInfo, Long> {
21 21  
22   - @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH)
  22 +// @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH)
  23 + // 因为使用了in操作符,用 @EntityGraph会报错,升到hibernate 5.0.4就好了,暂时不用@EntityGraph
  24 + // Hibernate ORMHHH-9230
23 25 @Override
24 26 Page<CarConfigInfo> findAll(Specification<CarConfigInfo> spec, Pageable pageable);
25 27  
... ...
src/main/java/com/bsth/repository/schedule/EmployeeConfigInfoRepository.java
... ... @@ -27,7 +27,9 @@ public interface EmployeeConfigInfoRepository extends BaseRepository&lt;EmployeeCon
27 27 @EntityGraph(value = "employeeConfigInfo_jsy_spy_xl", type = EntityGraph.EntityGraphType.FETCH)
28 28 List<EmployeeConfigInfo> findByXlId(Integer xlid);
29 29  
30   - @EntityGraph(value = "employeeConfigInfo_jsy_spy_xl", type = EntityGraph.EntityGraphType.FETCH)
  30 +// @EntityGraph(value = "employeeConfigInfo_jsy_spy_xl", type = EntityGraph.EntityGraphType.FETCH)
  31 + // 因为使用了in操作符,用 @EntityGraph会报错,升到hibernate 5.0.4就好了,暂时不用@EntityGraph
  32 + // Hibernate ORMHHH-9230
31 33 @Override
32 34 Page<EmployeeConfigInfo> findAll(Specification<EmployeeConfigInfo> spec, Pageable pageable);
33 35  
... ...
src/main/java/com/bsth/repository/schedule/GuideboardInfoRepository.java
... ... @@ -21,7 +21,9 @@ import org.springframework.stereotype.Repository;
21 21 @Repository
22 22 public interface GuideboardInfoRepository extends BaseRepository<GuideboardInfo, Long> {
23 23  
24   - @EntityGraph(value = "guideboardInfo_xl", type = EntityGraph.EntityGraphType.FETCH)
  24 +// @EntityGraph(value = "guideboardInfo_xl", type = EntityGraph.EntityGraphType.FETCH)
  25 + // 因为使用了in操作符,用 @EntityGraph会报错,升到hibernate 5.0.4就好了,暂时不用@EntityGraph
  26 + // Hibernate ORMHHH-9230
25 27 @Override
26 28 Page<GuideboardInfo> findAll(Specification<GuideboardInfo> spec, Pageable pageable);
27 29  
... ...
src/main/java/com/bsth/repository/schedule/RerunRuleRepository.java
... ... @@ -15,7 +15,9 @@ import org.springframework.stereotype.Repository;
15 15 */
16 16 @Repository
17 17 public interface RerunRuleRepository extends BaseRepository<RerunRule, Long> {
18   - @EntityGraph(value = "dylp", type = EntityGraph.EntityGraphType.FETCH)
  18 +// @EntityGraph(value = "dylp", type = EntityGraph.EntityGraphType.FETCH)
  19 + // 因为使用了in操作符,用 @EntityGraph会报错,升到hibernate 5.0.4就好了,暂时不用@EntityGraph
  20 + // Hibernate ORMHHH-9230
19 21 @Override
20 22 Page<RerunRule> findAll(Specification<RerunRule> spec, Pageable pageable);
21 23  
... ...
src/main/java/com/bsth/repository/schedule/SchedulePlanRepository.java
... ... @@ -5,7 +5,6 @@ import com.bsth.repository.BaseRepository;
5 5 import org.springframework.data.domain.Page;
6 6 import org.springframework.data.domain.Pageable;
7 7 import org.springframework.data.jpa.domain.Specification;
8   -import org.springframework.data.jpa.repository.EntityGraph;
9 8 import org.springframework.stereotype.Repository;
10 9  
11 10 /**
... ... @@ -13,7 +12,9 @@ import org.springframework.stereotype.Repository;
13 12 */
14 13 @Repository
15 14 public interface SchedulePlanRepository extends BaseRepository<SchedulePlan, Long> {
16   - @EntityGraph(value = "schedulePlan_xl", type = EntityGraph.EntityGraphType.FETCH)
  15 +// @EntityGraph(value = "schedulePlan_xl", type = EntityGraph.EntityGraphType.FETCH)
  16 + // 因为使用了in操作符,用 @EntityGraph会报错,升到hibernate 5.0.4就好了,暂时不用@EntityGraph
  17 + // Hibernate ORMHHH-9230
17 18 @Override
18 19 Page<SchedulePlan> findAll(Specification<SchedulePlan> spec, Pageable pageable);
19 20  
... ...
src/main/java/com/bsth/repository/schedule/ScheduleRule1FlatRepository.java
... ... @@ -18,7 +18,9 @@ import java.util.List;
18 18 @Repository
19 19 public interface ScheduleRule1FlatRepository extends BaseRepository<ScheduleRule1Flat, Long> {
20 20  
21   - @EntityGraph(value = "scheduleRule1Flat_xl_carconfig", type = EntityGraph.EntityGraphType.FETCH)
  21 +// @EntityGraph(value = "scheduleRule1Flat_xl_carconfig", type = EntityGraph.EntityGraphType.FETCH)
  22 + // 因为使用了in操作符,用 @EntityGraph会报错,升到hibernate 5.0.4就好了,暂时不用@EntityGraph
  23 + // Hibernate ORMHHH-9230
22 24 @Override
23 25 Page<ScheduleRule1Flat> findAll(Specification<ScheduleRule1Flat> spec, Pageable pageable);
24 26  
... ...
src/main/java/com/bsth/repository/schedule/TTInfoRepository.java
... ... @@ -19,7 +19,9 @@ import java.util.List;
19 19 @Repository
20 20 public interface TTInfoRepository extends BaseRepository<TTInfo, Long> {
21 21  
22   - @EntityGraph(value = "ttInfo_xl", type = EntityGraph.EntityGraphType.FETCH)
  22 +// @EntityGraph(value = "ttInfo_xl", type = EntityGraph.EntityGraphType.FETCH)
  23 + // 因为使用了in操作符,用 @EntityGraph会报错,升到hibernate 5.0.4就好了,暂时不用@EntityGraph
  24 + // Hibernate ORMHHH-9230
23 25 @Override
24 26 Page<TTInfo> findAll(Specification<TTInfo> spec, Pageable pageable);
25 27  
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect5.js
... ... @@ -19,7 +19,8 @@
19 19 angular.module('ScheduleApp').directive('saSelect5', [
20 20 '$timeout',
21 21 '$$SearchInfoService_g',
22   - function($timeout, $$searchInfoService_g) {
  22 + 'UserPrincipal',
  23 + function($timeout, $$searchInfoService_g, UserPrincipal) {
23 24 return {
24 25 restrict: 'E',
25 26 templateUrl: '/pages/scheduleApp/module/common/dts1/select/saSelect5Template.html',
... ... @@ -281,6 +282,13 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
281 282 }
282 283 }
283 284  
  285 + // 添加线路查询用的公司分公司信息
  286 + if (atype == 'xl') {
  287 + if (UserPrincipal.getGsStrs().length > 0) {
  288 + ajaxparamobj["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  289 + }
  290 + }
  291 +
284 292 $$searchInfoService_g[atype].list(
285 293 ajaxparamobj,
286 294 function(result) {
... ...
src/main/resources/static/pages/scheduleApp/module/common/main.js
... ... @@ -9,6 +9,41 @@ var ScheduleApp = angular.module(&#39;ScheduleApp&#39;, [
9 9 'ngHandsontable'
10 10 ]);
11 11  
  12 +ScheduleApp.factory('UserPrincipal', [
  13 + '$http',
  14 + function($http) {
  15 + // 登录后获取用户公司信息
  16 +
  17 + var gsinfos = []; // 原始返回的对象数据
  18 + var gsinfo_strs = []; // 拼装以后的
  19 +
  20 + $http({
  21 + method: 'GET',
  22 + url: '/user/companyData'
  23 + }).then(function(result) {
  24 + if (angular.isArray(result.data)) {
  25 + gsinfos = result;
  26 + angular.forEach(result.data, function(obj) {
  27 + var gsbm = obj.companyCode;
  28 + angular.forEach(obj.children, function(obj2) {
  29 + var fgsbm = obj2.code;
  30 + gsinfo_strs.push(gsbm + "_" + fgsbm);
  31 + });
  32 + });
  33 +
  34 + }
  35 + console.log(gsinfos);
  36 + console.log(gsinfo_strs);
  37 + });
  38 +
  39 + return {
  40 + getGsStrs: function() {
  41 + return gsinfo_strs;
  42 + }
  43 + };
  44 + }
  45 +]);
  46 +
12 47 /**
13 48 * 用于请求通知。
14 49 */
... ... @@ -154,8 +189,15 @@ ScheduleApp.factory(&#39;settings&#39;, [&#39;$rootScope&#39;, function($rootScope) {
154 189 }]);
155 190  
156 191 /** Schedule App 主应用控制器 */
157   -ScheduleApp.controller('ScheduleAppController', ['$scope', function($scope) {
158   - $scope.$on('$viewContentLoaded', function(event) {
159   - console.log("子页面已载入:" + event);
160   - });
161   -}]);
162 192 \ No newline at end of file
  193 +ScheduleApp.controller('ScheduleAppController', [
  194 + '$scope',
  195 + 'UserPrincipal',
  196 + function($scope, UserPrincipal) {
  197 + $scope.$on('$viewContentLoaded', function(event) {
  198 + console.log("子页面已载入:" + event);
  199 + });
  200 +
  201 + // 获取一次用户身份信息
  202 + UserPrincipal.getGsStrs();
  203 + }
  204 +]);
163 205 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -1324,7 +1324,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect4&#39;, [
1324 1324 angular.module('ScheduleApp').directive('saSelect5', [
1325 1325 '$timeout',
1326 1326 '$$SearchInfoService_g',
1327   - function($timeout, $$searchInfoService_g) {
  1327 + 'UserPrincipal',
  1328 + function($timeout, $$searchInfoService_g, UserPrincipal) {
1328 1329 return {
1329 1330 restrict: 'E',
1330 1331 templateUrl: '/pages/scheduleApp/module/common/dts1/select/saSelect5Template.html',
... ... @@ -1586,6 +1587,13 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1586 1587 }
1587 1588 }
1588 1589  
  1590 + // 添加线路查询用的公司分公司信息
  1591 + if (atype == 'xl') {
  1592 + if (UserPrincipal.getGsStrs().length > 0) {
  1593 + ajaxparamobj["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  1594 + }
  1595 + }
  1596 +
1589 1597 $$searchInfoService_g[atype].list(
1590 1598 ajaxparamobj,
1591 1599 function(result) {
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -185,7 +185,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
185 185 );
186 186  
187 187 // 车辆配置service
188   -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  188 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', 'UserPrincipal', function($resource, UserPrincipal) {
189 189 return {
190 190 rest : $resource(
191 191 '/cci/:id',
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
... ... @@ -3,7 +3,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
3 3 'BusConfigService',
4 4 [
5 5 'BusConfigService_g',
6   - function(service) {
  6 + 'UserPrincipal',
  7 + function(service, UserPrincipal) {
7 8 /** 当前的查询条件信息 */
8 9 var currentSearchCondition = {'isCancel_eq': false};
9 10  
... ... @@ -29,6 +30,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
29 30 */
30 31 getSearchCondition: function() {
31 32 currentSearchCondition.page = currentPage.uiNumber - 1;
  33 +
  34 + // 加公司判定
  35 + if (UserPrincipal.getGsStrs().length > 0) {
  36 + currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  37 + }
  38 +
32 39 return currentSearchCondition;
33 40 },
34 41 /**
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/service.js
1 1 // 车辆配置service
2   -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  2 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', 'UserPrincipal', function($resource, UserPrincipal) {
3 3 return {
4 4 rest : $resource(
5 5 '/cci/:id',
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
... ... @@ -4,7 +4,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
4 4 'EmployeeConfigService',
5 5 [
6 6 'EmployeeConfigService_g',
7   - function(service) {
  7 + 'UserPrincipal',
  8 + function(service, UserPrincipal) {
8 9 /** 当前的查询条件信息 */
9 10 var currentSearchCondition = {'isCancel_eq': false};
10 11 // 当前查询返回的信息
... ... @@ -29,6 +30,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
29 30 */
30 31 getSearchCondition: function() {
31 32 currentSearchCondition.page = currentPage.uiNumber - 1;
  33 +
  34 + // 加公司判定
  35 + if (UserPrincipal.getGsStrs().length > 0) {
  36 + currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  37 + }
  38 +
32 39 return currentSearchCondition;
33 40 },
34 41 /**
... ...
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/module.js
... ... @@ -4,7 +4,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
4 4 'GuideboardManageService',
5 5 [
6 6 'GuideboardManageService_g',
7   - function(service) {
  7 + 'UserPrincipal',
  8 + function(service, UserPrincipal) {
8 9  
9 10 /** 当前的查询条件信息 */
10 11 var currentSearchCondition = {page: 0, 'isCancel_eq': false};
... ... @@ -31,6 +32,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
31 32 */
32 33 getSearchCondition: function() {
33 34 currentSearchCondition.page = currentPage.uiNumber - 1;
  35 +
  36 + // 加公司判定
  37 + if (UserPrincipal.getGsStrs().length > 0) {
  38 + currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  39 + }
  40 +
34 41 return currentSearchCondition;
35 42 },
36 43 /**
... ...
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/module.js
... ... @@ -3,7 +3,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
3 3 'RerunManageService',
4 4 [
5 5 'rerunManageService_g',
6   - function(service) {
  6 + 'UserPrincipal',
  7 + function(service, UserPrincipal) {
7 8 /** 当前的查询条件信息 */
8 9 var currentSearchCondition = {'isCancel_eq': false};
9 10  
... ... @@ -25,6 +26,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
25 26 },
26 27 getSearchCondition: function() {
27 28 currentSearchCondition.page = currentPage.uiNumber - 1;
  29 +
  30 + // 加公司判定
  31 + if (UserPrincipal.getGsStrs().length > 0) {
  32 + currentSearchCondition["rerunXl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  33 + }
  34 +
28 35 return currentSearchCondition;
29 36 },
30 37 getPage: function(page) {
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/module.js
1   -// 车辆配置管理 service controller 等写在一起
  1 +// 排班计划管理 service controller 等写在一起
2 2 angular.module('ScheduleApp').factory(
3 3 'SchedulePlanManageService',
4 4 [
5 5 'SchedulePlanManageService_g',
6   - function(service) {
  6 + 'UserPrincipal',
  7 + function(service, UserPrincipal) {
7 8 /** 当前的查询条件信息 */
8 9 var currentSearchCondition = {};
9 10  
... ... @@ -25,6 +26,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
25 26 },
26 27 getSearchCondition: function() {
27 28 currentSearchCondition.page = currentPage.uiNumber - 1;
  29 +
  30 + // 加公司判定
  31 + if (UserPrincipal.getGsStrs().length > 0) {
  32 + currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  33 + }
  34 +
28 35 return currentSearchCondition;
29 36 },
30 37 getPage: function(page) {
... ...
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/module.js
... ... @@ -3,7 +3,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
3 3 'ScheduleRuleManageService',
4 4 [
5 5 'ScheduleRuleManageService_g',
6   - function(service) {
  6 + 'UserPrincipal',
  7 + function(service, UserPrincipal) {
7 8 /** 当前的查询条件信息 */
8 9 var currentSearchCondition = {};
9 10  
... ... @@ -30,6 +31,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
30 31 */
31 32 getSearchCondition: function() {
32 33 currentSearchCondition.page = currentPage.uiNumber - 1;
  34 +
  35 + // 加公司判定
  36 + if (UserPrincipal.getGsStrs().length > 0) {
  37 + currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  38 + }
  39 +
33 40 return currentSearchCondition;
34 41 },
35 42 getPage: function(page) {
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/module.js
... ... @@ -4,7 +4,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
4 4 [
5 5 'TTInfoManageService_g',
6 6 'TimeTableDetailManageService_g',
7   - function(service, dservice) {
  7 + 'UserPrincipal',
  8 + function(service, dservice, UserPrincipal) {
8 9 // 当前查询的内容条件搜索对象
9 10 var currentSearchCondition = {page: 0, 'isCancel_eq': false};
10 11 // 当前查询返回的信息
... ... @@ -25,6 +26,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
25 26 },
26 27 getSearchCondition: function() {
27 28 currentSearchCondition.page = currentPage.uiNumber - 1;
  29 +
  30 + // 加公司判定
  31 + if (UserPrincipal.getGsStrs().length > 0) {
  32 + currentSearchCondition["xl.cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  33 + }
  34 +
28 35 return currentSearchCondition;
29 36 },
30 37 getPage: function(page) {
... ...