2 Комити 7d5f413916 ... 0f845eea0c

Аутор SHA1 Порука Датум
  Lyyyi 0f845eea0c Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop пре 1 месец
  Lyyyi f20a5b812f 财务收款项优化及报销单导出增强 пре 1 месец

+ 48 - 64
OASystem/OASystem.Api/Controllers/FinancialController.cs

@@ -2280,72 +2280,65 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostAmountReceivedAddOrEdit(AmountReceivedAddOrEditDto dto)
         {
-            try
+            if (dto == null || dto._ProceedsReceivedInfos == null || dto._ProceedsReceivedInfos.Count < 1)
             {
-                if (dto == null)
-                {
-                    return Ok(JsonView(false, "参数不能为空!"));
-                }
+                return Ok(JsonView(false, "参数不能为空!"));
+            }
 
-                Result ffrData = await _proceedsReceivedRep.PostAmountReceivedAddOrEditDto(dto);
+            Result ffrData = await _proceedsReceivedRep.PostAmountReceivedAddOrEditDto(dto);
 
-                #region 判断金额是否收完
+            #region 判断金额是否收完
 
-                //已收
-                var Fin_ProceedsReceived_SumPrice = _sqlSugar
-                    .Queryable<Fin_ProceedsReceived>()
-                    .Where(x => x.Diid == dto.DiId && x.IsDel == 0)
-                    .Sum(x => x.Price);
+            //已收
+            var Fin_ProceedsReceived_SumPrice = _sqlSugar
+                .Queryable<Fin_ProceedsReceived>()
+                .Where(x => x.Diid == dto.DiId && x.IsDel == 0)
+                .Sum(x => x.Price);
 
-                //收款账单金额 (应收)
-                var Fin_ForeignReceivables_SumPrice = _sqlSugar
-                    .Queryable<Fin_ForeignReceivables>()
-                    .Where(x => x.Diid == dto.DiId && x.IsDel == 0)
-                    .Sum(x => x.ItemSumPrice);
+            //收款账单金额 (应收)
+            var Fin_ForeignReceivables_SumPrice = _sqlSugar
+                .Queryable<Fin_ForeignReceivables>()
+                .Where(x => x.Diid == dto.DiId && x.IsDel == 0)
+                .Sum(x => x.ItemSumPrice);
 
-                if ((Fin_ProceedsReceived_SumPrice - Fin_ForeignReceivables_SumPrice) >= 0)
-                {
-                    _sqlSugar.Updateable<Grp_DelegationInfo>()
-                        .Where(x => x.Id == dto.DiId && x.IsDel == 0)
-                        .SetColumns(x => new Grp_DelegationInfo { IsSure = 1 })
-                        .ExecuteCommand();
-                }
+            if ((Fin_ProceedsReceived_SumPrice - Fin_ForeignReceivables_SumPrice) >= 0)
+            {
+                _sqlSugar.Updateable<Grp_DelegationInfo>()
+                    .Where(x => x.Id == dto.DiId && x.IsDel == 0)
+                    .SetColumns(x => new Grp_DelegationInfo { IsSure = 1 })
+                    .ExecuteCommand();
+            }
 
-                #endregion
+            #endregion
 
-                if (dto.PortType == 1)
+            if (dto.PortType == 1)
+            {
+                if (ffrData.Code != 0)
                 {
-                    if (ffrData.Code != 0)
-                    {
-                        return Ok(JsonView(false, ffrData.Msg));
-                    }
-
+                    return Ok(JsonView(false, ffrData.Msg));
                 }
-                else if (dto.PortType == 2)
-                {
-                    if (ffrData.Code != 0)
-                    {
-                        return Ok(JsonView(false, ffrData.Msg));
-                    }
 
-                }
-                else if (dto.PortType == 2)
+            }
+            else if (dto.PortType == 2)
+            {
+                if (ffrData.Code != 0)
                 {
-                    if (ffrData.Code != 0)
-                    {
-                        return Ok(JsonView(false, ffrData.Msg));
-                    }
+                    return Ok(JsonView(false, ffrData.Msg));
                 }
-                else
+
+            }
+            else if (dto.PortType == 2)
+            {
+                if (ffrData.Code != 0)
                 {
-                    return Ok(JsonView(false, "请选择正确的端口号!"));
+                    return Ok(JsonView(false, ffrData.Msg));
                 }
-                return Ok(JsonView(true, "操作成功!"));
             }
-            catch (Exception ex)
+            else
             {
-                return Ok(JsonView(false, ex.Message));
+                return Ok(JsonView(false, "请选择正确的端口号!"));
             }
+            return Ok(JsonView(true, "操作成功!"));
         }
 
         /// <summary>
