owl-cli 5.33.0 → 5.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,35 +21,46 @@
21
21
 
22
22
  var params = JSON.parse($body);
23
23
  var id = params.id;
24
-
25
- var oldObj = @projectCodeService.get(id,true);
26
- if(!oldObj){
27
- $.log("object not found:" + id);
28
- var ret = {
29
- state: 'err',
30
- msg:'object not found'
31
- }
32
- out.print(JSON.stringify(ret));
33
- return;
24
+ var ids = params.ids;
25
+ if(!ids){
26
+ ids = [id];
34
27
  }
35
- if(orgId && oldObj._orgIds && oldObj._orgIds){
36
- //检查是否有权限修改
37
- if(orgId!='0' && oldObj._orgIds.indexOf(orgId)===-1){
28
+
29
+ for(var i=0;i<ids.length; i++){
30
+ var id = ids[i];
31
+ var oldObj = @projectCodeService.get(id,true);
32
+ if(!oldObj){
33
+ $.log("object not found:" + id);
38
34
  var ret = {
39
- state:'err',
40
- code: 'no permission',
41
- msg: '没有权限'
35
+ state: 'err',
36
+ msg:'object not found, id=' + id
42
37
  }
43
38
  out.print(JSON.stringify(ret));
44
39
  return;
45
40
  }
41
+ if(orgId && oldObj._orgIds && oldObj._orgIds){
42
+ //检查是否有权限修改
43
+ if(orgId!='0' && oldObj._orgIds.indexOf(orgId)===-1){
44
+ var ret = {
45
+ state:'err',
46
+ code: 'no permission',
47
+ msg: '没有权限,id=' + id
48
+ }
49
+ out.print(JSON.stringify(ret));
50
+ return;
51
+ }
52
+ }
46
53
  }
47
54
 
48
- var msg = '';
49
- @projectCodeService.del(id);
55
+
56
+ for(var i=0;i<ids.length; i++) {
57
+ var id = ids[i];
58
+ @projectCodeService.del(id);
59
+ }
60
+
61
+
50
62
  var ret = {
51
- state: msg ? 'err' : 'ok',
52
- msg: msg
63
+ state: 'ok'
53
64
  }
54
65
  out.print(JSON.stringify(ret));
55
66
  })();
@@ -144,19 +144,6 @@ function buildSort(sort){
144
144
  }
145
145
  }
146
146
 
147
- if(m !== '0'){
148
- filters = filters.concat([
149
- {"term": { "_m.keyword": m }},
150
- {"term":{"_t":spec["_t"]}}
151
- ]);
152
- }
153
- else{
154
- //如果m === '0',代表是平台
155
- filters = filters.concat([
156
- {"term":{"_t":spec["_t"]}}
157
- ]);
158
- }
159
-
160
147
  if(recycleBin){
161
148
  filters.push({"term":{"del.keyword":"T"}});
162
149
  var query = {
@@ -207,7 +194,7 @@ function buildSort(sort){
207
194
  var basicAuth = "Basic " + auth;
208
195
  headers["Authorization"] = basicAuth;
209
196
  }
210
- var searchUrl = elasticSearchUrl+"/owl_wh_receipt/_search";
197
+ var searchUrl = elasticSearchUrl+"/@projectCode/_search";
211
198
 
212
199
  var sndTxt = JSON.stringify(query);
213
200
  $.log(sndTxt);
@@ -222,7 +209,7 @@ function buildSort(sort){
222
209
  var objs = hits.map(function(hit){return hit._source});
223
210
 
224
211
 
225
- var countUrl = elasticSearchUrl+"/owl_wh_receipt/_count";
212
+ var countUrl = elasticSearchUrl+"/@projectCode/_count";
226
213
 
227
214
  var ss = HttpUtils.postRaw( countUrl, sndTxt, headers);
228
215
  var cr = JSON.parse(ss);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "5.33.0",
3
+ "version": "5.36.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {