Przeglądaj źródła

库存超限报警、库存空仓报警、存储超限报警

fanxw 2 lat temu
rodzic
commit
6e7d9d1925

+ 7 - 26
src/main/resources/static/app/storage/controller/numberManage/emptyPoliceCtrl.js

@@ -1,18 +1,18 @@
1 1
 "use strict";
2 2
 
3 3
 angular.module('app.business')
4
-    .controller("emptyPoliceCtrl", function($scope, $rootScope, $http, $state, $filter, StorehouseService, warehouseService) {
4
+    .controller("emptyPoliceCtrl", function($scope, $rootScope, $http, $state, $filter, sptService) {
5 5
         // 获取列表数据
6 6
         $scope.pageInfo = {pageNum : 1, pageSize : 10};
7
-        $scope.ware = {storehouseId:null, warehouseId:null};
7
+        $scope.serach = {cfmc:null, cfzt:null};
8 8
         $scope.loadDataSelect = function() {
9
-            var orgId = $rootScope.userInfo.orgId;//当前登录者的库id
10
-            warehouseService.getPageInfoWareAndTank($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $scope.ware).then(function(data){
11
-                $scope.pageInfo = data;
9
+        	var kqbm = $rootScope.orgInfo.kqbm;
10
+        	sptService.getkckcbjPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, kqbm, $scope.serach.cfmc, $scope.serach.cfzt).then(function(data){
11
+                $scope.pageInfo = data.data;
12 12
             },function(data){
13 13
                 console.log(data);
14 14
             });
15
-        };
15
+        }
16 16
 
17 17
         // 翻页
18 18
         $scope.goPage = function(pageNum) {
@@ -20,26 +20,7 @@ angular.module('app.business')
20 20
                 $scope.pageInfo.pageNum = pageNum;
21 21
                 $scope.loadDataSelect();
22 22
             }
23
-        };
24
-
25
-        // 货位列表
26
-        $scope.loadWare = function() {
27
-            warehouseService.getStorehouse($rootScope.orgInfo.orgId, $scope.ware.storehouseId).then(function(data){
28
-                $scope.warelist = data.wareList;
29
-            },function(data){
30
-                console.log(data);
31
-            });
32
-        };
33
-
34
-        // 仓房列表
35
-        $scope.loadStore = function() {
36
-            $scope.getBasicData();
37
-            StorehouseService.getStorehouseList($rootScope.orgInfo.orgId).then(function(data){
38
-                $scope.storelist = data.houseList;
39
-            },function(data){
40
-                console.log(data);
41
-            });
42
-        };
23
+        }
43 24
 
44 25
         $scope.loadDataSelect();
45 26
     });

+ 19 - 12
src/main/resources/static/app/storage/views/numberManage/emptyPolice-list.html

@@ -16,16 +16,13 @@
16 16
                                     <div class="col-xs-3 col-sm-10">
17 17
                                         <div class="form-group">
18 18
                                             <label> 仓房名称:&emsp;
19
-                                                <select ng-model="ware.storehouseId" class="form-control input-sm"
20
-                                                        ng-options="store.storehouseId as store.storehouseName for store in store_tank_list"
21
-                                                        ng-change="loadWare()">
22
-                                                    <option value="">请选择</option>
23
-                                                </select>&emsp;
19
+                                                <input ng-model="serach.cfmc" class="form-control" />&emsp;
24 20
                                             </label>
25
-                                            <label> 货位名称:&emsp;
26
-                                                <select ng-model="ware.warehouseId" class="form-control input-sm"
27
-                                                        ng-options="ware.warehouseId as ware.warehouseName for ware in warelist">
28
-                                                    <option value="">请选择</option>
21
+                                            <label> 仓房状态:&emsp;
22
+                                                <select ng-model="serach.cfzt" class="form-control input-sm">
23
+                                                    <option value="">-请选择-</option>
24
+                                                    <option value="1">空仓</option>
25
+                                                    <option value="2">半仓</option>
29 26
                                                 </select>&emsp;
30 27
                                             </label>
31 28
                                             <a class="btn btn-default btn-sm" ng-click="loadDataSelect()"><i class="fa fa-search"></i>&nbsp;查&nbsp;询</a>
@@ -46,15 +43,25 @@
46 43
                                     <tr>
47 44
                                         <th data-hide="phone">序号</th>
48 45
                                         <th data-class="expand">仓房名称</th>
49
-                                        <th data-class="expand">货位名称</th>
46
+                                        <th data-class="expand">粮食性质</th>
47
+                                        <th data-class="expand">库存数量(吨)</th>
48
+                                        <th data-class="expand">仓温</th>
49
+                                        <th data-class="expand">平均粮温</th>
50
+                                        <th data-class="expand">疑似半仓/空仓</th>
51
+                                        <th data-class="expand">报警日期</th>
50 52
                                     </tr>