@@ -3006,6 +2999,7 @@ namespace OASystem.API.Controllers
                     clientUnit = x.ClientUnit,
                     visitDate = x.VisitDate.ToString("yyyy-MM-dd"),
                     fulfiller = y.CnName,
+                    schedule = x.PrUnSettleReason,
                 })
                 .ToListAsync();
 
@@ -3228,7 +3222,8 @@ namespace OASystem.API.Controllers
                     decimal sum_refund = 0M; //收款退还
                     decimal sum_extra = 0M; //超支费用
                     //decimal balance = 0M;
-                    string str_schedule = string.Empty;
+                    // 默认新增 已收款项 特殊备注信息
+                    string str_schedule = $"特殊原因:{list_rst.FirstOrDefault(x => x.diid == diId)?.schedule ?? ""}\r\n其他原因:"; 
 
                     //1.应收
                     string sql_fr = string.Format(@" Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0} ", diId);
@@ -3238,22 +3233,11 @@ namespace OASystem.API.Controllers
                     //2.已收
                     string sql_pr = string.Format(@" Select * From Fin_ProceedsReceived Where IsDel=0 And Diid={0} ", diId);
                     List<Fin_ProceedsReceived> list_pr = _sqlSugar.SqlQueryable<Fin_ProceedsReceived>(sql_pr).ToList();
-                    foreach (var item_pr in list_pr)
-                    {
-                        sum_pr += item_pr.Price;
-                        str_client += string.Format(@"{0};", item_pr.Client);
-                        str_schedule += string.Format(@"{0};", item_pr.Remark);
-
-                    }
-                    if (str_schedule.Length > 0)
-                    {
-                        str_schedule = str_schedule.TrimEnd(';');
-                    }
-                    if (str_client.Length > 0)
-                    {
-                        str_client = str_client.TrimEnd(';');
-                    }
 
