Bladeren bron

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

yuanrf 1 jaar geleden
bovenliggende
commit
187e536d7e

+ 125 - 3
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -248,6 +248,26 @@ namespace OASystem.API.Controllers
             return Ok(JsonView(groupData.Data));
         }
 
+        /// <summary>
+        ///  接团信息列表 Page
+        /// </summary>
+        /// <param name="dto">团组列表请求dto</param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostGroupPageList(GroupPageListDto dto)
+        {
+            if (dto == null) return Ok(JsonView(false, "请输入搜索搜索条件!"));
+
+            var groupData = await _groupRepository.PostGroupPageList(dto);
+            if (groupData.Code != 0)
+            {
+                return Ok(JsonView(false, groupData.Msg));
+            }
+
+            return Ok(JsonView(groupData.Data));
+        }
+
         /// <summary>
         ///  接团信息详情
         /// </summary>
@@ -2622,6 +2642,33 @@ namespace OASystem.API.Controllers
             }
         }
 
+        /// <summary>
+        /// 团组模块 - 出入境费用 - 明细表导出
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostEnterExitCostExportDetailsList(EnterExitCostOperateDto dto)
+        {
+            try
+            {
+                var data = await _enterExitCostRep.PostEnterExitCostOperate(dto);
+
+                if (data.Code != 0)
+                {
+                    return Ok(JsonView(false, data.Msg));
+                }
+
+                return Ok(JsonView(true, data.Msg, data.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
+
+
+
         /// <summary>
         /// 团组模块 - 出入境费用 - 子项删除
         /// </summary>
@@ -2972,7 +3019,7 @@ namespace OASystem.API.Controllers
                 List<Sys_SetData> CurrencyList = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 66 && a.IsDel == 0).ToList();
                 List<SetDataInfoView> _CurrencyList = _mapper.Map<List<SetDataInfoView>>(CurrencyList);
 
-                //支付方式
+                //乘客类型
                 List<Sys_SetData> PassengerType = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 69 && a.IsDel == 0).ToList();
                 List<SetDataInfoView> _PassengerType = _mapper.Map<List<SetDataInfoView>>(PassengerType);
 
@@ -3056,8 +3103,14 @@ namespace OASystem.API.Controllers
         {
             try
             {
-                Grp_CarTouristGuideGroundReservations groupData = await _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().FirstAsync(a=>a.Id==dto.Id && a.IsDel==0);
-                return Ok(JsonView(true, "查询成功!", groupData));
+                Grp_CarTouristGuideGroundReservations _groupData = await _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().FirstAsync(a=>a.Id==dto.Id && a.IsDel==0);
+                Grp_CreditCardPayment _creditCardPayment = await _sqlSugar.Queryable<Grp_CreditCardPayment>().FirstAsync(a => a.CId == dto.Id && a.CTable==79 && a.IsDel == 0);
+                var data = new
+                {
+                    CarTouristGuideGround = _groupData,
+                    CreditCardPayment = _creditCardPayment
+                };
+                return Ok(JsonView(true, "查询成功!", data));
             }
             catch (Exception ex)
             {
@@ -3125,6 +3178,75 @@ namespace OASystem.API.Controllers
                 return Ok(JsonView(false, ex.Message));
             }
         }
+        /// <summary>
+        /// 填写费用详细页面初始化绑定
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> CarTouristGuideGroundContenInitialize(CarTouristGuideGroundContenDto dto)
+        {
+            try
+            {
+                Result groupData = await _carTouristGuideGroundRep.CarTouristGuideGroundConten(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
+        /// <summary>
+        /// 根据op费用Id查询详细数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OpCarTouristGuideGroundContenById(CarTouristGuideGroundIdDto dto)
+        {
+            try
+            {
+                Result groupData = await _carTouristGuideGroundRep.OpCarTouristGuideGroundContenById(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
+        /// <summary>
+        /// OP费用录入填写详情
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> OpCarTouristGuideGroundConten(OpCarTouristGuideGroundContenDto dto)
+        {
+            try
+            {
+                Result groupData = await _carTouristGuideGroundRep.OpCarTouristGuideGroundConten(dto);
+                if (groupData.Code != 0)
+                {
+                    return Ok(JsonView(false, groupData.Msg));
+                }
+                return Ok(JsonView(true, groupData.Msg, groupData.Data));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
         #endregion
 
         #region 团组成本

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

@@ -62,6 +62,7 @@ namespace OASystem.API.Controllers
 
         /// <summary>
         /// 工资 工作日信息
+        /// 查询
         /// </summary>
         /// <returns></returns>
         [HttpPost]
@@ -90,6 +91,7 @@ namespace OASystem.API.Controllers
 
         /// <summary>
         /// 工资 工作日信息
+        /// 编辑
         /// </summary>
         /// <returns></returns>
         [HttpPost]
@@ -142,10 +144,11 @@ namespace OASystem.API.Controllers
                 string sql = string.Format("Select * From Pm_WageIssueWorkingDay Where Isdel = 0 And YearMonth='{0}'", dto.YearMonth);
                 var workdsys = await _sqlSugar.SqlQueryable<Pm_WageIssueWorkingDay>(sql).FirstAsync();
 
+                pm_WageIssueWorkingDay.CreateUserId = dto.UserId;
+                pm_WageIssueWorkingDay.IsDel = 0;
+
                 if (workdsys == null) //添加
                 {
-                    pm_WageIssueWorkingDay.CreateUserId = dto.UserId;
-                    pm_WageIssueWorkingDay.IsDel = 0;
 
                     int addId = await _sqlSugar.Insertable(pm_WageIssueWorkingDay).ExecuteReturnIdentityAsync();
                 }
@@ -153,14 +156,14 @@ namespace OASystem.API.Controllers
                 {
                     int updCount = await _sqlSugar.Updateable(pm_WageIssueWorkingDay)
                         .IgnoreColumns(z => new { z.CreateUserId, z.CreateTime, z.DeleteUserId, z.DeleteTime, z.IsDel })
-                        .WhereColumns(it => it.Id)
+                        .WhereColumns(it => it.YearMonth)
                         .ExecuteCommandAsync();
                 }
 
                 List<Sys_Calendar> sys_Calendars_add = new List<Sys_Calendar>();
                 List<Sys_Calendar> sys_Calendars_update = new List<Sys_Calendar>();
-                sys_Calendars_add = sys_Calendars.Where(it => it.Id == 0).ToList();
-                sys_Calendars_update = sys_Calendars.Where(it => it.Id != 0).ToList();
+                sys_Calendars_add = sys_Calendars.Where(it => it.Id == 0).OrderBy(it => it.Dt).ToList();
+                sys_Calendars_update = sys_Calendars.Where(it => it.Id != 0).OrderBy(it => it.Dt).ToList();
 
                 int add1 = 0;
                 int upd = 0;

+ 41 - 7
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -151,7 +151,7 @@ namespace OASystem.API.Controllers
                 {
                     return Ok(JsonView(false, "请传类型Id!"));
                 }
-                var setData = _setDataRepository.QueryDto<Sys_SetData, SetDataView>(s => s.STid == dto.DataType).ToList();
+                var setData = _setDataRepository.QueryDto<Sys_SetData, SetDataView>(s => s.STid == dto.DataType && s.IsDel==0).ToList();
                 if (setData.Count == 0)
                 {
                     return Ok(JsonView(false, "暂无数据!"));
@@ -914,7 +914,7 @@ namespace OASystem.API.Controllers
         {
             try
             {
-                string sqlWhere = string.Empty;
+                string sqlWhere = string.Format(" Where su.IsDel = 0 ");
                 if (dto.CompanyId!=0)
                 {
                     sqlWhere += string.Format(@" And su.CompanyId={0}", dto.CompanyId);
@@ -927,11 +927,7 @@ namespace OASystem.API.Controllers
                 {
                     sqlWhere += string.Format(@" And su.JobPostId={0}", dto.JobPostId);
                 }
-                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
-                {
-                    Regex r = new Regex("And");
-                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
-                }
+               
                 List<UserInfo> _userList =await _userRep.QueryUser(sqlWhere);
                 if (_userList.Count == 0)
                 {
@@ -1043,6 +1039,44 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
+
+        /// <summary>
+        /// 删除用户信息
+        /// 即为离职
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostUserDelById(UserDelDto dto)
+        {
+            try
+            {
+                if (dto == null)
+                {
+                    return Ok(JsonView(false, "参数不能为空!"));
+                }
+
+                bool res = await _userRep.UpdateAsync<Sys_Users>(a => a.Id == dto.Id, a => new Sys_Users
+                {
+                    IsDel = 1,
+                    DeleteUserId = dto.OperateUserId,
+                    DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+                    Rdate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
+                });
+                if (!res)
+                {
+                    return Ok(JsonView(false, "操作失败!"));
+                }
+                return Ok(JsonView(true, "操作成功!"));
+
+            }
+            catch (Exception)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+            }
+        }
+
         #endregion
 
         #region 权限模块

+ 69 - 15
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -28,7 +28,7 @@ namespace OASystem.API.OAMethodLib
         private static readonly IQiYeWeChatApiService _qiYeWeChatApiService = AutofacIocManager.Instance.GetService<IQiYeWeChatApiService>(); 
         private static readonly UsersRepository _usersRep = AutofacIocManager.Instance.GetService<UsersRepository>();
         private static readonly IMapper _mapper = AutofacIocManager.Instance.GetService<IMapper>();
-        private static readonly decimal _chengDuMinimumWage = 2100.00M;
+        private static readonly decimal _chengDuMinimumWage = 2100.00M * 0.80M; //员工在病假医疗期限内的病假工资按照成都市最低工资标准的 80%发放 
 
         /// <summary>
         /// 计算工资
@@ -295,12 +295,14 @@ namespace OASystem.API.OAMethodLib
                                         day_deduction = ConvertToDecimal(day_miner_unit * 6); //3小时
                                         meal_deduction += 10.00M;  //餐补扣款
                                         absenteeism_deduction += day_deduction; //矿工半日
+                                        beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为下午旷工(3小时)";
                                     }
                                     else
                                     {
                                         day_deduction = ConvertToDecimal(dailyWage);
                                         absenteeism_deduction += day_deduction; //矿工一日
                                         meal_deduction += 10.00M;
+                                        beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
                                     }
 
                                     beLate_belate_ex.Deduction = day_deduction;
@@ -359,12 +361,62 @@ namespace OASystem.API.OAMethodLib
                                 {
                                     if (root.exception_infos.Count == 2)
                                     {
-                                        day_deduction = dailyWage;
-                                        meal_deduction += 10.00M;
-                                        absenteeism_deduction += day_deduction;
-                                        beLate_belate_ex.Reason = "上午-下午 缺卡/未打卡为旷工 一天";
-                                        beLate_belate_ex.Deduction = day_deduction;
-                                        ex_reissuecard_Items.Add(beLate_belate_ex);
+                                        if (ex_reissuecard_Items.Where(it => it.StartTimeDt.ToString("yyyy-MM-dd").Equals(thisDtStr)).Count() > 0)
+                                        {
+                                            if (earliest_time == lastest_time)
+                                            {
+                                                DateTime thisDt1 = Convert.ToDateTime(thisDtStr + " 12:00");
+
+
+                                                if (thisDt >= thisDt1)  //旷工 下午
+                                                {
+                                                    day_deduction = ConvertToDecimal(day_miner_unit * 9); //4.5小时
+                                                    meal_deduction += 10.00M;
+
+                                                    beLate_belate_ex.Duration = 270;
+                                                    absenteeism_deduction += day_deduction; //矿工半日
+                                                    beLate_belate_ex.Reason = thisDtStr + " 下午(18:00)缺卡/未打卡视为下午旷工(4.5小时)";
+
+                                                    beLate_belate_ex.Deduction = day_deduction;
+                                                    ex_reissuecard_Items.Add(beLate_belate_ex);
+                                                }
+                                                else if (thisDt <= thisDt1) //旷工 上午
+                                                {
+                                                    day_deduction = ConvertToDecimal(day_miner_unit * 6); //3小时
+                                                    meal_deduction += 10.00M;
+                                                    absenteeism_deduction += day_deduction; //矿工半日
+                                                    beLate_belate_ex.Duration = 180;
+                                                    beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为上午旷工(3小时)";
+
+                                                    beLate_belate_ex.Deduction = day_deduction;
+                                                    ex_reissuecard_Items.Add(beLate_belate_ex);
+                                                }
+                                                else //矿工一日
+                                                {
+
+                                                    day_deduction = ConvertToDecimal(dailyWage);
+                                                    meal_deduction += 10.00M;
+                                                    absenteeism_deduction += day_deduction;
+                                                    beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
+
+                                                    beLate_belate_ex.Deduction = day_deduction;
+                                                    ex_reissuecard_Items.Add(beLate_belate_ex);
+                                                }
+
+
+                                            }
+                                        }
+                                        else
+                                        {
+                                            day_deduction = dailyWage;
+                                            meal_deduction += 10.00M;
+                                            absenteeism_deduction += day_deduction;
+                                            beLate_belate_ex.Reason = "上午-下午 缺卡/未打卡为旷工 一天";
+                                            beLate_belate_ex.Deduction = day_deduction;
+                                            ex_reissuecard_Items.Add(beLate_belate_ex);
+                                        }
+
+                                        
 
                                     }
                                     else if (root.exception_infos.Count == 1)
@@ -570,7 +622,7 @@ namespace OASystem.API.OAMethodLib
                                     #region 累计类型扣款
                                     //1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他;9丧假
 
-                                    if (leaveType == 2) //
+                                    if (leaveType == 2) //调休
                                     {
                                         personalLeaveTotal += thisTypeDeduction;
                                     }
@@ -971,6 +1023,7 @@ namespace OASystem.API.OAMethodLib
 
                 }
 
+                
             }
             catch (Exception ex)
             {
@@ -1081,7 +1134,7 @@ namespace OASystem.API.OAMethodLib
                     {
 
                         decimal leave_halfHour = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
-                        typeDeduction = ConvertToDecimal( personalkLeave_dailywage_halfhour * leave_halfHour);
+                        typeDeduction = ConvertToDecimal(personalkLeave_dailywage_halfhour * leave_halfHour);
                         //duration = 11M;
                         if (duration >= 3 && duration < 7.5M) //单天请假三小时
                         {
@@ -1124,17 +1177,18 @@ namespace OASystem.API.OAMethodLib
                     // 病假日薪 *计算方式:日平均工资 = 成都市最低工资标准的80% /当月应出勤天数。 短期病假=当月15天内 
 
                     decimal chengDuMinimumWage_halrHour = _chengDuMinimumWage / work_days / halfHour;
-                    decimal sickLeave_dailywage_halfhour_deduction = personalkLeave_dailywage_day - chengDuMinimumWage_halrHour; //病假单位 0.5小时 扣款金额
+                    decimal sickLeave_dailywage_halfhour_deduction1 = (personalkLeave_dailywage_day / halfHour) - chengDuMinimumWage_halrHour; //病假单位 0.5小时 扣款金额
 
                     if (date_Range_type == "halfday")
                     {
                         mealDeduction = 10; //餐补扣款 
-                        typeDeduction = ConvertToDecimal( sickLeave_dailywage_halfhour_deduction * halfHour);
+                        typeDeduction = ConvertToDecimal( sickLeave_dailywage_halfhour_deduction1 * halfHour);
                     }
                     else if (date_Range_type == "hour")
                     {
                         decimal sickLeave_halfHour = duration / 0.5M;
-                        typeDeduction = ConvertToDecimal(personalkLeave_dailywage_day); ;
+                        typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction1 * sickLeave_halfHour); 
+
                         if (duration >= 3 && duration < 7.5M) //单天请假三小时 && 请假时间在上午 则没有餐补
                         {
                             mealDeduction = 10; //餐补扣款
@@ -1145,7 +1199,7 @@ namespace OASystem.API.OAMethodLib
 
                             decimal leaveDays = Convert.ToDecimal(duration / 7.5M);
 
-                            typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction * sickLeave_halfHour1);
+                            typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction1 * sickLeave_halfHour1);
                             if (leaveDays % 1 == 0)
                             {
                                 mealDeduction = 10 * leaveDays; //餐补扣款
@@ -1154,12 +1208,12 @@ namespace OASystem.API.OAMethodLib
                             {
                                 mealDeduction = 10 * Convert.ToInt32(leaveDays);
 
-                                typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction * Convert.ToInt32(leaveDays));
+                                typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction1 * Convert.ToInt32(leaveDays));
 
                                 decimal sy_bingjiaunit = sickLeave_halfHour1 - Convert.ToDecimal(15.00M * Convert.ToInt32(leaveDays));
                                 if (sy_bingjiaunit > 0)
                                 {
-                                    typeDeduction += ConvertToDecimal(sickLeave_dailywage_halfhour_deduction * sy_bingjiaunit);
+                                    typeDeduction += ConvertToDecimal(sickLeave_dailywage_halfhour_deduction1 * sy_bingjiaunit);
                                 }
 
                                 //得到最后一天的请假时间 是否有餐补

+ 70 - 4
OASystem/OASystem.Domain/Dtos/Groups/CarTouristGuideGroundDto.cs

@@ -83,10 +83,7 @@ namespace OASystem.Domain.Dtos.Groups
         /// 服务描述
         /// </summary>
         public string ServiceDescription { get; set; }
-        /// <summary>
-        /// 报价说明
-        /// </summary>
-        public string QuotedPriceExplanation { get; set; }
+       
         /// <summary>
         /// 公转私转标识
         /// </summary>
@@ -100,4 +97,73 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public string Remark { get; set; }
     }
+
+    public class CarTouristGuideGroundContenDto
+    {
+        public int UserId { get; set; }
+    }
+
+    public class OpCarTouristGuideGroundContenDto
+    {
+        /// <summary>
+        /// 团组Id
+        /// </summary>
+        public int DiId { get; set; }
+        /// <summary>
+        /// Op费用Id
+        /// </summary>
+        public int CTGGRId { get; set; }
+        /// <summary>
+        /// 费用表示
+        /// </summary>
+        public int OrbitalPrivateTransfer { get; set; }
+        /// <summary>
+        /// 付款百分百
+        /// </summary>
+        public decimal PayPercentage { get; set; }
+        /// <summary>
+        /// 收款方
+        /// </summary>
+        public string Payee { get; set; }
+        /// <summary>
+        /// 支付方式
+        /// </summary>
+        public int PayDId { get; set; }
+        /// <summary>
+        /// 币种Id
+        /// </summary>
+        public int Currency { get; set; }
+        /// <summary>
+        /// 详情数据
+        /// </summary>
+        public List<OPContenList> OPContenList { get; set; }
+        /// <summary>
+        /// 创建人Id
+        /// </summary>
+        public int CreateUserId { get; set; }
+    }
+    public class OPContenList
+    {
+        
+        /// <summary>
+        /// 费用详细Id
+        /// </summary>
+        public int Id { get; set; }
+        /// <summary>
+        /// 类型名称Id
+        /// </summary>
+        public int SId { get; set; }
+        /// <summary>
+        /// 费用金额
+        /// </summary>
+        public decimal Price { get; set; }
+        /// <summary>
+        /// 费用描述
+        /// </summary>
+        public string priceContent { get; set; }
+        /// <summary>
+        /// 备注
+        /// </summary>
+        public string Remark { get; set; }
+    }
 }

+ 15 - 0
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDto.cs

@@ -218,6 +218,21 @@ namespace OASystem.Domain.Dtos.Groups
 
     }
 
+    /// <summary>
+    /// 出入境费用 - 明细表导出 Dto
+    /// </summary>
+    public class EnterExitCostExportDetailsListDto :PortDtoBase
+    {
+        /// <summary>
+        /// 模板类型
+        /// 1 默认明细表
+        /// 2 因公出国(境)经费测算明细表
+        /// 3 四川省商务厅出国经费财政先行审核表
+        /// </summary>
+        public int ExportType { get; set; }
+    }
+
+
     /// <summary>
     /// 团组模块 - 出入境国家费用标准 Page List
     /// </summary>

+ 15 - 1
OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs

@@ -18,8 +18,13 @@ namespace OASystem.Domain.Dtos.Groups
     /// <summary>
     /// 获取团组列表 Page 请求实体类
     /// </summary>
-    public class GroupListPageDto : DtoBase
+    public class GroupPageListDto : DtoBase
     {
+        /// <summary>
+        /// 搜索条件
+        /// 团组类型/团队名称/客户名称/客户单位/接团操作人
+        /// </summary>
+        public string? SearchCriteria { get; set; }
     }
 
     /// <summary>
@@ -190,6 +195,15 @@ namespace OASystem.Domain.Dtos.Groups
         /// 备注
         /// </summary>
         public string Remark { get; set; }
+
+        /// <summary>
+        /// OP提成等级
+        /// </summary>
+        public int OpRoyaltyLv { get; set; }
+        /// <summary>
+        /// 等级说明
+        /// </summary>
+        public string opRoyaltyRemark { get; set; }
     }
 
     /// <summary>

+ 17 - 0
OASystem/OASystem.Domain/Dtos/System/UserDto.cs

@@ -200,4 +200,21 @@ namespace OASystem.Domain.Dtos.System
         public string Certificate { get; set; }
 
     }
+
+    /// <summary>
+    /// 删除用户信息
+    /// 即为离职
+    /// </summary>
+    public class UserDelDto : PortDtoBase
+    {
+        /// <summary>
+        /// 数据Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 操作人Id
+        /// </summary>
+        public int OperateUserId { get; set; }
+    }
 }

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

@@ -80,7 +80,6 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// 服务报价
         /// </summary>
-        /// 
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(18,2)")]
         public decimal ServiceQuotedPrice { get; set; }
         /// <summary>

+ 12 - 0
OASystem/OASystem.Domain/Entities/Groups/Grp_DelegationInfo.cs

@@ -214,5 +214,17 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
         public string ZZSCSPWH { get; set; }
+        #region 新增团组op提成等级
+        /// <summary>
+        /// Op提成等级
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int OpRoyaltyLv { get; set; }
+        /// <summary>
+        /// 等级说明
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(100)")]
+        public string OpRoyaltyRemark { get; set; }
+        #endregion
     }
 }

+ 10 - 0
OASystem/OASystem.Domain/ViewModels/Groups/DelegationInfoView.cs

@@ -189,6 +189,16 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 手机号
         /// </summary>
         public string? TellPhone { get; set; }
+        /// <summary>
+        /// op提成等级
+        /// </summary>
+        public int OpRoyaltyLv { get; set; }
+        /// <summary>
+        /// 提成等级说明
+        /// </summary>
+        public string?  OpRoyaltyRemark { get; set; }
+
+
     }
 
     /// <summary>

+ 2 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_CarTouristGuideGroundView.cs

@@ -21,6 +21,8 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 此次付款金额
         /// </summary>
         public decimal PayThenMoney { get; set; }
+
+        public decimal PayMoney { get; set; }
         /// <summary>
         /// 剩余尾款
         /// </summary>

+ 316 - 83
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -1,8 +1,10 @@
 using AutoMapper;
+using NPOI.OpenXmlFormats.Shared;
 using OASystem.Domain;
 using OASystem.Domain.Dtos.Groups;
 using OASystem.Domain.Entities.Financial;
 using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.Entities.Resource;
 using OASystem.Domain.ViewModels.Groups;
 using OASystem.Infrastructure.Tools;
 using System;
@@ -29,87 +31,86 @@ namespace OASystem.Infrastructure.Repositories.Groups
             BeginTran();
             try
             {
-                //int id = 0;
-                //Grp_CarTouristGuideGroundReservations grp_CarTouristGuide = _mapper.Map<Grp_CarTouristGuideGroundReservations>(dto);
-                //if (dto.Status == 1)//添加
-                //{
-                //    Grp_CarTouristGuideGroundReservations grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(a => a.IsDel == 0 && a.Area == dto.Area && a.BusName == dto.BusName && a.ServiceGuide == dto.ServiceGuide);
-                //    if (grp_CarTouristGuideGround != null)
-                //    {
-                //        return result = new Result() { Code = -1, Msg = "该笔费用已存在,请勿重复添加!" };
-                //    }
-                //    else
-                //    {
-                //        id = await AddAsyncReturnId(grp_CarTouristGuide);
-                //        if (id != 0)
-                //        {
-                //            //int cId = await _sqlSugar.Insertable(c).ExecuteReturnIdentityAsync();
-                //            if (true)
-                //            {
-                //                result = new Result() { Code = 0, Msg = "添加成功!" };
-
-                //            }
-                //            else
-                //            {
-                //                RollbackTran();
-                //                result = new Result() { Code = -1, Msg = "添加失败!" };
-                //            }
-                //        }
-                //        else
-                //        {
-                //            RollbackTran();
-                //            result = new Result() { Code = -1, Msg = "添加失败,请稍后重试!" };
-                //        }
-                //    }
-
-                //}
-                //else if (dto.Status == 2)//修改
-                //{
-
-                //    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_VisaInfo
-                //    {
-                //        VisaClient = grp_Visa1.VisaClient,
-                //        VisaPrice = grp_Visa1.VisaPrice,
-                //        VisaCurrency = grp_Visa1.VisaCurrency,
-                //        IsThird = grp_Visa1.IsThird,
-                //        PassengerType = grp_Visa1.PassengerType,
-                //        VisaNumber = grp_Visa1.VisaNumber,
-                //        VisaFreeNumber = grp_Visa1.VisaFreeNumber,
-                //        Remark = dto.Remark,
-                //    });
-                //    if (res)
-                //    {
-                //        int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == grp_Visa1.Id && a.CTable == 80).SetColumns(a => new Grp_CreditCardPayment
-                //        {
-                //            PayDId = dto.PayDId,
-                //            PayMoney = c.PayMoney,
-                //            PaymentCurrency = c.PaymentCurrency,
-                //            Payee = c.Payee,
-                //            OrbitalPrivateTransfer = c.OrbitalPrivateTransfer,
-                //            DayRate = c.DayRate,
-                //            RMBPrice = c.RMBPrice,
-                //            ConsumptionPatterns = c.ConsumptionPatterns,
-                //            ConsumptionDate = c.ConsumptionDate,
-                //            CTDId = c.CTDId,
-                //            CompanyBankNo = c.CompanyBankNo,
-                //            OtherBankName = c.OtherBankName,
-                //            OtherSideNo = c.OtherSideNo,
-                //            OtherSideName = c.OtherSideName,
-                //            BankNo = c.BankNo,
-                //            CardholderName = c.CardholderName,
-                //            Remark = c.Remark,
-
-                //        }).ExecuteCommandAsync();
-
-                //        result = new Result() { Code = 0, Msg = "修改成功!" };
-                //    }
-                //    else
-                //    {
-                //        RollbackTran();
-                //        result = new Result() { Code = -1, Msg = "修改失败,请稍后重试!" };
-                //    }
-                //}
-                //CommitTran();
+                int id = 0;
+                Grp_CarTouristGuideGroundReservations grp_CarTouristGuide = _mapper.Map<Grp_CarTouristGuideGroundReservations>(dto);
+                if (dto.Status == 1)//添加
+                {
+                    Grp_CarTouristGuideGroundReservations grp_CarTouristGuideGround = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(a => a.IsDel == 0 && a.Area == dto.Area && a.BusName == dto.BusName && a.ServiceGuide == dto.ServiceGuide && a.DiId==dto.DiId && a.BusTel==dto.BusTel && a.ServiceTel==dto.ServiceTel);
+                    if (grp_CarTouristGuideGround != null)
+                    {
+                        return result = new Result() { Code = -1, Msg = "该笔费用已存在,请勿重复添加!" };
+                    }
+                    else
+                    {
+                        id = await AddAsyncReturnId(grp_CarTouristGuide);
+                        if (id == 0)
+                        {
+                            RollbackTran();
+                            result = new Result() { Code = -1, Msg = "添加失败,请稍后重试!" };
+                        }
+                        else
+                        {
+                            result = new Result() { Code = 0, Msg = "添加成功!" };
+                        }
+
+                    }
+
+                }
+                else if (dto.Status == 2)//修改
+                {
+
+                    bool res = await UpdateAsync(a => a.Id == dto.Id, a => new Grp_CarTouristGuideGroundReservations
+                    {
+                        Area = grp_CarTouristGuide.Area,
+                        ServiceCompany = grp_CarTouristGuide.ServiceCompany,
+                        ServiceGuide = grp_CarTouristGuide.ServiceGuide,
+                        ServiceTel = grp_CarTouristGuide.ServiceTel,
+                        BusName = grp_CarTouristGuide.BusName,
+                        BusDescription = grp_CarTouristGuide.BusDescription,
+                        BusTel = grp_CarTouristGuide.BusTel,
+                        ServiceStartTime = grp_CarTouristGuide.ServiceStartTime,
+                        ServiceEndTime = grp_CarTouristGuide.ServiceEndTime,
+                        ServiceDescription = grp_CarTouristGuide.ServiceDescription,
+                        QuotedPriceExplanation = grp_CarTouristGuide.QuotedPriceExplanation,
+                        OrbitalPrivateTransfer = grp_CarTouristGuide.OrbitalPrivateTransfer,
+                        Remark = grp_CarTouristGuide.Remark,
+                    });
+                    if (res)
+                    {
+                        id = dto.Id;
+                        result = new Result() { Code = 0, Msg = "修改成功!" };
+                    }
+                    else
+                    {
+                        RollbackTran();
+                        result = new Result() { Code = -1, Msg = "修改失败,请稍后重试!" };
+                    }
+                }
+                if (id!=0)
+                {
+                    Res_LocalGuideData _LocalGuideDataCar = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.BusName && a.ContactTel == dto.BusTel && a.IsDel == 0);
+                    if (_LocalGuideDataCar == null)
+                    {
+                        Res_LocalGuideData res_LocalGuideCar = new Res_LocalGuideData();
+                        res_LocalGuideCar.UnitName = dto.BusName;
+                        res_LocalGuideCar.ContactTel = dto.BusTel;
+                        res_LocalGuideCar.CreateUserId = dto.CreateUserId;
+                        int cId = await _sqlSugar.Insertable(res_LocalGuideCar).ExecuteReturnIdentityAsync();
+                    }
+                    Res_LocalGuideData _LocalGuideDataService = _sqlSugar.Queryable<Res_LocalGuideData>().First(a => a.UnitName == dto.ServiceCompany && a.ContactTel == dto.ServiceTel && a.IsDel == 0);
+                    if (_LocalGuideDataService == null)
+                    {
+                        Res_LocalGuideData res_LocalGuideService = new Res_LocalGuideData();
+                        res_LocalGuideService.UnitName = dto.ServiceCompany;
+
+                        res_LocalGuideService.ContactTel = dto.ServiceTel;
+                        res_LocalGuideService.Contact = dto.ServiceTel;
+                        res_LocalGuideService.CreateUserId = dto.CreateUserId;
+                        int cId = await _sqlSugar.Insertable(res_LocalGuideService).ExecuteReturnIdentityAsync();
+                    }
+                }
+                
+                CommitTran();
             }
             catch (Exception ex)
             {
@@ -118,6 +119,85 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return result;
         }
 
+        public async Task<Result> CarTouristGuideGroundConten(CarTouristGuideGroundContenDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == 79).ToList();
+
+                string DiId = "0";
+                foreach (var item in grp_GroupsTaskAssignment)
+                {
+                    DiId += item.DIId + ",";
+                }
+                if (DiId != "0")
+                {
+                    DiId = DiId.Substring(0, DiId.Length - 1);
+                }
+                string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1}", DiId, 0);
+
+                //团组下拉框
+                List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
+                //支付方式
+                List<Sys_SetData> Payment = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 14 && a.IsDel == 0).ToList();
+                List<SetDataInfoView> _Payment = _mapper.Map<List<SetDataInfoView>>(Payment);
+
+                //币种
+                List<Sys_SetData> CurrencyList = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 66 && a.IsDel == 0).ToList();
+                List<SetDataInfoView> _CurrencyList = _mapper.Map<List<SetDataInfoView>>(CurrencyList);
+
+                //列表初始化
+                List<Sys_SetData> TableInitialization = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.STid == 17 && a.IsDel == 0).ToList();
+                List<SetDataInfoView> _TableInitialization = _mapper.Map<List<SetDataInfoView>>(TableInitialization);
+                _TableInitialization= _TableInitialization.OrderBy(a=>a.Name).ToList();
+
+                var data = new
+                {
+                    Payment = _Payment,
+                    CurrencyList = _CurrencyList,
+                    Delegations = grp_Delegations,
+                    TableInitialization = _TableInitialization
+                };
+                return result = new Result() { Code = 0, Msg = "查询成功",Data=data };
+
+            }
+            catch (Exception)
+            {
+                return result = new Result() { Code = -2, Msg = "未知错误" };
+                throw;
+            }
+        }
+
+        public async Task<Result> OpCarTouristGuideGroundContenById(CarTouristGuideGroundIdDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+               
+                List<Grp_CarTouristGuideGroundReservationsContent> grp_CarTouristsConten = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a=>a.IsDel==0 && a.CTGGRId==dto.Id).ToList();
+                Grp_CreditCardPayment _CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == dto.Id && a.IsDel == 0 && a.CTable == 79);
+                Grp_CarTouristGuideGroundReservations grp_CarTouristGuideGround= _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>().First(a => a.Id == dto.Id && a.IsDel == 0);
+                var data = new
+                {
+                    CarTouristsConten = grp_CarTouristsConten,
+                    CarTourists = grp_CarTouristGuideGround,
+                    CreditCardPayment = _CreditCardPayment,
+                };
+                return result = new Result() { Code = 0, Msg = "查询成功", Data = data };
+
+            }
+            catch (Exception)
+            {
+                return result = new Result() { Code = -2, Msg = "未知错误" };
+                throw;
+            }
+        }
+        /// <summary>
+        /// 根据diid查询op费用列表
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
         public async Task<Result> QueryCarTouristGuideGroundByDiId(CarTouristGuideGroundDto dto)
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
@@ -160,11 +240,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     string sql = string.Format(@"select t.*,s.Name as CurrencyStr,c.IsAuditGM,c.PayPercentage,c.PayMoney from 
                                                 Grp_CarTouristGuideGroundReservations t
                                                 left Join Grp_CreditCardPayment c on CTable=79 and c.CId=t.Id
-                                                left Join Sys_SetData s on s.Id=t.CId {0}
+                                                left Join Sys_SetData s on s.Id=c.PaymentCurrency {0}
                                                 order by CreateTime desc", sqlWhere);
                     List<Grp_CarTouristGuideGroundView> infoViews = _sqlSugar.SqlQueryable<Grp_CarTouristGuideGroundView>(sql).ToList();
                     foreach (var item in infoViews)
                     {
+                        item.ServiceQuotedPrice = item.PayMoney;
                         item.PayThenMoney = Math.Round(item.PayPercentage/100 * item.ServiceQuotedPrice, 2);
                         item.RemainingBalance = Math.Round(item.ServiceQuotedPrice- item.PayPercentage / 100 * item.ServiceQuotedPrice);
                     }
@@ -177,7 +258,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                             from 
                                             Grp_CarTouristGuideGroundReservations t
                                             left Join Grp_CreditCardPayment c on CTable=79 and c.CId=t.Id
-                                            left Join Sys_SetData s on s.Id=t.CId {0}
+                                            left Join Sys_SetData s on s.Id=c.PaymentCurrency {0}
                                             ) temp Where RowNumber Between {1} and {2}", sqlWhere, startIndex, endIndex);
 
                     List<Grp_CarTouristGuideGroundView> grp_CarTourists = _sqlSugar.SqlQueryable<Grp_CarTouristGuideGroundView>(sql).ToList();