51 53
                                     </thead>
52 54
 
53 55
                                     <tbody>
54 56
                                     <tr ng-repeat="empty in pageInfo.list">
55 57
                                         <th align="center">{{$index + 1 + (pageInfo.pageNum-1) * pageInfo.pageSize}}</th>
56
-                                        <td>{{storehouseObj[empty.cfid].storehouseName}}</td>
57
-                                        <td>{{empty.hwmc}}</td>
58
+                                        <td>{{empty.cfmc}}</td>
59
+                                        <td>{{empty.lyxz}}</td>
60
+                                        <td>{{empty.kcsl | number : 3}}</td>
61
+                                        <td>{{empty.cw}}</td>
62
+                                        <td>{{empty.pjlw}}</td>
63
+                                        <td>{{empty.cfzt == 1 ? '空仓' : '半仓'}}</td>
64
+                                        <td>{{empty.bjsj}}</td>
58 65
                                     </tr>
59 66
                                     </tbody>
60 67
                                 </table>

+ 3 - 2
src/main/resources/static/app/supervise/controller/stockWarningThresholdCtrl.js

@@ -1,12 +1,13 @@
1 1
 "use strict";
2 2
 
3 3
 angular.module('app.supervise')
4
-	.controller("stockWarningThresholdCtrl", function ($scope, $rootScope, $state, overRunAlarmService, APP_CONFIG, alertService) {
4
+	.controller("stockWarningThresholdCtrl", function ($scope, $rootScope, $state, overRunAlarmService, APP_CONFIG, sptService) {
5 5
 		// 默认分页
6 6
 		$scope.pageInfo = {pageNum: 1, pageSize: 10};
7 7
 		// 加载列表
8 8
 		$scope.loadData = function () {
9
-			overRunAlarmService.getKcPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $rootScope.orgInfo.orgId).then(function (data) {
9
+			var kqbm = $rootScope.orgInfo.kqbm;
10
+			sptService.getkccxbjPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, kqbm, $scope.cfmc).then(function (data) {
10 11
 				$scope.pageInfo = data.data;
11 12
 			}, function (data) {
12 13
 				// console.log(data);

+ 4 - 9
src/main/resources/static/app/supervise/controller/storeWarningThresholdCtrl.js

@@ -1,19 +1,14 @@
1 1
 "use strict";
2 2
 
3 3
 angular.module('app.supervise')
4
-	.controller("storeWarningThresholdCtrl", function ($scope, $rootScope, $state, overDueAlarmService) {
4
+	.controller("storeWarningThresholdCtrl", function ($scope, $rootScope, $state, sptService) {
5 5
 		// 默认分页
6 6
 		$scope.pageInfo = {pageNum: 1, pageSize: 10};
7
+		$scope.serach = {cfmc:null, pzbm:null};
7 8
 		// 加载列表
8 9
 		$scope.loadData = function () {
9
-			overDueAlarmService.getCcPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $rootScope.orgInfo.orgId).then(function (data) {
10
-				data.data.list.forEach(function (e){
11
-					let fcTime = new Date(e.fcTime)
12
-					let cznxTime = new Date(e.fcTime)
13
-					cznxTime.setFullYear(fcTime.getFullYear() + e.limitYear)
14
-					e.cznx = cznxTime
15
-				});
16
-
10
+			var kqbm = $rootScope.orgInfo.kqbm;
11
+			sptService.getCccxbjPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, kqbm, $scope.serach).then(function (data) {
17 12
 				$scope.pageInfo = data.data;
18 13
 			}, function (data) {
19 14
 				// console.log(data);

+ 74 - 0
src/main/resources/static/app/supervise/service/sptService.js

@@ -204,4 +204,78 @@ angular.module('app.supervise').service("sptService", function($http, $q, APP_CO
204 204
         });
205 205
         return d.promise;
206 206
     }
207
+
208
+    /**
209
+     * 库存超限报警
210
+     */
211
+    this.getkccxbjPageInfo = function(pageNum, pageSize, kqbm, cfmc) {
212
+        var d = $q.defer();
213
+        $http({
214
+            method : 'GET',
215
+            url : APP_CONFIG.depotStorageUrl + '/spt/getkccxbjList',
216
+            params : {
217
+                pageNum : pageNum,
218
+                pageSize : pageSize,
219
+                kqbm : kqbm, 
220
+                cfmc : cfmc
221
+            }
222
+        }).then(function successCallback(response) {
223
+            // 请求成功执行代码
224
+            d.resolve(response.data);
225
+        }, function errorCallback(response) {
226
+            // 请求失败执行代码
227
+            d.reject("error");
228
+        });
229
+        return d.promise;
230
+    }
231
+
232
+    /**
233
+     * 库存空仓报警
234
+     */
235
+    this.getkckcbjPageInfo = function(pageNum, pageSize, kqbm, cfmc, cfzt) {
236
+        var d = $q.defer();
237
+        $http({
238
+            method : 'GET',
239
+            url : APP_CONFIG.depotStorageUrl + '/spt/getkckcbjList',
240
+            params : {
241
+                pageNum : pageNum,
242
+                pageSize : pageSize,
243
+                kqbm : kqbm, 
244
+                cfmc : cfmc,
245
+                cfzt : cfzt
246
+            }
247
+        }).then(function successCallback(response) {
248
+            // 请求成功执行代码
249
+            d.resolve(response.data);
250
+        }, function errorCallback(response) {
251
+            // 请求失败执行代码
252
+            d.reject("error");
253
+        });
254
+        return d.promise;
255
+    }
256
+
257
+    /**
258
+     * 存储超限报警
259
+     */
260
+    this.getCccxbjPageInfo = function(pageNum, pageSize, kqbm, search) {
261
+        var d = $q.defer();
262
+        $http({
263
+            method : 'GET',
264
+            url : APP_CONFIG.depotStorageUrl + '/spt/getCccxbjList',
265
+            params : {
266
+                pageNum : pageNum,
267
+                pageSize : pageSize,
268
+                kqbm : kqbm, 
269
+                cfmc : search.cfmc,
270
+                pzbm : search.pzbm
271
+            }
272
+        }).then(function successCallback(response) {
273
+            // 请求成功执行代码
274
+            d.resolve(response.data);
275
+        }, function errorCallback(response) {
276
+            // 请求失败执行代码
277
+            d.reject("error");
278
+        });
279
+        return d.promise;
280
+    }
207 281
 });

+ 17 - 12
src/main/resources/static/app/supervise/views/stockWarningThreshold.html

@@ -14,7 +14,12 @@
14 14
 							<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
15 15
 								<div class="dt-toolbar">
16 16
 									<div class="col-xs-12 col-sm-10">
17
-										
17
+										<label>仓房名称:
18
+                                            <input class="form-control" type="text" ng-model="cfmc" name="cfmc" />
19
+                                        </label>
20
+                                        <a class="btn btn-default btn-sm" ng-click="loadData()">
21
+                                            <i class="fa fa-search"></i>&nbsp;查&nbsp;询
22
+                                        </a>
18 23
 									</div>
19 24
 									<div class="col-sm-2 col-xs-2 hidden-xs">
20 25
 										<div class="dataTables_length">
@@ -31,10 +36,10 @@
31 36
 												<th data-class="expand" style="text-align:center;">序号</th>
32 37
 												<th data-class="expand" style="text-align:center;">仓房名称</th>
33 38
 												<th data-class="expand" style="text-align:center;">粮油性质</th>
34
-												<th data-class="expand" style="text-align:center;">粮油名称</th>
35
-<!-- 												<th data-class="expand" style="text-align:center;">等级</th> -->
36
-												<th data-class="expand" style="text-align:center;">设计仓容(公斤)</th>
37
-												<th data-class="expand" style="text-align:center;">库存数量(公斤)</th>
39
+												<th data-class="expand" style="text-align:center;">品种明细</th>
40
+												<th data-class="expand" style="text-align:center;">生产年份</th>
41
+												<th data-class="expand" style="text-align:center;">核定仓容/罐容(吨)</th>
42
+												<th data-class="expand" style="text-align:center;">库存数量()</th>
38 43
 												<th data-class="expand" style="text-align:center;">报警时间</th>
39 44
 											</tr>
40 45
 										</thead>
@@ -42,13 +47,13 @@
42 47
 										<tbody>
43 48
 											<tr ng-repeat="warning in pageInfo.list">
44 49
 												<td style="text-align:center;">{{ $index + 1 }}</td>
45
-												<td style="text-align:center;">{{ warning.storeHouseName }}</td>
46
-												<td style="text-align:center;">{{ warning.grainOilQuality }}</td>
47
-												<td style="text-align:center;">{{ warning.grainOilName }}</td>
48
-<!-- 												<td style="text-align:center;">{{ warning.level }}</td> -->
49
-												<td style="text-align:center;">{{ warning.designCapacity | number : 2 }}</td>
50
-												<td style="text-align:center;">{{ warning.inventoryQuantity  | number : 2 }}</td>
51
-												<td style="text-align:center;">{{ warning.alarmTime }}</td>
50
+												<td style="text-align:center;">{{ warning.cfmc }}</td>
51
+												<td style="text-align:center;">{{ warning.lyxz }}</td>
52
+												<td style="text-align:center;">{{ warning.pzmx }}</td>
53
+												<td style="text-align:center;">{{ warning.scnf }}</td>
54
+												<td style="text-align:center;">{{ warning.hdcr | number : 3 }}</td>
55
+												<td style="text-align:center;">{{ warning.kcsl  | number : 3 }}</td>
56
+												<td style="text-align:center;">{{ warning.bjsj }}</td>
52 57
 											</tr>
53 58
 										</tbody>
54 59
 									</table>

+ 23 - 16
src/main/resources/static/app/supervise/views/storeWarningThreshold.html

@@ -14,7 +14,16 @@
14 14
 							<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
15 15
 								<div class="dt-toolbar">
16 16
 									<div class="col-xs-12 col-sm-10">
17
-										
17
+										<label> 仓房名称:&emsp;
18
+                                                <input ng-model="serach.cfmc" class="form-control" />&emsp;
19
+                                            </label>
20
+                                            <label> 品种明细:&emsp;
21
+                                                <select ng-model="serach.pzbm" class="form-control input-sm" 
22
+                                                ng-options="enum.gbcode as enum.enumname for enum in dicDataList[1061]">
23
+                                                    <option value="">-请选择-</option>
24
+                                                </select>&emsp;
25
+                                            </label>
26
+                                            <a class="btn btn-default btn-sm" ng-click="loadData()"><i class="fa fa-search"></i>&nbsp;查&nbsp;询</a>
18 27
 									</div>
19 28
 									<div class="col-sm-2 col-xs-2 hidden-xs">
20 29
 										<div class="dataTables_length">
@@ -31,28 +40,26 @@
31 40
 												<th data-class="expand" style="text-align:center;">序号</th>
32 41
 												<th data-class="expand" style="text-align:center;">仓房名称</th>
33 42
 												<th data-class="expand" style="text-align:center;">粮油性质</th>
34
-												<th data-class="expand" style="text-align:center;">粮油名称</th>
35
-												<th data-class="expand" style="text-align:center;">等级</th>
36
-												<th data-class="expand" style="text-align:center;">库存数量(公斤)</th>
37
-												<th data-class="expand" style="text-align:center;">封仓时间</th>
38
-												<th data-class="expand" style="text-align:center;">储备年限(年)</th>
43
+												<th data-class="expand" style="text-align:center;">粮油品种</th>
44
+												<th data-class="expand" style="text-align:center;">库存数量(吨)</th>
45
+												<th data-class="expand" style="text-align:center;">生产年份</th>
46
+												<th data-class="expand" style="text-align:center;">储备年限</th>
39 47
 												<th data-class="expand" style="text-align:center;">储存超限时间</th>
48
+												<th data-class="expand" style="text-align:center;">报警日期</th>
40 49
 											</tr>
41 50
 										</thead>
42 51
 
43 52
 										<tbody>
44 53
 											<tr ng-repeat="warning in pageInfo.list">
45 54
 												<td style="text-align:center;">{{ $index + 1 }}</td>
46
-												<td style="text-align:center;">{{ warning.storeHouseName }}</td>
47
-												<td style="text-align:center;">{{ warning.grainOilQuality }}</td>
48
-												<td style="text-align:center;">{{ warning.grainOilName }}</td>
49
-												<td style="text-align:center;">{{ warning.level }}</td>
50
-												<td style="text-align:center;">{{ warning.inventoryQuantity }}</td>
51
-												<td style="text-align:center;">
52
-													{{ warning.fcTime.split(' ')[0] }}
53
-												</td>
54
-												<td style="text-align:center;">{{ warning.limitYear }}</td>
55
-												<td style="text-align:center;">{{ warning.cznx | date:'yyyy-MM-dd' }}</td>
55
+												<td style="text-align:center;">{{ warning.cfmc }}</td>
56
+												<td style="text-align:center;">{{ warning.lyxz }}</td>
57
+												<td style="text-align:center;">{{ warning.pzmc }}</td>
58
+												<td style="text-align:center;">{{ warning.kcsl | number : 3 }}</td>
59
+												<td style="text-align:center;">{{ warning.scnf }}</td>
60
+												<td style="text-align:center;">{{ warning.cbnx }}</td>
61
+												<td style="text-align:center;">{{ warning.cccxsj }}</td>
62
+												<td style="text-align:center;">{{ warning.bjsj }}</td>
56 63
 											</tr>
57 64
 										</tbody>
58 65
 									</table>