Преглед изворни кода

【修改】收费明细管理-导入非固定项:非固定项不关联收费标准,只以导入为主;

西昌分支
dyy пре 7 месеци
родитељ
комит
d9f5503024
1 измењених фајлова са 34 додато и 30 уклоњено
  1. +34
    -30
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs

+ 34
- 30
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs Прегледај датотеку

@@ -252,6 +252,8 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
{
failDt.Columns.Add(dc.ColumnName, dc.DataType);
}
//获取收费项目
var finaChargeItemList = db.FindList<FinaChargeItemEntity>(x => x.ChargeItemType == 2 && x.CheckMark == true && x.F_DeleteMark == false);
//获取收费标准 非固定项目
var finaChargesStandardList = db.FindList<FinaChargesStandardEntity>("select a.Grade,a.DeptNo,a.MajorNo,a.Standard,a.SYear,b.ChargeItemName,b.ChargeItemCode,b.ChargeItemType,b.priority from [dbo].[FinaChargesStandard] a left join [dbo].[FinaChargeItem] b on a.ChargeItemID=b.[ChargeItemID] where b.ChargeItemType=2 and a.F_DeleteMark=0 and a.CheckMark=1 and b.CheckMark=1 and b.F_DeleteMark=0");
//var finaChargesStandardListGroup = db.FindList<FinaChargesStandardEntity>(@"select a.Grade,a.DeptNo,a.MajorNo,sum(isnull(a.Standard,0)) as YJAmount,a.SYear
@@ -267,6 +269,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
{
FinaChargeStudentEntity finaChargeStudentEntity = null;
FinaChargesStandardEntity finaChargesStandardEntity = null;
FinaChargeItemEntity finaChargeItemEntity = null;
//检测是否有空值
if (dr[0].ToString() == "" || dr[1].ToString() == "" || dr[2].ToString() == "" || dr[3].ToString() == "" || dr[4].ToString() == "" || dr[5].ToString() == "")
{
@@ -292,12 +295,13 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
throw new Exception("【金额】不能为零或小于零,必须为正数!");
}
//筛选不在标准代码表内的数据
if (finaChargesStandardList.Count(m => m.ChargeItemCode == dr[3].ToString()&&m.ChargeItemName== dr[4].ToString()) == 0)
finaChargeItemEntity = finaChargeItemList.FirstOrDefault(m => m.ChargeItemCode == dr[3].ToString() && m.ChargeItemName == dr[4].ToString());
if (finaChargeItemEntity == null)
{
throw new Exception("【收费项目】不存在,请核对!");
}
//筛选不在收费学生表内的数据
finaChargeStudentEntity = stulist.FirstOrDefault(m => m.StuNo == dr[0].ToString()&&m.StuName== dr[1].ToString());
finaChargeStudentEntity = stulist.FirstOrDefault(m => m.StuNo == dr[0].ToString() && m.StuName == dr[1].ToString());
if (finaChargeStudentEntity == null)
{
throw new Exception("【收费学生】不存在,请核对!");
@@ -305,28 +309,28 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
else
{
//筛选有无对应专业收费标准的数据
finaChargesStandardEntity = finaChargesStandardList.FirstOrDefault(m =>
m.DeptNo == finaChargeStudentEntity.DeptNo &&
m.MajorNo == finaChargeStudentEntity.MajorNo && m.SYear == payyearresult &&
m.Grade == finaChargeStudentEntity.Grade && m.ChargeItemCode == dr[3].ToString()&&m.ChargeItemName== dr[4].ToString());
if (finaChargesStandardEntity == null)
{
throw new Exception("【专业年度收费标准】不存在,请核对!");
}
//finaChargesStandardEntity = finaChargesStandardList.FirstOrDefault(m =>
// m.DeptNo == finaChargeStudentEntity.DeptNo &&
// m.MajorNo == finaChargeStudentEntity.MajorNo && m.SYear == payyearresult &&
// m.Grade == finaChargeStudentEntity.Grade && m.ChargeItemCode == dr[3].ToString()&&m.ChargeItemName== dr[4].ToString());
//if (finaChargesStandardEntity == null)
//{
// throw new Exception("【专业年度收费标准】不存在,请核对!");
//}
}
//开始导入操作
//查询有无学生年度缴费数据
FinaChargeStuYearEntity oldFinaChargeStuYearEntity =
oldFinaChargeStuYearList.FirstOrDefault(m =>
m.StuNo == finaChargeStudentEntity.StuNo &&
m.FSYear == finaChargesStandardEntity.SYear);
if (oldFinaChargeStuYearEntity==null)
m.FSYear == payyearresult);
if (oldFinaChargeStuYearEntity == null)
{
//无数据新增主表
var finaChargeStuYear = new FinaChargeStuYearEntity();
finaChargeStuYear.Create();
finaChargeStuYear.StuNo = finaChargeStudentEntity.StuNo;
finaChargeStuYear.FSYear = finaChargesStandardEntity.SYear;
finaChargeStuYear.FSYear = payyearresult.ToInt();
finaChargeStuYear.SJAmount = 0;
finaChargeStuYear.PayFeeStatus = 0;
//子表
@@ -334,19 +338,19 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
finaChargeStuYearItem.Create();
finaChargeStuYearItem.FSYId = finaChargeStuYear.FSYId;
finaChargeStuYearItem.FSYear = finaChargeStuYear.FSYear;
finaChargeStuYearItem.ChargeItemCode = finaChargesStandardEntity.ChargeItemCode;
finaChargeStuYearItem.ChargeItemName = finaChargesStandardEntity.ChargeItemName;
finaChargeStuYearItem.ChargeItemType = finaChargesStandardEntity.ChargeItemType;
finaChargeStuYearItem.priority = finaChargesStandardEntity.priority;
finaChargeStuYearItem.Standard = finaChargesStandardEntity.Standard;
finaChargeStuYearItem.NeedToPay = finaChargesStandardEntity.Standard;
finaChargeStuYearItem.ChargeItemCode = finaChargeItemEntity.ChargeItemCode;
finaChargeStuYearItem.ChargeItemName = finaChargeItemEntity.ChargeItemName;
finaChargeStuYearItem.ChargeItemType = finaChargeItemEntity.ChargeItemType;
finaChargeStuYearItem.priority = finaChargeItemEntity.priority;
finaChargeStuYearItem.Standard = dresult;
finaChargeStuYearItem.NeedToPay = dresult;
finaChargeStuYearItem.FSBlance = 0;
var loginUserInfo = LoginUserInfo.Get();
finaChargeStuYearItem.F_CreateUserId = loginUserInfo.userId;
finaChargeStuYearItem.F_CreateUserName = loginUserInfo.realName;
db.Insert(finaChargeStuYearItem);
finaChargeStuYear.YJAmount = finaChargeStuYearItem.Standard;
finaChargeStuYear.NeedToPay+= finaChargeStuYearItem.Standard;
finaChargeStuYear.NeedToPay = finaChargeStuYearItem.Standard;
finaChargeStuYear.FSBlance = 0;
db.Insert(finaChargeStuYear);
snum++;
@@ -354,27 +358,27 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
else
{
//查询子表有无记录
if (oldFinaChargeStuYearItemList.Count(m=>m.StuNo== finaChargeStudentEntity.StuNo&&m.FSYear == finaChargesStandardEntity.SYear&&m.ChargeItemCode== finaChargesStandardEntity.ChargeItemCode) ==0)
if (oldFinaChargeStuYearItemList.Count(m => m.StuNo == finaChargeStudentEntity.StuNo && m.FSYear == payyearresult && m.ChargeItemCode == finaChargeItemEntity.ChargeItemCode) == 0)
{
//子表
var finaChargeStuYearItem = new FinaChargeStuYearItemEntity();
finaChargeStuYearItem.Create();
finaChargeStuYearItem.FSYId = oldFinaChargeStuYearEntity.FSYId;
finaChargeStuYearItem.FSYear = oldFinaChargeStuYearEntity.FSYear;
finaChargeStuYearItem.ChargeItemCode = finaChargesStandardEntity.ChargeItemCode;
finaChargeStuYearItem.ChargeItemName = finaChargesStandardEntity.ChargeItemName;
finaChargeStuYearItem.ChargeItemType = finaChargesStandardEntity.ChargeItemType;
finaChargeStuYearItem.priority = finaChargesStandardEntity.priority;
finaChargeStuYearItem.Standard = finaChargesStandardEntity.Standard;
finaChargeStuYearItem.ChargeItemCode = finaChargeItemEntity.ChargeItemCode;
finaChargeStuYearItem.ChargeItemName = finaChargeItemEntity.ChargeItemName;
finaChargeStuYearItem.ChargeItemType = finaChargeItemEntity.ChargeItemType;
finaChargeStuYearItem.priority = finaChargeItemEntity.priority;
finaChargeStuYearItem.Standard = dresult;
finaChargeStuYearItem.NeedToPay = finaChargeStuYearItem.Standard;
var loginUserInfo = LoginUserInfo.Get();
finaChargeStuYearItem.F_CreateUserId = loginUserInfo.userId;
finaChargeStuYearItem.F_CreateUserName = loginUserInfo.realName;
db.Insert(finaChargeStuYearItem);
//更新主表
oldFinaChargeStuYearEntity.YJAmount+= finaChargeStuYearItem.Standard;
oldFinaChargeStuYearEntity.YJAmount += finaChargeStuYearItem.Standard;
oldFinaChargeStuYearEntity.NeedToPay += finaChargeStuYearItem.Standard;
oldFinaChargeStuYearEntity.PayFeeStatus = (oldFinaChargeStuYearEntity.PayFeeStatus==1 || oldFinaChargeStuYearEntity.PayFeeStatus == 4)? 4:0;
oldFinaChargeStuYearEntity.PayFeeStatus = (oldFinaChargeStuYearEntity.PayFeeStatus == 1 || oldFinaChargeStuYearEntity.PayFeeStatus == 4) ? 4 : 0;
db.Update(oldFinaChargeStuYearEntity);
snum++;
}
@@ -423,11 +427,11 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
{
try
{
List<string> keys = keyValue.Split(',').ToList().Select(m=>"'"+m.Clone().ToString()+"'").ToList();
List<string> keys = keyValue.Split(',').ToList().Select(m => "'" + m.Clone().ToString() + "'").ToList();
var strSql = new StringBuilder();
strSql.Append("SELECT t.*,b.StuNo,b.StuName,b.MajorNo,b.ClassNo,b.DeptNo,b.IdentityCardNo ");
strSql.Append(" FROM FinaChargeStuYearItem t left join FinaChargeStuYear a on t.FSYId=a.FSYId left join FinaChargeStudent b on a.StuNo=b.StuNo ");
strSql.Append(" WHERE 1=1 and b.F_CheckMark=1 and t.FSBlance>0 and t.FSYIId in(" + string.Join(",", keys)+")");
strSql.Append(" WHERE 1=1 and b.F_CheckMark=1 and t.FSBlance>0 and t.FSYIId in(" + string.Join(",", keys) + ")");
return this.BaseRepository("CollegeMIS").FindList<FinaChargeStuYearItemEntity>(strSql.ToString());
}
catch (Exception ex)


Loading…
Откажи
Сачувај