package cn.ey.biz.module.external.api.fd.feign.reqdto;

import java.math.BigDecimal;
import java.util.List;

import cn.ey.biz.module.external.api.fd.feign.reqdto.CommonRequest.OperationInfo;
import lombok.Data;

@Data
public class ExternalEngmentRequest {
	
	private String datajson;
	
	@Data
	public static class ExternalEngmentDataJson extends CommonRequest {

		List<EngmentInfo> data;
			
	}
	
	@Data
	public static class EngmentInfo{
		
		private OperationInfo operationinfo;	
		
		private ExternalEngmentReqMainTable mainTable;
		
		private List<Detail1Record> detail1;
		
		/**
		 * 人员
		 */
		private List<EngPersonnelRecord> detail2;
		
		/**
		 * 活动
		 */
		private List<EngActivityRecord> detail3;
		
		/**
		 * 人员
		 */
		private List<EngPersonnelRecord> detail4;
		
		/**
		 * 活动
		 */
		private List<EngActivityRecord> detail5;

	}
	
	@Data
	public static class ExternalEngmentReqMainTable {
		//字段描述	字段名称	字段类型	参数节点	是否必填	是否主键	字段约束
		//id	id	int	mainTable		是	
		private Long id;
		
		//流程编号	process_no	varchar(255)	mainTable
		private String process_no;
		
		//申请日期	application_date	char(10)	mainTable			传入格式：yyyy-MM-dd
		private String application_date;
		
		//生效日期	application_date	char(10)	mainTable			传入格式：yyyy-MM-dd
		private String effective_date;
		
		//Create Date	create_date	char(10)	mainTable	
		private String create_date;
		
		//申请人GPN	applicant_gpn	varchar(255)	mainTable
		private String applicant_gpn;
		
		//项目名称	engagement_name	varchar(255)	mainTable	
		private String engagement_name;
		
		//10位项目编号	engagement_code	varchar(10)	mainTable	
		private String engagement_code;
		
		//8位项目编号	engagement_code	varchar(10)	mainTable	
		private String engagement_code1;
		
		//项目状态	engagement_status	varchar(1000)	mainTable			传入：浏览框的数据id
		private String engagement_status;
		
		//业务线	service_line	varchar(255)	mainTable
		private String service_line;
		
		//子业务线	sub_service_line	varchar(255)	mainTable	
		private String sub_service_line;
		
		//全球服务编码	global_service_code	varchar(1000)	mainTable			传入：浏览框的数据id
		private String global_service_code;
		
		//本地服务编码	local_service_code	varchar(255)	mainTable	
		private String local_service_code;
		
		//基础币种	base_currency	int	mainTable
		private Integer base_currency;
		
		//项目用途	engagement_purpose	int(11)	mainTable			枚举：[0:Time,1:Expense,2:Time&Expense]
		private Integer engagement_purpose;
		
		//一次性/重复性	one_of_frecurring_event	int(11)	mainTable			枚举：[0:One-off,1:Recurring event]
		private Integer one_of_frecurring_event;
				
		//客户编号	client_id	varchar(255)	mainTable	
		private String client_id;
		
		//国家编号	country	varchar(255)	mainTable	
		private String country;
		
		//法律实体编号	legal_entity	varchar(255)	mainTable	
		private String legal_entity;
		
		//分支编号	branch	varchar(255)	mainTable
		private String branch;
		
		//权限范围	blocking_level	varchar(1000)	mainTable			传入：浏览框的数据id
		private String blocking_level;
		
		//项目预计开始时间	estimated_start_date	char(10)	mainTable			传入格式：yyyy-MM-dd
		private String estimated_start_date;
		
		//项目预计结束时间	estimated_close_date	char(10)	mainTable			传入格式：yyyy-MM-dd
		private String estimated_close_date;
		
		//小时数	hours	decimal(38,1)	mainTable
		private BigDecimal hours;
		
		//项目合伙人GPN	engagement_partner_gpn	varchar(255)	mainTable	
		private String engagement_partner_gpn;
		
		//项目经理GPN	engagement_manager_gpn	varchar(255)	mainTable	
		private String engagement_manager_gpn;
		
		//主要FMA GPN	primary_fma_gpn	varchar(255)	mainTable
		private String primary_fma_gpn;
		
		//活动编号	activity	varchar(255)	mainTable
		private String activity;
		
		//活动描述	activity_description	varchar(255)	mainTable
		private String activity_description;
		
		//变现	realization	varchar(255)	mainTable	
		private String realization;
		
		//合伙人参与度	partner_involvement	decimal(38,2)	mainTable	
		private BigDecimal partner_involvement;
		
		//总收入	total_revenue	decimal(38,2)	mainTable	
		private BigDecimal total_revenue;
		
		//利润率	margin	decimal(38,2)	mainTable	
		private BigDecimal margin;
		
		//本财年TER	current_fiscal_year_ter	decimal(38,2)	mainTable
		private BigDecimal current_fiscal_year_ter;
		
		//ERP	erp1	decimal(38,2)	mainTable
		private BigDecimal erp1;
		
		//项目描述	engagement_description	varchar(255)	mainTable	
		private String engagement_description;
		
		//计划预算编号	budget_plan_id	varchar(255)	mainTable	
		private String budget_plan_id;
		