@@ -217,5 +298,157 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
             return result;
         }
+        /// <summary>
+        /// OP费用录入填写详情
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async  Task<Result> OpCarTouristGuideGroundConten(OpCarTouristGuideGroundContenDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+            try
+            {
+                BeginTran();
+                List<Grp_CarTouristGuideGroundReservationsContent> carTouristList = new List<Grp_CarTouristGuideGroundReservationsContent>();
+                foreach (var item in dto.OPContenList)
+                {
+                    Grp_CarTouristGuideGroundReservationsContent s = new Grp_CarTouristGuideGroundReservationsContent();
+                    s.Id= item.Id;
+                    s.DiId = dto.DiId;
+                    s.CTGGRId = dto.CTGGRId;
+                    s.SId = item.SId;
+                    s.Price=item.Price;
+                    s.PriceContent = item.priceContent;
+                    s.Currency = dto.Currency;
+                    s.Remark=item.Remark;
+                    s.CreateUserId = dto.CreateUserId;
+                    carTouristList.Add(s);
+                }
+                foreach (var item in carTouristList)
+                {
+                   
+                    Grp_CarTouristGuideGroundReservationsContent QueryData = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().First(a => a.SId == item.SId && a.Id == item.Id && a.DiId == item.DiId && a.IsDel==0);
+                    if (QueryData==null)
+                    {
+                        if (item.Price!=0)
+                        {
+                            int id = await _sqlSugar.Insertable(item).ExecuteReturnIdentityAsync();
+                            if (id == 0)
+                            {
+                                RollbackTran();
+                                return result = new Result() { Code = -2, Msg = "添加失败" };
+                            }
+                        }
+                       
+                    }
+                    else
+                    {
+                        int CTable = await _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservationsContent>().Where(a => a.Id == item.Id).SetColumns(a => new Grp_CarTouristGuideGroundReservationsContent
+                        {
+                            Price = item.Price,
+                            PriceContent = item.PriceContent,
+                            Currency = dto.Currency,
+                            Remark = item.Remark,
+                        }).ExecuteCommandAsync();
+                        if (CTable==0)
+                        {
+                            RollbackTran();
+                            return result = new Result() { Code = -1, Msg = "修改失败,请稍后重试!" };
+                        }
+                    }
+                }
+                //修改C表数据
+                List<Grp_CarTouristGuideGroundReservationsContent> carTouristListEnd = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>().Where(a=>a.DiId==dto.DiId && a.CTGGRId==dto.CTGGRId && a.IsDel==0).ToList();
+                Grp_CreditCardPayment c=new Grp_CreditCardPayment();
+                c.PaymentCurrency = dto.Currency;
+                foreach (var item in carTouristListEnd)
+                {
+                    c.PayMoney += item.Price;
+                }
+                c.PayPercentage = dto.PayPercentage;
+                c.ConsumptionDate= DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                c.CTable = 79;
+                c.CId = dto.CTGGRId;
+                c.IsAuditGM = 0;
+                c.PayDId=dto.PayDId;
+                c.DIId = dto.DiId;
+                c.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
+                c.Payee=dto.Payee;
+                c.CreateUserId=dto.CreateUserId;
+                if (c.PayDId == 72)
+                {
+                    c.IsPay = 1;
+                }
+                c.RMBPrice = c.PayMoney;
+                c.DayRate = 1;
+                Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 79);
+                List<CurrencyInfo> currencyInfos = new List<CurrencyInfo>();
+                if (_TeamRate != null)
+                {
+                    Sys_SetData _SetData = _sqlSugar.Queryable<Sys_SetData>().First(a => a.IsDel == 0 && a.Id == c.PaymentCurrency);
+                    if (_SetData != null)
+                    {
+                        currencyInfos = CommonFun.GetCurrencyChinaToList(_TeamRate.Remark);
+                        CurrencyInfo CurrencyRate = currencyInfos.FirstOrDefault(a => a.CurrencyCode == _SetData.Name);
+                        if (CurrencyRate != null)
+                        {
+                            c.RMBPrice = c.PayMoney * Convert.ToDecimal(CurrencyRate.Rate);
+                            c.DayRate = CurrencyRate.Rate;
+                        }
+                    }
+                }
+                Grp_CreditCardPayment grp_CreditCard = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a=>a.CId==dto.CTGGRId && a.IsDel==0 && a.CTable==79 && a.DIId==dto.DiId);
+                if (grp_CreditCard!=null)//修改
+                {
+                    int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>().Where(a => a.CId == dto.CTGGRId && a.CTable == 79 && a.DIId==dto.DiId).SetColumns(a => new Grp_CreditCardPayment
+                    {
+                        PaymentCurrency = c.PaymentCurrency,
+                        PayMoney = c.PayMoney,
+                        PayPercentage = c.PayPercentage,
+                        CTable = c.CTable,
+                        PayDId = c.PayDId,
+                        OrbitalPrivateTransfer = c.OrbitalPrivateTransfer,
+                        Payee = c.Payee,
+                        IsPay = c.IsPay,
+                        RMBPrice = c.RMBPrice,
+                        DayRate = c.DayRate,
+                    }).ExecuteCommandAsync();
+                    if (CTable == 0)
+                    {
+                        RollbackTran();
+                        return result = new Result() { Code = -2, Msg = "修改失败" };
+                    }
+                }
+                else//添加
+                {
+                    int id = await _sqlSugar.Insertable(c).ExecuteReturnIdentityAsync();
+                    if (id == 0)
+                    {
+                        RollbackTran();
+                        return result = new Result() { Code = -2, Msg = "添加失败" };
+                    }
+                }
+                int CarTouristGuideCTable = await _sqlSugar.Updateable<Grp_CarTouristGuideGroundReservations>().Where(a => a.Id == dto.CTGGRId && a.DiId == dto.DiId).SetColumns(a => new Grp_CarTouristGuideGroundReservations
+                {
+                    
+                CId=dto.Currency,
+                ServiceQuotedPrice=c.PayMoney,
+                OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer,
+                }).ExecuteCommandAsync();
+                if (CarTouristGuideCTable == 0)
+                {
+                    RollbackTran();
+                    return result = new Result() { Code = -2, Msg = "修改失败" };
+                }
+                result = new Result() { Code =0, Msg = "保存成功" };
+                CommitTran();
+            }
+            catch (Exception)
+            {
+                return result = new Result() { Code = -2, Msg = "未知错误" };
+                throw;
+            }
+            return result;
+        }
     }
 }

