import { THzcb, TCore, TStim } from ".."; import { TFlowDataResponse } from "../flow"; import _ from "lodash"; export interface IHzcbNdjhResponse { whoBuild: number; userIndx: number; ndjhIndx: number; parentID: number; hashCode: number; dataLevl: number; dataFrom: number; kjndKJQJ: number; dataStat: number; dataOrdr: number; dataHide: number; dataType: number; dataDate: number; dataTime: number; dataGUID: string; mastName: string; mastGUID: string; userMain: number; createBy: string; createAt: number; updateBy: string; updateAt: number; deleteBy: string; deleteAt: number; queuesBy: number; entityID: string; sourceND: number; unitMain: number; deptMain: number; flowUndo: number; flowUser: string; flowText: string; menuMain: number; menuUUID: string; /**申请部门 */ sqbmText: string; /**申请用户 */ sqyhText: string; /**申请日期 */ ndjhDate: number; /**流程状态:(0:制单;1:送审;2:终审) */ ndjhStat: number; /**单据类型:检验类型 */ ndjhType: number; /**编号 */ ndjhCode: string; /**名称 */ ndjhName: string; /**申请用途 */ ndjhUses: string; /**基地ID */ hzcbMain: number; /**基地名称 */ hzcbName: string; /**备注说明 */ ndjhMemo: string; wContact: string; //#联系人 dContact: 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; /**附件 */ listPath: TCore.IPathResponse[]; listBill: THzcb.IHzcbNdjhBillResponse[]; /** 关联结果 */ listFrom: THzcb.IHzcbMainResponse[]; } export class THzcbNdjhResponse implements IHzcbNdjhResponse { whoBuild: number = 0; userIndx: number = 0; ndjhIndx: number = 0; parentID: number = 0; hashCode: number = 0; dataLevl: number = 0; dataFrom: number = 0; kjndKJQJ: number = 0; dataStat: number = 0; dataOrdr: number = 0; dataHide: number = 0; dataType: number = 0; dataDate: number = 0; dataTime: number = 0; dataGUID: string = ""; mastName: string = ""; mastGUID: string = ""; userMain: number = 0; createBy: string = ""; createAt: number = 0; updateBy: string = ""; updateAt: number = 0; deleteBy: string = ""; deleteAt: number = 0; queuesBy: number = 0; entityID: string = ""; sourceND: number = 0; unitMain: number = 0; deptMain: number = 0; flowUndo: number = 0; flowUser: string = ""; flowText: string = ""; menuMain: number = 0; menuUUID: string = ""; sqbmText: string = ""; sqyhText: string = ""; ndjhDate: number = 0; ndjhStat: number = 0; ndjhType: number = 0; ndjhCode: string = ""; ndjhName: string = ""; ndjhUses: string = ""; hzcbMain: number = 0; hzcbName: string = ""; ndjhMemo: string = ""; wContact: string = ""; //#联系人 dContact: 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; listPath: TCore.IPathResponse[] = []; listBill: THzcb.IHzcbNdjhBillResponse[] = []; listFrom: THzcb.IHzcbMainResponse[] = []; constructor(response: any = {}) { if (response) { _.merge(this, _.pick(response, Object.keys(this))); } } static toFlowDatas(notis: IHzcbNdjhResponse[]): TFlowDataResponse[] { return notis.map((u) => this.toFlowData(u)); } static toFlowData(ndjh: IHzcbNdjhResponse): TFlowDataResponse { const result = new TFlowDataResponse(); result.whoBuild = ndjh.whoBuild; result.userIndx = ndjh.userIndx; result.flowMain = ndjh.flowMain; result.flowNode = ndjh.flowNode; result.notified = ""; result.entityID = ndjh.entityID; result.billMain = ndjh.ndjhIndx; result.billCode = ndjh.ndjhCode; result.billMemo = ndjh.ndjhMemo; result.billUses = ""; result.ysxmText = ""; result.outMoney = 0; result.createAt = ndjh.createAt; result.mastName = ndjh.mastName; result.createBy = ndjh.createBy; result.unitMain = ndjh.unitMain; result.menuUUID = ndjh.menuUUID; result.deptMain = ndjh.deptMain; result.flowStat = ndjh.ndjhStat; return result; } static toWldyPrintData(noti: IHzcbNdjhResponse) { const data = new TStim.TStimulsoftPrintData(); data.billMain = String(noti.ndjhIndx); data.menuUUID = noti.menuUUID; return data; } static toWldyPrintDatas(listNoti: IHzcbNdjhResponse[]) { return listNoti.map((u) => this.toWldyPrintData(u)); } }