Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

wangh 1 year ago
parent
commit
719337c796

+ 3 - 1
OASystem/EntitySync/Program.cs

@@ -110,6 +110,8 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Pm_WageSheet)       //人事模块 工资表单
     //typeof(Grp_VisaProgressCustomer),
     //typeof(Grp_VisaProgressCustomerPicture)
-    typeof(Grp_VisaInfo)
+    //typeof(Grp_VisaInfo)
+    typeof(Grp_CarTouristGuideGroundReservations),
+    typeof(Grp_CarTouristGuideGroundReservationsContent)
 });
 Console.WriteLine("数据库结构同步完成!");

+ 1 - 5
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -127,13 +127,9 @@ namespace OASystem.API.Controllers
 
             var _sqlSugar = _wageSheetRep._sqlSugar;
             _sqlSugar.BeginTran();
-
-
+            
             try
             {
-
-
-
                 //月份表是否存在
                 Pm_WageIssueWorkingDay pm_WageIssueWorkingDay = new Pm_WageIssueWorkingDay()
                 {

+ 82 - 140
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -439,120 +439,6 @@ namespace OASystem.API.OAMethodLib
                             }
                         }
 
-                        //List<CheckInDataInfo> checkInDatas1 = new List<CheckInDataInfo>();
-                        //checkInDatas1 = checkInDatas.Where((x, i) => checkInDatas.FindLastIndex(z => z.checkin_time_dt.ToString("yyyy-MM-dd")
-                        //== x.checkin_time_dt.ToString("yyyy-MM-dd")) == i).ToList();
-
-                        //foreach (var checkInData in checkInDatas1)
-                        //{
-                        //    ex_reissuecard_Items.Add(new Ex_Item()
-                        //    {
-                        //        SubTypeId = 11,
-                        //        SubType = "外出打卡",
-                        //        StartTimeDt = Convert.ToDateTime(checkInData.checkin_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),
-                        //        Reason = checkInData.location_title + "(" + checkInData.location_detail + ")"
-                        //    });
-                        //}
-
-                        #region 外出打卡 计算旷工迟到
-                        ////外出打卡 计算旷工迟到
-                        //foreach (var checkInData in checkInDatas1)
-                        //{
-                        //    //当前时间是上午还是下午
-                        //    decimal timelength = 0.00M;
-                        //    string thisTime = string.Format(@"12:00:00");
-                        //    string wcdkTime = checkInData.checkin_time_dt.ToString("HH:mm:ss");
-                        //    DateTime wcdkDt = Convert.ToDateTime(wcdkTime);
-                        //    if (Convert.ToDateTime(thisTime) > wcdkDt) //上午
-                        //    {
-                        //        DateTime amDt = Convert.ToDateTime("09:00:00");
-                        //        timelength = (decimal)(wcdkDt - amDt).TotalMinutes;
-                        //        if (wcdkDt <=  amDt)
-                        //        {
-                        //            continue;
-                        //        }
-                        //    }
-                        //    else //下午
-                        //    {
-                        //        DateTime pmDt = Convert.ToDateTime("18:00:00");
-                        //        DateTime pmDt1 = Convert.ToDateTime("13:30:00");
-                        //        timelength = (decimal)(pmDt1 - wcdkDt).TotalMinutes;
-                        //        if (wcdkDt >= pmDt)
-                        //        {
-                        //            continue;
-                        //        }
-                        //    }
-                        //    if (timelength < 1)
-                        //    {
-                        //        continue;
-                        //    }
-                        //    timelength = ConvertToDecimal(timelength);
-                        //    decimal day_deduction = 0.00M;
-                        //    Ex_Item beLate_belate_ex = new Ex_Item()
-                        //    {
-                        //        SubTypeId = 4,
-                        //        SubType = "旷工",
-                        //        Duration = timelength,
-                        //        StartTimeDt = Convert.ToDateTime(checkInData.checkin_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),
-                        //        Unit = "分钟",
-                        //        Reason = "[外出打卡]"
-                        //    };
-                        //    if (timelength >= 1 && timelength < 10)
-                        //    {
-                        //        user_cd_zt_num++;
-                        //        beLate_belate_ex.SubTypeId = 1;
-                        //        beLate_belate_ex.SubType = "迟到";
-                        //        string thisStartDt = wcdkDt.ToString("yyyy-MM-dd HH:mm:ss");
-                        //        beLate_belate_ex.StartTimeDt = Convert.ToDateTime(thisStartDt);
-                        //        if (user_cd_zt_num >= 3)
-                        //        {
-                        //            day_deduction = 50.00M;
-                        //        }
-                        //        else
-                        //        {
-                        //            day_deduction = 0.00M;
-                        //        }
-                        //        beLate_belate_ex.Reason += "迟到/早退";
-                        //        beLate_deduction += day_deduction; //迟到扣款 总额
-                        //    }
-                        //    else if (timelength >= 10 && timelength <= 60)
-                        //    {
-                        //        beLate_belate_ex.SubType = "迟到";
-                        //        string thisStartDt = wcdkDt.ToString("yyyy-MM-dd HH:mm:ss");
-                        //        beLate_belate_ex.StartTimeDt = Convert.ToDateTime(thisStartDt);
-                        //        day_deduction = 50.00M;
-                        //        beLate_deduction += day_deduction; //迟到扣款 总额
-                        //        beLate_belate_ex.SubTypeId = 1;
-                        //        beLate_belate_ex.Reason += "迟到/早退";
-                        //    }
-                        //    else if (timelength > 60 && timelength <= 180)
-                        //    {
-                        //        day_deduction = ConvertToDecimal(((dailyWage / 7.50M) * 3.00M)); //3小时
-                        //        meal_deduction += 10.00M;  //餐补扣款
-                        //        absenteeism_deduction += day_deduction; //矿工半日
-                        //        beLate_belate_ex.Reason += " 迟到/早退(60分钟) 视为旷工上午(3小时)";
-                        //    }
-                        //    else if (timelength > 180 && timelength <= 270)
-                        //    {
-                        //        day_deduction = ConvertToDecimal(((dailyWage / 7.50M) * 4.50M)); //4小时
-                        //        meal_deduction += 10.00M;  //餐补扣款
-                        //        absenteeism_deduction += day_deduction; //矿工半日
-                        //        beLate_belate_ex.Reason += " 迟到/早退(60分钟) 视为旷工下午(4.5小时)";
-                        //    }
-                        //    else if(timelength > 270)
-                        //    {
-                        //        day_deduction = ConvertToDecimal(dailyWage);
-                        //        absenteeism_deduction += day_deduction; //矿工一日
-                        //        meal_deduction += 10.00M;
-                        //        beLate_belate_ex.Reason += " 迟到/早退 视为旷工一天(7.5小时)";
-                        //    }
-
-                        //    beLate_belate_ex.Deduction = day_deduction;
-                        //    ex_reissuecard_Items.Add(beLate_belate_ex);
-
-                        //}  
-                        #endregion
-
                         #endregion
 
                         #region 假勤/补卡次数 审批