+                    sum_pr += list_pr.Sum(x => x.Price);
+                    str_schedule  += string.Join(";", list_pr.Select(x => x.Remark.Trim()));
+                    str_client += string.Join(";", list_pr.Select(x => x.Client.Trim()));
+                    
                     //3.收款退还
                     string sql_other = string.Format(@"Select * From  Fin_PaymentRefundAndOtherMoney prao
 					  Inner Join Grp_CreditCardPayment ccp On prao.Id = ccp.CId

+ 132 - 98
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -15456,8 +15456,8 @@ FROM
                         {
                             Workbook = new Workbook(tempPath)
                         };
-
-                        var worksheet = designer.Workbook.Worksheets[0];
+                        Workbook workbook = designer.Workbook;
+                        var worksheet = workbook.Worksheets[0];
 
                         // 日期格式化
                         var dateFormat = "yyyy年MM月dd日";
@@ -15483,27 +15483,92 @@ FROM
                         // 数据整理
                         // 住宿费
                         var accomFees = dac1.GroupBy(x => x.NationalTravelFeeId)
-                            .Select(group => new
-                            {
-                                TravelFeeId = group.Key,
-                                TotalDays = group.Count(),
-                                group.First().Cost,
-                                TotalAmount = group.Sum(x => x.Cost),
-                                group.First().Currency,
-                                Details = group.ToList()
+                            .Select(group => 
+                            {
+                                var currData = group.FirstOrDefault();
+
+                                // 币种信息
+                                var currencyInfo = _CurrDatas.Where(x => x.Id == currData.Currency).FirstOrDefault();
+                                // 币种名称
+                                string currencyName = currencyInfo?.Remark ?? "";
+                                // 币种Code
+                                string currencyCode = currencyInfo?.Name ?? "";
+                                // 币种汇率信息
+                                var currencyRateInfo = enterExitCostCurrencys.Where(x => x.CurrencyName.Equals(currencyName)).FirstOrDefault();
+                                // 币种汇率
+                                decimal currencyRate = currencyRateInfo != null ? currencyRateInfo.Rate : 1.00M;
+
+                                // 城市信息 Grp_NationalTravelFee
+                                var placeName = GetEnterExitCostExportCity(placeData, group.Key);
+
+                                // 天数
+                                int totalDays = group.Count();
+
+                                // 原始币种小计
+                                decimal totalAmount = group.Sum(x => x.Cost);
+
+                                // 人名币金额
+                                decimal totalCNY = totalDays * totalAmount * currencyRate;
+
+                                return new {
+                                    TravelFeeId = group.Key,
+                                    PlaceName = placeName,
+                                    TotalDays = totalDays,
+                                    currData.Cost,
+                                    TotalAmount = totalAmount,
+                                    currData.Currency,
+                                    CurrencyCode = currencyCode,
+                                    CurrencyName = currencyName,
+                                    CurrencyRate = currencyRate,
+                                    TotalCNY = totalCNY,
+                                    Details = group.ToList()
+                                };
                             })
                             .ToList();
                         // 伙食费和公杂费
                         var foodSundCosts = _DayAndCosts.Where(x => x.Type == 2 || x.Type == 3)
                             .GroupBy(x => x.NationalTravelFeeId)
-                            .Select(group => new
-                            {
-                                TravelFeeId = group.Key,
-                                TotalDays = group.Count(),
-                                Cost = group.Sum(x => x.Cost) / group.Count() / 2,
-                                TotalAmount = group.Sum(x => x.Cost),
-                                group.First().Currency,
-                                Details = group.ToList()
+                            .Select(group =>
+                            {
+                                var currData = group.FirstOrDefault();
+
+                                // 币种信息
+                                var currencyInfo = _CurrDatas.Where(x => x.Id == currData.Currency).FirstOrDefault();
+                                // 币种名称
+                                string currencyName = currencyInfo?.Remark ?? "";
+                                // 币种Code
+                                string currencyCode = currencyInfo?.Name ?? "";
+                                // 币种汇率信息
+                                var currencyRateInfo = enterExitCostCurrencys.Where(x => x.CurrencyName.Equals(currencyName)).FirstOrDefault();
+                                // 币种汇率
+                                decimal currencyRate = currencyRateInfo != null ? currencyRateInfo.Rate : 1.00M;
+
+                                // 城市信息 Grp_NationalTravelFee
+                                var placeName = GetEnterExitCostExportCity(placeData, group.Key);
+
+                                // 天数
+                                int totalDays = group.Count() / 2;
+
+                                // 原始币种小计
+                                decimal totalAmount = group.Sum(x => x.Cost);
+
+                                // 人名币金额
+                                decimal totalCNY = totalDays * totalAmount * currencyRate;
+
+                                return new
+                                {
+                                    TravelFeeId = group.Key,
+                                    PlaceName = placeName,
+                                    TotalDays = totalDays,
+                                    currData.Cost,
+                                    TotalAmount = totalAmount,
+                                    currData.Currency,
+                                    CurrencyCode = currencyCode,
+                                    CurrencyName = currencyName,
+                                    CurrencyRate = currencyRate,
+                                    TotalCNY = totalCNY,
+                                    Details = group.ToList()
+                                };
                             })
                             .ToList();
 
@@ -15558,112 +15623,81 @@ FROM
 
                         #endregion
 
-                        designer.SetDataSource("TotalOtherFeeLabel", string.Join(";", otherFeestrs));
+                        designer.SetDataSource("TotalOtherFeeLabel", $"5.其他费用({string.Join(";", otherFeestrs)})");
                         designer.SetDataSource("TotalOtherFee", $"{totalOtherFee:0.00}");
 
                         // 住宿费、伙食费和公杂费合计
-                        //decimal grandTotalFee = foodSundCosts.Sum(x => )
-
-                        //decimal otherFee = _EnterExitCosts.Visa + _EnterExitCosts.YiMiao + _EnterExitCosts.HeSuan + _EnterExitCosts.Safe + _EnterExitCosts.Ticket + _EnterExitCosts.Service + otherPriceTotal;
-                        //decimal s = dac1totalPrice + dac2totalPrice + totalAirJJC + totalOtherFee;
-
-                        //decimal pxFee = dac4.Sum(it => it.Cost);
-                        //decimal glvFee = _EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsideGWPay;
-                        //string celllastStr1 = "";
-                        //if (dac1totalPrice > 0) celllastStr1 += $"住宿费 {dac1totalPrice:#0.00} 元";
-                        //if (dac2totalPrice > 0) celllastStr1 += $",伙食费和公杂费 {dac2totalPrice:#0.00} 元";
-                        //if (pxFee > 0) celllastStr1 += $",培训费 {pxFee:#0.00} 元";
-                        //celllastStr1 += $",国际旅费       元";
-                        //if (otherFee > 0) celllastStr1 += $",其他费用 {otherFee:#0.00} 元";
+                        decimal grandTotalFee = foodSundCosts.Sum(x => x.TotalCNY) + foodSundCosts.Sum(x => x.TotalCNY);
 
-                        //string celllastStr = $"    经审核,{celllastStr1},本次出国经费预算合计为         元。其中:市本级安排      。";
+                        //其他费用合计
+                        decimal otherFee = _EnterExitCosts.Visa + _EnterExitCosts.YiMiao + _EnterExitCosts.HeSuan + _EnterExitCosts.Safe + _EnterExitCosts.Ticket + _EnterExitCosts.Service + otherPriceTotal;
+                        decimal totalPrice = grandTotalFee + totalAirJJC + totalOtherFee;
 
-                        //designer.SetDataSource("cell4Str", cell4Str);
-                        //designer.SetDataSource("cellStr", cellStr);
-                        //designer.SetDataSource("cellSum", otherFee.ToString("#0.00"));
-                        //designer.SetDataSource("cellSum4", (_EnterExitCosts.OutsideJJPay + _EnterExitCosts.OutsideGWPay).ToString("#0.00"));
-                        //designer.SetDataSource("celllastStr", celllastStr);
+                        designer.SetDataSource("TotalFeeLabel", $"大写 :{CommonFun.ToChinese(totalPrice)}"); // 合计金额中文大写
+                        designer.SetDataSource("TotalFee", $"{totalPrice:0.00}");    // 合计金额 
+                        designer.SetDataSource("ActualAmount  ", $"{totalPrice:0.00}元");    // 合计金额 
 
-                        //模板文件名
-                        string strFileName = $"{_DelegationInfo.TeamName}-省级单位出国经费报销单{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
-                        designer.Workbook.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
+                        designer.Process();
 
                         #region 设置 住宿费、伙食费和公杂显示值
                         // 开始行
-                        int startRow = 7;
+                        int startRow = 8;
                         // 开始列
                         int startColumn = 1;
+                        // 数据展示默认行 含小计行
+                        int defualtRow = 4;
 
                         // 设置住宿费
-                        for (int i = 0; i < foodSundCosts.Count; i++)
+                        for (int i = 0; i < accomFees.Count; i++)
                         {
-                            var currData = foodSundCosts[i];
-
-                            // 币种信息
-                            var currencyInfo = _CurrDatas.Where(x => x.Id == currData.Currency).FirstOrDefault();
-                            // 币种名称
-                            string currencyName = currencyInfo?.Remark;
-                            // 币种Code
-                            string currencyCode = currencyInfo?.Name;
-                            // 币种汇率信息
-                            var currencyRateInfo = enterExitCostCurrencys.Where(x => x.CurrencyName.Equals(currencyName)).FirstOrDefault();
-                            // 币种汇率
-                            decimal currencyRate = currencyRateInfo != null ? currencyRateInfo.Rate : 1.00M;
-
-                            // 城市信息 Grp_NationalTravelFee
-                            var placeName = GetEnterExitCostExportCity(placeData, currData.TravelFeeId);
-
-                            decimal totalCNY = currData.TotalDays * currData.TotalAmount * currencyRate;
-                            startRow += i;
+                            var currData = accomFees[i];
+                            int startRow1 = startRow + i;
 
                             // 插入数据到对应列
-                            worksheet.Cells[startRow, startColumn].PutValue(placeName);                     // 国家(地区)/城市
-                            worksheet.Cells[startRow, startColumn + 1].PutValue(currencyName);              // 币种
-                            worksheet.Cells[startRow, startColumn + 2].PutValue($"{currData.Cost:0.00}");   // 标准
-                            worksheet.Cells[startRow, startColumn + 3].PutValue("1");                       // 人数
-                            worksheet.Cells[startRow, startColumn + 4].PutValue(currData.TotalDays);        // 天数
-                            worksheet.Cells[startRow, startColumn + 5].PutValue($"{currData.TotalAmount:0.00}");// 小计
-                            worksheet.Cells[startRow, startColumn + 6].PutValue($"{currencyRate:0.0000}");  // 汇率
-                            worksheet.Cells[startRow, startColumn + 7].PutValue($"{totalCNY:0.00}");        // 折合人民币(元)
+                            worksheet.Cells[startRow1, startColumn].PutValue(currData.PlaceName);                    // 国家(地区)/城市
+                            worksheet.Cells[startRow1, startColumn + 1].PutValue(currData.CurrencyName);             // 币种
+                            worksheet.Cells[startRow1, startColumn + 2].PutValue($"{currData.Cost:0.00}");           // 标准
+                            worksheet.Cells[startRow1, startColumn + 3].PutValue("1");                               // 人数
+                            worksheet.Cells[startRow1, startColumn + 4].PutValue(currData.TotalDays);                // 天数
+                            worksheet.Cells[startRow1, startColumn + 5].PutValue($"{currData.TotalAmount:0.00}");    // 小计
+                            worksheet.Cells[startRow1, startColumn + 6].PutValue($"{currData.CurrencyRate:0.0000}"); // 汇率
+                            worksheet.Cells[startRow1, startColumn + 7].PutValue($"{currData.TotalCNY:0.00}");       // 折合人民币(元)
                         }
 
+                        //设置小计行 合计金额 固定单元格
+                        worksheet.Cells[11, startColumn + 7].PutValue($"{accomFees.Sum(x => x.TotalCNY):0.00}");      // 折合人民币(元)
+
                         //  新增小计行
-                        startRow += 1;
+                        if (accomFees.Count == (defualtRow - 1)) startRow += 1;
+                        else startRow += defualtRow;
 
                         // 设置伙食费和公杂费行
-                        for (int i = 0; i < accomFees.Count; i++)
+                        for (int i = 0; i < foodSundCosts.Count; i++)
                         {
-                            var currData = accomFees[i];
-
-                            // 币种信息
-                            var currencyInfo = _CurrDatas.Where(x => x.Id == currData.Currency).FirstOrDefault();
-                            // 币种名称
-                            string currencyName = currencyInfo?.Remark;
-                            // 币种Code
-                            string currencyCode = currencyInfo?.Name;
-                            // 币种汇率信息
-                            var currencyRateInfo = enterExitCostCurrencys.Where(x => x.CurrencyName.Equals(currencyName)).FirstOrDefault();
-                            // 币种汇率
-                            decimal currencyRate = currencyRateInfo != null ? currencyRateInfo.Rate : 1.00M;
-
-                            // 城市信息 Grp_NationalTravelFee
-                            var placeName = GetEnterExitCostExportCity(placeData, currData.TravelFeeId);
-
-                            decimal totalCNY = currData.TotalDays * currData.TotalAmount * currencyRate;
-                            startRow += i;
+                            var currData = foodSundCosts[i];
+                            int startRow2 = startRow + i;
 
                             // 插入数据到对应列
-                            worksheet.Cells[startRow, startColumn].PutValue(placeName);                     // 国家(地区)/城市
-                            worksheet.Cells[startRow, startColumn + 1].PutValue(currencyName);              // 币种
-                            worksheet.Cells[startRow, startColumn + 2].PutValue($"{currData.Cost:0.00}");   // 标准
-                            worksheet.Cells[startRow, startColumn + 3].PutValue("1");                       // 人数
-                            worksheet.Cells[startRow, startColumn + 4].PutValue(currData.TotalDays);        // 天数
-                            worksheet.Cells[startRow, startColumn + 5].PutValue($"{currData.TotalAmount:0.00}");// 小计
-                            worksheet.Cells[startRow, startColumn + 6].PutValue($"{currencyRate:0.0000}");  // 汇率
-                            worksheet.Cells[startRow, startColumn + 7].PutValue($"{totalCNY:0.00}");        // 折合人民币(元)
-                        }
+                            worksheet.Cells[startRow2, startColumn].PutValue(currData.PlaceName);                    // 国家(地区)/城市
+                            worksheet.Cells[startRow2, startColumn + 1].PutValue(currData.CurrencyName);             // 币种
+                            worksheet.Cells[startRow2, startColumn + 2].PutValue($"{currData.Cost:0.00}");           // 标准
+                            worksheet.Cells[startRow2, startColumn + 3].PutValue("1");                               // 人数
+                            worksheet.Cells[startRow2, startColumn + 4].PutValue(currData.TotalDays);                // 天数
+                            worksheet.Cells[startRow2, startColumn + 5].PutValue($"{currData.TotalAmount:0.00}");    // 小计
+                            worksheet.Cells[startRow2, startColumn + 6].PutValue($"{currData.CurrencyRate:0.0000}"); // 汇率
+                            worksheet.Cells[startRow2, startColumn + 7].PutValue($"{currData.TotalCNY:0.00}");       // 折合人民币(元)
+                        }
+
+                        //设置小计行 合计金额 固定单元格
+                        worksheet.Cells[11, startColumn + 7].PutValue($"{accomFees.Sum(x => x.TotalCNY):0.00}");      // 折合人民币(元)
                         #endregion
 
+                        workbook.CalculateFormula(true);
+
+                        //模板文件名
+                        string strFileName = $"{_DelegationInfo.TeamName}-省级单位出国经费报销单{DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
+                        designer.Workbook.Save(AppSettingsHelper.Get("WordBasePath") + "EnterExitCost/File/" + strFileName);
+
                         string url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/EnterExitCost/File/" + strFileName;
                         if (dto.PortType == 1 || dto.PortType == 3) return Ok(JsonView(true, "成功", new { Url = url }));
                         else if (dto.PortType == 2) return Ok(JsonView(true, "成功", url));

+ 12 - 0
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -962,13 +962,25 @@ namespace OASystem.API.OAMethodLib
                 .Where(x => x.IsDel == 0 && x.STid == 66)
                 .ToListAsync();
 
+            //只记录 五种币种 汇率
+            var currencyCodes = new List<string>() {
+                "USD",
+                "EUR",
+                "JPY",
+                "GBP",
+                "HKD"
+            };
+
             foreach (var rate in _currencyRate)
             {
                 var oaCurrncy = oaCurrencyData.Find(x => x.Remark.Equals(rate.Name));
                 if (oaCurrncy == null) continue;
 
+                if (!currencyCodes.Contains(oaCurrncy.Name)) continue;
+
                 //美元(USD):7.5|
                 string rateStr = rate.FSellPri ?? "0.00";
+                
                 rateInfoStr += $"{rate.Name}({oaCurrncy.Name}):{rateStr}|";
             }
 

+ 5 - 0
OASystem/OASystem.Domain/Dtos/Financial/ProceedsReceivedDto.cs

@@ -179,6 +179,11 @@ namespace OASystem.Domain.Dtos.Financial
         /// </summary>
         public int DiId { get; set; }
 
+        /// <summary>
+        /// 未结清原因
+        /// </summary>
+        public string UnSettleReason { get; set; }
+
         /// <summary>
         /// 已收款项infos
         /// </summary>

+ 1 - 1
OASystem/OASystem.Domain/Dtos/PersonnelModule/GoodsDTO.cs

@@ -243,7 +243,7 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// <summary>
         /// 审核状态
         /// </summary>
-        public int AuditStatus { get; set; }
+        public string AuditLabel { get; set; }
         /// <summary>
         /// 物品Name
         /// </summary>

+ 0 - 1
OASystem/OASystem.Domain/Entities/Customer/Crm_DeleClient.cs

@@ -2,7 +2,6 @@
 
 namespace OASystem.Domain.Entities.Customer
 {
-
     /// <summary>
     /// 客户信息表
     /// </summary>

+ 6 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_DelegationInfo.cs

@@ -284,5 +284,11 @@ namespace OASystem.Domain.Entities.Groups
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int ExtOverCurrency { get; set; }
 
+        /// <summary>
+        /// 已收款项 - 未结清原因 
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)", IsJson = true)]
+        public string PrUnSettleReason { get; set; } = "";
+
     }
 }

+ 1 - 7
OASystem/OASystem.Domain/Entities/System/Sys_AuditRecord.cs

@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace OASystem.Domain.Entities.System
+namespace OASystem.Domain.Entities.System
 {
     /// <summary>
     /// 审核记录表

+ 5 - 5
OASystem/OASystem.Domain/Enums/GoodsAuditEnum.cs

@@ -23,12 +23,12 @@ namespace OASystem.Domain.Enums
         [Description("领用待确认")]
         Pending,
         /// <summary>
-        /// 领用已确认
+        /// 已确认领用
         /// </summary>
         [Description("已确认领用")]
         Approved,
         /// <summary>
-        /// 领用确认已拒绝
+        /// 已拒绝领用
         /// </summary>
         [Description("已拒绝领用")]
         UnApproved,
@@ -38,17 +38,17 @@ namespace OASystem.Domain.Enums
         [Description("出库待确认")]
         OutPending,
         /// <summary>
-        /// 出库确认中/确认中
+        /// 确认中
         /// </summary>
         [Description("确认中")]
         OutConfirming,
         /// <summary>
-        /// 出库确认完成
+        /// 完成
         /// </summary>
         [Description("已完成")]
         OutConfirmed,
         /// <summary>
-        /// 出库确认拒绝
+        /// 拒绝
         /// </summary>
         [Description("已拒绝")]
         OutRejected,

+ 0 - 1
OASystem/OASystem.Domain/ViewModels/Financial/Fin_ProceedsReceivedView.cs

@@ -72,7 +72,6 @@ namespace OASystem.Domain.ViewModels.Financial
         public string? Remark { get; set; }
     }
 
-
     /// <summary>
     /// 团组已收款项-1Info View
     /// </summary>

+ 12 - 17
OASystem/OASystem.Infrastructure/Repositories/Financial/ProceedsReceivedRepository.cs

@@ -233,10 +233,14 @@ namespace OASystem.Infrastructure.Repositories.Financial
                                          Where IsDel=0 And Diid={0}", diid);
 
             var groupReceivablesList = await _sqlSugar.SqlQueryable<ProceedsReceived1View>(sql).ToListAsync();
-
+            var groupInfo = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.IsDel == 0 && x.Id == diid).FirstAsync();
             result.Code = 0;
             result.Msg = "查询成功!";
-            result.Data = groupReceivablesList;
+            result.Data = new
+            {
+                UnSettleReason = groupInfo.PrUnSettleReason,
+                groupReceivablesList
+            };
 
             return result;
         }
