Browse Source

增加orgId

gaodd 3 years ago
parent
commit
6e73c13640

+ 6 - 4
src/main/java/com/chinaitop/depot/intelligent/IntelligentDetection/controller/IntelligentBatchDetectionController.java

@@ -53,15 +53,16 @@ public class IntelligentBatchDetectionController {
53 53
             @ApiImplicitParam(name = "pageSize", defaultValue = "10", value = "每页条数", paramType = "query"),
54 54
             @ApiImplicitParam(name = "tName", value = "机构id", paramType = "query"),
55 55
             @ApiImplicitParam(name = "tState", value = "是否开启", paramType = "query"),
56
+            @ApiImplicitParam(name = "orgId", value = "库id", paramType = "query"),
56 57
             @ApiImplicitParam(name = "tCategory", value = "检测类型", paramType = "query")
57 58
     })
58
-    public ResponseEntity<PageInfo<TTimingTask>> getList(Integer pageNum, Integer pageSize, String tName, String tState, String tCategory) {
59
+    public ResponseEntity<PageInfo<TTimingTask>> getList(Integer pageNum, Integer pageSize, String tName, String tState, String tCategory,String orgId) {
59 60
         List<TTimingTask> list = null;
60 61
         try {
61 62
             if (null != pageNum && null != pageSize) {
62 63
                 PageHelper.startPage(pageNum, pageSize);
63 64
             }
64
-            list = tTimingTaskService.getList(tName,tState,tCategory);
65
+            list = tTimingTaskService.getList(tName,tState,tCategory,orgId);
65 66
         } catch (Exception e) {
66 67
             e.printStackTrace();
67 68
             return ResponseEntity.failed(e.getMessage());
@@ -134,15 +135,16 @@ public class IntelligentBatchDetectionController {
134 135
             @ApiImplicitParam(name = "vcfcode", value = "仓房code", paramType = "query"),
135 136
             @ApiImplicitParam(name = "time", value = "更新时间", paramType = "query"),
136 137
             @ApiImplicitParam(name = "tid", value = "检测id", paramType = "query"),
138
+            @ApiImplicitParam(name = "orgId", value = "库id", paramType = "query"),
137 139
             @ApiImplicitParam(name = "type", value = "所属类型", paramType = "query")
138 140
     })
139
-    public ResponseEntity<PageInfo<TTimingTaskHistory>> getDetectionHistory(Integer pageNum, Integer pageSize, String vcfcode, String time, String tid,String type) {
141
+    public ResponseEntity<PageInfo<TTimingTaskHistory>> getDetectionHistory(Integer pageNum, Integer pageSize, String vcfcode, String time, String tid,String type,String orgId) {
140 142
         List<TTimingTaskHistory> list = null;
141 143
         try {
142 144
             if (null != pageNum && null != pageSize) {
143 145
                 PageHelper.startPage(pageNum, pageSize);
144 146
             }
145
-            list = tTimingTaskService.getDetectionHistory(vcfcode,time,tid,type);
147
+            list = tTimingTaskService.getDetectionHistory(vcfcode,time,tid,type,orgId);
146 148
         } catch (Exception e) {
147 149
             e.printStackTrace();
148 150
             return ResponseEntity.failed(e.getMessage());

+ 2 - 2
src/main/java/com/chinaitop/depot/intelligent/IntelligentDetection/service/TTimingTaskService.java

@@ -12,7 +12,7 @@ import java.util.List;
12 12
  */
13 13
 public interface TTimingTaskService {
14 14
 
15
-    List<TTimingTask> getList(String tName, String tState, String tCategory);
15
+    List<TTimingTask> getList(String tName, String tState, String tCategory,String orgId);
16 16
 
17 17
     void save(String taskSchemaJson);
18 18
 
@@ -20,5 +20,5 @@ public interface TTimingTaskService {
20 20
 
21 21
     TTimingTask getById(String id);
22 22
 
23
-    List<TTimingTaskHistory> getDetectionHistory(String vcfcode, String time, String tid,String type);
23
+    List<TTimingTaskHistory> getDetectionHistory(String vcfcode, String time, String tid,String type,String orgId);
24 24
 }

+ 8 - 2
src/main/java/com/chinaitop/depot/intelligent/IntelligentDetection/service/impl/TTimingTaskServiceImpl.java

@@ -40,7 +40,7 @@ public class TTimingTaskServiceImpl implements TTimingTaskService {
40 40
 
41 41
 
42 42
     @Override
43
-    public List<TTimingTask> getList(String tName, String tState, String tCategory) {
43
+    public List<TTimingTask> getList(String tName, String tState, String tCategory,String orgId) {
44 44
         TTimingTaskExample example = new TTimingTaskExample();
45 45
         TTimingTaskExample.Criteria criteria = example.createCriteria();
46 46
         if (StringUtils.isNotBlank(tName)) {
@@ -52,6 +52,9 @@ public class TTimingTaskServiceImpl implements TTimingTaskService {
52 52
         if (StringUtils.isNotBlank(tCategory)) {
53 53
             criteria.andTCategoryEqualTo(tCategory);
54 54
         }
55
+        if (StringUtils.isNotBlank(orgId)) {
56
+            criteria.andOrgIdEqualTo(orgId);
57
+        }
55 58
         example.setOrderByClause("t_update_time desc");
56 59
         return tTimingTaskMapper.selectByExample(example);
57 60
     }
@@ -104,7 +107,7 @@ public class TTimingTaskServiceImpl implements TTimingTaskService {
104 107
     }
105 108
 
106 109
     @Override
107
-    public List<TTimingTaskHistory> getDetectionHistory(String vcfcode, String time, String tid, String type) {
110
+    public List<TTimingTaskHistory> getDetectionHistory(String vcfcode, String time, String tid, String type,String orgId) {
108 111
         TTimingTaskHistoryExample example = new TTimingTaskHistoryExample();
109 112
         TTimingTaskHistoryExample.Criteria criteria = example.createCriteria();
110 113
         if (StringUtils.isNotBlank(vcfcode)){
@@ -119,6 +122,9 @@ public class TTimingTaskServiceImpl implements TTimingTaskService {
119 122
         if (StringUtils.isNotBlank(type)){
120 123
             criteria.andTCategoryEqualTo(type);
121 124
         }
125
+        if (StringUtils.isNotBlank(orgId)){
126
+            criteria.andOrgIdEqualTo(orgId);
127
+        }
122 128
         example.setOrderByClause("t_update_time desc");
123 129
         List<TTimingTaskHistory> tTimingTaskHistories = tTimingTaskHistoryMapper.selectByExample(example);
124 130
         return tTimingTaskHistories;