@@ -629,8 +515,18 @@ namespace OASystem.API.OAMethodLib
                                             unit = "天";
                                             startTime = date_Range.new_begin_dt.ToString("yyyy-MM-dd") + " 09:00";
                                             endTime = date_Range.new_begin_dt.ToString("yyyy-MM-dd") + " 18:00";
-                                            startTime1 = "09:00:00";
-                                            endTime1 = "18:00:00";
+                                            if (new_duration == 1)
+                                            {
+                                                startTime1 = "09:00:00";
+                                                endTime1 = "18:00:00";
+                                            }
+                                            else
+                                            {
+                                                startTime1 = date_Range.new_begin_dt.ToString("HH:mm:ss");
+                                                endTime1 = date_Range.new_end_dt.ToString("HH:mm:ss");
+                                            }
+
+                                            
                                         }
                                         else if (date_Range.type == "hour")
                                         {
@@ -779,40 +675,86 @@ namespace OASystem.API.OAMethodLib
                                 }
                             }
 
-                            //打卡记录里抓取的未打卡数据
-                            foreach (var item in checkInData2)
+                            //外出审批 已通过的数据 且 外出未打卡
+                            List<Sp_Detail> sp_goout_details = new List<Sp_Detail>();
+                            sp_goout_details = await _qiYeWeChatApiService.GetApprovalDetailsAsync(startDt, endDt, acctid, 2, 4); //时间段内所有 已同意的 外出 审批数据
+                            if (sp_goout_details.Count > 0)
                             {
-                                decimal bukaPrice = 0.00M;
-
-                                if (user_probationary_bk_decimal == 0) //计算试用员工补卡次数
+                                //找出外出的具体日期
+                                List<string> goOutDts = new List<string>();
+                                foreach (var goOutItem in sp_goout_details)
                                 {
-                                    if (bukaNum <= 2) bukaPrice = 0.00M;
-                                    else if (bukaNum <= 4 && bukaNum > 2) bukaPrice = 10.00M;
-                                    else bukaPrice = 50.00M;
+                                    Apply_data? apply_data = goOutItem.apply_data;
+                                    if (apply_data != null)
+                                    {
+                                        List<ContentsItem> contents = apply_data.contents;
+                                        ContentsItem content_Vacation = contents.Where(it => it.control == "Attendance").FirstOrDefault();  //请假类型 
+                                        ContentsItem content_Textarea = contents.Where(it => it.control == "Textarea").FirstOrDefault();    //多行文本 
 
+                                        if (content_Vacation != null)
+                                        {
+                                            var attendance = content_Vacation.value.attendance;
+
+                                            DateTime goOutDt = attendance.date_range.new_begin_dt;
+                                            DateTime goOutDtJudge = Convert.ToDateTime(goOutDt.ToString("yyyy-MM-dd"));
+                                            //筛选 不在工作日内的假勤申请
+                                            if (startDt >= goOutDtJudge || goOutDtJudge > endDt)
+                                            {
+                                                continue;
+                                            }
+                                            goOutDts.Add(goOutDt.ToString("yyyy-MM-dd"));
+                                        }
+                                    }
                                 }
-                                else   //计算正式员工补卡次数
+
+                                //处理日期范围内的数据
+                                List<CheckInDataInfo> filtratePrefix_checkInData = new List<CheckInDataInfo>();
+                                if (goOutDts.Count > 0)
                                 {
-                                    if (bukaNum <= 2) bukaPrice = 10.00M;
-                                    else bukaPrice = 50.00M;
+                                    foreach (var goOutDtItem in goOutDts)
+                                    {
+                                        List<CheckInDataInfo> filtrate_checkInData = new List<CheckInDataInfo>();
+                                        filtrate_checkInData = checkInData2.Where(it => it.checkin_time_dt.ToString("yyyy-MM-dd").Equals(goOutDtItem)).ToList();
+                                        if (filtrate_checkInData.Count > 0)
+                                        {
+                                            filtratePrefix_checkInData.AddRange(filtrate_checkInData);
+                                        }
+                                    }
                                 }
 
 
-
-                                Ex_Item ex_reissueCard = new Ex_Item()
+                                //打卡记录里抓取的未打卡数据
+                                foreach (var item in filtratePrefix_checkInData)
                                 {
-                                    SubTypeId = 7,
-                                    SubType = "打卡补卡",
-                                    StartTimeDt = Convert.ToDateTime(item.checkin_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),  //未打卡时间
-                                    Deduction = bukaPrice,
-                                    Reason = "[打卡记录]抓取到的未打卡数据!",
-                                    Unit = string.Empty
-                                };
-                                unprinted_deduction += bukaPrice;
-                                ex_reissuecard_Items.Add(ex_reissueCard);
-                                bukaNum++;
-                            }
+                                    decimal bukaPrice = 0.00M;
+
+                                    if (user_probationary_bk_decimal == 0) //计算试用员工补卡次数
+                                    {
+                                        if (bukaNum <= 2) bukaPrice = 0.00M;
+                                        else if (bukaNum <= 4 && bukaNum > 2) bukaPrice = 10.00M;
+                                        else bukaPrice = 50.00M;
+
+                                    }
+                                    else   //计算正式员工补卡次数
+                                    {
+                                        if (bukaNum <= 2) bukaPrice = 10.00M;
+                                        else bukaPrice = 50.00M;
+                                    }
 
