瀏覽代碼

增加更新新生表缴费字段状态代码

master
坤 梁 1 年之前
父節點
當前提交
164dd298a3
共有 3 個檔案被更改,包括 139 行新增12 行删除
  1. +48
    -12
      DigitalSchoolApi/Controllers/PayFeeResultTwoController.cs
  2. +1
    -0
      DigitalSchoolApi/DigitalSchoolApi.csproj
  3. +90
    -0
      DigitalSchoolApi/Models/FinaChargeStuYearEntity.cs

+ 48
- 12
DigitalSchoolApi/Controllers/PayFeeResultTwoController.cs 查看文件

@@ -27,6 +27,42 @@ namespace DigitalSchoolApi.Controllers
private static string payresulturl =
ConfigurationManager.AppSettings["payresulturl"];


/// <summary>
/// 定时更新线上收费状态到新生表
/// </summary>
/// <returns></returns>
public IHttpActionResult SyncPayStatusToFresh()
{
RecurringJob.AddOrUpdate("SyncPayStatusToFresh",
() => SyncStuInfoFreshPayStatus(),
Cron.Minutely, TimeZoneInfo.Local);
return Ok();
}

/// <summary>
/// 更新线上收费状态到新生表
/// </summary>
public void SyncStuInfoFreshPayStatus()
{
try
{
using (IDbConnection conn = new SqlConnection(_sqlConnection))
{
conn.Execute(@"update StuInfoFresh set payfeestatus=1
from FinaChargeStuYear a left join StuInfoFresh b on a.stuno = b.stuno where a.PayFeeStatus <> 0");
}
}
catch (Exception e)
{
using (IDbConnection conncore = new SqlConnection(_coresqlConnection))
{
conncore.Execute(
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),122,'syncpaystatustofresh','" + e.Message + "',getdate())");
}
}
}