@@ -257,7 +261,6 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 return result;
             }
 
-            
             int addCount = 0, updateCount = 0;
             if (dto.PortType == 1)
             {
@@ -308,22 +311,10 @@ namespace OASystem.Infrastructure.Repositories.Financial
                         updateCount++;
                     }
                     _sqlSugar.CommitTran();
-                    //updateCount = x.AsUpdateable.IgnoreColumns(p => new
-                    //{
-                    //    p.SectionTime,
-                    //    p.Price,
-                    //    p.Currency,
-                    //    p.ReceivablesType,
-                    //    p.Client,
-                    //    p.CustomerName,
-                    //    p.CustomerTel,
-                    //    p.Remark
-                    //}).ExecuteCommand();    //存在更新
                 }
                 result.Code = 0;
                 result.Msg = string.Format(@"操作成功!添加:{0}条;更新:{1};", addCount, updateCount);
 
-
                 //修改团组状态
                 int diId = dto.DiId;
                 decimal sum_fr = 0M;
@@ -364,9 +355,13 @@ namespace OASystem.Infrastructure.Repositories.Financial
                         IsSure = 1
                     });
                 }
-            }
-
 
+                var updateGroup = await _sqlSugar.Updateable<Grp_DelegationInfo>()
+                    .SetColumnsIF(balance <= 0, x => x.IsSure == 1)
+                    .SetColumns( x => x.PrUnSettleReason == dto.UnSettleReason)
+                    .Where(it => it.Id == dto.DiId)
+                    .ExecuteCommandAsync();
+            }
 
             return result;
         }

