@cpzxrobot/sdk 1.1.85 → 1.1.87

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/car_gateway.ts CHANGED
@@ -21,12 +21,21 @@ export class CarGateway extends Object {
21
21
  .then((res) => res.data);
22
22
  }
23
23
 
24
+ //根据工厂pid获取订单列表,注意,该接口和
24
25
  async orders(factory: Factory, date: Date) {
25
26
  var axios = await this.context.ready;
26
27
  return axios
27
28
  .get(`/api/v2/car/${factory.pid}/orders?date=` + date.toISOString())
28
29
  }
29
30
 
31
+ async ordersByFactory(factory: Factory, date: Date) {
32
+ var axios = await this.context.ready;
33
+ //filter=未分配的
34
+ return axios
35
+ .get(`/api/v2/car/${factory.id}/order?date=` + date.toISOString()+"&filter=unallocated")
36
+ .then((res) => res.data);
37
+ }
38
+
30
39
  listByProvince(area_code: string) {
31
40
  return this.context.ready.then((axios) => {
32
41
  return axios.get(`/api/v2/coremde-sale/car/province/get?area_code=${area_code}`);
@@ -20,7 +20,7 @@ export class CustomerGateway extends Object {
20
20
  });
21
21
  }
22
22
 
23
- listByProvince(area_code:string){
23
+ listByProvince(area_code: string) {
24
24
  return this.context.ready.then((axios) => {
25
25
  return axios.get(`/api/v2/coremde-sale/customer/province/get?area_code=${area_code}`);
26
26
  });
@@ -44,7 +44,7 @@ export class CustomerGateway extends Object {
44
44
  });
45
45
  }
46
46
 
47
- accountManager(customerId: number,pageNo:number|undefined= undefined,pageSize:number|undefined=undefined) {
47
+ accountManager(customerId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) {
48
48
  return this.context.ready.then((axios) => {
49
49
  var params = {
50
50
  customerId: customerId,
@@ -52,9 +52,9 @@ export class CustomerGateway extends Object {
52
52
  pageSize: pageSize,
53
53
  }
54
54
  return axios.get(
55
- `/api/v2/coremde-sale/customer/account-manager/list`,{
56
- params: params,
57
- }
55
+ `/api/v2/coremde-sale/customer/account-manager/list`, {
56
+ params: params,
57
+ }
58
58
  );
59
59
  });
60
60
  }
@@ -105,25 +105,17 @@ export class CustomerGateway extends Object {
105
105
  }
106
106
 
107
107
  //获得客户状态列表
108
- get status() {
109
- return {
110
- list: () => {
111
- return this.context.ready.then((axios) => {
112
- return axios.get(`/api/v2/coremde-sale/customer/status`);
113
- });
114
- },
115
- }
108
+ status() {
109
+ return this.context.ready.then((axios) => {
110
+ return axios.get(`/api/v2/coremde-sale/customer/status`);
111
+ });
116
112
  }
117
113
 
118
114
  //获得客户类型列表
119
- get types() {
120
- return {
121
- list: () => {
122
- return this.context.ready.then((axios) => {
123
- return axios.get(`/api/v2/coremde-sale/customer/types`);
124
- });
125
- },
126
- }
115
+ types() {
116
+ return this.context.ready.then((axios) => {
117
+ return axios.get(`/api/v2/coremde-sale/customer/types`);
118
+ });
127
119
  }
128
120
 
129
121
  }
@@ -18,11 +18,19 @@ class CarGateway extends Object {
18
18
  .get(`/api/v2/car/${factory.pid}/detections?date=` + date.toISOString())
19
19
  .then((res) => res.data);
20
20
  }
21
+ //根据工厂pid获取订单列表,注意,该接口和
21
22
  async orders(factory, date) {
22
23
  var axios = await this.context.ready;
23
24
  return axios
24
25
  .get(`/api/v2/car/${factory.pid}/orders?date=` + date.toISOString());
25
26
  }
27
+ async ordersByFactory(factory, date) {
28
+ var axios = await this.context.ready;
29
+ //filter=未分配的
30
+ return axios
31
+ .get(`/api/v2/car/${factory.id}/order?date=` + date.toISOString() + "&filter=unallocated")
32
+ .then((res) => res.data);
33
+ }
26
34
  listByProvince(area_code) {
27
35
  return this.context.ready.then((axios) => {
28
36
  return axios.get(`/api/v2/coremde-sale/car/province/get?area_code=${area_code}`);
@@ -77,24 +77,16 @@ class CustomerGateway extends Object {
77
77
  };
78
78
  }
79
79
  //获得客户状态列表
80
- get status() {
81
- return {
82
- list: () => {
83
- return this.context.ready.then((axios) => {
84
- return axios.get(`/api/v2/coremde-sale/customer/status`);
85
- });
86
- },
87
- };
80
+ status() {
81
+ return this.context.ready.then((axios) => {
82
+ return axios.get(`/api/v2/coremde-sale/customer/status`);
83
+ });
88
84
  }
89
85
  //获得客户类型列表
90
- get types() {
91
- return {
92
- list: () => {
93
- return this.context.ready.then((axios) => {
94
- return axios.get(`/api/v2/coremde-sale/customer/types`);
95
- });
96
- },
97
- };
86
+ types() {
87
+ return this.context.ready.then((axios) => {
88
+ return axios.get(`/api/v2/coremde-sale/customer/types`);
89
+ });
98
90
  }
99
91
  }
100
92
  exports.CustomerGateway = CustomerGateway;
@@ -67,12 +67,24 @@ class TransportGateway extends Object {
67
67
  create: (data) => {
68
68
  return this.context.ready.then(() => {
69
69
  return this.context.axios
70
- .post("/api/v1/pigfarm/device/fodder/add", data)
70
+ .post("/api/v2/pigfarm/feedTower/fodder/save", data)
71
71
  .then((res) => {
72
72
  if (res.data.code != 200) {
73
73
  throw res.data.message;
74
74
  }
75
- return res.data.data;
75
+ return res.data;
76
+ });
77
+ });
78
+ },
79
+ addImage: () => {
80
+ return this.context.ready.then(() => {
81
+ return this.context.axios
82
+ .upload("/api/v2/pigfarm/feedTower/fodder/photo/add")
83
+ .then((res) => {
84
+ if (res.data.code != 200) {
85
+ throw res.data.message;
86
+ }
87
+ return res.data;
76
88
  });
77
89
  });
78
90
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.85",
3
+ "version": "1.1.87",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -232,6 +232,9 @@ baseURL: "/"
232
232
  | cpzxrobot().car.stat.china | 获得车辆在全国的统计信息 |
233
233
  | cpzxrobot().car.listByProvince | 获得车辆在某个省的统计信息,传入province参数 |
234
234
  | cpzxrobot().car.listByCity | 获得车辆在某个市的统计信息,传入city参数 |
235
+ | cpzxrobot().car.listByDistrict | 获得车辆在某个区域的统计信息,传入district参数 |
236
+ | cpzxrobot().car.orders | 获得车辆运单列表,传入工厂(按工厂上级返回) |
237
+ | cpzxrobot().car.ordersByFactory | 获得车辆运单列表,传入工厂,按工厂id返回 ,只返回未分配的运单 |
235
238
  | cpzxrobot().news.add | 添加新闻 |
236
239
  | cpzxrobot().news.list | 获得新闻列表,传入必要的分页参数 |
237
240
  | cpzxrobot().news.alarm.add | 添加报警信息 |
@@ -21,12 +21,12 @@ export class TransportGateway extends Object {
21
21
  unitId: number | undefined;
22
22
  factoryId: number | undefined;
23
23
  } = {
24
- current: 1,
25
- pageSize: 10,
26
- deviceId: id,
27
- unitId: undefined,
28
- factoryId: undefined,
29
- }
24
+ current: 1,
25
+ pageSize: 10,
26
+ deviceId: id,
27
+ unitId: undefined,
28
+ factoryId: undefined,
29
+ }
30
30
  ): Promise<FodderOrder[]> => {
31
31
  return this.context.ready.then(() => {
32
32
  return this.context.axios
@@ -78,12 +78,24 @@ export class TransportGateway extends Object {
78
78
  create: (data: FodderOrder) => {
79
79
  return this.context.ready.then(() => {
80
80
  return this.context.axios
81
- .post("/api/v1/pigfarm/device/fodder/add", data)
81
+ .post("/api/v2/pigfarm/feedTower/fodder/save", data)
82
82
  .then((res) => {
83
83
  if (res.data.code != 200) {
84
84
  throw res.data.message;
85
85
  }
86
- return res.data.data;
86
+ return res.data;
87
+ });
88
+ });
89
+ },
90
+ addImage: () => {
91
+ return this.context.ready.then(() => {
92
+ return this.context.axios
93
+ .upload("/api/v2/pigfarm/feedTower/fodder/photo/add")
94
+ .then((res) => {
95
+ if (res.data.code != 200) {
96
+ throw res.data.message;
97
+ }
98
+ return res.data;
87
99
  });
88
100
  });
89
101
  },