Bladeren bron

添加检索新申请递交中和前一天已完成的案件清单模块
添加宁德时代绩效金额分配比率实体类

luocaiyang 10 maanden geleden
bovenliggende
commit
a97c798868

+ 24 - 0
wispro.sp.api/spDbContext.cs

@@ -64,6 +64,8 @@ namespace wispro.sp.api
 
         public virtual DbSet<StaffStatisticsforLevel> StaffStatisticsforLevels { get; set; }
 
+        public virtual DbSet<AllocationRatio> AllocationRatios { get; set; }
+
         #region 流程定义
         public virtual DbSet<Workflow> Workflows { get; set; }
 
@@ -419,6 +421,28 @@ namespace wispro.sp.api
                 
             });
 
+            modelBuilder.Entity<AllocationRatio>(entity =>
+            {
+                entity.HasKey(e => new { e.ItemId, e.PersonId });
+
+                entity.ToTable("AllocationRatio");
+
+                entity.Property(e => e.Ratio);//.HasColumnType("numeric(18, 2)");
+
+                entity.HasOne(d => d.Person)
+                    .WithMany(p => p.AllocationRatios)
+                    .HasForeignKey(d => d.PersonId)
+                    .OnDelete(DeleteBehavior.ClientSetNull)
+                    .HasConstraintName("FK_AllocationRatio_Staff");
+
+                entity.HasOne(d => d.Item)
+                    .WithMany(p => p.AllocationRatios)
+                    .HasForeignKey(d => d.ItemId)
+                    .OnDelete(DeleteBehavior.ClientSetNull)
+                    .HasConstraintName("FK_FK_AllocationRatio_PerformanceItem");
+                
+            });
+
             modelBuilder.Entity<Message>(entity =>
             {
                 //entity.HasKey(e => e.Id);

+ 130 - 4
wispro.sp.utility/IPEasyUtility.cs

@@ -317,7 +317,10 @@ namespace wispro.sp.utility
                     driver.ExecuteJavaScript("arguments[0].click();", lifile);
 
 
-                    //添加从文件清单中获取“新申请第一次内审	(初稿)、	新申请第一次返稿(第一次发客户文档)、新申请文档(定稿文档)”
+                    //添加从文件清单中获取
+                    //“新申请第一次内审(初稿)、	
+                    //新申请第一次返稿(第一次发客户文档)、
+                    //新申请文档(定稿文档)”
                     var table_filelist = waitGetElementById(wait, "table_filelist");
                     //定稿文件
                     try
@@ -401,16 +404,139 @@ namespace wispro.sp.utility
 
                     driver.SwitchTo().Frame(1);
 
-                    //var inputSearch = waitGetElementById(wait, "case_volume");//driver.FindElement(By.Id("case_volume"));
-                    //inputSearch.SendKeys(caseNo.Trim());
                     #region 添加检索条件
+                    var chkDoItem = waitGetElementById(wait, "is_proc");
+                    chkDoItem.Click();
 
+                    var ictrlproc = waitGetElementById(wait, "i_ctrl_proc");
+                    ictrlproc.Click();
+
+
+                    var chkXSQ = waitGetElementById(wait, "ctrl_proc_id_3_check");
+                    chkXSQ.Click();
+                    
+
+                    var btnOk = waitGetElementById(wait, "ctrl_proc_ida_ok");
+                    btnOk.Click();
+
+                    waitGetElementById(wait,"proc_status").Click();
+
+                    if (type == 0)
+                    {
+                        waitGetElementById(wait, "procstatus_5_check").Click();
+
+                        waitGetElementById(wait, "procstatusa_ok").Click() ;
+                    }
+                    else
+                    {
+                        if(type == 1)
+                        {
+                            waitGetElementById(wait, "procstatus_12_check").Click();
+                            waitGetElementById(wait, "procstatusa_ok").Click();
+
+                            Log($"{DateTime.Now}\t输入处理事项完成日期:开始日期");
+                            var startDate = wait.Until((d) => {
+                                return d.FindElement(By.Id("finish_date_start"));
+                            });
+
+                            startDate.Click();
+
+                            startDate.SendKeys(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
+
+                            Log($"{DateTime.Now}\t输入处理事项完成日期:结束日期");
+
+                            var endDate = wait.Until((d) =>
+                            {
+                                try
+                                {
+                                    return d.FindElement(By.Id("finish_date_end"));
+                                }
+                                catch
+                                {
+                                    return null;
+                                }
+
+                            });
+
+                            endDate.Click();
+                            endDate.SendKeys(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
+                        }
+                    }
+
+                    waitGetElementById(wait,"procstatusa_ok").Click();
                     #endregion
 
+
+                    #region 导出检索结果
                     var btnSearch = waitGetElementById(wait, "btn_Search");// driver.FindElement(By.Id("btn_Search"));
                     driver.ExecuteJavaScript("arguments[0].click();", btnSearch);
 
-                    #region 导出检索结果
+
+                    Log($"{DateTime.Now}\t切换到弹出的导出报表窗口,点击导出按钮");
+                    var btnExport = waitGetElementById(wait, "btn_Export");
+                    driver.ExecuteJavaScript("arguments[0].click();", btnExport);
+
+                    Log($"{DateTime.Now}\t切换到弹出的导出报表窗口,点击导出按钮");
+                    driver.SwitchTo().DefaultContent();
+                    var ihg_export = driver.FindElement(By.Name("ihg_export"));
+                    driver.SwitchTo().Frame(ihg_export);
+                    waitGetElementById(wait, "btnSubmit").Click();
+
+                    //切换到弹出的下载报表界面,点击下载按钮
+                    Log($"{DateTime.Now}\t切换到弹出的下载报表界面,点击下载按钮");
+                    //System.Threading.Thread.Sleep(3000);
+                    driver.SwitchTo().DefaultContent();
+                    var frameDownload = waitGetElementByName(wait, "DownloadList");
+                    driver.SwitchTo().Frame(frameDownload);
+                    //driver.FindElement(By.CssSelector("table tbody tr:first-child"));
+                    var firstTr = wait.Until((d) => {
+                        return d.FindElement(By.CssSelector("table tbody tr"));
+                    });  
+                    var tdStatus = firstTr.FindElement(By.XPath(".//td")).FindElement(By.XPath("following-sibling::td[4]"));
+                    string strStatus = tdStatus.Text;
+                    while (strStatus.Trim() != "导出成功!")
+                    {
+                        if (strStatus.Trim() == "导出失败,请稍后重试!")
+                        {
+                            return null;
+                        }
+
+                        System.Threading.Thread.Sleep(5000);
+                        firstTr = wait.Until((d) => {
+                            return d.FindElement(By.CssSelector("table tbody tr"));
+                        });
+                        tdStatus = firstTr.FindElement(By.XPath(".//td")).FindElement(By.XPath("following-sibling::td[4]"));
+                        strStatus = tdStatus.Text;
+                    }
+
+                    Log($"{DateTime.Now}\t点击下载按钮下载文档");
+                    firstTr = wait.Until((d) => {
+                        return d.FindElement(By.CssSelector("table tbody tr"));
+                    });
+
+                    wait.Until((d)=>{
+                        return firstTr.FindElement(By.XPath(".//td/a[@title='下载']"));
+                    }).Click();
+                    
+                    var ReportName = $"案件清单({DateTime.Now.ToString("yyyy年MM月dd日")})";
+                    string strFilePath = System.IO.Path.Combine(strFileSavePath, $"{ReportName.Trim()}.xlsx");
+                    WaitForFileDownload(strFileSavePath, $"{ReportName.Trim()}.xlsx", TimeSpan.FromMinutes(5));
+
+                    //删除下载记录
+                    Log($"{DateTime.Now}\t删除下载记录");
+                    firstTr = wait.Until((d) => {
+                        return d.FindElement(By.CssSelector("table tbody tr"));
+                    });
+
+                    wait.Until((d) => {
+                        return firstTr.FindElement(By.XPath(".//td/a[@title='删除']"));
+                    }).Click();
+
+                    #endregion
+
+                    #region 将下载的excel档转换成Datatable
+                    retObject = NPOIExcel.ExcelToDataTable(strFilePath.Replace("~", "_"), true,true,1);
+                    System.IO.File.Delete(strFilePath.Replace("~", "_"));
                     #endregion
 
                 }

+ 3 - 0
wispro.sp.winClient/frmCaseFileCompare.cs

@@ -372,6 +372,9 @@ namespace wispro.sp.winClient
 
         private void button2_Click(object sender, EventArgs e)
         {
+            var retData = IPEasyUtility.GetFinished3FilesCases(1);
+            return;
+            
             OpenFileDialog openFileDialog = new OpenFileDialog();
 
             if(openFileDialog.ShowDialog() == DialogResult.OK)

+ 37 - 0
wospro.sp.entity/AllocationRatio.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity
+{
+    /// <summary>
+    /// 绩效分配比率,默认是案件处理人、对外处理人和核稿人参与分配案件绩效,
+    /// 默认利率为:50:50:0
+    /// </summary>
+    public class AllocationRatio
+    {
+        public int ItemId { get; set; }
+        public int PersonId { get; set; }
+
+        /// <summary>
+        /// 绩效分配比率
+        /// </summary>
+        public double? Ratio { get; set; }
+
+        /// <summary>
+        /// 绩效分配参与人
+        /// </summary>
+        [Description("绩效分配参与人")]
+        public virtual Staff Person { get; set; }
+
+        [JsonIgnore]
+        /// <summary>
+        /// 绩效案件
+        /// </summary>
+        public virtual PerformanceItem Item { get; set; }
+    }
+}

+ 3 - 0
wospro.sp.entity/Organization/Staff.cs

@@ -14,6 +14,7 @@ namespace wispro.sp.entity
         {
             Customers = new HashSet<Customer>();
             ItemStaffs = new HashSet<ItemStaff>();
+            AllocationRatios = new HashSet<AllocationRatio>(); 
         }
 
         
@@ -120,6 +121,8 @@ namespace wispro.sp.entity
         /// </summary>
         public virtual ICollection<ItemStaff> ItemStaffs { get; set; }
 
+        public virtual ICollection<AllocationRatio> AllocationRatios { get; set; }
+
 
         [JsonIgnore]
         /// <summary>

+ 3 - 0
wospro.sp.entity/PerformanceItem.cs

@@ -16,6 +16,7 @@ namespace wispro.sp.entity
         public PerformanceItem()
         {
             ItemStaffs = new HashSet<ItemStaff>();
+            AllocationRatios = new HashSet<AllocationRatio>();
         }
 
         /// <summary>
@@ -198,6 +199,8 @@ namespace wispro.sp.entity
 
         public virtual ICollection<ItemStaff> ItemStaffs { get; set; }
 
+        public virtual ICollection<AllocationRatio> AllocationRatios { get; set; }
+
         /// <summary>
         /// 核稿人
         /// </summary>