Browse Source

Merge branch '西昌分支' of http://8.141.155.183:3000/bjquanjiang/DigitalScholl into 西昌分支

西昌分支
ndbs 6 months ago
parent
commit
43a015875d
1 changed files with 31 additions and 15 deletions
  1. +31
    -15
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs

+ 31
- 15
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs View File

@@ -253,7 +253,9 @@ 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 finaChargeItemList = db.FindList<FinaChargeItemEntity>(x => x.ChargeItemType == 2 && x.CheckMark == true && x.F_DeleteMark == false);
//todo:待还原
var finaChargeItemList = db.FindList<FinaChargeItemEntity>(x => 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
@@ -262,13 +264,14 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
var oldFinaChargeStuYearList = db.FindList<FinaChargeStuYearEntity>();
//获取已有年度学生缴费明细记录
var oldFinaChargeStuYearItemList = db.FindList<FinaChargeStuYearItemEntity>("select a.*,b.StuNo from FinaChargeStuYearItem a left join FinaChargeStuYear b on a.FSYId=b.FSYId ");
var insertFinaChargeStuYearList = new List<FinaChargeStuYearEntity>();
// 循环遍历导入
foreach (DataRow dr in dt.Rows)
{
try
{
FinaChargeStudentEntity finaChargeStudentEntity = null;
FinaChargesStandardEntity finaChargesStandardEntity = 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() == "")
@@ -326,18 +329,10 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
m.FSYear == payyearresult);
if (oldFinaChargeStuYearEntity == null)
{
//无数据新增主表
var finaChargeStuYear = new FinaChargeStuYearEntity();
finaChargeStuYear.Create();
finaChargeStuYear.StuNo = finaChargeStudentEntity.StuNo;
finaChargeStuYear.FSYear = payyearresult.ToInt();
finaChargeStuYear.SJAmount = 0;
finaChargeStuYear.PayFeeStatus = 0;
//子表
var finaChargeStuYearItem = new FinaChargeStuYearItemEntity();
finaChargeStuYearItem.Create();
finaChargeStuYearItem.FSYId = finaChargeStuYear.FSYId;
finaChargeStuYearItem.FSYear = finaChargeStuYear.FSYear;
finaChargeStuYearItem.FSYear = payyearresult.ToInt();
finaChargeStuYearItem.ChargeItemCode = finaChargeItemEntity.ChargeItemCode;
finaChargeStuYearItem.ChargeItemName = finaChargeItemEntity.ChargeItemName;
finaChargeStuYearItem.ChargeItemType = finaChargeItemEntity.ChargeItemType;
@@ -348,11 +343,31 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
var loginUserInfo = LoginUserInfo.Get();
finaChargeStuYearItem.F_CreateUserId = loginUserInfo.userId;
finaChargeStuYearItem.F_CreateUserName = loginUserInfo.realName;
//主表
var insertFinaChargeStuYearEntity = insertFinaChargeStuYearList.FirstOrDefault(x => x.StuNo == finaChargeStudentEntity.StuNo && x.FSYear == payyearresult);
if (insertFinaChargeStuYearEntity == null)
{
//无数据新增主表
var finaChargeStuYear = new FinaChargeStuYearEntity();
finaChargeStuYear.Create();
finaChargeStuYear.StuNo = finaChargeStudentEntity.StuNo;
finaChargeStuYear.FSYear = payyearresult.ToInt();
finaChargeStuYear.SJAmount = 0;
finaChargeStuYear.PayFeeStatus = 0;
finaChargeStuYear.YJAmount = finaChargeStuYearItem.Standard;
finaChargeStuYear.NeedToPay = finaChargeStuYearItem.Standard;
finaChargeStuYear.FSBlance = 0;
finaChargeStuYearItem.FSYId = finaChargeStuYear.FSYId;
insertFinaChargeStuYearList.Add(finaChargeStuYear);
}
else
{
insertFinaChargeStuYearEntity.YJAmount += finaChargeStuYearItem.Standard;
insertFinaChargeStuYearEntity.NeedToPay += finaChargeStuYearItem.Standard;
finaChargeStuYearItem.FSYId = insertFinaChargeStuYearEntity.FSYId;
}
db.Insert(finaChargeStuYearItem);
finaChargeStuYear.YJAmount = finaChargeStuYearItem.Standard;
finaChargeStuYear.NeedToPay = finaChargeStuYearItem.Standard;
finaChargeStuYear.FSBlance = 0;
db.Insert(finaChargeStuYear);
snum++;
}
else
@@ -401,6 +416,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
string errordt = failDt.ToJson();
cache.Write<string>(cacheKey + fileGuid, errordt, CacheId.excel);
}
db.Insert(insertFinaChargeStuYearList);
db.Commit();
//更新学生缴费总表
BaseRepository("CollegeMIS").ExecuteBySql(@"update FinaChargeStudent set NeedToPay=a.[NeedToPay]


Loading…
Cancel
Save