+ 5 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/DecreasePaymentsRepository.cs

@@ -77,12 +77,15 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                 List<Grp_GroupsTaskAssignment> grp_GroupsTaskAssignment = Query<Grp_GroupsTaskAssignment>(a => a.IsDel == 0 && a.UId == dto.UserId && a.CTId == dto.CTId).ToList();
 
-                string DiId = "";
+                string DiId = "0";
                 foreach (var item in grp_GroupsTaskAssignment)
                 {
                     DiId += item.DIId + ",";
                 }
-                DiId = DiId.Substring(0, DiId.Length - 1);
+                if (DiId!="0")
+                {
+                    DiId = DiId.Substring(0, DiId.Length - 1);
+                }
                 string sql = string.Format(@"select * from Grp_DelegationInfo where Id in({0}) and IsDel={1}", DiId, 0);
                 List<Grp_DelegationInfo> grp_Delegations = _sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
                 if (grp_Delegations.Count == 0)

+ 44 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -216,6 +216,43 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
         }
 
+        /// <summary>
+        /// 获取接团信息 Page List
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        public async Task<Result> PostGroupPageList(GroupPageListDto dto)
+        {
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
+
+            if (dto.PortType == 1 || dto.PortType == 2) // web/Android
+            {
+                string sql = string.Format(@"Select gdi.Id,SalesQuoteNo,TourCode,ssd.Id TeamTypeId, ssd.Name TeamType,ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,ClientName,ClientUnit,VisitDate,VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure
+                  From  Grp_DelegationInfo gdi
+                  Inner Join Sys_SetData ssd On gdi.TeamDid = ssd.Id 
+                  Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
+                  Left Join Sys_Users su On gdi.JietuanOperator = su.Id
+                  Where gdi.IsDel = 0 
+                  Order By gdi.CreateTime Desc");
+
+                var _DelegationList = await _sqlSugar.SqlQueryable<DelegationListView>(sql).ToListAsync();
+                if (_DelegationList.Count > 0)
+                {
+                    result.Code = 0;
+                    result.Msg = "成功!";
+                    result.Data = _DelegationList;
+                }
+                else
+                {
+                    result.Msg = "暂无该团组信息";
+                }
+            }
+
+
+            return result;
+
+        }
+
         /// <summary>
         /// 获取接团信息Info
         /// </summary>
@@ -230,7 +267,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 string sql = string.Format(@"Select Id,SalesQuoteNo,TourCode,JietuanOperator,TeamLevSId,TeamDid,TeamName,ClientName,
 	                                                ClientUnit,VisitCountry,VisitDate,VisitDays,VisitPNumber,TontractTime,
 	                                                PayDay,PaymentMoney,VisitPurpose,SpecialNeeds,OtherNeeds,CGRWSPBMMC,CGRWSPWH,
-	                                                ZZSCBMMC,ZZSCSPWH,Remark,TellPhone
+	                                                ZZSCBMMC,ZZSCSPWH,Remark,TellPhone,OpRoyaltyLv,OpRoyaltyRemark
                                              From Grp_DelegationInfo Where Id = {0} And IsDel = 0", dto.Id);
 
                 var _DelegationInfo = await _sqlSugar.SqlQueryable<DelegationInfoWebView>(sql).FirstAsync();
@@ -383,7 +420,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         CreateUserId = dto.UserId,
                         CreateTime = DateTime.Now,
                         DeleteUserId = null,
-                        DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss")
+                        DeleteTime = new DateTime(1990, 1, 1).ToString("yyyy-MM-dd HH:mm:ss"),
+                        OpRoyaltyLv = dto.OpRoyaltyLv,
+                        OpRoyaltyRemark=dto.opRoyaltyRemark
                     };
 
                     Log.Information("添加:"+ JsonConvert.SerializeObject(delegationInfo));
@@ -426,7 +465,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         ZZSCSPWH = dto.ZZSCSPWH,
                         TontractTime = Convert.ToDateTime(dto.TontractTime),
                         PaymentMoney = dto.PaymentMoney,
-                        PayDay = dto.PayDay
+                        PayDay = dto.PayDay,
+                        OpRoyaltyLv = dto.OpRoyaltyLv,
+                        OpRoyaltyRemark = dto.opRoyaltyRemark
                     });
 
                     if (updateStatus)

