@cpzxrobot/sdk 1.3.47 → 1.3.49

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.
package/device_gateway.ts CHANGED
@@ -211,17 +211,17 @@ export class DeviceGateway extends Object {
211
211
  }
212
212
 
213
213
  async watch(
214
- ids: number|number[],
214
+ ids: number | number[],
215
215
  fn: any,
216
216
  ) {
217
217
  var axios = await this.context.ready;
218
218
  var idQuery = "";
219
219
  if (Array.isArray(ids)) {
220
220
  idQuery = ids.map(x => `ids=${x}`).join("&");
221
- }else{
221
+ } else {
222
222
  idQuery = `ids=${ids}`;
223
223
  }
224
- return axios.getAsSse(`/api/v1/device/watch?`+idQuery, fn)
224
+ return axios.getAsSse(`/api/v1/device/watch?` + idQuery, fn)
225
225
  }
226
226
 
227
227
  private getFilter<T extends { id: number }>(
@@ -981,26 +981,35 @@ export class DeviceGateway extends Object {
981
981
 
982
982
  get disinfect() {
983
983
  return {
984
- openDoor: async (deviceId: number,door: "doora" | "doorb", open: boolean) => {
984
+ openDoor: async (deviceId: number, door: "doora" | "doorb", open: boolean) => {
985
985
  var axios = await this.context.ready;
986
986
  return axios.post(`/api/v2/disinfect/${deviceId}`, { door, open })
987
987
  },
988
- action: async (deviceId: number,action: "start"|"end") => {
988
+ action: async (deviceId: number, action: "start" | "end") => {
989
989
  var axios = await this.context.ready;
990
990
  return axios.post(`/api/v2/disinfect/${deviceId}`, { action })
991
991
  },
992
- config: async (deviceId: number, config: {
993
- mode?: number; // 0:没有消毒 1:高温消毒 2:臭氧消毒 3:高温+臭氧
994
- disinfectTime?: number; // 洗消时间(s)
995
- targetTemp?: number; // 目标温度
996
- targetOzone?: number; // 目标臭氧浓度
997
- }) => {
998
- let axios = await this.context.ready;
999
- return axios.post(`/api/v2/disinfect/${deviceId}`, config).then((res) => {
1000
- return res.data;
1001
- });
992
+ config: {
993
+ set: async (deviceId: number, config: {
994
+ mode?: number; // 0:没有消毒 1:高温消毒 2:臭氧消毒 3:高温+臭氧
995
+ disinfectTime?: number; // 洗消时间(s)
996
+ targetTemp?: number; // 目标温度
997
+ targetOzone?: number; // 目标臭氧浓度
998
+ soaktime?: number; // 浸泡时间(s)
999
+ }) => {
1000
+ let axios = await this.context.ready;
1001
+ return axios.post(`/api/v2/disinfect/${deviceId}/params`, config).then((res) => {
1002
+ return res.data;
1003
+ });
1004
+ },
1005
+ get: async (deviceId: number) => {
1006
+ let axios = await this.context.ready;
1007
+ return axios.get(`/api/v2/disinfect/${deviceId}/params`).then((res) => {
1008
+ return res.data;
1009
+ });
1010
+ }
1002
1011
  },
1003
- history: async (deviceId: number, pageNum:number,pageSize:number) => {
1012
+ history: async (deviceId: number, pageNum: number, pageSize: number) => {
1004
1013
  let axios = await this.context.ready;
1005
1014
  return axios.get(`/api/v2/disinfect/${deviceId}`, { params: { pageNum, pageSize } }).then((res) => {
1006
1015
  return res.data;
@@ -757,11 +757,19 @@ class DeviceGateway extends Object {
757
757
  var axios = await this.context.ready;
758
758
  return axios.post(`/api/v2/disinfect/${deviceId}`, { action });
759
759
  },
760
- config: async (deviceId, config) => {
761
- let axios = await this.context.ready;
762
- return axios.post(`/api/v2/disinfect/${deviceId}`, config).then((res) => {
763
- return res.data;
764
- });
760
+ config: {
761
+ set: async (deviceId, config) => {
762
+ let axios = await this.context.ready;
763
+ return axios.post(`/api/v2/disinfect/${deviceId}/params`, config).then((res) => {
764
+ return res.data;
765
+ });
766
+ },
767
+ get: async (deviceId) => {
768
+ let axios = await this.context.ready;
769
+ return axios.get(`/api/v2/disinfect/${deviceId}/params`).then((res) => {
770
+ return res.data;
771
+ });
772
+ }
765
773
  },
766
774
  history: async (deviceId, pageNum, pageSize) => {
767
775
  let axios = await this.context.ready;
@@ -352,6 +352,16 @@ class ProjectGateway extends Object {
352
352
  return axios.get(`/api/v2/coremde-sale/project/consignee/delete?id=${id}`);
353
353
  });
354
354
  },
355
+ /**
356
+ * 获取收货单位列表
357
+ * @param args 分页参数和项目ID
358
+ * @returns Promise
359
+ */
360
+ list: (args) => {
361
+ return this.context.ready.then((axios) => {
362
+ return axios.post(`/api/v2/coremde-sale/project/consignee/list`, args);
363
+ });
364
+ },
355
365
  };
356
366
  }
357
367
  get bom() {
@@ -134,6 +134,13 @@ class PurchaseGateway {
134
134
  */
135
135
  apply: async (params) => {
136
136
  return this.axios.post("/api/v2/coremde-sale/purchase/adjust/apply", params);
137
+ },
138
+ /**
139
+ * 更新采购变更单
140
+ * @param params 更新参数
141
+ */
142
+ update: async (params) => {
143
+ return this.axios.post("/api/v2/coremde-sale/purchase/adjust/update", params);
137
144
  }
138
145
  };
139
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.47",
3
+ "version": "1.3.49",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -491,13 +491,7 @@ export class ProjectGateway extends Object {
491
491
  * @param args 收货单位参数
492
492
  * @returns Promise
493
493
  */
494
- add: (args: {
495
- name: string
496
- contactPeople: string
497
- contactPhone: string
498
- contactAddress: string
499
- projectId: number
500
- }) => {
494
+ add: (args: any) => {
501
495
  return this.context.ready.then((axios) => {
502
496
  return axios.post(`/api/v2/coremde-sale/project/consignee/add`, args)
503
497
  })
@@ -507,13 +501,7 @@ export class ProjectGateway extends Object {
507
501
  * @param args 收货单位参数
508
502
  * @returns Promise
509
503
  */
510
- update: (args: {
511
- id: number
512
- name: string
513
- contactPeople: string
514
- contactPhone: string
515
- contactAddress: string
516
- }) => {
504
+ update: (args: any) => {
517
505
  return this.context.ready.then((axios) => {
518
506
  return axios.post(`/api/v2/coremde-sale/project/consignee/update`, args)
519
507
  })
@@ -528,6 +516,20 @@ export class ProjectGateway extends Object {
528
516
  return axios.get(`/api/v2/coremde-sale/project/consignee/delete?id=${id}`)
529
517
  })
530
518
  },
519
+ /**
520
+ * 获取收货单位列表
521
+ * @param args 分页参数和项目ID
522
+ * @returns Promise
523
+ */
524
+ list: (args: {
525
+ pageNo: number
526
+ pageSize: number
527
+ projectId: number
528
+ }) => {
529
+ return this.context.ready.then((axios) => {
530
+ return axios.post(`/api/v2/coremde-sale/project/consignee/list`, args)
531
+ })
532
+ },
531
533
  }
532
534
  }
533
535
 
@@ -758,7 +760,7 @@ export class ProjectGateway extends Object {
758
760
  get principal() {
759
761
  return {
760
762
  // 分配负责人
761
- assign: (args: {id: number, principalId: number, principalName: string}) => {
763
+ assign: (args: { id: number, principalId: number, principalName: string }) => {
762
764
  return this.context.ready.then((axios) => {
763
765
  return axios.post(
764
766
  `/api/v2/coremde-sale/project/principal/assign`,
@@ -249,6 +249,37 @@ export class PurchaseGateway {
249
249
  }>;
250
250
  }) => {
251
251
  return this.axios.post("/api/v2/coremde-sale/purchase/adjust/apply", params);
252
+ },
253
+
254
+ /**
255
+ * 更新采购变更单
256
+ * @param params 更新参数
257
+ */
258
+ update: async (params: {
259
+ projectId: number;
260
+ contractId?: number;
261
+ purchaseOrderProjectId: number;
262
+ id: number;
263
+ taskId: number;
264
+ deptId: number;
265
+ approveUserId: number;
266
+ adjustReason: string;
267
+ purchaseAdjustDetailList: Array<{
268
+ productId: number;
269
+ productName: string;
270
+ qtyBefore: number;
271
+ qtyAfter: number;
272
+ model: string;
273
+ materialCode: string;
274
+ unit: string;
275
+ price: string;
276
+ cost: string;
277
+ taxRate: string;
278
+ disinfection: string;
279
+ remark?: string;
280
+ }>;
281
+ }) => {
282
+ return this.axios.post("/api/v2/coremde-sale/purchase/adjust/update", params);
252
283
  }
253
284
  };
254
285
  }
package/user_gateway.ts CHANGED
@@ -413,8 +413,6 @@ export class UserGateway extends Object {
413
413
  }
414
414
  }
415
415
 
416
-
417
-
418
416
  get position() {
419
417
  return {
420
418
  leader: () => {