/// <summary>
/// 每分钟执行缴费后处理
/// </summary>
@@ -91,7 +127,7 @@ namespace DigitalSchoolApi.Controllers
foreach (var stuorderEntity in stuorderlist)
{
//开票
YKTTrabs.InvoiceEBillMethodTwo(stuorderEntity);
YKTTrabs.InvoiceEBillMethodTwo(stuorderEntity);
}
}
}
@@ -140,7 +176,7 @@ namespace DigitalSchoolApi.Controllers
using (IDbConnection conncore = new SqlConnection(_coresqlConnection))
{
conncore.Execute(
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','s = 000000: "+ Learun.Util.Str.ReplaceHtml(reStr) + "',getdate())");
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','s = 000000: " + Learun.Util.Str.ReplaceHtml(reStr) + "',getdate())");
}
string Orderid = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/ORDER")).InnerText;
string PAYMENT_MONEY = ((XmlElement)xml.SelectSingleNode("TX/TX_INFO/LIST/PAYMENT_MONEY")).InnerText;
@@ -162,7 +198,7 @@ namespace DigitalSchoolApi.Controllers
//string Orderid = item.orderid;
//string REM1 = item.StuNo;
//string REM2 = item.YearNo.ToString();
if (ORDER_STATUS=="1")
if (ORDER_STATUS == "1")
{
conn.Execute("update FinaChargeStuOrder set SJAmount='" + PAYMENT_MONEY + "',Status='" + ORDER_STATUS + "',PayTime='" + TRAN_DATE + "',PayMode='" + PAY_MODE + "',BankOrder='" + OriOvrlsttnEV_Trck_No + "' where orderid='" + Orderid + "'");
////判断实缴金额是否缴清费用
@@ -180,30 +216,30 @@ namespace DigitalSchoolApi.Controllers
//}
//记录缴费前余额、待缴金额
var oldFinaChargeStuYearItem = conn.Query<FinaChargeStuYearItemEntity>(@"select b.* from [dbo].[FinaChargeStuOrderDetail] a left join [dbo].[FinaChargeStuYearItem] b on a.ChargeItemCode=b.ChargeItemCode
where a.[FCSOId] = '"+item.Id+"' and b.FSYId = '"+ item.FSYId + "'");
where a.[FCSOId] = '" + item.Id + "' and b.FSYId = '" + item.FSYId + "'");
//实缴、缴费余额更新
//FinaChargeStuYearItem表
conn.Execute(@"update [dbo].[FinaChargeStuYearItem] set SJAmount=b.SJAmount+a.SJAmount,NeedToPay=NeedToPay-a.SJAmount,PayFeeStatus=(case when(NeedToPay-a.SJAmount<=0) then 1 when(NeedToPay-a.SJAmount=Standard) then 0 else 4 end)
from [dbo].[FinaChargeStuOrderDetail] a left join [dbo].[FinaChargeStuYearItem] b on a.ChargeItemCode=b.ChargeItemCode
where a.[FCSOId]='" + item.Id + "' and b.FSYId='"+item.FSYId+"'");
where a.[FCSOId]='" + item.Id + "' and b.FSYId='" + item.FSYId + "'");
//FinaChargeStuYear表
conn.Execute(@" update FinaChargeStuYear set SJAmount=aa.SJAmount,NeedToPay=aa.NeedToPay,PayFeeStatus=(case when(aa.NeedToPay<=0) then 1 else 4 end)
from (select isnull(sum(a.[NeedToPay]),0) as [NeedToPay],isnull(sum(a.SJAmount),0) as SJAmount,a.FSYear,b.StuNo from FinaChargeStuYearItem a left join FinaChargeStuYear b on a.FSYId=b.FSYId
group by a.FSYear,b.StuNo ) aa left join
FinaChargeStuYear b on aa.stuno=b.stuno and aa.FSYear=b.FSYear
where aa.StuNo='" + item.StuNo+"' and aa.FSYear='"+item.YearNo+"'");
where aa.StuNo='" + item.StuNo + "' and aa.FSYear='" + item.YearNo + "'");
//FinaChargeStudent表
conn.Execute(@"update FinaChargeStudent set NeedToPay=a.NeedToPay
from (select isnull(sum([NeedToPay]),0) as [NeedToPay],StuNo from [FinaChargeStuYear] group by StuNo) a left join
FinaChargeStudent b on a.stuno=b.stuno where a.stuno='" + item.StuNo+"'");
FinaChargeStudent b on a.stuno=b.stuno where a.stuno='" + item.StuNo + "'");
//FinaChargeStuBalance流水表
//记录缴费后余额、待缴金额
var newFinaChargeStuYearItem = conn.Query<FinaChargeStuYearItemEntity>(@"select b.* from [dbo].[FinaChargeStuOrderDetail] a left join [dbo].[FinaChargeStuYearItem] b on a.ChargeItemCode=b.ChargeItemCode
where a.[FCSOId] = '" + item.Id + "' and b.FSYId = '" + item.FSYId + "'");
IEnumerable<FinaChargeStuOrderDetailEntity> detaillist =conn.Query<FinaChargeStuOrderDetailEntity>("select * from FinaChargeStuOrderDetail where FCSOId='"+item.Id+"'");
IEnumerable<FinaChargeStuOrderDetailEntity> detaillist = conn.Query<FinaChargeStuOrderDetailEntity>("select * from FinaChargeStuOrderDetail where FCSOId='" + item.Id + "'");
foreach (var finaChargeStuOrderDetailEntity in detaillist)
{
if (finaChargeStuOrderDetailEntity.SJAmount>0)
if (finaChargeStuOrderDetailEntity.SJAmount > 0)
{
//计算学生缴费项目当前欠缴金额
var olditem = oldFinaChargeStuYearItem.FirstOrDefault(m => m.ChargeItemCode == finaChargeStuOrderDetailEntity.ChargeItemCode);
@@ -214,8 +250,8 @@ group by a.FSYear,b.StuNo ) aa left join
"'0','" + newitem.FSBlance + "',getdate(),'1')");
}
}
int PayFeeStatus = Convert.ToInt32(conn.ExecuteScalar("select PayFeeStatus from FinaChargeStuYear where StuNo='"+item.StuNo+"' and FSYear='"+item.YearNo+"'"));
if (PayFeeStatus==1)
int PayFeeStatus = Convert.ToInt32(conn.ExecuteScalar("select PayFeeStatus from FinaChargeStuYear where StuNo='" + item.StuNo + "' and FSYear='" + item.YearNo + "'"));
if (PayFeeStatus == 1)
{
//开票
Task.Run(() => YKTTrabs.InvoiceEBillMethodTwo(item));
@@ -245,7 +281,7 @@ group by a.FSYear,b.StuNo ) aa left join
using (IDbConnection conncore = new SqlConnection(_coresqlConnection))
{
conncore.Execute(
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','catch error:" + e.Message + ":"+e.StackTrace+"',getdate())");
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','catch error:" + e.Message + ":" + e.StackTrace + "',getdate())");
}
}
}


+ 1
- 0
DigitalSchoolApi/DigitalSchoolApi.csproj 查看文件

@@ -419,6 +419,7 @@
<Compile Include="Models\Ass_FixAssetsEntity.cs" />
<Compile Include="Models\FinaChargeStuOrderDetailEntity.cs" />
<Compile Include="Models\FinaChargeStuOrderEntity.cs" />
<Compile Include="Models\FinaChargeStuYearEntity.cs" />
<Compile Include="Models\FinaChargeStuYearItemEntity.cs" />
<Compile Include="Models\NewsEntity.cs" />
<Compile Include="Models\EmailManagementEntity.cs" />


+ 90
- 0
DigitalSchoolApi/Models/FinaChargeStuYearEntity.cs 查看文件

@@ -0,0 +1,90 @@
using Learun.Util;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2023-08-07 15:52
/// 描 述:学生年度缴费管理
/// </summary>
public class FinaChargeStuYearEntity
{
#region 实体成员
/// <summary>
/// FSYId
/// </summary>
public string FSYId { get; set; }
/// <summary>
/// StuNo
/// </summary>
public string StuNo { get; set; }
/// <summary>
/// FSYear
/// </summary>
public int? FSYear { get; set; }
/// <summary>
/// 应缴金额(收费标准)
/// </summary>
public decimal? YJAmount { get; set; }
/// <summary>
/// 实缴金额(已缴金额)
/// </summary>
public decimal? SJAmount { get; set; }
/// <summary>
/// 应缴余额
/// </summary>
public decimal? NeedToPay { get; set; }
/// <summary>
/// 超出应收额
/// </summary>
public decimal? FSBlance { get; set; }
/// <summary>
/// 缴费标志(0未缴费,1已缴清,4部分缴纳)
/// </summary>
public int? PayFeeStatus { get; set; }
#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.FSYId = Guid.NewGuid().ToString();
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.FSYId = keyValue;
}
#endregion
#region 扩展字段
[NotMapped]
public string DeptNo { get; set; }
[NotMapped]
public string MajorNo { get; set; }
[NotMapped]
public string ClassNo { get; set; }
[NotMapped]
public string Grade { get; set; }
[NotMapped]
public string IdentityCardNo { get; set; }
[NotMapped]
public string StuName { get; set; }
[NotMapped]
public bool? GenderNo { get; set; }
[NotMapped]
public decimal? PayMoney { get; set; }
[NotMapped]
public string orderid { get; set; }
#endregion
}
}


Loading…
取消
儲存