+ 2 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/VisaPriceRepository.cs

@@ -176,7 +176,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 {
                     c.IsPay = 1;
                 }
-                c.RMBPrice = c.RMBPrice;
+                c.RMBPrice = c.PayMoney;
                 c.DayRate = 1;
                 Grp_TeamRate _TeamRate = _sqlSugar.Queryable<Grp_TeamRate>().First(a => a.DiId == dto.DiId && a.IsDel == 0 && a.CTable == 80);
                 List<CurrencyInfo> currencyInfos = new List<CurrencyInfo>();
@@ -186,7 +186,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     if (_SetData!=null)
                     {
                         currencyInfos = CommonFun.GetCurrencyChinaToList(_TeamRate.Remark);
-                        CurrencyInfo CurrencyRate = currencyInfos.Where(a => a.CurrencyCode == _SetData.Name).First();
+                        CurrencyInfo CurrencyRate = currencyInfos.FirstOrDefault(a => a.CurrencyCode == _SetData.Name);
                         if (CurrencyRate!=null)
                         {
                             c.RMBPrice = c.PayMoney * Convert.ToDecimal(CurrencyRate.Rate);

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/WageSheetRepository.cs

@@ -67,7 +67,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                 _result.Msg = "暂无数据!";
                 return _result;
             }
-
+            wageSheetList = wageSheetList.OrderBy(it => it.Row_Number).ToList();
             _result.Code = 0;
             _result.Msg = "查询成功!";
             _result.Data = wageSheetList;

+ 4 - 2
OASystem/OASystem.Infrastructure/Repositories/System/UsersRepository.cs

@@ -58,7 +58,7 @@ namespace OASystem.Infrastructure.Repositories.System
                                                       From Sys_Users su 
                                                       Inner Join Sys_Company sc On su.CompanyId = sc.Id
                                                       Inner Join Sys_Department sd On su.DepId = sd.Id
-                                                      Inner Join Sys_JobPost sjp On su.JobPostId = sjp.Id {0}", sqlWhere);
+                                                      Inner Join Sys_JobPost sjp On su.JobPostId = sjp.Id ");
                 var _userList = await _sqlSugar.SqlQueryable<UserInfoWebView>(userSqlWhere).ToListAsync();
 
                 if (_userList.Count != 0)
@@ -79,7 +79,8 @@ namespace OASystem.Infrastructure.Repositories.System
                                                       From Sys_Users su 
                                                       Inner Join Sys_Company sc On su.CompanyId = sc.Id
                                                       Inner Join Sys_Department sd On su.DepId = sd.Id
-                                                      Inner Join Sys_JobPost sjp On su.JobPostId = sjp.Id {0}", sqlWhere);
+                                                      Inner Join Sys_JobPost sjp On su.JobPostId = sjp.Id ");
+
                 var _userList = await _sqlSugar.SqlQueryable<UserInfoWebView>(userSqlWhere).ToListAsync();
 
                 if (_userList.Count != 0)
@@ -143,6 +144,7 @@ namespace OASystem.Infrastructure.Repositories.System
 
             return result;
         }
+
         public async Task<List<UserInfo>> QueryUser(string sqlWhere)
         {
             string sql = string.Format(@"Select sc.CompanyName,sd.DepName,sjp.JobName,su.* From Sys_Users su