|
@@ -2533,9 +2533,9 @@ namespace OASystem.API.Controllers
|
|
|
int rowNumber = 1;
|
|
|
foreach (var subItem in item.childList)
|
|
|
{
|
|
|
- string remaksDescription = $"{rowNumber}、【{item.priceTypeStr}】{item.Instructions}({subItem.PriceName}) CNY:{subItem.ItemTotal.ToString("#0.00")}(单价:{subItem.Price.ToString("#0.00")} * {subItem.Quantity})";
|
|
|
+ string remaksDescription = $"{rowNumber}、【{item.priceTypeStr}】{item.Instructions}({subItem.PriceName}) CNY:{subItem.ItemTotal.ToString("#0.0000")}(单价:{subItem.Price.ToString("#0.0000")} * {subItem.Quantity.ToString("#0.0000")})";
|
|
|
subItem.RemaksDescription = remaksDescription;
|
|
|
- string excelRemaksDescription = $"【{item.priceTypeStr}】{item.Instructions}({subItem.PriceName}) CNY:{subItem.ItemTotal.ToString("#0.00")}(单价:{subItem.Price.ToString("#0.00")} * {subItem.Quantity})【申请人:{item.CreateUser} 申请时间:{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}】";
|
|
|
+ string excelRemaksDescription = $"【{item.priceTypeStr}】{item.Instructions}({subItem.PriceName}) CNY:{subItem.ItemTotal.ToString("#0.0000")}(单价:{subItem.Price.ToString("#0.0000")} * {subItem.Quantity.ToString("#0.0000")})【申请人:{item.CreateUser} 申请时间:{item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")}】";
|
|
|
subItem.ExcelRemaksDescription = excelRemaksDescription;
|
|
|
rowNumber++;
|
|
|
}
|
|
@@ -4242,7 +4242,21 @@ Group by PriceType ", dto.diId);
|
|
|
dt.Columns.Add(GetString(worksheet.Cells[i, j].Value));
|
|
|
//剩下的写入datatable
|
|
|
else
|
|
|
- dr[j - 1] = GetString(worksheet.Cells[i, j].Value);
|
|
|
+ {
|
|
|
+ var cell = worksheet.Cells[i, j];
|
|
|
+
|
|
|
+ if (j == 1 || j == 2)
|
|
|
+ {
|
|
|
+ if (cell.Value is double)
|
|
|
+ {
|
|
|
+ dr[j - 1] = EPPlusConvertToDateTime((double)cell.Value).ToString("MM/dd");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dr[j - 1] = GetString(cell.Value);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return dt;
|
|
@@ -4250,7 +4264,6 @@ Group by PriceType ", dto.diId);
|
|
|
|
|
|
private string GetString(object obj)
|
|
|
{
|
|
|
-
|
|
|
if (obj == null)
|
|
|
return "";
|
|
|
|
|
@@ -4258,6 +4271,15 @@ Group by PriceType ", dto.diId);
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static DateTime EPPlusConvertToDateTime(double numericDate)
|
|
|
+ {
|
|
|
+ // Excel起始日期
|
|
|
+ DateTime startDate = new DateTime(1899, 12, 30);
|
|
|
+ // 将数字日期转换为时间间隔,并加上起始日期
|
|
|
+ TimeSpan duration = new TimeSpan((long)(numericDate * TimeSpan.TicksPerDay));
|
|
|
+ return startDate.Add(duration);
|
|
|
+ }
|
|
|
+
|
|
|
private DataTable ExcelFileToDataTable(IFormFile file)
|
|
|
{
|
|
|
DataTable dtTest = null;
|
|
@@ -4302,7 +4324,7 @@ Group by PriceType ", dto.diId);
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- public async Task<IActionResult> PostCreditCardBill(IFormFile file, int cardType, string beginDt, string endDt)
|
|
|
+ public async Task<IActionResult> PostCreditCardBill(IFormFile file, int cardType, string beginDt, string endDt)
|
|
|
{
|
|
|
if (file == null || file.Length < 1)
|
|
|
{
|
|
@@ -4319,8 +4341,8 @@ Group by PriceType ", dto.diId);
|
|
|
|
|
|
if (string.IsNullOrEmpty(beginDt) || string.IsNullOrEmpty(endDt)) return Ok(JsonView(false, "请输入开始/结束日期!"));
|
|
|
|
|
|
- var beginValid = DateTime.TryParse(beginDt, out _);
|
|
|
- var endValid = DateTime.TryParse(endDt, out _);
|
|
|
+ var beginValid = DateTime.TryParse(beginDt, out DateTime _beginDt);
|
|
|
+ var endValid = DateTime.TryParse(endDt, out DateTime _endDt);
|
|
|
if (!beginValid || !endValid) return Ok(JsonView(false, "请输入正确的日期格式"));
|
|
|
|
|
|
//读取ExcelFile
|
|
@@ -4339,6 +4361,41 @@ Group by PriceType ", dto.diId);
|
|
|
return Ok(JsonView(false, $"未查询到 {beginDt} 至 {endDt} 信用卡账单信息!!!!"));
|
|
|
}
|
|
|
|
|
|
+ //酒店刷卡信息
|
|
|
+ var hotelData = await _sqlSugar.Queryable<Grp_HotelReservations>()
|
|
|
+ .LeftJoin<Grp_HotelReservationsContent>((hr, hrc) => hr.Id == hrc.HrId)
|
|
|
+ .Where((hr, hrc) => hr.IsDel == 0 && hrc.Price > 0 && hrc.IsPay == 1)
|
|
|
+ .Select((hr, hrc) => new
|
|
|
+ {
|
|
|
+ hrc.DiId,
|
|
|
+ hrc.HrId,
|
|
|
+ hrc.Id,
|
|
|
+ hrc.PriceType,
|
|
|
+ hrc.Price,
|
|
|
+ hrc.Currency,
|
|
|
+ hrc.Rate,
|
|
|
+ hrc.IsOppay,
|
|
|
+ hrc.PayDId,
|
|
|
+ hrc.ConsumptionPatterns,
|
|
|
+ hrc.ConsumptionDate,
|
|
|
+ ConsumptionDt = string.IsNullOrEmpty(hrc.ConsumptionDate) ? new DateTime(1990, 12, 30) : Convert.ToDateTime(hrc.ConsumptionDate),
|
|
|
+ hrc.CTDId,
|
|
|
+ hrc.BankNo,
|
|
|
+ hrc.CardholderName,
|
|
|
+ hrc.CompanyBankNo,
|
|
|
+ hrc.OtherBankName,
|
|
|
+ hrc.OtherSideNo,
|
|
|
+ hrc.IsPay,
|
|
|
+ hrc.Payee,
|
|
|
+ hrc.OrbitalPrivateTransfer
|
|
|
+ })
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ if (hotelData.Count > 0)
|
|
|
+ {
|
|
|
+ hotelData = hotelData.Where(x => x.ConsumptionDt >= _beginDt && x.ConsumptionDt <= _endDt).ToList();
|
|
|
+ }
|
|
|
+
|
|
|
//资源信息
|
|
|
var delegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(it => it.IsDel == 0).ToList();
|
|
|
var users = _sqlSugar.Queryable<Sys_Users>().Where(it => it.IsDel == 0).ToList();
|
|
@@ -4601,22 +4658,23 @@ Group by PriceType ", dto.diId);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var HotelGroupReuslt = List_ccp.Where(x => x.CTable == 76).GroupBy(x => x.DIId).ToList();
|
|
|
- if (HotelGroupReuslt != null && HotelGroupReuslt.Count > 0)
|
|
|
+ //机票刷卡记录
|
|
|
+ var hotelGroupReuslt = hotelData.Where(x => x.CTDId == 86).GroupBy(x => x.DiId).ToList();
|
|
|
+ if (hotelGroupReuslt != null && hotelGroupReuslt.Count > 0)
|
|
|
{
|
|
|
- foreach (var item in HotelGroupReuslt)
|
|
|
+ foreach (var item in hotelGroupReuslt)
|
|
|
{
|
|
|
- if (item.Count() > 1)
|
|
|
+ if (item.Count() > 0)
|
|
|
{
|
|
|
- var di = delegationInfos.Find(it => it.Id == item.Key);
|
|
|
- var obj = item.FirstOrDefault();
|
|
|
- obj.Remark = "团组酒店总价";
|
|
|
- if (di != null)
|
|
|
+ var hotelInfo = new Grp_CreditCardPayment()
|
|
|
{
|
|
|
- obj.Remark = "团组酒店总价(" + di.TeamName + ")";
|
|
|
- }
|
|
|
- obj.RMBPrice = item.Sum(x => x.RMBPrice);//合计人民币
|
|
|
- List_ccp.Add(obj);
|
|
|
+ Remark = $"团组酒店总价(" + delegationInfos.Find(it => it.Id == item.Key)?.TeamName ?? "" + ")",
|
|
|
+ RMBPrice = item.Sum(x => x.Price * x.Rate),
|
|
|
+ ConsumptionDate = item.FirstOrDefault()?.ConsumptionDate ?? ""
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ List_ccp.Add(hotelInfo);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -4641,8 +4699,11 @@ Group by PriceType ", dto.diId);
|
|
|
for (int j = 0; j < dt.Rows.Count; j++)//遍历行
|
|
|
{
|
|
|
DataRow dr = dt1.NewRow(); //获取每一行的数据
|
|
|
- dr["TradingDay"] = dt.Rows[j][0].ToString();
|
|
|
- dr["TallyDay"] = dt.Rows[j][1].ToString();
|
|
|
+ var tradingDay = dt.Rows[j][0].ToString();
|
|
|
+
|
|
|
+ dr["TradingDay"] = tradingDay;
|
|
|
+ var tallyDay = dt.Rows[j][1].ToString();
|
|
|
+ dr["TallyDay"] = tallyDay;
|
|
|
dr["TransactionDesc"] = dt.Rows[j][2].ToString();
|
|
|
dr["RMBMoney"] = dt.Rows[j][3].ToString();
|
|
|
dr["CardNo"] = dt.Rows[j][4].ToString();
|
|
@@ -4683,7 +4744,9 @@ Group by PriceType ", dto.diId);
|
|
|
|
|
|
if (item["TradingDay"] != null)
|
|
|
{
|
|
|
- ExcelDt = DateTime.Parse(item["TradingDay"].ToString()).ToString("MMdd");
|
|
|
+
|
|
|
+ ExcelDt = item["TradingDay"].ToString();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//加一获取金额区间
|
|
@@ -4691,7 +4754,7 @@ Group by PriceType ", dto.diId);
|
|
|
decimal MinTradingMoney = TradingMoney - 1;
|
|
|
|
|
|
//匹配C表金额相等的值
|
|
|
- var CList = List_ccp.FindAll(x => x.PayMoney < MaxTradingMoney && x.PayMoney > MinTradingMoney);
|
|
|
+ var CList = List_ccp.FindAll(x => x.PayMoney <= MaxTradingMoney && x.PayMoney >= MinTradingMoney);
|
|
|
|
|
|
if (CList != null && CList.Count > 0)
|
|
|
{
|
|
@@ -4700,9 +4763,9 @@ Group by PriceType ", dto.diId);
|
|
|
{
|
|
|
if (!string.IsNullOrWhiteSpace(Citem.ConsumptionDate))
|
|
|
{
|
|
|
- DBDt = DateTime.Parse(Citem.ConsumptionDate).ToString("MMdd");
|
|
|
+ DBDt = DateTime.Parse(Citem.ConsumptionDate).ToString("MM/dd");
|
|
|
|
|
|
- if (DBDt == ExcelDt)
|
|
|
+ if (DBDt.Equals(ExcelDt))
|
|
|
{
|
|
|
item["TeamRemark"] = delegationInfos.Find(it => it.Id == Citem.DIId)?.TeamName;
|
|
|
item["Handlers"] = users.Find(it => it.Id == Citem.CreateUserId)?.CnName;
|
|
@@ -4714,20 +4777,12 @@ Group by PriceType ", dto.diId);
|
|
|
#endregion
|
|
|
}
|
|
|
|
|
|
- if (item["TransactionDesc"].ToString().Contains("财付通"))
|
|
|
- item["State"] = "2";
|
|
|
- else if (item["TransactionDesc"].ToString().Contains("京东支付"))
|
|
|
- item["State"] = "2";
|
|
|
- else if (item["TransactionDesc"].ToString().Contains("微信支付"))
|
|
|
- item["State"] = "2";
|
|
|
- else if (item["TransactionDesc"].ToString().Contains("淘宝"))
|
|
|
- item["State"] = "2";
|
|
|
- else if (item["TransactionDesc"].ToString().Contains("支付宝"))
|
|
|
- item["State"] = "2";
|
|
|
- else if (item["TransactionDesc"].ToString().Contains("拼多多"))
|
|
|
- item["State"] = "2";
|
|
|
- else
|
|
|
- item["State"] = "0";
|
|
|
+ var whereRange = new List<string>() { "财付通", "京东", "微信", "淘宝", "支付宝", "拼多多" };
|
|
|
+ foreach (var where in whereRange)
|
|
|
+ {
|
|
|
+ if (item["TransactionDesc"].ToString().Contains(where)) item["State"] = "2";
|
|
|
+ else item["State"] = "0";
|
|
|
+ }
|
|
|
|
|
|
if (!string.IsNullOrEmpty(item["TeamRemark"].ToString()) && !string.IsNullOrEmpty(item["Handlers"].ToString()))
|
|
|
item["State"] = "1";
|