amigotrip 7 months ago
parent
commit
7333f356a0

+ 20 - 4
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -26,6 +26,7 @@ using NetTaste;
 using OASystem.Domain.ViewModels.QiYeWeChat;
 using NPOI.POIFS.Crypt.Dsig;
 using EyeSoft.SequentialIdentity;
+using Microsoft.Extensions.Configuration;
 
 namespace OASystem.API.Controllers
 {
@@ -37,6 +38,7 @@ namespace OASystem.API.Controllers
     public class StatisticsController : ControllerBase
     {
         private readonly int _decimalPlaces;
+        private readonly IConfiguration _config;
         private readonly IMapper _mapper;
         private readonly SqlSugarClient _sqlSugar;
         private readonly DelegationInfoRepository _groupRep;
@@ -51,9 +53,10 @@ namespace OASystem.API.Controllers
         /// <param name="sqlSugar"></param>
         /// <param name="groupRep"></param>
         /// <param name="setDataRep"></param>
-        public StatisticsController(IMapper mapper, SqlSugarClient sqlSugar, DelegationInfoRepository groupRep, SetDataRepository setDataRep, TeamRateRepository teamRate, VisitingClientsRepository visitingClientsRep)
+        public StatisticsController(IMapper mapper, IConfiguration config, SqlSugarClient sqlSugar, DelegationInfoRepository groupRep, SetDataRepository setDataRep, TeamRateRepository teamRate, VisitingClientsRepository visitingClientsRep)
         {
             _mapper = mapper;
+            _config = config;
             _groupRep = groupRep;
             _setDataRep = setDataRep;
             _sqlSugar = sqlSugar;
@@ -2917,14 +2920,27 @@ Order By Count Desc");
                                                         55,//  大运会
                                                          };
 
+                //更改appsettings 值
+                //AppSettingsHelper.UpdateIntList("Dailypayment",new List<int>() { 666 });
+                //var listConfig = _config.GetSection("Dailypayment").GetValue<List<int>>();
+                //listConfig.Add(666);
+
+                //读取appsettings json DailypaymentTypeData 配置
+                List<int> dailypaymentTypeData = AppSettingsHelper.Get<int>("Dailypayment");
                 var _view = await _sqlSugar.Queryable<DailypaymentParentTypeView>()
                                            .Includes(x => x.SubData)
                                            .Where(x => defaultParentIds.Contains(x.Id))
                                            .ToListAsync();
+                _view.ForEach(x =>
+                {
+                    x.SubData.ForEach(y =>
+                    {
+                        int currId = dailypaymentTypeData.Find(z => z == y.Id);
+                        y.IsChecked = currId == 0 ? false : true;
+                    });
+                });
 
-                //return Ok(JsonView(true, "查询成功!", _view, total));
-                return Ok(JsonView(false, "查询失败",_view));
-
+                return Ok(JsonView(true, "查询成功!", _view));
             }
             else
             {

+ 5 - 0
OASystem/OASystem.Api/appsettings.json

@@ -353,5 +353,10 @@
         }
       ]
     }
+  ],
+  
+  //日付类型Data
+  "Dailypayment": [
+
   ]
 }

+ 2 - 0
OASystem/OASystem.Domain/ViewModels/Statistics/DailypaymentView.cs

@@ -31,6 +31,8 @@ namespace OASystem.Domain.ViewModels.Statistics
         public int Id { get; set; }
         public int STid { get; set; }
         public string Name { get; set; }
+
+        public bool IsChecked { get; set; } = false;
     }
 
 }

+ 1 - 0
OASystem/OASystem.Infrastructure/OASystem.Infrastructure.csproj

@@ -12,6 +12,7 @@
     <PackageReference Include="AutoMapper" Version="12.0.0" />
     <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
     <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.0" />
     <PackageReference Include="NPOI" Version="2.6.0" />

+ 18 - 4
OASystem/OASystem.Infrastructure/Repositories/Financial/ForeignReceivablesRepository.cs

@@ -372,9 +372,22 @@ Where ffr.IsDel=0 And ffr.Diid={0}", dto.DiId);
             int addCount = 0, updateCount = 0;
             if (dto.PortType == 1)
             {
-                List<Fin_ForeignReceivables> _ForeignReceivables = new List<Fin_ForeignReceivables>();
+                //查询值是否更改
+                var selectInfos = await _sqlSugar.Queryable<Fin_ForeignReceivables>().Where(it => it.Diid == dto.DiId && it.Status == 1).ToListAsync();
+
+                List <Fin_ForeignReceivables> _ForeignReceivables = new List<Fin_ForeignReceivables>();
                 foreach (var item in dto.foreignReceivablesInfos)
                 {
+                    var info = selectInfos.Find(x => x.Id == item.Id);
+                    if (info != null)
+                    {
+                        if (info.ItemSumPrice == item.ItemSumPrice)
+                        {
+                            continue;
+                        }
+                    }
+
+
                     _ForeignReceivables.Add(new Fin_ForeignReceivables()
                     {
                         Diid = dto.DiId,
@@ -397,9 +410,10 @@ Where ffr.IsDel=0 And ffr.Diid={0}", dto.DiId);
                     var x = _sqlSugar.Storageable(_ForeignReceivables).ToStorage();
                     addCount = x.AsInsertable.ExecuteCommand();       //不存在插入
                     updateCount = x.AsUpdateable.IgnoreColumns(it => new 
-                                    {  it.Status, 
-                                        it.Auditor, 
-                                        it.AuditTime, 
+                                    {  
+                                        //it.Status, 
+                                        //it.Auditor, 
+                                        //it.AuditTime, 
                                         it.CreateUserId, 
                                         it.CreateTime 
                                     }).ExecuteCommand();    //存在更新

+ 6 - 1
OASystem/OASystem.Infrastructure/Tools/AppSettingsHelper.cs

@@ -1,4 +1,8 @@
-namespace OASystem.Infrastructure.Tools;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Configuration.Memory;
+using MySqlX.XDevAPI;
+
+namespace OASystem.Infrastructure.Tools;
 
 /// <summary>
 /// 配置帮助类
@@ -75,4 +79,5 @@ public class AppSettingsHelper
             return null;
         }
     }
+
 }