Browse Source

企业利润调整

LEIYI 3 months ago
parent
commit
79a3cdc3c3

File diff suppressed because it is too large
+ 3 - 3
OASystem/OASystem.Api/Controllers/StatisticsController.cs


+ 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