Commit 068487798423b6eb528c98e055a248def0a48773

Authored by 徐烜
1 parent f10a219b

Update

src/main/java/com/bsth/entity/Cars.java
... ... @@ -2,6 +2,7 @@ package com.bsth.entity;
2 2  
3 3 import com.bsth.entity.schedule.BEntity;
4 4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  5 +import org.hibernate.annotations.Formula;
5 6  
6 7 import javax.persistence.*;
7 8 import java.io.Serializable;
... ... @@ -47,6 +48,10 @@ public class Cars extends BEntity implements Serializable {
47 48 /** 分公司 */
48 49 private String brancheCompany;
49 50  
  51 + /** 组合公司分公司编码 */
  52 + @Formula(" concat(business_code, '_', branche_company_code) ")
  53 + private String cgsbm;
  54 +
50 55 /** 车辆编码(TODO:在原系统里没有,这里暂时留着) */
51 56 @Column(nullable = false)
52 57 private String carCode;
... ... @@ -499,4 +504,12 @@ public class Cars extends BEntity implements Serializable {
499 504 public void setXlmc(String xlmc) {
500 505 this.xlmc = xlmc;
501 506 }
  507 +
  508 + public String getCgsbm() {
  509 + return cgsbm;
  510 + }
  511 +
  512 + public void setCgsbm(String cgsbm) {
  513 + this.cgsbm = cgsbm;
  514 + }
502 515 }
... ...
src/main/java/com/bsth/entity/Personnel.java
... ... @@ -2,6 +2,7 @@ package com.bsth.entity;
2 2  
3 3 import com.bsth.entity.schedule.BEntity;
4 4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  5 +import org.hibernate.annotations.Formula;
5 6  
6 7 import javax.persistence.*;
7 8  
... ... @@ -39,6 +40,10 @@ public class Personnel extends BEntity {
39 40 private String brancheCompany;
40 41 /** 分公司编码 */
41 42 private String brancheCompanyCode;
  43 + /** 组合公司分公司编码 */
  44 + @Formula(" concat(company_code, '_', branche_company_code) ")
  45 + private String cgsbm;
  46 +
42 47 /** 工号 */
43 48 @Column(nullable = false)
44 49 private String jobCode;
... ... @@ -218,4 +223,12 @@ public class Personnel extends BEntity {
218 223 public void setDescriptions(String descriptions) {
219 224 this.descriptions = descriptions;
220 225 }
  226 +
  227 + public String getCgsbm() {
  228 + return cgsbm;
  229 + }
  230 +
  231 + public void setCgsbm(String cgsbm) {
  232 + this.cgsbm = cgsbm;
  233 + }
221 234 }
... ...
src/main/resources/application-dev.properties
... ... @@ -6,11 +6,11 @@ spring.jpa.hibernate.ddl-auto= update
6 6 spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
7 7 #DATABASE
8 8 spring.jpa.database= MYSQL
9   -spring.jpa.show-sql= false
  9 +spring.jpa.show-sql= true
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://localhost:3306/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  11 +spring.datasource.url= jdbc:mysql://127.0.0.1:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
13   -spring.datasource.password= root
  13 +spring.datasource.password=
14 14 #DATASOURCE
15 15 spring.datasource.max-active=100
16 16 spring.datasource.max-idle=8
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
... ... @@ -4,7 +4,8 @@ angular.module('ScheduleApp').factory(
4 4 'BusInfoManageService',
5 5 [
6 6 'BusInfoManageService_g',
7   - function(service) {
  7 + 'UserPrincipal',
  8 + function(service, UserPrincipal) {
8 9  
9 10 /** 当前的查询条件信息 */
10 11 var currentSearchCondition = {
... ... @@ -36,6 +37,11 @@ angular.module('ScheduleApp').factory(
36 37 */
37 38 getSearchCondition: function() {
38 39 currentSearchCondition.page = currentPage.uiNumber - 1;
  40 +
  41 + if (UserPrincipal.getGsStrs().length > 0) {
  42 + currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  43 + }
  44 +
39 45 return currentSearchCondition;
40 46 },
41 47 /**
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
... ... @@ -4,7 +4,8 @@ angular.module('ScheduleApp').factory(
4 4 'DeviceInfoManageService',
5 5 [
6 6 'DeviceInfoManageService_g',
7   - function(service) {
  7 + 'UserPrincipal',
  8 + function(service, UserPrincipal) {
8 9 /** 当前的查询条件信息 */
9 10 var currentSearchCondition = {'isCancel_eq': false};
10 11  
... ... @@ -26,6 +27,11 @@ angular.module('ScheduleApp').factory(
26 27 },
27 28 getSearchCondition: function() {
28 29 currentSearchCondition.page = currentPage.uiNumber - 1;
  30 +
  31 + if (UserPrincipal.getGsStrs().length > 0) {
  32 + currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  33 + }
  34 +
29 35 return currentSearchCondition;
30 36 },
31 37 getPage: function(page) {
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
... ... @@ -4,7 +4,8 @@ angular.module('ScheduleApp').factory(
4 4 'EmployeeInfoManageService',
5 5 [
6 6 'EmployeeInfoManageService_g',
7   - function(service) {
  7 + 'UserPrincipal',
  8 + function(service, UserPrincipal) {
8 9  
9 10 /** 当前的查询条件信息 */
10 11 var currentSearchCondition = {
... ... @@ -36,6 +37,11 @@ angular.module('ScheduleApp').factory(
36 37 */
37 38 getSearchCondition: function() {
38 39 currentSearchCondition.page = currentPage.uiNumber - 1;
  40 +
  41 + if (UserPrincipal.getGsStrs().length > 0) {
  42 + currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(",");
  43 + }
  44 +
39 45 return currentSearchCondition;
40 46 },
41 47 /**
... ...
src/main/resources/static/pages/scheduleApp/module/common/main.js
... ... @@ -15,7 +15,8 @@ ScheduleApp.factory('UserPrincipal', [
15 15 // 登录后获取用户公司信息
16 16  
17 17 var gsinfos = []; // 原始返回的对象数据
18   - var gsinfo_strs = []; // 拼装以后的
  18 + var gsinfo_strs = []; // 拼装以后的(公司代码_分公司代码)
  19 + var gsinfo_strs_u = []; // 拼装以后的(分公司代码_公司代码)
19 20  
20 21 $http({
21 22 method: 'GET',
... ... @@ -28,6 +29,7 @@ ScheduleApp.factory('UserPrincipal', [
28 29 angular.forEach(obj.children, function(obj2) {
29 30 var fgsbm = obj2.code;
30 31 gsinfo_strs.push(gsbm + "_" + fgsbm);
  32 + gsinfo_strs_u.push(fgsbm + "_" + gsbm);
31 33 });
32 34 });
33 35  
... ... @@ -39,6 +41,9 @@ ScheduleApp.factory('UserPrincipal', [
39 41 return {
40 42 getGsStrs: function() {
41 43 return gsinfo_strs;
  44 + },
  45 + getGsStrsU: function() {
  46 + return gsinfo_strs_u;
42 47 }
43 48 };
44 49 }
... ...