@cpzxrobot/sdk 1.2.39 → 1.2.40

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.
@@ -1,10 +1,13 @@
1
1
  import { Cpzxrobot } from "./types";
2
+ import { WarzoneGateway } from "./warzone_gateway";
2
3
 
3
4
  export class CompanyGateway extends Object {
4
5
  context: Cpzxrobot;
6
+ warzone!: WarzoneGateway;
5
7
  constructor(context: Cpzxrobot) {
6
8
  super();
7
9
  this.context = context;
10
+ this.warzone = new WarzoneGateway(context);
8
11
  }
9
12
 
10
13
  async list(pageNo: number, pageSize: number,pid:number, companyName:string) {
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CompanyGateway = void 0;
4
+ const warzone_gateway_1 = require("./warzone_gateway");
4
5
  class CompanyGateway extends Object {
5
6
  constructor(context) {
6
7
  super();
7
8
  this.context = context;
9
+ this.warzone = new warzone_gateway_1.WarzoneGateway(context);
8
10
  }
9
11
  async list(pageNo, pageSize, pid, companyName) {
10
12
  var axios = await this.context.ready;
@@ -230,5 +230,39 @@ class ProjectGateway extends Object {
230
230
  }
231
231
  };
232
232
  }
233
+ get plan() {
234
+ return {
235
+ // 创建计划
236
+ add: (args) => {
237
+ return this.context.ready.then((axios) => {
238
+ return axios.post(`/api/v2/coremde-sale/project/plan/add`, args);
239
+ });
240
+ },
241
+ // 分页获取计划列表
242
+ list: (args) => {
243
+ return this.context.ready.then((axios) => {
244
+ return axios.post(`/api/v2/coremde-sale/project/plan/list`, args);
245
+ });
246
+ },
247
+ // 获取单个计划详情
248
+ get: (id) => {
249
+ return this.context.ready.then((axios) => {
250
+ return axios.get(`/api/v2/coremde-sale/project/plan/get?id=${id}`);
251
+ });
252
+ },
253
+ // 更新计划
254
+ update: (args) => {
255
+ return this.context.ready.then((axios) => {
256
+ return axios.post(`/api/v2/coremde-sale/project/plan/update`, args);
257
+ });
258
+ },
259
+ // 删除计划
260
+ delete: (id) => {
261
+ return this.context.ready.then((axios) => {
262
+ return axios.get(`/api/v2/coremde-sale/project/plan/delete?id=${id}`);
263
+ });
264
+ }
265
+ };
266
+ }
233
267
  }
234
268
  exports.ProjectGateway = ProjectGateway;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WarzoneGateway = void 0;
4
+ class WarzoneGateway extends Object {
5
+ constructor(context) {
6
+ super();
7
+ this.context = context;
8
+ }
9
+ // 创建战区
10
+ add(args) {
11
+ return this.context.ready.then((axios) => {
12
+ return axios.post(`/api/v2/coremde-sale/war-zone/add`, args);
13
+ });
14
+ }
15
+ // 分页获取战区列表
16
+ list(args) {
17
+ return this.context.ready.then((axios) => {
18
+ return axios.post(`/api/v2/coremde-sale/war-zone/list`, args);
19
+ });
20
+ }
21
+ // 获取单个战区详情
22
+ get(id) {
23
+ return this.context.ready.then((axios) => {
24
+ return axios.get(`/api/v2/coremde-sale/war-zone/get?id=${id}`);
25
+ });
26
+ }
27
+ // 更新战区信息
28
+ update(args) {
29
+ return this.context.ready.then((axios) => {
30
+ return axios.post(`/api/v2/coremde-sale/war-zone/update`, args);
31
+ });
32
+ }
33
+ // 删除战区
34
+ delete(id) {
35
+ return this.context.ready.then((axios) => {
36
+ return axios.get(`/api/v2/coremde-sale/war-zone/delete?id=${id}`);
37
+ });
38
+ }
39
+ get manager() {
40
+ return {
41
+ // 指定战区负责人
42
+ add: (args) => {
43
+ return this.context.ready.then((axios) => {
44
+ return axios.post(`/api/v2/coremde-sale/war-zone/manager/add`, args);
45
+ });
46
+ },
47
+ // 修改战区负责人
48
+ update: (args) => {
49
+ return this.context.ready.then((axios) => {
50
+ return axios.get(`/api/v2/coremde-sale/war-zone/manager/update`, {
51
+ params: args
52
+ });
53
+ });
54
+ },
55
+ // 删除战区负责人
56
+ delete: (id) => {
57
+ return this.context.ready.then((axios) => {
58
+ return axios.get(`/api/v2/coremde-sale/war-zone/manager/delete?id=${id}`);
59
+ });
60
+ }
61
+ };
62
+ }
63
+ }
64
+ exports.WarzoneGateway = WarzoneGateway;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.39",
3
+ "version": "1.2.40",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -282,4 +282,61 @@ export class ProjectGateway extends Object {
282
282
  };
283
283
  }
284
284
 
