@ningboyz/types 1.3.1 → 1.3.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ningboyz/types",
3
3
  "type": "module",
4
- "version": "1.3.1",
4
+ "version": "1.3.2",
5
5
  "private": false,
6
6
  "description": "宁波甬政类型库",
7
7
  "author": "nbyt-syq",
@@ -1,4 +1,6 @@
1
1
  import { TCore, TVary } from "..";
2
+ import { TFlowDataResponse } from "../flow";
3
+ import _ from "lodash";
2
4
 
3
5
  export interface IVaryMainResponse {
4
6
  whoBuild: number;
@@ -140,4 +142,35 @@ export class TVaryMainResponse implements IVaryMainResponse {
140
142
  listSQBM: TCore.IDeptResponse[] = [];
141
143
  listSQYH: TCore.IUserResponse[] = [];
142
144
  listBill: TVary.IVaryBillResponse[] = [];
145
+
146
+
147
+ constructor(data: Partial<IVaryMainResponse> = {}) {
148
+ if (data) {
149
+ _.merge(this, _.pick(data, Object.keys(this)));
150
+ }
151
+ }
152
+
153
+ static toFlowData(data: IVaryMainResponse): TFlowDataResponse {
154
+ const result = new TFlowDataResponse();
155
+ result.whoBuild = data.whoBuild;
156
+ result.flowMain = data.flowMain;
157
+ result.flowNode = data.flowNode;
158
+ result.notified = "";
159
+ result.entityID = data.entityID;
160
+ result.billMain = data.varyIndx;
161
+ result.billCode = data.varyCode;
162
+ result.billMemo = data.varyMemo;
163
+ result.createAt = data.createAt;
164
+ result.mastName = data.mastName;
165
+ result.createBy = data.createBy;
166
+ result.unitMain = data.unitMain;
167
+ result.deptMain = data.deptMain;
168
+ result.menuUUID = data.menuUUID;
169
+ result.flowStat = data.varyStat;
170
+ return result;
171
+ }
172
+
173
+ static toFlowDatas(data: IVaryMainResponse[]): TFlowDataResponse[] {
174
+ return data.map((u) => this.toFlowData(u));
175
+ }
143
176
  }