@@ -71,7 +71,7 @@ namespace DigitalSchoolApi.Controllers | |||
{ | |||
RecurringJob.AddOrUpdate("PayFeeResultMinutes20", | |||
() => GetResult(true), | |||
Cron.Minutely, TimeZoneInfo.Local); | |||
"0 0/5 * * * ?", TimeZoneInfo.Local); | |||
return Ok(); | |||
} | |||
/// <summary> | |||
@@ -106,6 +106,40 @@ namespace DigitalSchoolApi.Controllers | |||
BackgroundJob.Enqueue(() => DoUnInvoiceHandleByFSYID(FSYID)); | |||
return Ok(); | |||
} | |||
/// <summary> | |||
/// 根据年度学生缴费id批量触发开票任务 | |||
/// </summary> | |||
/// <param name="yearno">学年,如2024</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public IHttpActionResult SetUnInvoiceHandleByFSYIDs(string yearno) | |||
{ | |||
try | |||
{ | |||
using (IDbConnection conn = new SqlConnection(_sqlConnection)) | |||
{ | |||
var FinaChargeStuYearList = conn.Query<FinaChargeStuYearEntity>($@"select f.* | |||
from FinaChargeStuYear f | |||
left join StuEnrollInvoiceRecord s on f.StuNo=s.StuNo and f.FSYear=s.YearNo | |||
where f.FSYear='{yearno}' and f.PayFeeStatus =1 | |||
and s.Id is null"); | |||
foreach (var item in FinaChargeStuYearList) | |||
{ | |||
DoUnInvoiceHandleByFSYID(item.FSYId); | |||
} | |||
} | |||
} | |||
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(),121,'piaoju','" + yearno + "学年批量开票异常:" + e.Message + "',getdate())"); | |||
} | |||
} | |||
return Ok(); | |||
} | |||
/// <summary> | |||
/// 补开发票 | |||
@@ -118,6 +152,19 @@ namespace DigitalSchoolApi.Controllers | |||
return Ok(); | |||
} | |||
/// <summary> | |||
/// 根据学生缴费订单id手动处理缴费结果 | |||
/// </summary> | |||
/// <param name="FCSOId"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public IHttpActionResult SetPayResultHandleByFCSOId(string FCSOId) | |||
{ | |||
BackgroundJob.Enqueue(() => DoPayResultHandleByFCSOId(FCSOId)); | |||
return Ok(); | |||
} | |||
public void UnInvoiceHandle(bool isexcel) | |||
{ | |||
try | |||
@@ -158,7 +205,7 @@ namespace DigitalSchoolApi.Controllers | |||
using (IDbConnection conn = new SqlConnection(_sqlConnection)) | |||
{ | |||
List<FinaChargeStuOrderEntity> stuorderlist = null; | |||
stuorderlist = conn.Query<FinaChargeStuOrderEntity>(@"select StuNo,YearNo,FSYId,'ExcelOffLine' as PayMode from FinaChargeStuOrder where Status=1 and fsyid='"+ FSYID + @"' | |||
stuorderlist = conn.Query<FinaChargeStuOrderEntity>(@"select StuNo,YearNo,FSYId,'ExcelOffLine' as PayMode from FinaChargeStuOrder where Status=1 and fsyid='" + FSYID + @"' | |||
group by StuNo, YearNo, FSYId, PayMode").ToList(); | |||
foreach (var stuorderEntity in stuorderlist) | |||
{ | |||
@@ -173,7 +220,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,'piaoju','" + e.Message + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FSYId:" + FSYID + ",异常原因:" + e.Message + "',getdate(),'" + FSYID + "')"); | |||
} | |||
} | |||
} | |||
@@ -188,9 +235,15 @@ namespace DigitalSchoolApi.Controllers | |||
string lastdate = iflasttenminutes | |||
? DateTime.Now.AddMinutes(-30).ToString("yyyy-MM-dd HH:mm:ss") | |||
: DateTime.Now.AddDays(-20).ToString("yyyy-MM-dd HH:mm:ss"); | |||
List<FinaChargeStuOrderEntity> list = conn.Query<FinaChargeStuOrderEntity>("select * from FinaChargeStuOrder where PlaceOrderTime>='" + lastdate + "' and Status=0 and OrderType=1 ").ToList(); | |||
List<FinaChargeStuOrderEntity> list = conn.Query<FinaChargeStuOrderEntity>("select * from FinaChargeStuOrder where PlaceOrderTime>='" + lastdate + "' and Status=0 and OrderType=1 order by PlaceOrderTime desc").ToList(); | |||
foreach (var item in list) | |||
{ | |||
//校验 | |||
var orderentity = conn.QueryFirstOrDefault<FinaChargeStuOrderEntity>($"select * from FinaChargeStuOrder where Id='{item.Id}' "); | |||
if (orderentity == null || orderentity.Status == 1) | |||
{ | |||
continue; | |||
} | |||
//轮询建行商户平台 | |||
XmlDocument xml = new XmlDocument(); | |||
xml.Load(AppContext.BaseDirectory + "\\Content\\payxml\\PayResultXMLFile.xml"); | |||
@@ -204,7 +257,20 @@ namespace DigitalSchoolApi.Controllers | |||
byte[] payload = encoding.GetBytes(par); | |||
HttpClient httpClient = new HttpClient(); | |||
HttpContent content = new ByteArrayContent(payload); | |||
string reStr = httpClient.PostAsync(payresulturl, content).Result.Content.ReadAsStringAsync().Result; | |||
string reStr = string.Empty; | |||
try | |||
{ | |||
reStr = httpClient.PostAsync(payresulturl, content).Result.Content.ReadAsStringAsync().Result; | |||
} | |||
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,F_Module) values(newid(),121,'ccb','FCSOId:" + item.Id + " 对接支付结果地址接口失败:" + reStr + ":" + e.Message + ":" + e.StackTrace + "',getdate(),'" + item.Id + "')"); | |||
} | |||
continue; | |||
} | |||
xml.LoadXml(reStr); | |||
string s = ((XmlElement)xml.SelectSingleNode("TX/RETURN_CODE")).InnerText; | |||
//string s = "000000"; | |||
@@ -213,7 +279,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','FCSOId:" + item.Id + " 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; | |||
@@ -237,6 +303,12 @@ namespace DigitalSchoolApi.Controllers | |||
//string REM2 = item.YearNo.ToString(); | |||
if (ORDER_STATUS == "1") | |||
{ | |||
//校验 | |||
var orderentity2 = conn.QueryFirstOrDefault<FinaChargeStuOrderEntity>($"select * from FinaChargeStuOrder where Id='{item.Id}' "); | |||
if (orderentity2 == null || orderentity2.Status == 1) | |||
{ | |||
continue; | |||
} | |||
conn.Execute("update FinaChargeStuOrder set SJAmount='" + PAYMENT_MONEY + "',Status='" + ORDER_STATUS + "',PayTime='" + TRAN_DATE + "',PayMode='" + PAY_MODE + "',BankOrder='" + OriOvrlsttnEV_Trck_No + "' where orderid='" + Orderid + "'"); | |||
////判断实缴金额是否缴清费用 | |||
//decimal sjcount = Convert.ToDecimal(conn.ExecuteScalar("select isnull(sum(SJAmount),0) from FinaChargeStuOrder where StuNo='" + REM1 + "' and Status=1 and YearNo='" + REM2 + "' ")); | |||
@@ -287,19 +359,17 @@ group by a.FSYear,b.StuNo ) aa left join | |||
"'0','" + newitem.FSBlance + "',getdate(),'1')"); | |||
} | |||
} | |||
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','FCSOId:" + item.Id + " orderid:" + Orderid + " StuNo:" + REM1 + " 缴费状态更新成功',getdate())"); | |||
} | |||
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)); | |||
} | |||
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','orderid:" + Orderid + " StuNo:" + REM1 + "',getdate())"); | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'ccb','缴费状态更新成功',getdate())"); | |||
} | |||
} | |||
} | |||
else | |||
@@ -307,8 +377,9 @@ 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','error:code=" + s + "xml=" + Learun.Util.Str.ReplaceHtml(reStr) + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'ccb','FCSOId:" + item.Id + " error:code=" + s + "xml=" + Learun.Util.Str.ReplaceHtml(reStr) + "',getdate(),'" + item.Id + "')"); | |||
} | |||
//s:YDCA02910001流水记录不存在;0250E0200001流水记录不存在;YALA02910002查询过于频繁,请稍后再试 | |||
} | |||
} | |||
} | |||
@@ -323,6 +394,87 @@ group by a.FSYear,b.StuNo ) aa left join | |||
} | |||
} | |||
public void DoPayResultHandleByFCSOId(string FCSOId) | |||
{ | |||
try | |||
{ | |||
using (IDbConnection conn = new SqlConnection(_sqlConnection)) | |||
{ | |||
var item = conn.QuerySingleOrDefault<FinaChargeStuOrderEntity>("select * from FinaChargeStuOrder where Id='" + FCSOId + "' and Status=0 and OrderType=1 "); | |||
if (item != null) | |||
{ | |||
conn.Execute("update FinaChargeStuOrder set Status='1' where Id='" + item.Id + "'"); | |||
//记录缴费前余额、待缴金额 | |||
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 + "'"); | |||
//实缴、缴费余额更新 | |||
//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 + "'"); | |||
//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 + "'"); | |||
//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 + "'"); | |||
//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 + "'"); | |||
foreach (var finaChargeStuOrderDetailEntity in detaillist) | |||
{ | |||
if (finaChargeStuOrderDetailEntity.SJAmount > 0) | |||
{ | |||
//计算学生缴费项目当前欠缴金额 | |||
var olditem = oldFinaChargeStuYearItem.FirstOrDefault(m => m.ChargeItemCode == finaChargeStuOrderDetailEntity.ChargeItemCode); | |||
var newitem = newFinaChargeStuYearItem.FirstOrDefault(m => m.ChargeItemCode == finaChargeStuOrderDetailEntity.ChargeItemCode); | |||
conn.Execute(@"insert into FinaChargeStuBalance(Id, StuNo, FSYear, FCSOId, ChargeItemCode, ChargeItemName, Standard, DJAmount, PaymentAmount, QJAmount, OldBalance, ChangeAmount, NowBalance, ChangeDate, ChangeType) values( | |||
newid(),'" + item.StuNo + "','" + item.YearNo + "','" + item.Id + "','" + finaChargeStuOrderDetailEntity.ChargeItemCode + "','" + finaChargeStuOrderDetailEntity.ChargeItemName + "','" + finaChargeStuOrderDetailEntity.YJAmount + "'," + | |||
"'" + olditem.NeedToPay + "','" + finaChargeStuOrderDetailEntity.SJAmount + "','" + newitem.NeedToPay + "','" + olditem.FSBlance + "'," + | |||
"'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) | |||
{ | |||
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','【手动处理缴费结果】FCSOId:" + FCSOId + " StuNo:" + item.StuNo + "可以触发开票接口',getdate())"); | |||
} | |||
//开票 | |||
Task.Run(() => YKTTrabs.InvoiceEBillMethodTwo(item)); | |||
} | |||
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','【手动处理缴费结果】FCSOId:" + FCSOId + " StuNo:" + item.StuNo + " 缴费状态更新成功',getdate())"); | |||
} | |||
} | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conn = new SqlConnection(_sqlConnection)) | |||
{ | |||
conn.Execute("update FinaChargeStuOrder set PayTime=null,PayMode=null,BankOrder=null where Id='" + FCSOId + "'"); | |||
} | |||
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())"); | |||
} | |||
} | |||
} | |||
public void GetOrderResult(string orderid) | |||
{ | |||
try | |||
@@ -21,6 +21,8 @@ using Learun.Util; | |||
using Microsoft.AspNet.SignalR.Client; | |||
using Newtonsoft.Json; | |||
using Convert = System.Convert; | |||
using DESEncrypt = Learun.Util.DESEncrypt; | |||
using Md5Helper = Learun.Util.Md5Helper; | |||
namespace DigitalSchoolApi.Controllers | |||
{ | |||
@@ -33,6 +35,8 @@ namespace DigitalSchoolApi.Controllers | |||
private readonly static string _misConnection = ConfigurationManager.ConnectionStrings["ConnectionPfcMisDBString"].ConnectionString; | |||
private static string _tlmzyMiddleConnection = ConfigurationManager.ConnectionStrings["TLMZYMiddleDBString"].ConnectionString; | |||
private readonly static string _tlmMiddleConnection =ConfigurationManager.ConnectionStrings["TLMMiddleDBString"].ConnectionString; | |||
/// <summary> | |||
/// 超过设置的晚归时间后,推送到负责人 | |||
@@ -427,6 +431,9 @@ where DateDiff(dd,t.CheckDate,getdate())=0 and t.OutTime<'{lateReturnTime}' and | |||
} | |||
} | |||
#region 数校同步到oracle中间库 | |||
/// <summary> | |||
/// 系部 | |||
/// </summary> | |||
@@ -481,7 +488,6 @@ where DateDiff(dd,t.CheckDate,getdate())=0 and t.OutTime<'{lateReturnTime}' and | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 专业 | |||
/// </summary> | |||
@@ -669,7 +675,6 @@ where DateDiff(dd,t.CheckDate,getdate())=0 and t.OutTime<'{lateReturnTime}' and | |||
var aa = _admsConnection.Split(';').First(x => x.Contains("Initial Catalog=")); | |||
basedbname = aa.Substring(aa.IndexOf("=") + 1); | |||
} | |||
var sqlstring = new StringBuilder(); | |||
sqlstring.Append("select t.StuId,t.StuNo,t.DeptNo,t.MajorNo,t.Grade,t.ClassNo,t.StuName,t.GenderNo,t.Birthday,t.IdentityCardNo,t.mobile,u.F_UserId from StuInfoBasic t "); | |||
sqlstring.Append(" left join " + basedbname + ".dbo.LR_Base_User u on t.StuNo=u.F_Account and t.StuName=u.F_RealName and t.IdentityCardNo=u.F_IdentityCardNo "); | |||
@@ -844,6 +849,379 @@ where DateDiff(dd,t.CheckDate,getdate())=0 and t.OutTime<'{lateReturnTime}' and | |||
} | |||
} | |||
#endregion | |||
#region oracle同步到数校 | |||
/// <summary> | |||
/// 从oracle中间库同步系部数据 | |||
/// </summary> | |||
public static void SyncDeptOracle() | |||
{ | |||
try | |||
{ | |||
IEnumerable<CX_JW_YX> entityList = null; | |||
using (IDbConnection conn = new OracleConnection(_tlmMiddleConnection)) | |||
{ | |||
entityList = conn.Query<CX_JW_YX>("SELECT * FROM \"CX_JW_YX\" WHERE YXBH in (SELECT YXBH FROM \"CX_JW_ZY\" GROUP BY YXBH)"); | |||
} | |||
using (IDbConnection conn = new SqlConnection(_misConnection)) | |||
{ | |||
try | |||
{ | |||
var maxSort = -1; | |||
try | |||
{ | |||
maxSort = conn.QueryFirstOrDefault<int>("select MAX(DeptSort) FROM CdDept"); | |||
} | |||
catch (Exception e) | |||
{ | |||
maxSort = -1; | |||
} | |||
//插入sql | |||
foreach (var item in entityList) | |||
{ | |||
CdDeptEntity model = null; | |||
using (IDbConnection xbconn = new SqlConnection(_misConnection)) | |||
{ | |||
model = xbconn.QueryFirstOrDefault<CdDeptEntity>($"select * from CdDept where DeptNo='{item.YXBH}'"); | |||
} | |||
if (model == null) | |||
{ | |||
maxSort++; | |||
var id = item.ID.Length == 30 ? Guid.ParseExact(item.ID, "N") : Guid.NewGuid(); | |||
//没有就新增 | |||
var sql = | |||
"INSERT INTO CdDept(DeptId, DeptNo, DeptName, DeptShortName, DeptEnBrief, DeptSort, DeptEnShort, DeptDirector, " + | |||
"DeptpSychology, TeachSecretary, DeptOldName, F_SchoolId, SyncFlag, DeptSubsidizer) " + | |||
$"VALUES ('{id}', '{item.YXBH}', '{item.YXMC}', '', '', {maxSort}, NULL,NULL," + | |||
" NULL, NULL, NULL, '207fa1a9-160c-4943-a89b-8fa4db0547ce', '0',NULL);"; | |||
conn.Execute(sql); | |||
} | |||
else | |||
{ | |||
//存在就修改 | |||
var sql = $"UPDATE CdDept SET DeptName='{item.YXMC}' where DeptNo='{model.DeptNo}';"; | |||
conn.Execute(sql); | |||
} | |||
} | |||
//插入数据同步结果 | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步系部信息到数校完成','系部同步数量:" + | |||
entityList.Count() + "条',getdate())"); | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步系部信息到数校异常','" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conn = new SqlConnection(_admsConnection)) | |||
{ | |||
conn.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步系部信息到数校异常','错误信息:" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 从oracle中间库同步专业数据 Photo数据 | |||
/// </summary> | |||
public static void SyncMajorOracle() | |||
{ | |||
try | |||
{ | |||
IEnumerable<CX_JW_ZY> entityList = null; | |||
using (IDbConnection conn = new OracleConnection(_tlmMiddleConnection)) | |||
{ | |||
entityList = conn.Query<CX_JW_ZY>("SELECT * FROM \"CX_JW_ZY\""); | |||
} | |||
using (IDbConnection conn = new SqlConnection(_misConnection)) | |||
{ | |||
try | |||
{ | |||
//插入sql | |||
foreach (var item in entityList) | |||
{ | |||
CdMajorEntity model = null; | |||
using (IDbConnection xbconn = new SqlConnection(_misConnection)) | |||
{ | |||
model = xbconn.QueryFirstOrDefault<CdMajorEntity>($"select * from CdMajor where MajorNo='{item.ZYBH}'"); | |||
} | |||
if (model == null) | |||
{ | |||
var id = item.ID.Length == 30 ? Guid.ParseExact(item.ID, "N") : Guid.NewGuid(); | |||
var sql = | |||
$"INSERT INTO CdMajor([ID], [MajorNo], [MajorName], [LengthOfSchooling], [SubjectSpeciesNo], [DeptNo], [GovMajorNo], [GovMajorName], " + | |||
$"[MajorNameEn], [SubjectSpeciesNo1], [GraduateNo], [CheckMark], [MajorNameBrief], [MajorDirector], [FreshStuMark], [F_SchoolId], [SyncFlag], " + | |||
$"[RecruitObject], [DevelopLevel], [Certificate], [DevelopTarget], [Introduce], [Photo], [Year], [Province], [City], [Area]) " + | |||
$"VALUES ('{id}', '{item.ZYBH}', '{item.ZYMC}', {Convert.ToInt32(item.XZ.Replace("年", ""))}, ''," + | |||
$" '{item.YXBH}', '{item.ZYBH}', '{item.ZYMC}', '', NULL, '2', '1', '', '', NULL, '207fa1a9-160c-4943-a89b-8fa4db0547ce', '0', '', '', '', '', '', NULL, NULL, NULL, NULL, NULL);"; | |||
conn.Execute(sql); | |||
} | |||
else | |||
{ | |||
var sql = $"UPDATE CdMajor SET MajorName='{item.ZYMC}',LengthOfSchooling={Convert.ToInt32(item.XZ.Replace("年", ""))},DeptNo='{item.YXBH}',GovMajorName='{item.ZYMC}' where MajorNo='{model.MajorNo}';"; | |||
conn.Execute(sql); | |||
} | |||
} | |||
//插入数据同步结果 | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步专业信息到数校完成','专业同步数量:" + | |||
entityList.Count() + "条',getdate())"); | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步专业信息到数校异常','" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conn = new SqlConnection(_admsConnection)) | |||
{ | |||
conn.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步专业信息到数校异常','错误信息:" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 从oracle中间库同步班级数据 | |||
/// </summary> | |||
public static void SyncClassInfoOracle() | |||
{ | |||
try | |||
{ | |||
IEnumerable<CX_JW_BJ> entityList = null; | |||
using (IDbConnection conn = new OracleConnection(_tlmMiddleConnection)) | |||
{ | |||
entityList = conn.Query<CX_JW_BJ>("SELECT * FROM \"CX_JW_BJ\""); | |||
} | |||
using (IDbConnection conn = new SqlConnection(_misConnection)) | |||
{ | |||
try | |||
{ | |||
//插入sql | |||
foreach (var item in entityList) | |||
{ | |||
ClassInfoEntity model = null; | |||
using (IDbConnection xbconn = new SqlConnection(_misConnection)) | |||
{ | |||
model = xbconn.QueryFirstOrDefault<ClassInfoEntity>($"select * from ClassInfo where ClassNo='{item.BJBH}'"); | |||
} | |||
if (model == null) | |||
{ | |||
var id = item.ID.Length == 30 ? Guid.ParseExact(item.ID, "N") : Guid.NewGuid(); | |||
var sql = | |||
"INSERT INTO ClassInfo([ClassId], [ClassNo], [ClassName], [DeptNo], [MajorNo], [MajorDetailNo], [MajorDetailName], [Grade], " + | |||
"[StuNum], [SerialNum], [ClassDiredctorNo], [ClassTutorNo], [ClassNameFull], [CheckMark], [SyncFlag], [ClassType], [IsSeparate])" + | |||
$" VALUES ('{id}', '{item.BJBH}', '{item.BJMC}', '{item.YXBH}', '{item.ZYBH}', NULL, NULL," + | |||
$" '{item.SZNJ.Substring(item.SZNJ.Length - 2)}', 1, '', '', '', NULL, '1', '0', '', '0');"; | |||
conn.Execute(sql); | |||
} | |||
else | |||
{ | |||
var sql = | |||
$"UPDATE ClassInfo SET ClassName='{item.BJMC}',DeptNo='{item.YXBH}',MajorNo='{item.ZYBH}',Grade='{item.SZNJ.Substring(item.SZNJ.Length - 2)}' where ClassNo='{model.ClassNo}';"; | |||
conn.Execute(sql); | |||
} | |||
} | |||
//插入数据同步结果 | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步班级信息到数校完成','班级同步数量:" + | |||
entityList.Count() + "条',getdate())"); | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步班级信息到数校异常','" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conn = new SqlConnection(_admsConnection)) | |||
{ | |||
conn.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步班级信息到数校异常','错误信息:" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 从oracle中间库同步学生数据 | |||
/// </summary> | |||
public static void SyncStuInfoOracle(string date) | |||
{ | |||
try | |||
{ | |||
//增加列sql | |||
//ALTER TABLE StuInfoBasic ADD XJZT nvarchar(50); --增加XJZT 学籍状态 | |||
//EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'学籍状态', @level0type = N'Schema', @level0name = dbo, @level1type = N'Table', @level1name = StuInfoBasic, @level2type = N'Column', @level2name = XJZT; | |||
//ALTER TABLE StuInfoBasic ADD XSDQZT nvarchar(50); --增加XSDQZT 学生当前状态 | |||
//EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'学生当前状态', @level0type = N'Schema', @level0name = dbo, @level1type = N'Table', @level1name = StuInfoBasic, @level2type = N'Column', @level2name = XSDQZT; | |||
if (string.IsNullOrEmpty(date)) | |||
{ | |||
date = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"); | |||
} | |||
IEnumerable<CX_JW_XSXX> entityList = null; | |||
using (IDbConnection conn = new OracleConnection(_tlmMiddleConnection)) | |||
{ | |||
entityList = conn.Query<CX_JW_XSXX>($"SELECT ID,XH,KSH,YXBH,ZYBH,BJBH,SZNJ,XM,XMPY,XB,CSRQ,LXDH,SFZX,XJZT,XSDQZT,ZZMM,MZ,SFZJH FROM \"CX_JW_XSXX\" WHERE UPDATE_DATE> TO_DATE('{date}', 'YYYY-MM-DD')"); | |||
} | |||
using (IDbConnection conn = new SqlConnection(_misConnection)) | |||
{ | |||
try | |||
{ | |||
//插入sql | |||
foreach (var item in entityList) | |||
{ | |||
StuInfoBasicEntity model = null; | |||
using (IDbConnection xbconn = new SqlConnection(_misConnection)) | |||
{ | |||
model = xbconn.QueryFirstOrDefault<StuInfoBasicEntity>($"select * from StuInfoBasic where StuNo='{item.XH}'"); | |||
} | |||
var mzSql = | |||
$"SELECT t.F_ItemValue FROM LR_Base_DataItemDetail t INNER JOIN LR_Base_DataItem t2 ON t.F_ItemId = t2.F_ItemId WHERE t2.F_ItemCode = 'National' AND t.F_ItemName='{item.MZ}'"; | |||
var xb = item.XB == "男" ? 1 : 0; | |||
var MZ = ""; | |||
if (model == null) | |||
{ | |||
var basedbname = string.Empty; | |||
if (_admsConnection.IndexOf("database=") > 0) | |||
{ | |||
var aa = _admsConnection.Split(';').First(x => x.Contains("database=")); | |||
basedbname = aa.Substring(aa.IndexOf("=") + 1); | |||
} | |||
else if (_admsConnection.IndexOf("Initial Catalog=") > 0) | |||
{ | |||
var aa = _admsConnection.Split(';').First(x => x.Contains("Initial Catalog=")); | |||
basedbname = aa.Substring(aa.IndexOf("=") + 1); | |||
} | |||
var key = Md5Helper.Encrypt(CreateNo(), 16).ToLower(); | |||
var pwd = Md5Helper.Encrypt(DESEncrypt.Encrypt(Md5Helper.Encrypt("tlmzy123456", 32).ToLower(), key).ToLower(), 32).ToLower(); | |||
var id= item.ID.Length == 30 ? Guid.ParseExact(item.ID, "N"):Guid.NewGuid(); | |||
var sql = | |||
"INSERT INTO StuInfoBasic(StuId,StuNo,StuCode,NoticeNo,GraduateYear,ksh,DeptNo,MajorNo,Grade,ClassNo,StuName,SpellFull,GenderNo,Birthday,PartyFaceNo," + | |||
"FamilyOriginNo,NationalityNo,ResidenceNo,HealthStatusNo,GraduateNo,OverseasChineseNo,GoodAt,IdentityCardNo,InSchoolAddress," + | |||
"InSchoolTelephone,Remark,mobile,CheckMark,InSchoolStatus,F_SchoolId,EduSystem,StudyModality,XJZT,XSDQZT) " + | |||
$"VALUES('{id}','{item.XH}','{item.XH}','{item.XH}','','{item.KSH}', '{item.YXBH}', '{item.ZYBH}'," + | |||
$"'{item.SZNJ.Substring(item.SZNJ.Length - 2)}','{item.BJBH}','{item.XM}', '{item.XMPY}','{xb}','{item.CSRQ}','{GetZZMM(item.ZZMM)}',''," + | |||
$"'{MZ}','','1','2','0','','{item.SFZJH}','','',''," + | |||
$"'{item.LXDH}','1','{item.SFZX}','207fa1a9-160c-4943-a89b-8fa4db0547ce', '2', '1','{item.XJZT}','{item.XSDQZT}');"; | |||
//conn.Execute(sql); | |||
var userSql = | |||
$"INSERT INTO {basedbname}.dbo.LR_Base_User(F_UserId,F_EnCode,F_Account,F_Password,F_Secretkey,F_RealName,F_Gender,F_CompanyId," + | |||
$"F_DepartmentId,F_DeleteMark,F_EnabledMark,F_Description,F_CreateDate,F_CreateUserId,F_CreateUserName,F_IdentityCardNo) VALUES('{Guid.NewGuid():D}'," + | |||
$"'{item.XH}','{item.XH}','{pwd}','{key}','{item.XM}','{xb}','207fa1a9-160c-4943-a89b-8fa4db0547ce','{item.YXBH}',0,1,'学生'," + | |||
$"'{DateTime.Now:yyyy-MM-dd hh:mm:ss}','System','数据同步','{item.SFZJH}');"; | |||
conn.Execute(sql+userSql); | |||
} | |||
else | |||
{ | |||
var sql = | |||
$"UPDATE StuInfoBasic SET StuName='{item.XM}',SpellFull='{item.XMPY}',GenderNo={xb},Birthday='{item.CSRQ}',IdentityCardNo='{item.SFZJH}'," + | |||
$"Grade='{item.SZNJ.Substring(item.SZNJ.Length - 2)}',DeptNo='{item.YXBH}'," + | |||
$"MajorNo='{item.ZYBH}',ClassNo='{item.BJBH}',ksh='{item.KSH}',mobile='{item.LXDH}'," + | |||
$"InSchoolStatus='{item.SFZX}', XJZT='{item.XJZT}',XSDQZT='{item.XSDQZT}' where StuNo='{model.StuNo}';"; | |||
conn.Execute(sql); | |||
} | |||
} | |||
//插入数据同步结果 | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步学生信息到数校完成','学生同步数量:" + | |||
entityList.Count() + "条',getdate())"); | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conncore = new SqlConnection(_admsConnection)) | |||
{ | |||
conncore.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步学生信息到数校异常','" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
using (IDbConnection conn = new SqlConnection(_admsConnection)) | |||
{ | |||
conn.Execute( | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),999,'从超星oracle中间库同步学生信息到数校异常','错误信息:" + | |||
e.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取政治面貌代码 | |||
/// </summary> | |||
/// <returns></returns> | |||
private static string GetZZMM(string zzmmstr) | |||
{ | |||
if (string.IsNullOrEmpty(zzmmstr)) | |||
{ | |||
return "13"; | |||
} | |||
if (zzmmstr.Contains("共青") || zzmmstr.Contains("青年")) | |||
{ | |||
return "03"; | |||
} | |||
else if (zzmmstr.Contains("群众")) | |||
{ | |||
return "13"; | |||
} | |||
return "13"; | |||
} | |||
/// <summary> | |||
/// 自动生成编号 201008251145409865 | |||
/// </summary> | |||
/// <returns></returns> | |||
private static string CreateNo() | |||
{ | |||
Random random = new Random(); | |||
string strRandom = random.Next(1000, 10000).ToString(); //生成编号 | |||
string code = DateTime.Now.ToString("yyyyMMddHHmmss") + strRandom;//形如 | |||
return code; | |||
} | |||
#endregion | |||
/// <summary> | |||
/// 发送邮件提醒 | |||
/// </summary> | |||
@@ -14,12 +14,50 @@ using Learun.Application.Organization; | |||
namespace DigitalSchoolApi.Controllers | |||
{ | |||
public class YKTController : BaseController | |||
public class YKTController : BaseController | |||
{ | |||
private readonly static string _admsConnection = ConfigurationManager.ConnectionStrings["CoreDBString"].ConnectionString; | |||
private readonly static string _misConnection = ConfigurationManager.ConnectionStrings["ConnectionPfcMisDBString"].ConnectionString; | |||
/// <summary> | |||
/// 从oracle中间库中同步学生 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public IHttpActionResult SyncStuInfoOracle(string date) | |||
{ | |||
TLMSchoolController.SyncStuInfoOracle(date); | |||
return Ok("同步成功"); | |||
} | |||
/// <summary> | |||
/// 从oracle中间库中同步院系 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public IHttpActionResult SyncDeptOracle() | |||
{ | |||
TLMSchoolController.SyncDeptOracle(); | |||
return Ok("同步成功"); | |||
} | |||
/// <summary> | |||
/// 从oracle中间库中同步专业 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public IHttpActionResult SyncMajorOracle() | |||
{ | |||
TLMSchoolController.SyncMajorOracle(); | |||
return Ok("同步成功"); | |||
} | |||
/// <summary> | |||
/// 从oracle中间库中同步班级 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public IHttpActionResult SyncClassInfoOracle() | |||
{ | |||
TLMSchoolController.SyncClassInfoOracle(); | |||
return Ok("同步成功"); | |||
} | |||
/// <summary> | |||
/// 西昌一卡通推送 | |||
/// </summary> | |||
@@ -451,7 +489,29 @@ namespace DigitalSchoolApi.Controllers | |||
//TLMSchoolController.CloseAccount(); | |||
return Ok(); | |||
} | |||
/// <summary> | |||
/// 塔里木从超星oracle中间库同步学生基础数据到数校 | |||
/// </summary> | |||
public IHttpActionResult SyncTLMZYMiddleToBaseInfo() | |||
{ | |||
//院系 | |||
RecurringJob.AddOrUpdate("SyncTLMZYMiddleToDepartment", | |||
() => TLMSchoolController.SyncDeptOracle(), | |||
Cron.Daily(1), TimeZoneInfo.Local); | |||
//专业 | |||
RecurringJob.AddOrUpdate("SyncTLMZYMiddleToMajor", | |||
() => TLMSchoolController.SyncMajorOracle(), | |||
Cron.Daily(1), TimeZoneInfo.Local); | |||
//班级 | |||
RecurringJob.AddOrUpdate("SyncTLMZYMiddleToClassInfo", | |||
() => TLMSchoolController.SyncClassInfoOracle(), | |||
Cron.Daily(1), TimeZoneInfo.Local); | |||
//学生 | |||
RecurringJob.AddOrUpdate("SyncTLMZYMiddleToStuInfo", | |||
() => TLMSchoolController.SyncStuInfoOracle(null), | |||
Cron.Daily(1), TimeZoneInfo.Local); | |||
return Ok(); | |||
} | |||
/// <summary> | |||
/// 往塔里木oracle中间库中同步数校基础信息 | |||
/// </summary> | |||
@@ -672,7 +672,7 @@ namespace DigitalSchoolApi.Controllers | |||
eBillListClass eBillListitem = new eBillListClass(); | |||
eBillListitem.busNo = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); | |||
eBillListitem.ivcDate = DateTime.Now.ToString("yyyy-MM-dd"); | |||
eBillListitem.placeCode = "001"; | |||
eBillListitem.placeCode = "004"; | |||
eBillListitem.billCode = "4004"; | |||
eBillListitem.channel = "23"; | |||
eBillListitem.payerType = "1"; | |||
@@ -811,7 +811,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,'typecode','开票typecode:" + item.Key + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'typecode','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";开票typecode:" + item.Key + "',getdate())"); | |||
} | |||
InvoiceEBillByTypeTwo(conn, orderEntity, item.Key, item); | |||
} | |||
@@ -820,7 +820,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,'piaoju','开票异常:" + ex.Message + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";开票异常:" + ex.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
@@ -831,7 +831,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,'piaoju','开票异常:" + ex.Message + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";开票准备报错:" + ex.Message + "',getdate())"); | |||
} | |||
} | |||
} | |||
@@ -848,7 +848,7 @@ namespace DigitalSchoolApi.Controllers | |||
biParam.busType = appid; | |||
biParam.busNo = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); | |||
biParam.ivcDate = DateTime.Now.ToString("yyyy-MM-dd"); | |||
biParam.placeCode = "001"; | |||
biParam.placeCode = "004"; | |||
biParam.billCode = billCode;//"4004"; | |||
biParam.channel = "28"; | |||
if (orderEntity.PayMode == "BHK" || orderEntity.PayMode == "THK")//BHK:建行;THK:他行;ZFB:支付宝;CFT:微信 | |||
@@ -941,7 +941,7 @@ namespace DigitalSchoolApi.Controllers | |||
string checkCode = billInfo.checkCode; | |||
//记录票号 | |||
var recordId = Guid.NewGuid(); | |||
conn.Execute($"insert into StuEnrollInvoiceRecord(Id,YearNo,StuNo,billNo,random,billStatus) values('{recordId}','{orderEntity.YearNo}','{orderEntity.StuNo}','{eBillNo}','{checkCode}','1')"); | |||
conn.Execute($"insert into StuEnrollInvoiceRecord(Id,YearNo,StuNo,billNo,random,billStatus,FCSOId,CreateTime) values('{recordId}','{orderEntity.YearNo}','{orderEntity.StuNo}','{eBillNo}','{checkCode}','1','{orderEntity.Id}',getdate())"); | |||
//conn.Execute("update StuEnrollFeeOrder set billBatchCode='" + eBillCode + "',billNo='" + eBillNo + "',random='" + checkCode + "',billStatus=1 where orderid='" + OrderId + "'"); | |||
if (IsNewOrOld) | |||
{ | |||
@@ -1042,7 +1042,7 @@ namespace DigitalSchoolApi.Controllers | |||
biParam.busType = appid; | |||
biParam.busNo = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); | |||
biParam.ivcDate = DateTime.Now.ToString("yyyy-MM-dd"); | |||
biParam.placeCode = "001"; | |||
biParam.placeCode = "004"; | |||
biParam.billCode = billCode;//"4004"; | |||
biParam.channel = "28"; | |||
if (orderEntity.PayMode == "BHK" || orderEntity.PayMode == "THK")//BHK:建行;THK:他行;ZFB:支付宝;CFT:微信 | |||
@@ -1086,7 +1086,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,'piaoju','发送给开票系统原始数据:" + JsonConvert.SerializeObject(biParam) + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";发送给开票系统原始数据:" + JsonConvert.SerializeObject(biParam) + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
var data = Convert.ToBase64String(encoding.GetBytes(JsonConvert.SerializeObject(biParam))); | |||
var noise = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); | |||
@@ -1113,7 +1113,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,'piaoju','开票系统返回:" + datain + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";开票系统返回:" + datain + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
string returnresult = encoding.GetString(Convert.FromBase64String(datain)); | |||
if (returnresult != "") | |||
@@ -1127,7 +1127,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,'piaoju','开票系统成功返回:" + messagedecode + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";开票系统成功返回:" + messagedecode + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
dynamic billInfo = JsonConvert.DeserializeObject(messagedecode); | |||
string eBillCode = billInfo.eBillCode; | |||
@@ -1135,7 +1135,7 @@ namespace DigitalSchoolApi.Controllers | |||
string checkCode = billInfo.checkCode; | |||
//记录票号 | |||
var recordId = Guid.NewGuid(); | |||
conn.Execute($"insert into StuEnrollInvoiceRecord(Id,YearNo,StuNo,billNo,random,billStatus) values('{recordId}','{orderEntity.YearNo}','{orderEntity.StuNo}','{eBillNo}','{checkCode}','1')"); | |||
conn.Execute($"insert into StuEnrollInvoiceRecord(Id,YearNo,StuNo,billNo,random,billStatus,FCSOId,CreateTime,FSYId) values('{recordId}','{orderEntity.YearNo}','{orderEntity.StuNo}','{eBillNo}','{checkCode}','1','{orderEntity.Id}',getdate(),'{orderEntity.FSYId}')"); | |||
//查询票据url | |||
var invoiceobj = new { billBatchCode = eBillCode, billNo = eBillNo, random = checkCode, channelMode = "1" }; | |||
@@ -1162,7 +1162,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,'piaoju','查询开票url返回:" + datainvoice + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";查询开票url返回:" + datainvoice + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
string returnresultinvoice = encoding.GetString(Convert.FromBase64String(datainvoice)); | |||
resultobj = JsonConvert.DeserializeObject(returnresultinvoice); | |||
@@ -1173,7 +1173,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,'piaoju','查询开票url成功返回:" + messagedecode + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";查询开票url成功返回:" + messagedecode + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
dynamic InvoiceUrlInfo = JsonConvert.DeserializeObject(messagedecode); | |||
string pictureUrl = InvoiceUrlInfo.pictureUrl; | |||
@@ -1187,7 +1187,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,'piaoju','查询开票url错误:" + messagedecode + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";查询开票url错误:" + messagedecode + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
} | |||
} | |||
@@ -1198,7 +1198,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,'piaoju','开票系统错误:" + messagedecode + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";开票系统错误:" + messagedecode + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
} | |||
} | |||
@@ -1210,7 +1210,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,'piaoju','开票系统报错:" + e.Message + "',getdate())"); | |||
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime,F_Module) values(newid(),121,'piaoju','FCSOId:" + orderEntity.Id + ";FSYId:" + orderEntity.FSYId + ";开票系统报错:" + e.Message + "',getdate(),'" + orderEntity.Id + "')"); | |||
} | |||
} | |||
} | |||
@@ -1443,7 +1443,7 @@ namespace DigitalSchoolApi.Controllers | |||
//教室组织机构 | |||
List<V_JS_ZZJG> zzjg = conn_oracle.Query<V_JS_ZZJG>("select * from V_JS_ZZJG where ID!='0'").ToList(); | |||
//学生信息 | |||
List<V_XSXX> xsxx = conn_oracle.Query<V_XSXX>("select * from V_XSXX where MAJOR_CODE is not null ").ToList(); | |||
List<V_XSXX> xsxx = conn_oracle.Query<V_XSXX>("select * from V_XSXX ").ToList(); | |||
//记录获取数据条数 | |||
using (IDbConnection conncore = new SqlConnection(_coresqlConnection)) | |||
{ | |||
@@ -1458,7 +1458,7 @@ namespace DigitalSchoolApi.Controllers | |||
conncore.Execute( | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'中间库班级数据','获取oracle班级数据共{bjxx.Count()}条',getdate())"); | |||
conncore.Execute( | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'中间库教室数据','获取oracle教室数据共{jsxx.Count()}条',getdate())"); | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'中间库教室数据','获取oracle教室数据共{zzjg.Count()}条',getdate())"); | |||
conncore.Execute( | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'中间库学生数据','获取oracle学生数据共{xsxx.Count()}条',getdate())"); | |||
} | |||
@@ -1860,7 +1860,7 @@ namespace DigitalSchoolApi.Controllers | |||
List<DepartmentEntity> departments = db.Query<DepartmentEntity>("select * from LR_Base_Department").ToList(); | |||
int anumDept = 0; | |||
int unumDept = 0; | |||
foreach (var item in depts) | |||
{ | |||
try | |||
@@ -1942,6 +1942,11 @@ namespace DigitalSchoolApi.Controllers | |||
{ | |||
sb.Append($" ClassNo='{item.CLASS_ID}',"); | |||
} | |||
//考生号 | |||
if (!string.IsNullOrEmpty(item.KSH)) | |||
{ | |||
sb.Append($" ksh='{item.KSH}',"); | |||
} | |||
if (!string.IsNullOrEmpty(item.FORMER_NAME)) | |||
{ | |||
sb.Append($" FORMER_NAME='{item.FORMER_NAME}',"); | |||
@@ -2089,6 +2094,12 @@ namespace DigitalSchoolApi.Controllers | |||
fieleSb.Append("ClassNo,"); | |||
sb.Append($" '{xsxx.CLASS_ID}',"); | |||
} | |||
//考生号 | |||
if (!string.IsNullOrEmpty(xsxx.KSH)) | |||
{ | |||
fieleSb.Append("ksh,"); | |||
sb.Append($" '{xsxx.KSH}',"); | |||
} | |||
if (!string.IsNullOrEmpty(xsxx.PINYIN)) | |||
{ | |||
fieleSb.Append("SpellFull,"); | |||
@@ -2353,11 +2364,6 @@ namespace DigitalSchoolApi.Controllers | |||
{ | |||
try | |||
{ | |||
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(),55555,'一卡通交易流水1','开始执行',getdate())"); | |||
} | |||
string Token = ""; | |||
#region 登陆获取token | |||
//获取配置文件 | |||
@@ -2377,57 +2383,83 @@ 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(),55555,'一卡通交易流水2','Token秘钥获取成功',getdate())"); | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'一卡通交易流水','Token秘钥获取成功',getdate())"); | |||
} | |||
#endregion | |||
#region 插入数据 | |||
using (IDbConnection conn = new SqlConnection(_sqlConnection)) | |||
{ | |||
var tday = DateTime.Now.ToShortDateString(); | |||
DateTime StartTime = DateTime.Today.AddHours(0); | |||
DateTime EndTime = DateTime.Today.AddHours(1); | |||
string JylsUrl = ConfigurationManager.AppSettings["JylsUrl"]; | |||
var Historylist = Convert.ToInt64(conn.ExecuteScalar("select isnull(Max(centralNo),0) from MealCardRunTab ")); | |||
string data = "{ \"pageNo\":\"1\",\"PageSize\":\"1000\",\"Date\":\"" + DateTime.Now.ToShortDateString() + "\",\"StartTime\":\"00:00:00\",\"EndTime\":\"23:59:59\"}"; | |||
string data = "{ \"pageNo\":\"1\",\"PageSize\":\"1000\",\"Date\":\"" + tday + "\",\"StartTime\":\"00:00:00\",\"EndTime\":\"23:59:59\",\"depcode\":\"7D\"}"; | |||
var responses = HttpMethods.sendHttpPost(JylsUrl, Token, data); | |||
var RequsetList = JsonConvert.DeserializeObject<JSONList>(responses); | |||
if (RequsetList.pageTotal > 0) | |||
using (IDbConnection conncore = new SqlConnection(_coresqlConnection)) | |||
{ | |||
for (int i = 1; i <= RequsetList.pageTotal; i++) | |||
conncore.Execute( | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'一卡通数据()','本次一共" + RequsetList.total + "条数据',getdate())"); | |||
} | |||
for (int k = 0; k <= 23; k++) | |||
{ | |||
using (IDbConnection conncore = new SqlConnection(_coresqlConnection)) | |||
{ | |||
data = "{ \"pageNo\":\"" + i + " \",\"PageSize\":\"1000\",\"Date\":\"" + DateTime.Now.ToShortDateString() + "\",\"StartTime\":\"00:00:00\",\"EndTime\":\"23:59:59\"}"; | |||
var responses1 = HttpMethods.sendHttpPost(JylsUrl, Token, data); | |||
var RequsetList1 = JsonConvert.DeserializeObject<JSONList>(responses1); | |||
var NowCen = RequsetList1.data.flowlist.Max(x => x.centralNo); | |||
if (NowCen > Historylist) | |||
conncore.Execute( | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'一卡通数据','第" + k + "次循环',getdate())"); | |||
} | |||
if (k != 0) | |||
{ | |||
StartTime = StartTime.AddHours(1); | |||
EndTime = EndTime.AddHours(1); | |||
} | |||
data = "{ \"pageNo\":\"1\",\"PageSize\":\"1000\",\"Date\":\"" + tday + "\",\"StartTime\":\"" + StartTime + "\",\"EndTime\":\"" + EndTime + "\",\"depcode\":\"7D\"}"; | |||
responses = HttpMethods.sendHttpPost(JylsUrl, Token, data); | |||
RequsetList = JsonConvert.DeserializeObject<JSONList>(responses); | |||
if (RequsetList.pageTotal > 0) | |||
{ | |||
int total = (int)Math.Ceiling((decimal)RequsetList.total / 1000); | |||
using (IDbConnection conncore = new SqlConnection(_coresqlConnection)) | |||
{ | |||
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(),55555,'一卡通交易流水3','准备开始插入数据',getdate())"); | |||
} | |||
for (int j = 0; j < RequsetList1.data.flowlist.Count; j++) | |||
conncore.Execute( | |||
$"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),55555,'一卡通交易流水1','一共" + RequsetList.total + "条数据',getdate())"); | |||
} | |||
for (int i = 1; i <= total; i++) | |||
{ | |||
data = "{ \"pageNo\":\"" + i + " \",\"PageSize\":\"1000\",\"Date\":\"" + tday + "\",\"StartTime\":\"" + StartTime + "\",\"EndTime\":\"" + EndTime + "\",\"depcode\":\"7D\"}"; | |||
responses = HttpMethods.sendHttpPost(JylsUrl, Token, data); | |||
RequsetList = JsonConvert.DeserializeObject<JSONList>(responses); | |||
if (RequsetList.data.flowlist.Count > 0) | |||
{ | |||
var nowCen = Convert.ToInt32(conn.ExecuteScalar("select Count(*) from MealCardRunTab where centralNo='" + RequsetList1.data.flowlist[j].centralNo + "' ")); | |||
if (nowCen <= 0) | |||
var NowCen = RequsetList.data.flowlist.Max(x => x.centralNo); | |||
if (NowCen > Historylist) | |||
{ | |||
conn.Execute( | |||
"insert into MealCardRunTab(Id,accountNo,accountName,depName,personId,identiName,flowtype,flowamount,balance,cardNo,centralTm,centralNo,occurTime,node,bigGroup,smallGroup,seg,pos) " + | |||
"values(newid(), '" + RequsetList1.data.flowlist[j].accountNo + "', '" + RequsetList1.data.flowlist[j].accountName + "', '" + RequsetList1.data.flowlist[j].depName + "','" + RequsetList1.data.flowlist[j].personId + "','" + RequsetList1.data.flowlist[j].identiName + "','" + RequsetList1.data.flowlist[j].flowType + "','" + RequsetList1.data.flowlist[j].flowAmount + | |||
"','" + RequsetList1.data.flowlist[j].balance + "','" + RequsetList1.data.flowlist[j].cardNo + "','" + RequsetList1.data.flowlist[j].centralTm + "','" + RequsetList1.data.flowlist[j].centralNo + "','" + RequsetList1.data.flowlist[j].occurTime + "','" + RequsetList1.data.flowlist[j].node + "','" + RequsetList1.data.flowlist[j].bigGroup + "','" + RequsetList1.data.flowlist[j].group + "','" + RequsetList1.data.flowlist[j].seg + "','" + RequsetList1.data.flowlist[j].pos + "')"); | |||
} | |||
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(),55555,'一卡通交易流水4','第" + j + "次插入数据完成',getdate())"); | |||
for (int j = 0; j < RequsetList.data.flowlist.Count; j++) | |||
{ | |||
var nowCen = Convert.ToInt32(conn.ExecuteScalar("select Count(*) from MealCardRunTab where centralNo='" + RequsetList.data.flowlist[j].centralNo + "' ")); | |||
if (nowCen <= 0) | |||
{ | |||
conn.Execute( | |||
"insert into MealCardRunTab(Id,accountNo,accountName,depName,personId,identiName,flowtype,flowamount,balance,cardNo,centralTm,centralNo,occurTime,node,bigGroup,smallGroup,seg,pos) " + | |||
"values(newid(), '" + RequsetList.data.flowlist[j].accountNo + "', '" + RequsetList.data.flowlist[j].accountName + "', '" + RequsetList.data.flowlist[j].depName + "','" + RequsetList.data.flowlist[j].personId + "','" + RequsetList.data.flowlist[j].identiName + "','" + RequsetList.data.flowlist[j].flowType + "','" + RequsetList.data.flowlist[j].flowAmount + | |||
"','" + RequsetList.data.flowlist[j].balance + "','" + RequsetList.data.flowlist[j].cardNo + "','" + RequsetList.data.flowlist[j].centralTm + "','" + RequsetList.data.flowlist[j].centralNo + "','" + RequsetList.data.flowlist[j].occurTime + "','" + RequsetList.data.flowlist[j].node + "','" + RequsetList.data.flowlist[j].bigGroup + "','" + RequsetList.data.flowlist[j].group + "','" + RequsetList.data.flowlist[j].seg + "','" + RequsetList.data.flowlist[j].pos + "')"); | |||
} | |||
} | |||
} | |||
} | |||
} | |||
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(),55555,'一卡通交易流水5','插入数据',getdate())"); | |||
} | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -14,7 +14,8 @@ | |||
<AssemblyName>DigitalSchoolApi</AssemblyName> | |||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | |||
<UseIISExpress>true</UseIISExpress> | |||
<Use64BitIISExpress /> | |||
<Use64BitIISExpress> | |||
</Use64BitIISExpress> | |||
<IISExpressSSLPort /> | |||
<IISExpressAnonymousAuthentication /> | |||
<IISExpressWindowsAuthentication /> | |||
@@ -424,6 +425,7 @@ | |||
<Compile Include="Models\NewsEntity.cs" /> | |||
<Compile Include="Models\EmailManagementEntity.cs" /> | |||
<Compile Include="Models\Acc_DormitoryBuildEntity.cs" /> | |||
<Compile Include="Models\OracleEducationalSystemInfoSync.cs" /> | |||
<Compile Include="Models\XCStudentEntity.cs" /> | |||
<Compile Include="Models\EmpInfoEntity.cs" /> | |||
<Compile Include="Models\ShowAuthorizeEntity.cs" /> | |||
@@ -0,0 +1,181 @@ | |||
using System; | |||
namespace DigitalSchoolApi.Models | |||
{ | |||
/// <summary> | |||
/// 塔里木同步oracle中间库数据实体 | |||
/// </summary> | |||
public class OracleEducationalSystemInfoSync | |||
{ | |||
} | |||
/// <summary> | |||
/// 院系 | |||
/// </summary> | |||
public class CX_JW_YX | |||
{ | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 院系编号 | |||
/// </summary> | |||
public string YXBH { get; set; } | |||
/// <summary> | |||
/// 院系名称 | |||
/// </summary> | |||
public string YXMC { get; set; } | |||
} | |||
/// <summary> | |||
/// 专业 | |||
/// </summary> | |||
public class CX_JW_ZY | |||
{ | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 专业编号 | |||
/// </summary> | |||
public string ZYBH { get; set; } | |||
/// <summary> | |||
/// 专业名称 | |||
/// </summary> | |||
public string ZYMC { get; set; } | |||
/// <summary> | |||
/// 专业简称 | |||
/// </summary> | |||
public string ZYJC { get; set; } | |||
/// <summary> | |||
/// 专业英文名称 | |||
/// </summary> | |||
public string ZYYWMC { get; set; } | |||
/// <summary> | |||
/// 所属院系(CX_JW_YX中的ID字段) | |||
/// </summary> | |||
public string YXID { get; set; } | |||
/// <summary> | |||
/// 院系编号 | |||
/// </summary> | |||
public string YXBH { get; set; } | |||
/// <summary> | |||
/// 学制 | |||
/// </summary> | |||
public string XZ { get; set; } | |||
/// <summary> | |||
///培养层次 | |||
/// </summary> | |||
public string PYCC { get; set; } | |||
} | |||
/// <summary> | |||
/// 班级 | |||
/// </summary> | |||
public class CX_JW_BJ | |||
{ | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 班级编号 | |||
/// </summary> | |||
public string BJBH { get; set; } | |||
/// <summary> | |||
/// 班级名称 | |||
/// </summary> | |||
public string BJMC { get; set; } | |||
/// <summary> | |||
/// 院系(CX_JW_YX中的ID字段) | |||
/// </summary> | |||
public string YXID { get; set; } | |||
/// <summary> | |||
/// 院系编号 | |||
/// </summary> | |||
public string YXBH { get; set; } | |||
/// <summary> | |||
/// 专业(CX_JW_ZY中的ID字段) | |||
/// </summary> | |||
public string ZYID { get; set; } | |||
/// <summary> | |||
/// 专业编号 | |||
/// </summary> | |||
public string ZYBH { get; set; } | |||
/// <summary> | |||
/// 年级 | |||
/// </summary> | |||
public string SZNJ { get; set; } | |||
/// <summary> | |||
/// 校区(CX_JW_XQ中的ID字段) | |||
/// </summary> | |||
public string XQID { get; set; } | |||
/// <summary> | |||
/// 校区(CX_JW_XQ中的ID字段) | |||
/// </summary> | |||
public string KYZT { get; set; } | |||
} | |||
/// <summary> | |||
/// 学生信息 | |||
/// </summary> | |||
public class CX_JW_XSXX | |||
{ | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// 学号 | |||
/// </summary> | |||
public string XH { get; set; } | |||
/// <summary> | |||
/// 姓名 | |||
/// </summary> | |||
public string XM { get; set; } | |||
/// <summary> | |||
/// 姓名拼音 | |||
/// </summary> | |||
public string XMPY { get; set; } | |||
/// <summary> | |||
/// 性别 | |||
/// </summary> | |||
public string XB { get; set; } | |||
/// <summary> | |||
/// 出生日期 | |||
/// </summary> | |||
public string CSRQ { get; set; } | |||
/// <summary> | |||
/// 身份证件号 | |||
/// </summary> | |||
public string SFZJH { get; set; } | |||
/// <summary> | |||
/// 所在年级 | |||
/// </summary> | |||
public string SZNJ { get; set; } | |||
public string YXBH { get; set; } | |||
/// <summary> | |||
/// 专业编号 | |||
/// </summary> | |||
public string ZYBH { get; set; } | |||
/// <summary> | |||
/// 班级编号 | |||
/// </summary> | |||
public string BJBH { get; set; } | |||
/// <summary> | |||
/// 学籍状态 | |||
/// </summary> | |||
public string XJZT { get; set; } | |||
/// <summary> | |||
/// 是否在校 | |||
/// </summary> | |||
public string SFZX { get; set; } | |||
/// <summary> | |||
/// 学生当前状态 | |||
/// </summary> | |||
public string XSDQZT { get; set; } | |||
/// <summary> | |||
/// 考生号 | |||
/// </summary> | |||
public string KSH { get; set; } | |||
/// <summary> | |||
/// 民族 | |||
/// </summary> | |||
public string MZ { get; set; } | |||
/// <summary> | |||
/// 联系电话 | |||
/// </summary> | |||
public string LXDH { get; set; } | |||
/// <summary> | |||
/// 政治面貌 | |||
/// </summary> | |||
public string ZZMM { get; set; } | |||
} | |||
} |
@@ -932,6 +932,7 @@ namespace DigitalSchoolApi.Models | |||
public string STU_STATE_CODE { get; set; } | |||
public string STU_ROLL_CODE { get; set; } | |||
public string IS_NORMAL { get; set; } | |||
public string KSH { get; set; } | |||
} | |||
public class V_Dept | |||
@@ -21,7 +21,7 @@ | |||
<add key="secretcode" value="2f9af5ea0704ed15" /> | |||
<add key="pwdcode" value="6be99c61d83f0184f4f5b768b30e1813" /> | |||
<add key="apiUrl" value="http://localhost:8088" /> | |||
<add key="dbbackuppath" value="E:\西昌程序单校区版2019_09_16\Learun.Framework.Ultimate V7\Learun.Application.Web\Resource\DataBaseBackup" /> | |||
<add key="dbbackuppath" value="D:\西昌程序单校区版2019_09_16\Learun.Framework.Ultimate V7\Learun.Application.Web\Resource\DataBaseBackup" /> | |||
<add key="AttendancePhotoPath" value="E:\西昌程序单校区版2019_09_16\Learun.Framework.Ultimate V7\Learun.Application.Web\Resource\AttendancePhoto" /> | |||
<!--自动考勤人员角色Id--> | |||
<add key="AutoAttendance" value="8f271d78-66ed-43d6-b7ed-d729c2d36282" /> | |||
@@ -64,9 +64,10 @@ | |||
<add name="bachuJavaDBString" connectionString="Data Source=127.0.0.1;Database=oa;User ID=root;Password=123456;Command Logging=false;" providerName="MySql.Data.MySqlClient" /> | |||
<add name="TLMZYMiddleDBString" connectionString="Data Source=TLMZYMIDDLE;Persist Security Info=True;User ID=digitalschool;Password=digitalschool;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="CYZJMiddleDBString" connectionString="Data Source=CYZJMIDDLE;Persist Security Info=True;User ID=digitalschool;Password=digitalschool;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="YongyouDb" connectionString="Server=123.57.209.16;Password=bjqjkj@2014~2015!;User ID=sa; Initial Catalog=u8gx" providerName="System.Data.SqlClient" /> | |||
<add name="YongyouDb" connectionString="Server=8.141.155.183,53314;Password=bjqjkj@2014~2015!;User ID=sa; Initial Catalog=u8gx" providerName="System.Data.SqlClient" /> | |||
<add name="XCMiddleDBString" connectionString="Data Source=FSZJK;Persist Security Info=True;User ID=fszjk;Password=fszjk20220705;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="HLZJMiddleDBString" connectionString="Data Source=ORCL;Persist Security Info=True;User ID=digitalschool;Password=digitalschool;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="TLMMiddleDBString" connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=libraries.chaoxing.com)(PORT=38023)))(CONNECT_DATA=(SERVICE_NAME=jwxt01)));User Id=TLM_XG;Password=bbfc2d7e4fd0bd829b2f;Pooling='true';Max Pool Size=150" providerName="System.Data.OracleClient" /> | |||
</connectionStrings> | |||
<!-- | |||