|
|
@@ -792,40 +792,35 @@ namespace DigitalSchoolApi.Controllers |
|
|
|
/// <summary> |
|
|
|
/// 单张票据开具接口 |
|
|
|
/// </summary> |
|
|
|
public static void InvoiceEBillMethodTwo(string OrderId) |
|
|
|
public static void InvoiceEBillMethodTwo(FinaChargeStuOrderEntity orderEntity) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
using (IDbConnection conn = new SqlConnection(_sqlConnection)) |
|
|
|
{ |
|
|
|
FinaChargeStuOrderEntity orderEntity = conn.QuerySingle<FinaChargeStuOrderEntity>("select * from FinaChargeStuOrder where orderid='" + OrderId + "'"); |
|
|
|
|
|
|
|
if (orderEntity.Status == 1) |
|
|
|
{ |
|
|
|
List<FinaChargeStuOrderDetailEntity> stuEnrollFeeOrderDetailList = |
|
|
|
conn.Query<FinaChargeStuOrderDetailEntity>(@"select a.*, b.InvoiceTypeCode from FinaChargeStuOrderDetail a |
|
|
|
List<FinaChargeStuYearItemEntity> stuEnrollFeeOrderDetailList = |
|
|
|
conn.Query<FinaChargeStuYearItemEntity>(@"select a.*, b.InvoiceTypeCode from FinaChargeStuYearItem a |
|
|
|
join StuEnrollInvoiceTypeCode b on a.chargeItemcode = b.ProjectCode |
|
|
|
where a.FCSOId = '" + orderEntity.Id + "'").ToList(); |
|
|
|
where a.FSYId = '" + orderEntity.FSYId + "'").ToList(); |
|
|
|
|
|
|
|
var groupDetail = stuEnrollFeeOrderDetailList.GroupBy(x => x.InvoiceTypeCode); |
|
|
|
foreach (IGrouping<string, FinaChargeStuOrderDetailEntity> item in groupDetail) |
|
|
|
var groupDetail = stuEnrollFeeOrderDetailList.GroupBy(x => x.InvoiceTypeCode); |
|
|
|
foreach (IGrouping<string, FinaChargeStuYearItemEntity> item in groupDetail) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
try |
|
|
|
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(),121,'typecode','开票typecode:" + item.Key + "',getdate())"); |
|
|
|
} |
|
|
|
InvoiceEBillByTypeTwo(conn, OrderId, orderEntity, item.Key, item); |
|
|
|
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())"); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
InvoiceEBillByTypeTwo(conn,orderEntity, item.Key, item); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
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(),121,'piaoju','开票异常:" + ex.Message + "',getdate())"); |
|
|
|
} |
|
|
|
conncore.Execute( |
|
|
|
"insert into LR_Base_Log(F_LogId,F_CategoryId,F_SourceObjectId,F_SourceContentJson,F_OperateTime) values(newid(),121,'piaoju','开票异常:" + ex.Message + "',getdate())"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -1035,7 +1030,7 @@ namespace DigitalSchoolApi.Controllers |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static void InvoiceEBillByTypeTwo(IDbConnection conn, string OrderId, FinaChargeStuOrderEntity orderEntity, string billCode, IGrouping<string, FinaChargeStuOrderDetailEntity> stuEnrollFeeOrderDetailList) |
|
|
|
private static void InvoiceEBillByTypeTwo(IDbConnection conn,FinaChargeStuOrderEntity orderEntity, string billCode, IGrouping<string, FinaChargeStuYearItemEntity> stuEnrollFeeOrderDetailList) |
|
|
|
{ |
|
|
|
Encoding encoding = Encoding.UTF8; |
|
|
|
string StuName = conn.QuerySingle("select StuName from FinaChargeStudent where stuno='" + orderEntity.StuNo + "'").StuName; |
|
|
@@ -1081,8 +1076,8 @@ namespace DigitalSchoolApi.Controllers |
|
|
|
itemdetail.itemCode = itemEntity.ChargeItemCode; |
|
|
|
itemdetail.itemName = itemEntity.ChargeItemName; |
|
|
|
itemdetail.count = 1; |
|
|
|
itemdetail.standard = Convert.ToDouble(itemEntity.YJAmount); |
|
|
|
itemdetail.amt = Convert.ToDouble((itemEntity.SJAmount > itemEntity.YJAmount ? itemEntity.YJAmount : itemEntity.SJAmount)); |
|
|
|
itemdetail.standard = Convert.ToDouble(itemEntity.Standard); |
|
|
|
itemdetail.amt = Convert.ToDouble((itemEntity.SJAmount > itemEntity.Standard ? itemEntity.Standard : itemEntity.SJAmount)); |
|
|
|
itemdetailList.Add(itemdetail); |
|
|
|
} |
|
|
|
biParam.totalAmt = Convert.ToDouble(itemdetailList.Sum(m => m.amt)); |
|
|
@@ -1961,7 +1956,7 @@ namespace DigitalSchoolApi.Controllers |
|
|
|
{ |
|
|
|
sb.Append($" STU_ROLL_CODE='{item.STU_ROLL_CODE}',"); |
|
|
|
} |
|
|
|
sb.Append(@" CheckMark='" + (item.IS_NORMAL) + "',"); |
|
|
|
sb.Append(@" InSchoolStatus='" + (item.IS_NORMAL) + "',"); |
|
|
|
//去掉最后一个逗号 |
|
|
|
if (sb.ToString().Contains(",")) |
|
|
|
{ |
|
|
@@ -2106,7 +2101,7 @@ namespace DigitalSchoolApi.Controllers |
|
|
|
fieleSb.Append("Grade,"); |
|
|
|
sb.Append($" '{xsxx.ENROLL_GRADE.ToString().Substring(2)}',"); |
|
|
|
} |
|
|
|
sb.Append(@" CheckMark='" + (xsxx.IS_NORMAL) + "',"); |
|
|
|
sb.Append(@" InSchoolStatus='" + (xsxx.IS_NORMAL) + "',"); |
|
|
|
//去掉最后一个逗号 |
|
|
|
if (fieleSb.ToString().Contains(",") && sb.ToString().Contains(",")) |
|
|
|
{ |
|
|
|