285
+ get plan() {
286
+ return {
287
+ // 创建计划
288
+ add: (args: {
289
+ projectId: number;
290
+ planStartDate: string;
291
+ planEndDate: string;
292
+ departmentId: number;
293
+ projectNodeId: number;
294
+ projectManager: string;
295
+ groupId: number;
296
+ }) => {
297
+ return this.context.ready.then((axios) => {
298
+ return axios.post(`/api/v2/coremde-sale/project/plan/add`, args);
299
+ });
300
+ },
301
+ // 分页获取计划列表
302
+ list: (args: {
303
+ pageNo: number;
304
+ pageSize: number;
305
+ projectId?: number;
306
+ projectNodeId?: number;
307
+ planStartDate?: string;
308
+ planEndDate?: string;
309
+ }) => {
310
+ return this.context.ready.then((axios) => {
311
+ return axios.post(`/api/v2/coremde-sale/project/plan/list`, args);
312
+ });
313
+ },
314
+ // 获取单个计划详情
315
+ get: (id: number) => {
316
+ return this.context.ready.then((axios) => {
317
+ return axios.get(`/api/v2/coremde-sale/project/plan/get?id=${id}`);
318
+ });
319
+ },
320
+ // 更新计划
321
+ update: (args: {
322
+ planStartDate: string;
323
+ planEndDate: string;
324
+ departmentId: number;
325
+ projectNodeId: number;
326
+ projectManager: string;
327
+ id: number;
328
+ }) => {
329
+ return this.context.ready.then((axios) => {
330
+ return axios.post(`/api/v2/coremde-sale/project/plan/update`, args);
331
+ });
332
+ },
333
+ // 删除计划
334
+ delete: (id: number) => {
335
+ return this.context.ready.then((axios) => {
336
+ return axios.get(`/api/v2/coremde-sale/project/plan/delete?id=${id}`);
337
+ });
338
+ }
339
+ };
340
+ }
341
+
285
342
  }
@@ -0,0 +1,96 @@
1
+ import { Cpzxrobot } from "./types";
2
+
3
+ export class WarzoneGateway extends Object {
4
+ context: Cpzxrobot;
5
+
6
+ constructor(context: Cpzxrobot) {
7
+ super();
8
+ this.context = context;
9
+ }
10
+
11
+ // 创建战区
12
+ add(args: {
13
+ groupId: string;
14
+ warZoneName: string;
15
+ areas: Array<{
16
+ areaName: string;
17
+ code: string;
18
+ children: Array<{
19
+ areaName?: string;
20
+ code?: string;
21
+ children?: Array<Record<string, never>>;
22
+ }>;
23
+ }>;
24
+ }) {
25
+ return this.context.ready.then((axios) => {
26
+ return axios.post(`/api/v2/coremde-sale/war-zone/add`, args);
27
+ });
28
+ }
29
+
30
+ // 分页获取战区列表
31
+ list(args: { pageNo: number; pageSize: number }) {
32
+ return this.context.ready.then((axios) => {
33
+ return axios.post(`/api/v2/coremde-sale/war-zone/list`, args);
34
+ });
35
+ }
36
+
37
+ // 获取单个战区详情
38
+ get(id: number) {
39
+ return this.context.ready.then((axios) => {
40
+ return axios.get(`/api/v2/coremde-sale/war-zone/get?id=${id}`);
41
+ });
42
+ }
43
+
44
+ // 更新战区信息
45
+ update(args: {
46
+ warZoneName: string;
47
+ areas: Array<{
48
+ areaId: number;
49
+ areaName: string;
50
+ areaCode: string;
51
+ children: Array<{
52
+ areaId: number;
53
+ areaName: string;
54
+ areaCode: string;
55
+ children?: Array<Record<string, never>>;
56
+ }>;
57
+ }>;
58
+ warZoneId: number;
59
+ }) {
60
+ return this.context.ready.then((axios) => {
61
+ return axios.post(`/api/v2/coremde-sale/war-zone/update`, args);
62
+ });
63
+ }
64
+
65
+ // 删除战区
66
+ delete(id: number) {
67
+ return this.context.ready.then((axios) => {
68
+ return axios.get(`/api/v2/coremde-sale/war-zone/delete?id=${id}`);
69
+ });
70
+ }
71
+
72
+ get manager() {
73
+ return {
74
+ // 指定战区负责人
75
+ add: (args: { warZoneId: number; userId: number }) => {
76
+ return this.context.ready.then((axios) => {
77
+ return axios.post(`/api/v2/coremde-sale/war-zone/manager/add`, args);
78
+ });
79
+ },
80
+ // 修改战区负责人
81
+ update: (args: { id: number; userId: number }) => {
82
+ return this.context.ready.then((axios) => {
83
+ return axios.get(`/api/v2/coremde-sale/war-zone/manager/update`, {
84
+ params: args
85
+ });
86
+ });
87
+ },
88
+ // 删除战区负责人
89
+ delete: (id: number) => {
90
+ return this.context.ready.then((axios) => {
91
+ return axios.get(`/api/v2/coremde-sale/war-zone/manager/delete?id=${id}`);
92
+ });
93
+ }
94
+ };
95
+ }
96
+ }