package nc.pubitf.cmp.report.fundexedetail;


import com.ufida.dataset.IContext;

import nc.bs.framework.common.NCLocator;
import nc.itf.cmp.report.fundexedetail.IFundExecutionDetail;
import nc.pub.smart.data.DataSet;
import nc.pub.smart.metadata.DataTypeConstant;
import nc.pub.smart.metadata.Field;
import nc.pub.smart.metadata.MetaData;
import nc.vo.pub.BusinessException;

/**
 * @Description: 资金执行明细（分公司）
 * 
 * @author 谢文如 【碧桂园-物业NCC-资金执行明细（分公司）】
 * @date 2021-4-11
 * @version with NCC V2005
 */
public class FundExecutionDetailService {

	private static final MetaData metaData;
	
	static {
		metaData = new MetaData();
		Field[] fields = new Field[74];
		for(int i=0;i<fields.length;i++){
			fields[i] = new Field();
			fields[i].setPrecision(500);
			fields[i].setDataType(DataTypeConstant.STRING);
		}
		int j = 0;
//1
		fields[j].setFldname("def47");
		fields[j++].setCaption("所属一级管理单位");
//2
		fields[j].setFldname("def41");
		fields[j++].setCaption("股权情况主键");
//3
		fields[j].setFldname("def41_name");
		fields[j++].setCaption("股权情况");
//4
		fields[j].setFldname("def4");
		fields[j++].setCaption("是否合资公司主键");
//5
		fields[j].setFldname("def4_name");
		fields[j++].setCaption("是否合资公司");
//6
		fields[j].setFldname("def6");
		fields[j++].setCaption("所属板块主键");
//7
		fields[j].setFldname("def6_name");
		fields[j++].setCaption("所属板块");
//8
		fields[j].setFldname("def11");
		fields[j++].setCaption("所属区域主键");
//9
		fields[j].setFldname("def11_name");
		fields[j++].setCaption("所属区域");
//10
		fields[j].setFldname("org_code");
		fields[j++].setCaption("公司编码");
//11
		fields[j].setFldname("org_name");
		fields[j++].setCaption("公司名称");
//12
		fields[j].setFldname("PK_ORG");
		fields[j++].setCaption("公司主键");
//13
		fields[j].setFldname("BILLNAME");
		fields[j++].setCaption("单据名称");
//14
		fields[j].setFldname("PK_ACCOUNT");
		fields[j++].setCaption("账户主键");
//15
		fields[j].setFldname("accnum");
		fields[j++].setCaption("账户编码");
//16
		fields[j].setFldname("BILL_DATE");
		fields[j++].setCaption("单据日期(带时分秒)");
//17
		fields[j].setFldname("SETTLEDATE");
		fields[j++].setCaption("结算日期(带时分秒)");
//18
		fields[j].setFldname("BILL_DATE_NAME");
		fields[j++].setCaption("单据日期");
//19
		fields[j].setFldname("SETTLEDATE_NAME");
		fields[j++].setCaption("结算日期");
//20
		fields[j].setFldname("MEMO");
		fields[j].setCaption("备注");
		fields[j++].setPrecision(4000);
//21
		fields[j].setFldname("BILL_NO");
		fields[j++].setCaption("单据号");
//22
		fields[j].setFldname("PK_CUST_SUPPLIER");
		fields[j++].setCaption("客商主键");
//23
		fields[j].setFldname("cp_code");
		fields[j++].setCaption("客商编码");
//24
		fields[j].setFldname("cp_name");
		fields[j++].setCaption("客商名称");
//25
		fields[j].setFldname("DFZT_CODE");
		fields[j++].setCaption("被代付账套/被代收账套编码");
//26
		fields[j].setFldname("DFZT_NAME");
		fields[j++].setCaption("被代付账套/被代收账套名称");
//27
		fields[j].setFldname("PK_DEPT");
		fields[j++].setCaption("部门主键");
//28
		fields[j].setFldname("dept_code");
		fields[j++].setCaption("部门编码");
//29
		fields[j].setFldname("dept_name");
		fields[j++].setCaption("部门名称");
//30
		fields[j].setFldname("REC_TYPE");
		fields[j++].setCaption("收款方式主键");
//31
		fields[j].setFldname("rec_type_code");
		fields[j++].setCaption("收款方式编码");
//32
		fields[j].setFldname("rec_type_name");
		fields[j++].setCaption("收款方式名称");
//33
		fields[j].setFldname("balatype_name");
		fields[j++].setCaption("结算方式名称");
//34
		fields[j].setFldname("CHARGE_TYPE");
		fields[j++].setCaption("收费类型主键");
//35
		fields[j].setFldname("EXPENSE_TYPE");
		fields[j++].setCaption("费用类型");
//36
		fields[j].setFldname("CHARGE_TYPE_code");
		fields[j++].setCaption("收费类型编码");
//37
		fields[j].setFldname("CHARGE_TYPE_name");
		fields[j++].setCaption("收费类型名称");
//38
		fields[j].setFldname("EXPENSE_TYPE_code");
		fields[j++].setCaption("费用类型编码");
//39
		fields[j].setFldname("EXPENSE_TYPE_name");
		fields[j++].setCaption("费用类型名称");
//40
		fields[j].setFldname("PK_RECPROJECT_63");
		fields[j++].setCaption("NC63收支项目主键");
//41
		fields[j].setFldname("inout_63_code");
		fields[j++].setCaption("NC63收支项目编码");
//42
		fields[j].setFldname("inout_63_name");
		fields[j++].setCaption("NC63收支项目名称");
//43
		fields[j].setFldname("BANKROLL_PROJET_63");
		fields[j++].setCaption("NC63资金计划项目主键");
//44
		fields[j].setFldname("fundplan_63_code");
		fields[j++].setCaption("NC63资金计划项目编码");
//45
		fields[j].setFldname("fundplan_63_name");
		fields[j++].setCaption("NC63资金计划项目名称");
//46
		fields[j].setFldname("CASH_ITEM_63");
		fields[j++].setCaption("NC63现金流量项目主键");
//47
		fields[j].setFldname("cashflow_63_code");
		fields[j++].setCaption("NC63现金流量项目编码");
//48
		fields[j].setFldname("cashflow_63_name");
		fields[j++].setCaption("NC63现金流量项目名称");
//49
		fields[j].setFldname("PK_RECPROJECT");
		fields[j++].setCaption("NCC收支项目主键");
//50
		fields[j].setFldname("inout_ncc_code");
		fields[j++].setCaption("NCC收支项目编码");
//51
		fields[j].setFldname("inout_ncc_name");
		fields[j++].setCaption("NCC收支项目名称");
//52
		fields[j].setFldname("BANKROLL_PROJET");
		fields[j++].setCaption("NCC资金计划项目主键");
//53
		fields[j].setFldname("fundplan_ncc_code");
		fields[j++].setCaption("NCC资金计划项目编码");
//54
		fields[j].setFldname("fundplan_ncc_name");
		fields[j++].setCaption("NCC资金计划项目名称");
//55
		fields[j].setFldname("CASH_ITEM");
		fields[j++].setCaption("NCC现金流量项目主键");
//56
		fields[j].setFldname("cashflow_ncc_code");
		fields[j++].setCaption("NCC现金流量项目编码");
//57
		fields[j].setFldname("cashflow_ncc_name");
		fields[j++].setCaption("NCC现金流量项目名称");
//58
		fields[j].setFldname("RECPROJECT_ISOK");
		fields[j++].setCaption("收支项目是否转换正确");
//59
		fields[j].setFldname("PLANITEM_ISOK");
		fields[j++].setCaption("资金计划项目是否转换正确");
//60
		fields[j].setFldname("CASH_ITEM_ISOK");
		fields[j++].setCaption("现金流量项目是否转换正确");
//61
		fields[j].setFldname("PK_PROJECT");
		fields[j++].setCaption("项目档案主键");
//62
		fields[j].setFldname("project_code");
		fields[j++].setCaption("项目档案编码");
//63
		fields[j].setFldname("project_name");
		fields[j++].setCaption("项目档案名称");
//64
		fields[j].setFldname("rec_primal");
		fields[j].setCaption("原币收入");
		fields[j].setPrecision(31);
		fields[j].setScale(2);
		fields[j++].setDataType(DataTypeConstant.DOUBLE);
//65
		fields[j].setFldname("pay_primal");
		fields[j].setCaption("原币支出");
		fields[j].setPrecision(31);
		fields[j].setScale(2);
		fields[j++].setDataType(DataTypeConstant.DOUBLE);
//66
		fields[j].setFldname("rec_local");
		fields[j].setCaption("本币收入");
		fields[j].setPrecision(31);
		fields[j].setScale(2);
		fields[j++].setDataType(DataTypeConstant.DOUBLE);
//67
		fields[j].setFldname("pay_local");
		fields[j].setCaption("本币支出");
		fields[j].setPrecision(31);
		fields[j].setScale(2);
		fields[j++].setDataType(DataTypeConstant.DOUBLE);
//68
		fields[j].setFldname("PK_CURRTYPE");
		fields[j++].setCaption("币种主键");
//69
		fields[j].setFldname("currtype_code");
		fields[j++].setCaption("币种编码");
//70
		fields[j].setFldname("currtype_name");
		fields[j++].setCaption("币种名称");
//71
		fields[j].setFldname("LOCAL_RATE");
		fields[j++].setCaption("汇率");
//72 经营类别
		fields[j].setFldname("jylbcode");
		fields[j++].setCaption("经营类别编码");
//73 经营类别
		fields[j].setFldname("jylbname");
		fields[j++].setCaption("经营类别名称");
//74 是否代收代付
		fields[j].setFldname("is_df");
		fields[j++].setCaption("代收代付情况");

		
		metaData.addField(fields);
	}
	
	public static MetaData getMetaData(){
		return metaData;
	}
	
	public static DataSet queryData(IContext context) throws BusinessException{
		IFundExecutionDetail service = NCLocator.getInstance().lookup(IFundExecutionDetail.class);
		return service.queryData(context);
	}
}

