|
@@ -1109,18 +1109,6 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#region 应收报表
|
|
|
|
|
|
- ///// <summary>
|
|
|
- ///// 应收报表
|
|
|
- ///// 查询 根据日期范围
|
|
|
- ///// </summary>
|
|
|
- ///// <param name="dto"></param>
|
|
|
- ///// <returns></returns>
|
|
|
- //[HttpPost]
|
|
|
- //[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
- //public async Task<IActionResult> ExcelSyntheticalReceivable(PostSyntheticalReceivableByDateRangeDto dto)
|
|
|
- //{
|
|
|
- //}
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 应收报表
|
|
|
/// 查询 根据日期范围
|
|
@@ -1148,7 +1136,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sqlWhere += string.Format(@" And di.VisitDate >= '{0}' ", dto.beginDt);
|
|
|
+ sqlWhere += string.Format(@" And di.VisitDate >= '{0} 00:00:00' ", dto.beginDt);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1160,7 +1148,7 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sqlWhere += string.Format(@" And di.VisitDate <= '{0}' ", dto.endDt);
|
|
|
+ sqlWhere += string.Format(@" And di.VisitDate <= '{0} 23:59:59' ", dto.endDt);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1191,7 +1179,7 @@ namespace OASystem.API.Controllers
|
|
|
decimal balance = 0M;
|
|
|
string str_schedule = string.Empty;
|
|
|
|
|
|
- //1.
|
|
|
+ //1. 缺超支费用!!!!!!!!!!!!!!!!!!!!
|
|
|
string sql_fr = string.Format(@" Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0} ", diId);
|
|
|
List<Fin_ForeignReceivables> list_fr = _sqlSugar.SqlQueryable<Fin_ForeignReceivables>(sql_fr).ToList();
|
|
|
sum_fr = list_fr.Sum(s => s.ItemSumPrice);
|
|
@@ -1222,9 +1210,11 @@ namespace OASystem.API.Controllers
|
|
|
item_rst.frPrice = sum_fr.ToString("#0.00");
|
|
|
item_rst.prPrice = (sum_pr - sum_other).ToString("#0.00");
|
|
|
item_rst.balPrice = (sum_fr - (sum_pr - sum_other)).ToString("#0.00");
|
|
|
- item_rst.clientUnit = str_client;
|
|
|
+ item_rst.prClient = str_client;
|
|
|
item_rst.schedule = str_schedule;
|
|
|
|
|
|
+ string tempVisitDate = Convert.ToDateTime(item_rst.visitDate).ToString("yyyy-MM-dd");
|
|
|
+
|
|
|
sumAll_fr += sum_fr;
|
|
|
sumAll_pr += (sum_pr - sum_other);
|
|
|
sumAll_balance += (sum_fr - (sum_pr - sum_other));
|
|
@@ -1241,7 +1231,8 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
return Ok(JsonView(true, "请求成功", result, list_rst.Count));
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
//----------------------------
|
|
|
List<Excel_SyntheticalReceivableByDateRange> list_Ex = new List<Excel_SyntheticalReceivableByDateRange>();
|
|
|
WorkbookDesigner designer = new WorkbookDesigner();
|
|
@@ -1295,7 +1286,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1304,5 +1295,106 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
+
|
|
|
+ #region 付款申请
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 应收报表
|
|
|
+ /// 查询 根据日期范围
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostPayRequest_Center(PostPayRequestByDateRangeDto dto)
|
|
|
+ {
|
|
|
+ tree_Fin_DailyFeePaymentResult dailyResult = PayRequest_DailyByDateRange(dto.beginDt, dto.endDt);
|
|
|
+
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "获取成功", new { daily = dailyResult }));
|
|
|
+
|
|
|
+ return Ok(JsonView(false, "获取失败"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 付款申请
|
|
|
+ /// 查询 根据日期范围
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private tree_Fin_DailyFeePaymentResult PayRequest_DailyByDateRange(string beginDt, string endDt)
|
|
|
+ {
|
|
|
+ #region sql条件处理
|
|
|
+ string sqlWhere = string.Format(@" And dfp.CreateTime between '{0} 00:00:00' And '{1} 23:59:59' ", beginDt, endDt);
|
|
|
+
|
|
|
+ string sql_1 = string.Format(@"Select * From (
|
|
|
+ Select row_number() over (order by dfp.Id Desc) as RowNumber,
|
|
|
+ dfp.Id,dfp.CompanyId,c.CompanyName,dfp.Instructions,dfp.SumPrice,
|
|
|
+ dfp.CreateUserId,u.CnName CreateUser,dfp.CreateTime,dfp.FAudit,dfp.MAudit,
|
|
|
+ dfp.PriceTypeId,dfp.TransferTypeId
|
|
|
+ From Fin_DailyFeePayment dfp
|
|
|
+ Inner Join Sys_Company c On dfp.CompanyId = c.Id
|
|
|
+ Left Join Sys_Users u On dfp.CreateUserId = u.Id
|
|
|
+ Where dfp.IsDel=0 {0} And dfp.FAudit = 1 And dfp.MAudit = 1
|
|
|
+ ) temp ", sqlWhere);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ List<tree_Fin_DailyFeePaymentPageListView> DailyFeePaymentData = _sqlSugar.SqlQueryable<tree_Fin_DailyFeePaymentPageListView>(sql_1).ToList();
|
|
|
+
|
|
|
+ Dictionary<int, string> dic_setData = new Dictionary<int, string>();
|
|
|
+
|
|
|
+ foreach (var item in DailyFeePaymentData)
|
|
|
+ {
|
|
|
+ if (dic_setData.ContainsKey(item.PriceTypeId))
|
|
|
+ {
|
|
|
+ item.priceTypeStr = dic_setData[item.PriceTypeId];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Sys_SetData sd_priceType = _daiRep.Query<Sys_SetData>(s => s.Id == item.PriceTypeId).First();
|
|
|
+ if (sd_priceType != null)
|
|
|
+ {
|
|
|
+ item.priceTypeStr = sd_priceType.Name;
|
|
|
+ dic_setData.Add(item.PriceTypeId, sd_priceType.Name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (dic_setData.ContainsKey(item.transferTypeId))
|
|
|
+ {
|
|
|
+ item.transferTypeIdStr = dic_setData[item.transferTypeId];
|
|
|
+ Sys_SetData sd_transfer = _daiRep.Query<Sys_SetData>(s => s.Id == item.transferTypeId).First();
|
|
|
+ if (sd_transfer != null)
|
|
|
+ {
|
|
|
+ item.transferParentId = sd_transfer.STid;
|
|
|
+ item.transferParentIdStr = sd_transfer.STid == 62 ? "公转" : sd_transfer.STid == 63 ? "私转" : "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Sys_SetData sd_transfer = _daiRep.Query<Sys_SetData>(s => s.Id == item.transferTypeId).First();
|
|
|
+ if (sd_transfer != null)
|
|
|
+ {
|
|
|
+ item.transferTypeIdStr = sd_transfer.Name;
|
|
|
+ item.transferParentId = sd_transfer.STid;
|
|
|
+ item.transferParentIdStr = sd_transfer.STid == 62 ? "公转" : sd_transfer.STid == 63 ? "私转" : "";
|
|
|
+ dic_setData.Add(item.transferTypeId, sd_transfer.Name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ string feeContentSql = string.Format(@"Select * From Fin_DailyFeePaymentContent
|
|
|
+ Where IsDel=0 And DFPId = {0} ", item.Id);
|
|
|
+ item.childList = _sqlSugar.SqlQueryable<Fin_DailyFeePaymentContentInfolView>(feeContentSql).ToList();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ decimal total_gz = DailyFeePaymentData.Where(s => s.transferParentId == 62).Sum(d => d.SumPrice ?? 0M);
|
|
|
+ decimal total_sz = DailyFeePaymentData.Where(s => s.transferParentId == 63).Sum(d => d.SumPrice ?? 0M);
|
|
|
+
|
|
|
+ var result = new tree_Fin_DailyFeePaymentResult() { gz = total_gz, sz = total_sz, dataList = DailyFeePaymentData };
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|