+ 3 - 1
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/GoodsRepository.cs

@@ -3000,8 +3000,9 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
         /// <returns></returns>
         public async Task<JsonView> GoodsReceiveAuditList(GoodsReceiveAuditListDTO dto)
         {
+            // 审核状态 默认全部 -1
+            int auditStatus = int.TryParse(dto.AuditLabel, out int parsed) ? parsed : -1;
             var currUserId = dto.CurrUserId;
-            var auditStatus = dto.AuditStatus;
             var goodsName = dto.GoodsName;
 
             var sql = string.Format(@"SELECT
@@ -3070,6 +3071,7 @@ FROM
             }
             RefAsync<int> total = 0;
             var view = await _sqlSugar.SqlQueryable<GoodsReceiveListMobileView>(sql)
+                .WhereIF(auditStatus != -1, x => x.AuditStatus == (GoodsAuditEnum)auditStatus)
                 .WhereIF(isValueable, x => x.IsValuable == true)
                 .WhereIF(!string.IsNullOrEmpty(goodsName), x => x.GoodsName.Contains(goodsName))
                 .ToPageListAsync(dto.PageIndex, dto.PageSize, total);

+ 99 - 1
OASystem/OASystem.Infrastructure/Tools/CommonFun.cs

@@ -522,7 +522,7 @@ public static class CommonFun
             
             foreach (string currency in currencyArr)
             {
-                if (!string.IsNullOrEmpty(currency))
+                if (!string.IsNullOrEmpty(currency) && !currency.Contains("-"))
                 {
                     string[] currency1 = currency.Split(":");
                     string[] currency2 = currency1[0].Split("(");
@@ -937,4 +937,102 @@ public static class CommonFun
 
         return (province, city);
     }
+
+    #region 金额转中文大写
+    private static readonly string[] numbers = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" };
+    private static readonly string[] units = { "", "拾", "佰", "仟" };
+    private static readonly string[] bigUnits = { "", "万", "亿" };
+
+    /// <summary>
+    /// 金额转中文大写
+    /// </summary>
+    public static string ToChinese(decimal money)
+    {
+        // 特殊情况处理
+        if (money == 0) return "零元整";
+        if (money > 999999999999.99m) return "金额超出范围";
+
+        // 处理负数和取绝对值
+        bool negative = money < 0;
+        money = Math.Abs(money);
+
+        // 四舍五入到分
+        money = Math.Round(money, 2, MidpointRounding.AwayFromZero);
+
+        // 分离整数和小数部分
+        long yuan = (long)Math.Floor(money);
+        int fen = (int)Math.Round((money - yuan) * 100);
+
+        string result = "";
+
+        // 转换整数部分
+        if (yuan > 0)
+        {
+            result += ConvertYuan(yuan) + "元";
+        }
+
+        // 转换小数部分
+        if (fen > 0)
+        {
+            int jiao = fen / 10;  // 角
+            int f = fen % 10;     // 分
+
+            if (jiao > 0)
+                result += numbers[jiao] + "角";
+
+            if (f > 0)
+                result += numbers[f] + "分";
+        }
+
+        // 关键:判断是否需要添加"整"
+        if (fen == 0)  // 没有小数部分
+        {
+            if (!result.EndsWith("整"))
+                result += "整";
+        }
+
+        // 处理负数
+        if (negative)
+            result = "负" + result;
+
+        return result;
+    }
+
+    private static string ConvertYuan(long yuan)
+    {
+        if (yuan == 0) return "";
+
+        string yuanStr = yuan.ToString();
+        StringBuilder sb = new StringBuilder();
+        int len = yuanStr.Length;
+
+        for (int i = 0; i < len; i++)
+        {
+            int digit = yuanStr[i] - '0';
+            int position = len - i - 1;
+
+            if (digit == 0)
+            {
+                // 只在需要时添加零
+                if (sb.Length > 0 && sb[sb.Length - 1] != '零')
+                    sb.Append("零");
+            }
+            else
+            {
+                sb.Append(numbers[digit]);
+                sb.Append(units[position % 4]);
+            }
+
+            // 添加万、亿单位
+            if (position % 4 == 0 && position > 0)
+            {
+                sb = new StringBuilder(sb.ToString().TrimEnd('零'));
+                sb.Append(bigUnits[position / 4]);
+            }
+        }
+
+        return sb.ToString().TrimEnd('零');
+    }
+    #endregion
+
 }