+                                    Ex_Item ex_reissueCard = new Ex_Item()
+                                    {
+                                        SubTypeId = 7,
+                                        SubType = "打卡补卡",
+                                        StartTimeDt = Convert.ToDateTime(item.checkin_time_dt.ToString("yyyy-MM-dd HH:mm:ss")),  //未打卡时间
+                                        Deduction = bukaPrice,
+                                        Reason = "[打卡记录]抓取到的未打卡数据!",
+                                        Unit = string.Empty
+                                    };
+                                    unprinted_deduction += bukaPrice;
+                                    ex_reissuecard_Items.Add(ex_reissueCard);
+                                    bukaNum++;
+                                }
+                            }
                         }
 
                         if (ex_reissuecard_Items.Count > 0)

+ 4 - 0
OASystem/OASystem.Domain/Dtos/Resource/LocalGuideDataDto.cs

@@ -139,6 +139,10 @@ namespace OASystem.Domain.Dtos.Resource
         /// 备注
         /// </summary>
         public string Remark { get; set; }
+        /// <summary>
+        /// 导游地接的类型:0公司1私人
+        /// </summary>
+        public int StaffType { get; set; }
     }
 
     /// <summary>

+ 102 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_CarTouristGuideGroundReservations.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 车/导游地接预订费用表
+    /// </summary>
+    [SugarTable("Grp_CarTouristGuideGroundReservations")]
+    public class Grp_CarTouristGuideGroundReservations : EntityBase
+    {
+        /// <summary>
+        /// 团组外键编号
+        /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="int")]
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 地接地区
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string Area { get; set; }
+
+        /// <summary>
+        /// 服务公司
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string ServiceCompany { get; set; }
+
+        /// <summary>
+        /// 服务导游
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string ServiceGuide { get; set; }
+
+        /// <summary>
+        /// 导游地接联系电话
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(30)")]
+        public string ServiceTel { get; set; }
+
+        /// <summary>
+        /// Bus名称
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(200)")]
+        public string BusName { get; set; }
+
+        /// <summary>
+        /// Bus描述
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string BusDescription { get; set; }
+
+        /// <summary>
+        /// 车公司联系电话
+        /// </summary>
+        /// 
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(30)")]
+        public string BusTel { get; set; }
+
+        /// <summary>
+        /// 服务时间起
+        /// </summary>
+        /// 
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(80)")]
+        public string ServiceStartTime { get; set; }
+        /// <summary>
+        /// 服务时间止
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(80)")]
+        public string ServiceEndTime { get; set; }
+        /// <summary>
+        /// 服务描述
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string ServiceDescription { get; set; }
+        /// <summary>
+        /// 服务报价
+        /// </summary>
+        /// 
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(18,2)")]
+        public decimal ServiceQuotedPrice { get; set; }
+        /// <summary>
+        /// 币种(设置数据外键编号)
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int CId { get; set; }
+        /// <summary>
+        /// 报价说明
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string QuotedPriceExplanation { get; set; }
+        /// <summary>
+        /// 公转私转标识
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int OrbitalPrivateTransfer{get;set; }
+    }
+}

