public class SpecialPrintModel
{
/// <summary>
/// 供应商承担
/// </summary>
public string SupplierUnderTaker { get; set; }
/// <summary>
/// 客户订单号
/// </summary>
public string CustomerSerialNumber { get; set; }
/// <summary>
/// 付款金额
/// </summary>
public decimal PayAmount { get; set; }
/// <summary>
/// 开户行
/// </summary>
public string OpeningBank { get; set; }
/// <summary>
/// 收款单位
/// </summary>
public string CollectionMonad { get; set; }
/// <summary>
/// 银行帐号
/// </summary>
public string BankAccount { get; set; }
/// <summary>
/// 经办人
/// </summary>
public string ResponseiblePerson { get; set; }
/// <summary>
/// 分管领导
/// </summary>
public string Leader { get; set; }
/// <summary>
/// 财务审核
/// </summary>
public string FinanceApproval { get; set; }
/// <summary>
/// 财务经理审核
/// </summary>
public string FinanceManagerApproval { get; set; }
/// <summary>
/// 财务总监审核
/// </summary>
public string FinanceDirectorApproval { get; set; }
/// <summary>
/// CEO审核
/// </summary>
public string CEOApproval { get; set; }
/// <summary>
/// 流水号
/// </summary>
public string SerialNumber { get; set; }
}
public List<ShipSpecialPrintModel> GetTobePaidRecepit(ShipSpecialSearch search)
{
List<ShipSpecialPrintModel> curiseShipModel = new List<ShipSpecialPrintModel>();
var toBePaidModel = persistant.GetTobePaidRecepit(search);//查找出待支付的单据表信息
ArrayList serialArray=new ArrayList();//定义一个流水号列表
toBePaidModel.ForEach((u) => { serialArr.Add(u.SerialNumber); });
var toBePaidComment = persistant.GetTobePaidRecepitComment(serialArr);//查找出待支付单据的审核意见表(1个单据对应多少审核意见)
foreach (var item in toBePaidModel)
{
ShipSpecialPrintModel temp = new ShipSpecialPrintModel()
{
SupplierUnderTaker = supplierUnderTaker;
CustomerSerialNumber = item.CustomerOrderNumber;
PayAmount = item.PayAmount;
OpeningBank = item.PayBank;
CollectionMonad = item.Payee;
ResponseiblePerson = item.Creator;
SerialNumber = item.SerialNumber;
};
curiseShipModel.Add(temp);
}
foreach (var curise in curiseShipModel)
{
foreach (var comment in toBePaidComment)
{
if (comment.SerialNumber == curise.SerialNumber)
{
if (comment.ApprovalLevel == (int)LevelType.BranchedLeader)
{
curise.Leader = comment.Creator;
}
else if (comment.ApprovalLevel == (int)LevelType.Finance)
{
curise.FinanceApproval = comment.Creator;
}
else if (comment.ApprovalLevel == (int)LevelType.FinanceManager)
{
curise.FinanceManagerApproval = comment.Creator;
}
else if (comment.ApprovalLevel == (int)LevelType.ProjectDirector)
{
curise.FinanceDirectorApproval = comment.Creator;
}
else if (comment.ApprovalLevel == (int)LevelType.CEO)
{
curise.CEOApproval = comment.Creator;
}
}
}
}
return curiseShipModel
}
public class ShipSpecialPrintModel
{
/// <summary>
/// 供应商承担
/// </summary>
public string SupplierUnderTaker { get; set; }
/// <summary>
/// 客户订单号
/// </summary>
public string CustomerSerialNumber { get; set; }
/// <summary>
/// 付款金额
/// </summary>
public decimal PayAmount { get; set; }
/// <summary>
/// 开户行
/// </summary>
public string OpeningBank { get; set; }
/// <summary>
/// 收款单位
/// </summary>
public string CollectionMonad { get; set; }
/// <summary>
/// 银行帐号
/// </summary>
public string BankAccount { get; set; }
/// <summary>
/// 经办人
/// </summary>
public string ResponseiblePerson { get; set; }
/// <summary>
/// 分管领导
/// </summary>
[LevelAttribute(Level = 1)]
public string Leader { get; set; }
/// <summary>
/// 财务审核
/// </summary>
[LevelAttribute(Level = 2)]
public string FinanceApproval { get; set; }
/// <summary>
/// 财务经理审核
/// </summary>
[LevelAttribute(Level = 3)]
public string FinanceManagerApproval { get; set; }
/// <summary>
/// 财务总监审核
/// </summary>
[LevelAttribute(Level = 4)]
public string FinanceDirectorApproval { get; set; }
/// <summary>
/// CEO审核
/// </summary>
[LevelAttribute(Level = 5)]
public string CEOApproval { get; set; }
/// <summary>
/// 流水号
/// </summary>
public string SerialNumber { get; set; }
}
public class LevelAttribute : Attribute
{
public int Level { get; set; }
}
var toBePaidComment = persistant.GetTobePaidRecepitComment(ArrayList.Adapter(toBePaidModel.Select(u => u.SerialNumber).ToList()));
var specialPropertyInfo = (from property in typeof(CuriseShipSpecialPrintModel).GetProperties()
where property.GetCustomAttributes(typeof(LevelAttribute), false).Count() > 0
select property).ToList();
toBePaidModel.ForEach((item)=>{
ShipSpecialPrintModel temp = new ShipSpecialPrintModel()
{
SupplierUnderTaker = supplierUnderTaker;
CustomerSerialNumber = item.CustomerOrderNumber;
PayAmount = item.PayAmount;
OpeningBank = item.PayBank;
CollectionMonad = item.Payee;
ResponseiblePerson = item.Creator;
SerialNumber = item.SerialNumber;
};
var thisComments=toBePaidComment.Where(u=>u.SerialNumber =item.SerialNumber ).ToList();
thisComment.ForEach((cm)=>
{
if(cm.ApprovalLevel==(specialPropertyInfo.GetCustomAttributes(typeof(LevelAttribute),false).First() as LevelAttribute).Level)
{
cm.SetValue(model,cm.Creator,null);
}
});
})
Dictionary<int, PropertyInfo> dic = new Dictionary<int, PropertyInfo>();
propertyInfos.ForEach((myProperty) => { dic.Add((a.GetCustomAttributes(typeof(LevelAttribute),false).First() as LevelAttribute).Level,myProperty));
} );
comments.ForEach((cm) =>
{
if (dic.Keys.Contains(cm.ApprovalLevel))
{
dic[cm.ApprovalLevel].SetValue(model, cm.Creator, null);
}
});
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有