Quellcode durchsuchen

fix: 修复库存bug && 储存超限报警

maopixin vor 2 Jahren
Ursprung
Commit
ae0d1f632a

+ 5 - 0
src/main/resources/static/app/supervise/controller/stockWarningThresholdCtrl.js

@@ -13,4 +13,9 @@ angular.module('app.supervise')
13 13
 			});
14 14
 		};
15 15
 		$scope.loadData();
16
+
17
+		$scope.goPage = function(pageNum) {
18
+			$scope.pageInfo.pageNum = pageNum
19
+			$scope.loadData();
20
+		}
16 21
 	})

+ 28 - 0
src/main/resources/static/app/supervise/controller/storeWarningThresholdCtrl.js

@@ -0,0 +1,28 @@
1
+"use strict";
2
+
3
+angular.module('app.supervise')
4
+	.controller("storeWarningThresholdCtrl", function ($scope, $rootScope, $state, overDueAlarmService) {
5
+		// 默认分页
6
+		$scope.pageInfo = {pageNum: 1, pageSize: 10};
7
+		// 加载列表
8
+		$scope.loadData = function () {
9
+			overDueAlarmService.getCcPageInfo($scope.pageInfo.pageNum, $scope.pageInfo.pageSize, $rootScope.orgInfo.orgId).then(function (data) {
10
+				data.data.list.forEach(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
+
17
+				$scope.pageInfo = data.data;
18
+			}, function (data) {
19
+				// console.log(data);
20
+			});
21
+		};
22
+		$scope.loadData();
23
+
24
+		$scope.goPage = function(pageNum) {
25
+			$scope.pageInfo.pageNum = pageNum
26
+			$scope.loadData();
27
+		}
28
+	})

+ 96 - 0
src/main/resources/static/app/supervise/module.js

@@ -251,6 +251,102 @@ angular.module('app.supervise', ['ui.router','app.basic','app.business','app.ala
251 251
                     }
252 252
                 }
253 253
             )
254
+			// 湿度报警
255
+            .state('app.supervise.situation.humidity', {
256
+				url: '/supervise/situation/humidity/:isShow/:houseId',
257
+				data: {
258
+					title: '湿度报警'
259
+				},
260
+				params:{
261
+					showType : "WD"
262
+				},
263
+				views: {
264
+					"content@app": {
265
+						controller: 'humidityWarningThresholdCtrl',
266
+						templateUrl: 'app/supervise/views/humidityWarningThreshold.html'
267
+					}
268
+				}
269
+			})
270
+			// 库存超限报警
271
+            .state('app.supervise.situation.stock', {
272
+				url: '/supervise/situation/stock/:isShow/:houseId',
273
+				data: {
274
+					title: '库存超限报警'
275
+				},
276
+				params:{
277
+					showType : "WD"
278
+				},
279
+				views: {
280
+					"content@app": {
281
+						controller: 'stockWarningThresholdCtrl',
282
+						templateUrl: 'app/supervise/views/stockWarningThreshold.html'
283
+					}
284
+				}
285
+			})
286
+			// 储存超限报警
287
+            .state('app.supervise.situation.store', {
288
+				url: '/supervise/situation/store/:isShow/:houseId',
289
+				data: {
290
+					title: '储存超限报警'
291
+				},
292
+				params:{
293
+					showType : "WD"
294
+				},
295
+				views: {
296
+					"content@app": {
297
+						controller: 'storeWarningThresholdCtrl',
298
+						templateUrl: 'app/supervise/views/storeWarningThreshold.html'
299
+					}
300
+				}
301
+			})
302
+			// 内控预警列表
303
+            .state('app.supervise.situation.internalControl', {
304
+				url: '/supervise/situation/internalControl/:isShow/:houseId',
305
+				data: {
306
+					title: '内控预警列表'
307
+				},
308
+				params:{
309
+					showType : "WD"
310
+				},
311
+				views: {
312
+					"content@app": {
313
+						controller: 'internalWarningListCtrl',
314
+						templateUrl: 'app/supervise/views/internalWarningList.html'
315
+					}
316
+				}
317
+			})
318
+			// 违规预警
319
+            .state('app.supervise.situation.violation', {
320
+				url: '/supervise/situation/violation/:isShow/:houseId',
321
+				data: {
322
+					title: '违规预警'
323
+				},
324
+				params:{
325
+					showType : "WD"
326
+				},
327
+				views: {
328
+					"content@app": {
329
+						controller: 'violationWarningListCtrl',
330
+						templateUrl: 'app/supervise/views/violationWarningList.html'
331
+					}
332
+				}
333
+			})
334
+			// 违规预警详情页
335
+            .state('app.supervise.situation.violationDetail', {
336
+				url: '/supervise/situation/violationDetail/:isShow/:houseId',
337
+				data: {
338
+					title: '违规预警'
339
+				},
340
+				params:{
341
+					showType : "WD"
342
+				},
343
+				views: {
344
+					"content@app": {
345
+						controller: 'violationDetailCtrl',
346
+						templateUrl: 'app/supervise/views/violationDetail.html'
347
+					}
348
+				}
349
+			})
254 350
             //=======================粮情监测========================//