+ 46 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_CarTouristGuideGroundReservationsContent.cs

@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Groups
+{
+    /// <summary>
+    /// 车/导游地接预订详细类
+    /// </summary>
+    public class Grp_CarTouristGuideGroundReservationsContent:EntityBase
+    {
+        /// <summary>
+        /// 团组外键编号
+        /// </summary>
+        [SugarColumn(IsNullable =true,ColumnDataType ="int")]
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 车/导游地接预订外键编号
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int CTGGRId { get; set; }
+        /// <summary>
+        /// 费用项目明细
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int SId { get; set; }
+        /// <summary>
+        /// 金额
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(18,2)")]
+        public decimal Price { get; set; }
+        /// <summary>
+        /// 费用明细
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        public string PriceContent { get; set; }
+        /// <summary>
+        /// 币种
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Currency { get; set; }
+    }
+}

+ 0 - 1
OASystem/OASystem.Domain/Entities/Resource/Res_CarGuides.cs

@@ -7,7 +7,6 @@ using System.Threading.Tasks;
 namespace OASystem.Domain.Entities.Resource
 {
     /// <summary>
-    /// 
     /// 团组成本 司兼导资料表
     /// </summary>
     [SugarTable("Res_CarGuides")]

+ 4 - 0
OASystem/OASystem.Domain/Entities/Resource/Res_LocalGuideData.cs

@@ -114,5 +114,9 @@ namespace OASystem.Domain.Entities.Resource
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(10)")]
         public string LocalAndChineseScore { get; set; }
+        /// <summary>
+        /// 导游地接的类型:0公司1私人
+        /// </summary>
+        public int StaffType { get; set; }
     }
 }

+ 1 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

@@ -66,6 +66,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                         FitScore = dto.FitScore,
                         StrainScore = dto.StrainScore,
                         LocalAndChineseScore = dto.LocalAndChineseScore,
+                        StaffType=dto.StaffType,
                         Remark = dto.Remark,
                     });
                     if (!res)