@cpzxrobot/sdk 1.2.6 → 1.2.8

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,4 +1,4 @@
1
- import { Cpzxrobot, Factory, Unit } from "./types";
1
+ import { Cpzxrobot } from "./types";
2
2
 
3
3
  export class ContractGateway extends Object {
4
4
  context: Cpzxrobot;
@@ -123,6 +123,40 @@ export class CustomerGateway extends Object {
123
123
  return axios.get(`/api/v2/coremde-sale/customer/stat/china`);
124
124
  });
125
125
  },
126
+ periodCount: (args: {
127
+ dateType: number;
128
+ companyId: number;
129
+ }) => {
130
+ return this.context.ready.then((axios) => {
131
+ return axios.post(`/api/v2/coremde-sale/customer/stat/period/count`, args);
132
+ });
133
+ },
134
+ totalCount: (args: {
135
+ companyId: number;
136
+ }) => {
137
+ return this.context.ready.then((axios) => {
138
+ return axios.post(`/api/v2/coremde-sale/customer/stat/total/count`, args);
139
+ });
140
+ },
141
+ //成交金额统计
142
+ amount: (args: {
143
+ companyId: number;
144
+ }) => {
145
+ return this.context.ready.then((axios) => {
146
+ return axios.post(`/api/v2/coremde-sale/customer/stat/total/amount`, args);
147
+ });
148
+ },
149
+ project: (args: {
150
+ pageNo: number;
151
+ pageSize: number;
152
+ projectProgress: number;
153
+ companyId: number;
154
+ status: "tracking"
155
+ }) => {
156
+ return this.context.ready.then((axios) => {
157
+ return axios.post(`/api/v2/coremde-sale/customer/stat/period/project`, args);
158
+ });
159
+ },
126
160
  }
127
161
  }
128
162
 
@@ -90,6 +90,27 @@ class CustomerGateway extends Object {
90
90
  return axios.get(`/api/v2/coremde-sale/customer/stat/china`);
91
91
  });
92
92
  },
93
+ periodCount: (args) => {
94
+ return this.context.ready.then((axios) => {
95
+ return axios.post(`/api/v2/coremde-sale/customer/stat/period/count`, args);
96
+ });
97
+ },
98
+ totalCount: (args) => {
99
+ return this.context.ready.then((axios) => {
100
+ return axios.post(`/api/v2/coremde-sale/customer/stat/total/count`, args);
101
+ });
102
+ },
103
+ //成交金额统计
104
+ amount: (args) => {
105
+ return this.context.ready.then((axios) => {
106
+ return axios.post(`/api/v2/coremde-sale/customer/stat/total/amount`, args);
107
+ });
108
+ },
109
+ project: (args) => {
110
+ return this.context.ready.then((axios) => {
111
+ return axios.post(`/api/v2/coremde-sale/customer/stat/period/project`, args);
112
+ });
113
+ },
93
114
  };
94
115
  }
95
116
  get count() {
@@ -30,6 +30,13 @@ class TransportGateway extends Object {
30
30
  });
31
31
  });
32
32
  },
33
+ ///api/v2/pigfarm/feedTower/fodder/recentLoad/{towerId}
34
+ getRecentLoad: (towerId) => {
35
+ return this.context.ready.then(() => {
36
+ return this.context.axios
37
+ .get(`/api/v2/pigfarm/feedTower/fodder/recentLoad/${towerId}`);
38
+ });
39
+ },
33
40
  //获取打料详情