255 351
             //=======================仓储作业========================//
256 352
             .state('app.supervise.operation', {

+ 26 - 0
src/main/resources/static/app/supervise/service/overDueAlarmService.js

@@ -0,0 +1,26 @@
1
+"use strict";
2
+
3
+angular.module('app.supervise').service("overDueAlarmService", function($http, $q, APP_CONFIG, $rootScope) {
4
+    /**
5
+     * 查询储存超限报警列表
6
+     */
7
+    this.getCcPageInfo = function(pageNum, pageSize, orgId) {
8
+        var d = $q.defer();
9
+        $http({
10
+            method : 'GET',
11
+            url : APP_CONFIG.sharedUrl + '/overDueAlarm/getOverDueAlarmList',
12
+            params : {
13
+                pageNum : pageNum,
14
+                pageSize : pageSize,
15
+				orgId: orgId,
16
+            }
17
+        }).then(function successCallback(response) {
18
+            // 请求成功执行代码
19
+            d.resolve(response.data);
20
+        }, function errorCallback(response) {
21
+            // 请求失败执行代码
22
+            d.reject("error");
23
+        });
24
+        return d.promise;
25
+    };
26
+});

+ 2 - 3
src/main/resources/static/app/supervise/service/overRunAlarmService.js

@@ -1,11 +1,10 @@
1 1
 "use strict";
2 2
 
3 3
 angular.module('app.supervise').service("overRunAlarmService", function($http, $q, APP_CONFIG, $rootScope) {
4
-	console.log(APP_CONFIG, 9889);
5 4
     /**
6 5
      * 查询库存超限报警列表
7 6
      */
8
-    this.getKcPageInfo = function(pageNum, pageSize) {
7
+    this.getKcPageInfo = function(pageNum, pageSize, orgId) {
9 8
         var d = $q.defer();
10 9
         $http({
11 10
             method : 'GET',
@@ -13,7 +12,7 @@ angular.module('app.supervise').service("overRunAlarmService", function($http, $
13 12
             params : {
14 13
                 pageNum : pageNum,
15 14
                 pageSize : pageSize,
16
-				orgId: 68,
15
+				orgId: orgId,
17 16
             }
18 17
         }).then(function successCallback(response) {
19 18
             // 请求成功执行代码

+ 68 - 0
src/main/resources/static/app/supervise/views/storeWarningThreshold.html

@@ -0,0 +1,68 @@
1
+<!-- MAIN CONTENT -->
2
+<div id="content">
3
+	<!-- widget grid -->
4
+	<section widget-grid id="widget-grid">
5
+		<div class="row">
6
+			<article class="col-sm-12">
7
+				<div jarvis-widget id="standard-datatable-widget" data-widget-color="darken" data-widget-editbutton="true">
8
+					<header>
9
+						<span class="widget-icon"> <i class="fa fa-table"></i> </span>
10
+						<h2>储存超限报警</h2>
11
+					</header>
12
+					<div>
13
+						<div class="widget-body no-padding">
14
+							<div id="DataTables_Table_1_wrapper" class="dataTables_wrapper form-inline no-footer">
15
+								<div class="dt-toolbar">
16
+									<div class="col-xs-12 col-sm-10">
17
+										
18
+									</div>
19
+									<div class="col-sm-2 col-xs-2 hidden-xs">
20
+										<div class="dataTables_length">
21
+											<label>每页显示 <select ng-model="pageInfo.pageSize" ng-change="loadData()" ng-options="num as num for num in [10,25,50,100]" class="form-control input-sm"></select> 条
22
+											</label>
23
+										</div>
24
+									</div>
25
+								</div>
26
+								<div id="print">
27
+									<table class="table table-striped table-bordered table-hover" width="100%"
28
+										border="1" style="border-collapse:collapse;border:none;">
29
+										<thead>
30
+											<tr>
31
+												<th data-class="expand" style="text-align:center;">序号</th>
32
+												<th data-class="expand" style="text-align:center;">仓房名称</th>
33
+												<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>
39
+												<th data-class="expand" style="text-align:center;">储存超限时间</th>
40
+											</tr>
41
+										</thead>
42
+
43
+										<tbody>
44
+											<tr ng-repeat="warning in pageInfo.list">
45
+												<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 | date:'yyyy-MM-dd HH:mm:ss' }}
53
+												</td>
54
+												<td style="text-align:center;">{{ warning.limitYear }}</td>
55
+												<td style="text-align:center;">{{ warning.cznx | date:'yyyy-MM-dd HH:mm:ss' }}</td>
56
+											</tr>
57
+										</tbody>
58
+									</table>
59
+								</div>
60
+								<div smart-include="app/layout/partials/page.tpl.html"></div>
61
+							</div>
62
+						</div>
63
+					</div>
64
+				</div>
65
+			</article>
66
+		</div>
67
+	</section>
68
+</div>