Browse Source

企业利润调整

LEIYI 1 năm trước cách đây
mục cha
commit
79a3cdc3c3

+ 3 - 3
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -7959,7 +7959,7 @@ ORDER BY
 
             var dailyItems = await _sqlSugar.SqlQueryable<DailyInfo>(dailySql).ToArrayAsync();
 
-            view.GroupItems = groupItems;
+            view.GroupItems = groupItems.OrderBy(x=> x.RowIndex).ToArray();
             view.DailyItems = dailyItems;
             return view;
         }
@@ -8030,11 +8030,11 @@ ORDER BY
             {
                 foreach (var dailyFee in companyDailyItems)
                 {
-                    dailyLabel += $"[{dailyFee.CompanyName}]日常产生费用:{dailyFee.CNYTotal.ToString("#0.00")} CNY \r\n";
+                    dailyLabel += $"<p>[{dailyFee.CompanyName}]日常产生费用:{dailyFee.CNYTotal.ToString("#0.00")} CNY </p>";
                 }
             }
 
-            string label = string.Format(@$"团组收款合计:{groupCollectionTotal.ToString("#0.00")} CNY\t团组产生费用合计:{groupCostTotal.ToString("#0.00")} CNY\t团组利润合计:{groupProfitTotal.ToString("#0.00")} CNY\r\n非团组收款合计:{notGroupCollectionTotal.ToString("#0.00")} CNY\t非团组产生费用合计:{notGroupCostTotal.ToString("#0.00")} CNY\t非团组利润合计:{notGroupProfitTotal.ToString("#0.00")} CNY\r\n{dailyLabel}其中会务:{inforCount}个\r\n服务人数:{serviceCount}人\r\n总利润:{totalProfit.ToString("#0.00")} CNY\r\n");
+            string label = string.Format(@$"<div style='color:black'><p>团组收款合计:{groupCollectionTotal.ToString("#0.00")} CNY&nbsp;团组产生费用合计:{groupCostTotal.ToString("#0.00")} CNY&nbsp;团组利润合计:{groupProfitTotal.ToString("#0.00")} CNY</p><p>非团组收款合计:{notGroupCollectionTotal.ToString("#0.00")} CNY&nbsp;非团组产生费用合计:{notGroupCostTotal.ToString("#0.00")} CNY&nbsp;非团组利润合计:{notGroupProfitTotal.ToString("#0.00")} CNY</p>{dailyLabel}<p>其中会务:{inforCount}个</p><p>服务人数:{serviceCount}人</p>总利润:{totalProfit.ToString("#0.00")} CNY</div>");
 
             var datas = _mapper.Map<CorporateProfitItem[]>(groupItems);
             if (type == 2) //excel 下载

+ 1 - 1
OASystem/OASystem.Api/Middlewares/FixedPromptMiddleware.cs

@@ -28,7 +28,7 @@ namespace OASystem.API.Middlewares
                 //固定提示格式
                 var response = new JsonView()
                 {
-                    Code = 204,
+                    Code = 400,
                     Msg = "紧急通知:因明年接入AI接口,需服务器框架升级及数据库数据备份,OA系统pc端及手机端将暂停使用,我们尽量在48小时内升级完成并恢复使用。"
 
                 };

+ 17 - 4
OASystem/OASystem.Api/Program.cs

@@ -61,8 +61,20 @@ builder.Services.AddCors(policy =>
     //.WithExposedHeaders("X-Pagination"));
 
     policy.AddPolicy("Cors", opt => opt
-          .SetIsOriginAllowed(origin => true)
-                                             //.AllowAnyOrigin()
+            .SetIsOriginAllowed(origin =>
+            {
+                // 定义允许的来源列表
+                var allowedOrigins = new List<string>
+                    {
+                       "http://132.232.92.186:9002"
+                      
+                    };
+
+                // 检查请求的来源是否在允许的列表中
+                return allowedOrigins.Contains(origin);
+            })
+
+          //.AllowAnyOrigin()
           .AllowAnyHeader()
           .WithMethods("GET", "POST", "HEAD", "PUT", "DELETE", "OPTIONS")
           .AllowCredentials());
@@ -361,6 +373,8 @@ builder.Services.TryAddSingleton(typeof(CommonService));
 
 var app = builder.Build();
 
+
+
 AutofacIocManager.Instance.Container = app.UseHostFiltering().ApplicationServices.GetAutofacRoot();//AutofacIocManager
 
 // Configure the HTTP request pipeline.
@@ -371,12 +385,11 @@ if (!app.Environment.IsDevelopment())
 
 app.UseStaticFiles();
 
-app.UseMiddleware<FixedPromptMiddleware>();
+//app.UseMiddleware<FixedPromptMiddleware>();
 app.UseMiddleware<ExceptionHandlingMiddleware>();
 
 app.UseRouting();
 
-
 app.UseCors("Cors");  //Cors
 
 app.UseAuthentication(); // 认证

+ 0 - 2
OASystem/OASystem.Domain/Dtos/Statistics/CorporateProfitDtos.cs

@@ -60,8 +60,6 @@ namespace OASystem.Domain.Dtos.Statistics
         /// </summary>
         public int ExcelType { get; set; }
 
-        public string BeginDt { get; set; }
-        public string EndDt { get; set; }
     }
     public class CorporateProfitExcelDownloadDtoFoalidator : AbstractValidator<CorporateProfitExcelDownloadDto>
     {

+ 42 - 3
OASystem/OASystem.Domain/ViewModels/Statistics/CorporateProfitViews.cs

@@ -98,15 +98,54 @@ namespace OASystem.Domain.ViewModels.Statistics
         /// <summary>
         /// 收款合计
         /// </summary>
-        public decimal CollectionTotal { get { return ReceivedAmount - RefundedAmount; } }
+        public decimal CollectionTotal
+        {
+            get
+            {
+                var total = ReceivedAmount - RefundedAmount; 
+                var totalInt = (int)(total * 100);
+
+                var total1 = new decimal(0, 0, 0, false, 2);
+                if (total > 0) total1 = new decimal(totalInt, 0, 0, false, 2);
+                else if (total < 0) total1 = new decimal(totalInt, 0, 0, true, 2);
+
+                return total1;
+            }
+        }
         /// <summary>
         /// 成本合计
         /// </summary>
-        public decimal CostTotal { get { return HotelAmount + LocalGuideAmount + AirTicketAmount + VisaAmount + OAAmount + InsureAmount + OtherAmount; } }
+        public decimal CostTotal
+        {
+            get
+            {
+                var total = HotelAmount + LocalGuideAmount + AirTicketAmount + VisaAmount + OAAmount + InsureAmount + OtherAmount;
+                var totalInt = (int)(total * 100);
+
+                var total1 = new decimal(0, 0, 0, false, 2);
+                if (total > 0) total1 = new decimal(totalInt, 0, 0, false, 2);
+                else if (total < 0) total1 = new decimal(totalInt, 0, 0, true, 2);
+
+                return total1;
+            }
+        }
         /// <summary>
         /// 利润合计
         /// </summary>
-        public decimal ProfitTotal { get { return CollectionTotal - CostTotal; } }
+        public decimal ProfitTotal
+        {
+            get
+            {
+                var total = CollectionTotal - CostTotal;
+                var totalInt = (int)(total * 100);
+
+                var total1 = new decimal(0, 0, 0, false, 2);
+                if (total > 0) total1 = new decimal(totalInt, 0, 0, false, 2);
+                else if (total < 0) total1 = new decimal(totalInt, 0, 0, true, 2);
+
+                return total1;
+            }
+        }
     }
 
     public class CorporateProfitItem