import { THznj, TCore, TStim } from ".."; import _ from "lodash"; import { TFlowDataResponse } from "../flow"; export interface IHznjZblyResponse { whoBuild: number; userIndx: number; zblyIndx: number; sourceID: number; parentID: number; hashCode: number; dataLevl: number; dataFrom: number; kjndKJQJ: number; dataStat: number; dataOrdr: number; dataDate: number; dataType: number; dataTime: number; dataHide: number; dataGUID: string; userMain: number; mastName: string; mastGUID: string; createBy: string; createAt: number; updateBy: string; updateAt: number; deleteBy: string; deleteAt: number; queuesBy: number; entityID: string; sourceND: number; menuMain: number; menuUUID: string; unitMain: number; deptMain: number; sqyhText: string; sqbmText: string; flowUndo: number; flowUser: string; flowText: string; /**申请日期 */ zblyDate: number; /**流程状态:(0:制单;1:送审;2:终审) */ zblyStat: number; /**单据类型:检验类型 */ zblyType: number; /**单据编号 */ zblyCode: string; /**单据名称 */ zblyName: string; /**申请用途 */ zblyUses: string; /**备注说明 */ zblyMemo: string; /**联系人 */ wContact: string; /**联系方式 */ dContact: string; /**样品类型 */ lybmMain: number; /**领用人 */ lyyhText: string; /**样品类型 */ lybmText: string; /**样品类型 */ yplxMain: number; /**样品类型 */ yplxText: string; /**样品编号 */ sampCode: string; /**样品名称 */ sampName: string; coverURL: string; touchURL: string; unitText: string; sourceDW: string; lastDate: number; lastTime: number; flowStat: number; didFirst: number; lastMemo: string; userName: string; userGUID: string; flowMain: number; flowNode: number; memoMain: number; /**附件 */ listPath: TCore.IPathResponse[]; listBill: THznj.IHznjZblyBillResponse[]; listItem: THznj.IHznjZblyItemResponse[]; /** 关联结果 */ listFrom: THznj.IHznjZbjgResponse[]; } export class THznjZblyResponse implements IHznjZblyResponse { whoBuild: number = 0; userIndx: number = 0; zblyIndx: number = 0; sourceID: number = 0; parentID: number = 0; hashCode: number = 0; dataLevl: number = 0; dataFrom: number = 0; kjndKJQJ: number = 0; dataStat: number = 0; dataOrdr: number = 0; dataDate: number = 0; dataType: number = 0; dataTime: number = 0; dataHide: number = 0; dataGUID: string = ""; userMain: number = 0; mastName: string = ""; mastGUID: string = ""; createBy: string = ""; createAt: number = 0; updateBy: string = ""; updateAt: number = 0; deleteBy: string = ""; deleteAt: number = 0; queuesBy: number = 0; entityID: string = ""; sourceND: number = 0; menuMain: number = 0; menuUUID: string = ""; unitMain: number = 0; deptMain: number = 0; sqyhText: string = ""; sqbmText: string = ""; flowUndo: number = 0; flowUser: string = ""; flowText: string = ""; zblyDate: number = 0; zblyStat: number = 0; zblyType: number = 0; zblyCode: string = ""; zblyName: string = ""; zblyUses: string = ""; zblyMemo: string = ""; wContact: string = ""; dContact: string = ""; lybmMain: number = 0; lyyhText: string = ""; lybmText: string = ""; yplxMain: number = 0; yplxText: string = ""; /**样品编号 */ sampCode: string = ""; /**样品名称 */ sampName: string = ""; coverURL: string = ""; touchURL: string = ""; unitText: string = ""; sourceDW: string = ""; lastDate: number = 0; lastTime: number = 0; flowStat: number = 0; didFirst: number = 0; lastMemo: string = ""; userName: string = ""; userGUID: string = ""; flowMain: number = 0; flowNode: number = 0; memoMain: number = 0; listPath: TCore.IPathResponse[] = []; listBill: THznj.IHznjZblyBillResponse[] = []; listItem: THznj.IHznjZblyItemResponse[] = []; listFrom: THznj.IHznjZbjgResponse[] = []; constructor(data: Partial = {}) { if (data) { _.merge(this, _.pick(data, Object.keys(this))); } } static toFlowData(data: IHznjZblyResponse): TFlowDataResponse { const result = new TFlowDataResponse(); result.whoBuild = data.whoBuild; result.userIndx = data.userIndx; result.flowMain = data.flowMain; result.flowNode = data.flowNode; result.notified = ""; result.entityID = data.entityID; result.billMain = data.zblyIndx; result.billCode = data.zblyCode; result.billMemo = data.zblyMemo; result.flowStat = data.zblyStat; result.createAt = data.createAt; result.mastName = data.mastName; result.createBy = data.createBy; result.unitMain = data.unitMain; result.deptMain = data.deptMain; result.menuUUID = data.menuUUID; return result; } static toFlowDatas(list: IHznjZblyResponse[]): TFlowDataResponse[] { return list.map((data) => this.toFlowData(data)); } static toWldyPrintData(noti: IHznjZblyResponse) { const data = new TStim.TStimulsoftPrintData(); data.billMain = String(noti.zblyIndx); data.menuUUID = noti.menuUUID; return data; } static toWldyPrintDatas(listNoti: IHznjZblyResponse[]) { return listNoti.map((u) => this.toWldyPrintData(u)); } }