Commit 421823e77b6cb7fa98de438ac74aae41dad714eb
1 parent
d9ea8cf2
Update
Showing
7 changed files
with
90 additions
and
51 deletions
.gitignore
src/main/java/com/bsth/controller/PersonnelController.java
| ... | ... | @@ -36,6 +36,7 @@ public class PersonnelController extends BaseController<Personnel, Integer> { |
| 36 | 36 | |
| 37 | 37 | @RequestMapping(value = "/all_py", method = RequestMethod.GET) |
| 38 | 38 | public List<PersionPinYin> findAll_PY(){ |
| 39 | + persionPinYinBuffer.refresh(); | |
| 39 | 40 | return persionPinYinBuffer.getAll(); |
| 40 | 41 | } |
| 41 | 42 | ... | ... |
src/main/java/com/bsth/controller/schedule/BController.java
| ... | ... | @@ -213,6 +213,7 @@ public class BController<T, ID extends Serializable> { |
| 213 | 213 | rtn.put("status", ResponseCode.SUCCESS); |
| 214 | 214 | rtn.put("msg", "上传&导入文件成功"); |
| 215 | 215 | } catch (Exception exp) { |
| 216 | + exp.printStackTrace(); | |
| 216 | 217 | rtn.put("status", ResponseCode.ERROR); |
| 217 | 218 | rtn.put("msg", exp.getMessage()); |
| 218 | 219 | } | ... | ... |
src/main/java/com/bsth/service/schedule/utils/PoiUtils.java
| ... | ... | @@ -18,7 +18,7 @@ public class PoiUtils { |
| 18 | 18 | * @return |
| 19 | 19 | */ |
| 20 | 20 | public static String getStringValueFromCell(Cell cell) { |
| 21 | - SimpleDateFormat sFormat = new SimpleDateFormat("MM/dd/yyyy"); | |
| 21 | + SimpleDateFormat sFormat = new SimpleDateFormat("yyyy-MM-dd"); | |
| 22 | 22 | DecimalFormat decimalFormat = new DecimalFormat("#.#"); |
| 23 | 23 | String cellValue = ""; |
| 24 | 24 | if(cell == null) { | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
| ... | ... | @@ -229,7 +229,8 @@ angular.module('ScheduleApp').controller( |
| 229 | 229 | 'BusInfoManageService', |
| 230 | 230 | '$stateParams', |
| 231 | 231 | '$state', |
| 232 | - function(service, $stateParams, $state) { | |
| 232 | + 'DataStore', | |
| 233 | + function(service, $stateParams, $state, DataStore) { | |
| 233 | 234 | var self = this; |
| 234 | 235 | var Cars = service.getQueryClass(); |
| 235 | 236 | |
| ... | ... | @@ -264,6 +265,7 @@ angular.module('ScheduleApp').controller( |
| 264 | 265 | console.log(self.busInfoForSave); |
| 265 | 266 | // 保存或者更新 |
| 266 | 267 | self.busInfoForSave.$save(function() { |
| 268 | + DataStore.refreshData("cl"); | |
| 267 | 269 | $state.go("busInfoManage"); |
| 268 | 270 | }); |
| 269 | 271 | }; | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
| ... | ... | @@ -245,7 +245,8 @@ angular.module('ScheduleApp').controller( |
| 245 | 245 | 'EmployeeInfoManageService', |
| 246 | 246 | '$stateParams', |
| 247 | 247 | '$state', |
| 248 | - function(service, $stateParams, $state) { | |
| 248 | + 'DataStore', | |
| 249 | + function(service, $stateParams, $state, DataStore) { | |
| 249 | 250 | var self = this; |
| 250 | 251 | var Employee = service.getQueryClass(); |
| 251 | 252 | |
| ... | ... | @@ -271,6 +272,7 @@ angular.module('ScheduleApp').controller( |
| 271 | 272 | |
| 272 | 273 | // 保存或更新 |
| 273 | 274 | self.employeeInfoForSave.$save(function() { |
| 275 | + DataStore.refreshData("ry"); | |
| 274 | 276 | $state.go("employeeInfoManage"); |
| 275 | 277 | }); |
| 276 | 278 | }; | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/main.js
| ... | ... | @@ -53,64 +53,89 @@ ScheduleApp.factory('UserPrincipal', [ |
| 53 | 53 | |
| 54 | 54 | ScheduleApp.factory('DataStore', [ |
| 55 | 55 | '$http', |
| 56 | - function($http) { | |
| 56 | + '$q', | |
| 57 | + function($http, $q) { | |
| 57 | 58 | // 本地数据存储,如车辆数据,人员数据 |
| 58 | 59 | var dataMap = { |
| 59 | 60 | "cl": [], |
| 60 | 61 | "ry": [] |
| 61 | 62 | }; |
| 62 | 63 | |
| 63 | - $http({ | |
| 64 | - method: 'GET', | |
| 65 | - url: '/cars_sc/all' | |
| 66 | - }).then(function(result) { | |
| 67 | - // 简拼数据 | |
| 68 | - dataMap.cl = result.data.data; | |
| 69 | - angular.forEach(result.data.data, function(obj) { | |
| 70 | - //// 全拼 | |
| 71 | - //obj["$fullChars"] = pinyin.getFullChars(obj.insideCode ? obj.insideCode: ""); | |
| 72 | - //// 简拼 | |
| 73 | - //obj["$camelChars"] = pinyin.getCamelChars(obj.insideCode ? obj.insideCode: ""); | |
| 74 | - // 全拼 | |
| 75 | - obj["$fullChars"] = obj.insideCode? obj.insideCode: ""; | |
| 76 | - // 简拼 | |
| 77 | - obj["$camelChars"] = obj.insideCode? obj.insideCode: ""; | |
| 78 | - // 原值 | |
| 79 | - obj["$calcu_str"] = obj.insideCode? obj.insideCode: ""; | |
| 64 | + var dataPromise_cars = function() { | |
| 65 | + var deferred = $q.defer(); | |
| 66 | + $http({ | |
| 67 | + method: 'GET', | |
| 68 | + url: '/cars_sc/all' | |
| 69 | + }).then(function(result) { | |
| 70 | + // 简拼数据 | |
| 71 | + var dd = result.data.data; | |
| 72 | + angular.forEach(result.data.data, function(obj) { | |
| 73 | + //// 全拼 | |
| 74 | + //obj["$fullChars"] = pinyin.getFullChars(obj.insideCode ? obj.insideCode: ""); | |
| 75 | + //// 简拼 | |
| 76 | + //obj["$camelChars"] = pinyin.getCamelChars(obj.insideCode ? obj.insideCode: ""); | |
| 77 | + // 全拼 | |
| 78 | + obj["$fullChars"] = obj.insideCode? obj.insideCode: ""; | |
| 79 | + // 简拼 | |
| 80 | + obj["$camelChars"] = obj.insideCode? obj.insideCode: ""; | |
| 81 | + // 原值 | |
| 82 | + obj["$calcu_str"] = obj.insideCode? obj.insideCode: ""; | |
| 83 | + }); | |
| 84 | + deferred.resolve(dd); | |
| 80 | 85 | }); |
| 81 | - }); | |
| 86 | + return deferred.promise; | |
| 87 | + }; | |
| 82 | 88 | |
| 83 | - //$http({ | |
| 84 | - // method: 'GET', | |
| 85 | - // url: '/ee/all' | |
| 86 | - //}).then(function(result) { | |
| 87 | - // // 简拼数据 | |
| 88 | - // dataMap.ry = result.data.data; | |
| 89 | - // angular.forEach(result.data.data, function(obj) { | |
| 90 | - // // 全拼 | |
| 91 | - // obj["$fullChars"] = pinyin.getFullChars(obj.personnelName + "-" + obj.jobCode); | |
| 92 | - // // 简拼 | |
| 93 | - // obj["$camelChars"] = pinyin.getCamelChars(obj.personnelName + "-" + obj.jobCode); | |
| 94 | - // // 原值 | |
| 95 | - // obj["$calcu_str"] = obj.personnelName + "-" + obj.jobCode; | |
| 96 | - // }); | |
| 97 | - //}); | |
| 89 | + var dataPromise_ees = function() { | |
| 90 | + var deferred = $q.defer(); | |
| 98 | 91 | |
| 99 | - $http({ | |
| 100 | - method: 'GET', | |
| 101 | - url: '/personnel/all_py' | |
| 102 | - }).then(function(result) { | |
| 103 | - // 简拼数据 | |
| 104 | - dataMap.ry = result.data; | |
| 105 | - angular.forEach(result.data, function(obj) { | |
| 106 | - // 全拼 | |
| 107 | - obj["$fullChars"] = obj.fullChars; | |
| 108 | - // 简拼 | |
| 109 | - obj["$camelChars"] = obj.camelChars; | |
| 110 | - // 原值 | |
| 111 | - obj["$calcu_str"] = obj.name + "-" + obj.workId; | |
| 92 | + $http({ | |
| 93 | + method: 'POST', | |
| 94 | + url: '/basic/refresh_person_data' | |
| 95 | + }).then(function() { | |
| 96 | + $http({ | |
| 97 | + method: 'GET', | |
| 98 | + url: '/personnel/all_py' | |
| 99 | + }).then(function(result) { | |
| 100 | + // 简拼数据 | |
| 101 | + var dd = result.data; | |
| 102 | + angular.forEach(result.data, function(obj) { | |
| 103 | + // 全拼 | |
| 104 | + obj["$fullChars"] = obj.fullChars; | |
| 105 | + // 简拼 | |
| 106 | + obj["$camelChars"] = obj.camelChars; | |
| 107 | + // 原值 | |
| 108 | + obj["$calcu_str"] = obj.name + "-" + obj.workId; | |
| 109 | + }); | |
| 110 | + deferred.resolve(dd); | |
| 111 | + }); | |
| 112 | 112 | }); |
| 113 | - }); | |
| 113 | + return deferred.promise; | |
| 114 | + }; | |
| 115 | + | |
| 116 | + var refreshCars = function() { | |
| 117 | + dataPromise_cars().then(function(res) { | |
| 118 | + console.log("refreshCars"); | |
| 119 | + dataMap.cl = []; | |
| 120 | + angular.forEach(res, function(obj) { | |
| 121 | + dataMap.cl.push(obj); | |
| 122 | + }); | |
| 123 | + }); | |
| 124 | + }; | |
| 125 | + | |
| 126 | + var refreshEes = function() { | |
| 127 | + dataPromise_ees().then(function(res) { | |
| 128 | + console.log("refreshEes"); | |
| 129 | + dataMap.ry = []; | |
| 130 | + angular.forEach(res, function(obj) { | |
| 131 | + dataMap.ry.push(obj); | |
| 132 | + }); | |
| 133 | + }); | |
| 134 | + }; | |
| 135 | + | |
| 136 | + // 初始化 | |
| 137 | + refreshCars(); | |
| 138 | + refreshEes(); | |
| 114 | 139 | |
| 115 | 140 | return { |
| 116 | 141 | getData: function(type) { |
| ... | ... | @@ -119,6 +144,13 @@ ScheduleApp.factory('DataStore', [ |
| 119 | 144 | } else { |
| 120 | 145 | return []; |
| 121 | 146 | } |
| 147 | + }, | |
| 148 | + refreshData: function(type) { | |
| 149 | + if (type == 'cl') { | |
| 150 | + refreshCars(); | |
| 151 | + } else if (type == 'ry') { | |
| 152 | + refreshEes(); | |
| 153 | + } | |
| 122 | 154 | } |
| 123 | 155 | } |
| 124 | 156 | ... | ... |