		//计划预算版本编号	budget_version_id	varchar(255)	mainTable	
		private String budget_version_id;
		
		//项目类型	engagement_type	varchar(1000)	mainTable			传入：浏览框的数据id
		private String engagement_type;
		
		//项目子类型	engagement_sub_type	varchar(1000)	mainTable			传入：浏览框的数据id
		private String engagement_sub_type;
		
		//业务单元	business_unit	varchar(1000)	mainTable			传入：浏览框的数据id
		private String business_unit;
		
		//管理地区编号	mgmt_region	varchar(1000)	mainTable			传入：浏览框的数据id
		private String mgmt_region;
		
		//运营单位编号	oper_unit	varchar(1000)	mainTable			传入：浏览框的数据id
		private String oper_unit;
		
		//管理单位编号	mgmt_unit	varchar(1000)	mainTable			传入：浏览框的数据id
		private String mgmt_unit;
		
		//子管理单位编号	sub_mgmt_unit	varchar(1000)	mainTable			传入：浏览框的数据id
		private String sub_mgmt_unit;
		
		//地理区域编号	geo_region	varchar(255)	mainTable	
		private String geo_region;
		
		//PACE ID	pace_id	varchar(255)	mainTable	
		private String pace_id;
		
		//商机ID	opportunity_id	varchar(255)	mainTable	
		private String opportunity_id;
		
		//PY编号	py_code	varchar(255)	mainTable	
		private String py_code;
		
		//项目属性	engagement_code_attribute	int(11)	mainTable			枚举：[0:Master Code,1:Sub Code]
		private String engagement_code_attribute;
				
		//主项目编号	master_code	varchar(255)	mainTable	
		private String master_code;
		
		//地区编号	area	varchar(255)	mainTable
		private String area;
		
		//EAF	eaf	varchar(255)	mainTable
		private BigDecimal eaf;
		
		//ERP备注	erp_comments	varchar(255)	mainTable	
		private String erp_comments;
		
		//费用	expenses	decimal(38,2)	mainTable
		private BigDecimal expenses;
		
		private String reoxzk;
		
		private String typexzk;
		
		//财年	 mainTable
		private String fiscal_year;
		
		//本年度总收入	current_year_total_revenue	decimal(38,2)	mainTable
		private BigDecimal current_year_total_revenue;
		
		//Standard Engagement Revenue	standard_engagement_revenue	decimal(38,2)	mainTable		
		private BigDecimal standard_engagement_revenue;
		
		//Net Engagement Revenue	net_engagement_revenue	decimal(38,2)	mainTable	
		private BigDecimal net_engagement_revenue;
		
		//毛利	margin1	decimal(38,2)	mainTable		
		private BigDecimal margin1;
		
		//Cost	total_cost	decimal(38,2)	mainTable		
		private BigDecimal total_cost;
		
		//数据来源	 mainTable
		private String data_sources;
		
		//codeBlock
		private String codeblock;
		 
		//epCodeBlock
		private String ep_codeblock;
		
		//创建人gpn
		private String creatorgpn;
		
		/**是否公开*/
		private String isconfidential;
		
		/**保密等级  1: Maximum security,2:High security,3: Medium security,4: Minimal security*/
		private String confidential_level;
		
		/**计划来源[0:CCT,1:MMT,2:SmartHub]*/
		private Integer plan_source;
		
		/**Mercury Service Code*/
		private String mercury_service_code;
		
	}
	
	@Data
	public static class Operate {
		/**
		 * SaveOrUpdate 新增或修改/Save 新增/Update 修改/Delete 删
		 */
		private String action;
		
		/**
		 * SaveOrUpdate 新增或修改/Save 新增/Update 修改/Delete 删
		 */
		private String actionDescribe;
	}
	
	@Data
	public static class Detail1Record {
		
		private Operate operate;
		
		private Detail1Data data;

	}
	
	@Data
	public static class EngActivityRecord {
		
		private Operate operate;
		
		private EngActivity data;	

	}
	
	@Data
	public static class EngPersonnelRecord {
		
		private Operate operate;
		
		private EngPersonnel data;

	}
	
	@Data
	public static class Detail1Data {

	}
	
	@Data
	public static class EngActivity {
		
		//id	id	int	detail3		是	
		private Long id;
		
		//活动编号	activity	varchar(255)	detail3	
		private String activity;
		
		//活动描述 varchar(255)
		private String activity_description;

	}
	
	@Data
	public static class EngPersonnel {
		
		//id	id	int	detail2		是	
		private Long id;
		
		//人员角色	role	varchar(255)	detail2	
		private String role;
		
		//人员GPN	role_gpn	varchar(255)	detail2		
		private String role_gpn;
		
		//是否有效	sfyx	int(11)	detail2			枚举：[0:否,1:是]
	    private String sfyx;
	    
	    //创建日期	cjrq	char(10)	detail2			传入格式：yyyy-MM-dd
	    private String cjrq;
	    
	    /**生效日期	sxsj1	char(10)		传入格式：yyyy-MM-dd*/
	    private String sxsj1;
	    
	    /**失效日期	sxsj2	char(10)	detail4			传入格式：yyyy-MM-dd*/
	    private String sxsj2;

	}
	
	


}