34
41
  get inputs() {
35
42
  return this.getDetail;
package/index.ts CHANGED
@@ -482,8 +482,8 @@ export default function (
482
482
  devAuth: string;
483
483
  baseURL: string;
484
484
  appCode: string;
485
- selectedFarm: Factory;
486
- selectedUnit: Unit;
485
+ selectedFarm: Factory | null | undefined;
486
+ selectedUnit: Unit | null | undefined;
487
487
  } = {
488
488
  devAuth: "",
489
489
  appCode: "",
package/logs_gateway.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Factory, Unit } from "./types";
1
+ import { Cpzxrobot } from "./types";
2
2
 
3
3
  export class LogsGateway extends Object {
4
4
  context: Cpzxrobot;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -103,6 +103,7 @@ baseURL: "/"
103
103
  | cpzxrobot().factory.workshop.delete | 删除车间信息,需要传入id参数 |
104
104
  | cpzxrobot().factory.batch.list | 获得批次列表,传入factoryId参数 |ldiba
105
105
  | cpzxrobot().transport.fodder.getDeviceByFodderld | 获得料单对应的设备 |
106
+ | cpzxrobot().transport.fodder.getRecentLoad | 获取料塔最近打料记录,传入towerId参数 |
106
107
  | cpzxrobot().transport.fodder.delete | 删除饲料信息,需要传入id参数 |
107
108
  | cpzxrobot().pigfarm.heatlamp.xxx | 操作保温灯 |
108
109
  | cpzxrobot().pigfarm.weightMeter.config.list | 获取称重计的配置信息 |
@@ -153,7 +154,7 @@ baseURL: "/"
153
154
  | cpzxrobot().unit.batch.searchInUnit | 搜索单元的生产批次信息 |
154
155
  | cpzxrobot().unit.batch.list | 获取多个单元的生产批次信息 |
155
156
  | cpzxrobot().unit.batch.operation | 获取批次操作记录,传入 batchNo 参数 |
156
- | cpzxrobot().unit.batch.deleteBatch | 删除批次,传入批次 id 参数 |
157
+ | cpzxrobot().unit.batch.delete | 删除批次,传入批次 id 参数 |
157
158
  | cpzxrobot().user.add | 添加用户 |
158
159
  | cpzxrobot().user.update | 更新用户 |
159
160
  | cpzxrobot().user.list | 列出用户(传入工厂) |
@@ -228,6 +229,10 @@ baseURL: "/"
228
229
  | cpzxrobot().customer.categories | 获得客户类别列表 |
229
230
  | cpzxrobot().customer.count.byStatus | 获取客户状态列表及各状态下的客户数量 |
230
231
  | cpzxrobot().customer.visit.list | 获取客户拜访列表 |
232
+ | cpzxrobot().customer.stat.periodCount | 按周、月、年及类型对客户数量统计 |
233
+ | cpzxrobot().customer.stat.totalCount | 统计客户总数 |
234
+ | cpzxrobot().customer.stat.amount | 统计追踪、在建阶段的项目金额 |
235
+ | cpzxrobot().customer.stat.project | 追踪项目统计 |
231
236
  | cpzxrobot().company.list | 获得公司列表,传入必要的分页参数 |
232
237
  | cpzxrobot().company.rank.byRevenue | 按公司营收获取排名,传入必要的分页参数 |
233
238
  | cpzxrobot().company.rank.byProfit | 按公司利润获取排名,传入必要的分页参数 |
package/robot_gateway.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Cpzxrobot, Factory, Unit } from "./types";
1
+ import { Cpzxrobot } from "./types";
2
2
 
3
3
  export class RobotGateway extends Object {
4
4
  context: Cpzxrobot;
@@ -8,13 +8,13 @@ export class RobotGateway extends Object {
8
8
  this.context = context;
9
9
  }
10
10
 
11
- async cage(unitId: number){
11
+ async cage(unitId: number) {
12
12
  ///api/v2/robot/getCageList/{unitId}
13
13
  var axios = await this.context.ready;
14
14
  return axios.get(`/api/v2/robot/getCageList/${unitId}`);
15
15
  }
16
16
 
17
- async alarm(unitId: number){
17
+ async alarm(unitId: number) {
18
18
  ///api/v2/robot/getAlarmList/{unitId}
19
19
  var axios = await this.context.ready;
20
20
  return axios.get(`/api/v2/robot/getAlarmList/${unitId}`);
@@ -41,6 +41,13 @@ export class TransportGateway extends Object {
41
41
  });
42
42
  });
43
43
  },
44
+ ///api/v2/pigfarm/feedTower/fodder/recentLoad/{towerId}
45
+ getRecentLoad: (towerId: number) => {
46
+ return this.context.ready.then(() => {
47
+ return this.context.axios
48
+ .get(`/api/v2/pigfarm/feedTower/fodder/recentLoad/${towerId}`);
49
+ });
50
+ },
44
51
  //获取打料详情
45
52
  get inputs() {
46
53
  return this.getDetail;
@@ -90,7 +97,7 @@ export class TransportGateway extends Object {
90
97
  addImage: (args: any) => {
91
98
  return this.context.ready.then(() => {
92
99
  return this.context.axios
93
- .upload("/api/v2/pigfarm/feedTower/fodder/photo/add",args)
100
+ .upload("/api/v2/pigfarm/feedTower/fodder/photo/add", args)
94
101
  .then((res) => {
95
102
  if (res.data.code != 200) {
96
103
  throw res.data.message;