Explorar o código

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

yuanrf hai 1 ano
pai
achega
60abf74812
Modificáronse 24 ficheiros con 605 adicións e 202 borrados
  1. 7 7
      OASystem/OASystem.Api/Controllers/BaiduOCRController.cs
  2. 269 43
      OASystem/OASystem.Api/Controllers/GroupsController.cs
  3. 1 5
      OASystem/OASystem.Api/Controllers/SystemController.cs
  4. 202 82
      OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs
  5. 0 1
      OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskNotification.cs
  6. 0 1
      OASystem/OASystem.Api/Program.cs
  7. 2 2
      OASystem/OASystem.Api/appsettings.json
  8. 21 0
      OASystem/OASystem.Domain/Dtos/Groups/GroupCostSavaDto.cs
  9. 5 0
      OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs
  10. 1 1
      OASystem/OASystem.Domain/Entities/EntityBase.cs
  11. 3 3
      OASystem/OASystem.Domain/Entities/Groups/Grp_CarTouristGuideGroundReservations.cs
  12. 8 1
      OASystem/OASystem.Domain/Entities/Groups/Grp_DelegationInfo.cs
  13. 1 0
      OASystem/OASystem.Domain/Entities/Groups/Grp_GroupCostParameter.cs
  14. 2 1
      OASystem/OASystem.Domain/Entities/Groups/Grp_GroupsTaskAssignment.cs
  15. 6 0
      OASystem/OASystem.Domain/ViewModels/Groups/DelegationInfoView.cs
  16. 1 0
      OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostView.cs
  17. 43 0
      OASystem/OASystem.Domain/ViewModels/Groups/GroupCostParameterView.cs
  18. 1 1
      OASystem/OASystem.Domain/ViewModels/System/MessageView.cs
  19. 4 17
      OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs
  20. 23 14
      OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs
  21. 0 4
      OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs
  22. 1 1
      OASystem/OASystem.Infrastructure/Repositories/Groups/TaskAssignmentRepository.cs
  23. 3 17
      OASystem/OASystem.Infrastructure/Repositories/System/MessageRepository.cs
  24. 1 1
      OASystem/OASystem.Infrastructure/Repositories/System/UsersRepository.cs

+ 7 - 7
OASystem/OASystem.Api/Controllers/BaiduOCRController.cs

@@ -64,17 +64,17 @@ namespace OASystem.API.Controllers
                     int maxRowIndex = dataList.Max(s => s.row_start);
                     int maxColIndex = headerList.Max(s => s.col_start) + 1;
                     Dictionary<int, string> dicHeader = new Dictionary<int, string>();
-                    List<string> listNameStr = new List<string>() { "姓名", "Name" };
-                    List<string> listSexStr = new List<string>() { "性别", "Gender" };
+                    List<string> listNameStr = new List<string>() { "姓名", "name" };
+                    List<string> listSexStr = new List<string>() { "性别", "gender", "sex" };
                     List<string> listDOBStr = new List<string>() { "D.O.B", "出生年月", "生日", "出生日期" };
                     List<string> listIdCard = new List<string>() { "身份证号码", "身份证" };
-                    List<string> listOrganizationStr = new List<string>() { "工作单位", "Organization", "单位", "所在单位及职务" };
-                    List<string> listJobStr = new List<string>() { "职务", "Title", "职位" };
-                    List<string> listMobileStr = new List<string>() { "联系电话", "Mobile" };
-                    List<string> listAgeStr = new List<string>() { "年龄", "Age" };
+                    List<string> listOrganizationStr = new List<string>() { "工作单位", "organization", "单位", "所在单位及职务" };
+                    List<string> listJobStr = new List<string>() { "职务", "title", "职位" };
+                    List<string> listMobileStr = new List<string>() { "联系电话", "mobile" };
+                    List<string> listAgeStr = new List<string>() { "年龄", "age" };
                     for (int i = 0; i < headerList.Count; i++)
                     {
-                        string words = headerList[i].words.Trim();
+                        string words = headerList[i].words.Trim().ToLower();
                         if (listNameStr.Exists(s => s == words))
                         {
                             dicHeader.Add(i, "Name");

+ 269 - 43
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -51,6 +51,9 @@ using Google.Protobuf.WellKnownTypes;
 using Microsoft.AspNetCore.SignalR;
 using OASystem.API.OAMethodLib.Hub.HubClients;
 using OASystem.API.OAMethodLib.Hub.Hubs;
+using System.Collections.Generic;
+using OASystem.API.OAMethodLib.JuHeAPI;
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
 
 namespace OASystem.API.Controllers
 {
@@ -93,6 +96,7 @@ namespace OASystem.API.Controllers
         private readonly EnterExitCostRepository _enterExitCostRep;
         private readonly IHubContext<ChatHub, IChatClient> _hubContext;
         private readonly UsersRepository _usersRep;
+        private readonly IJuHeApiService _juHeApi;
 
         public GroupsController(IMapper mapper, SqlSugarClient sqlSugar, GrpScheduleRepository grpScheduleRep, DelegationInfoRepository groupRepository,
             TaskAssignmentRepository taskAssignmentRep, AirTicketResRepository airTicketResRep, DecreasePaymentsRepository decreasePaymentsRep,
@@ -100,7 +104,7 @@ namespace OASystem.API.Controllers
             , DelegationVisaRepository delegationVisaRep, MessageRepository message, VisaPriceRepository visaPriceRep, CarTouristGuideGroundRepository carTouristGuideGroundRep,
             CheckBoxsRepository checkBoxs, GroupCostRepository GroupCostRepository, CostTypeHotelNumberRepository CostTypeHotelNumberRepository,
             GroupCostParameterRepository GroupCostParameterRepository, HotelPriceRepository hotelPriceRep, CustomersRepository customersRep, SetDataRepository setDataRep,
-            TourClientListRepository tourClientListRep, TeamRateRepository teamRateRep, IHubContext<ChatHub, IChatClient> hubContext, UsersRepository usersRep)
+            TourClientListRepository tourClientListRep, TeamRateRepository teamRateRep, IHubContext<ChatHub, IChatClient> hubContext, UsersRepository usersRep, IJuHeApiService juHeApi)
         {
             _mapper = mapper;
             _grpScheduleRep = grpScheduleRep;
@@ -133,6 +137,7 @@ namespace OASystem.API.Controllers
             _teamRateRep = teamRateRep;
             _hubContext = hubContext;
             _usersRep = usersRep;
+            _juHeApi = juHeApi;
         }
 
         #region 流程管控
@@ -405,7 +410,7 @@ namespace OASystem.API.Controllers
             //团组名称
             if (!string.IsNullOrEmpty(dto.TeamName))
             {
-                sqlWhere += string.Format(@"And TeamName Like '%{0}%'",dto.TeamName);
+                sqlWhere += string.Format(@"And TeamName Like '%{0}%'", dto.TeamName);
             }
 
             //客户名称
@@ -440,7 +445,7 @@ namespace OASystem.API.Controllers
 					                              Inner Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
 					                              Left Join Sys_Users su On gdi.JietuanOperator = su.Id
 					                              Where gdi.IsDel = 0  {1}
-				                              ) temp  ", orderbyStr , sqlWhere);
+				                              ) temp  ", orderbyStr, sqlWhere);
 
 
             RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
@@ -514,9 +519,13 @@ namespace OASystem.API.Controllers
                 if (dto.Status == 1) //添加
                 {
                     diId = groupData.Data;
-                    GeneralMethod.PostGroupRateAddInit(dto.UserId, diId);//添加默认币种
+                    //添加默认币种
+                    await GeneralMethod.PostGroupRateAddInit(dto.UserId, diId);
 
-                    //消息提示
+                    //默认分配权限
+                    await GeneralMethod.PostGroupAuthAddInit(dto.UserId, diId);
+
+                    //消息提示 王鸽 主管号
                     List<int> _managerIds = new List<int>() { 22, 32 };
                     var userIds = _usersRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.IsDel == 0 && _managerIds.Contains(it.JobPostId)).Select(it => it.Id).ToList();
                     if (userIds.Count > 0)
@@ -534,16 +543,15 @@ namespace OASystem.API.Controllers
                         string title = $"新建团组";
                         string content = $"团组[{groupName}(创建人:{createGroupUser})]创建成功,请前往页面进行下一步操作!";
                         await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, content, userIds, diId);
-
                     }
 
                 }
-                else if(dto.Status == 2)
+                else if (dto.Status == 2)
                 {
                     diId = dto.Id;
                 }
 
-                return Ok(JsonView(true,"操作成功!", diId));
+                return Ok(JsonView(true, "操作成功!", diId));
             }
             catch (Exception ex)
             {
@@ -592,9 +600,9 @@ namespace OASystem.API.Controllers
                 if (dto.Status == 1) //添加
                 {
                     diId = groupData.Data;
-                    GeneralMethod.PostGroupRateAddInit(dto.UserId, diId);
+                    await GeneralMethod.PostGroupRateAddInit(dto.UserId, diId);
                 }
-               
+
 
                 if (dto.Status == 2)
                 {
@@ -655,11 +663,11 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GroupOperation11(int userId,int diId)
+        public async Task<IActionResult> GroupOperation11(int userId, int diId)
         {
             try
             {
-                 GeneralMethod.PostGroupRateAddInit(userId, diId);
+                GeneralMethod.PostGroupRateAddInit(userId, diId);
 
                 return Ok(JsonView(true));
             }
@@ -741,8 +749,6 @@ namespace OASystem.API.Controllers
             return Ok(JsonView(true, "操作成功!", groupData.Data));
         }
 
-
-
         /// <summary>
         /// 获取团组名称data  And 签证国别Data
         /// </summary>
@@ -761,6 +767,7 @@ namespace OASystem.API.Controllers
 
             return Ok(JsonView(groupData.Data));
         }
+       
         /// <summary>
         /// 根据CTable类型返回对应的团组名称及简单数据(APP端)
         /// </summary>
@@ -1181,7 +1188,6 @@ namespace OASystem.API.Controllers
         /// </summary>
         /// <param name="paras">参数Json字符串</param>
         /// <returns></returns>
-
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostSearchGrpCreditCardPayment(Search_GrpCreditCardPaymentDto _dto)
@@ -1205,6 +1211,8 @@ namespace OASystem.API.Controllers
 
                 Grp_CreditCardPaymentView _view = new Grp_CreditCardPaymentView();
 
+                List<SimplClientInfo> clientNameList = getSimplClientList(_dto.DiId);
+
                 #region 费用清单
                 var exp = Expressionable.Create<Grp_CreditCardPayment>();
                 exp.AndIF(_dto.AuditStatus != -1, it => it.IsAuditGM == _dto.AuditStatus);
@@ -1245,6 +1253,7 @@ namespace OASystem.API.Controllers
                 List<Grp_VisaInfo> _VisaInfos = await _groupRepository
                                                       .Query<Grp_VisaInfo>(s => s.DIId == _dto.DiId && s.IsDel == 0)
                                                       .ToListAsync();
+                
 
 
                 /*
@@ -1280,11 +1289,11 @@ namespace OASystem.API.Controllers
                 /*
                  *  285://收款退还
                  */
-                List<Fin_PaymentRefundAndOtherMoney> _PaymentRefundAndOtherMoneys= await _groupRepository
+                List<Fin_PaymentRefundAndOtherMoney> _PaymentRefundAndOtherMoneys = await _groupRepository
                                                                                 .Query<Fin_PaymentRefundAndOtherMoney>(s => s.DiId == _dto.DiId && s.IsDel == 0)
                                                                                 .ToListAsync();
 
-                
+
                 /*
                  * 币种信息
                  */
@@ -1385,15 +1394,15 @@ namespace OASystem.API.Controllers
                             Grp_HotelReservations hotelReservations = _HotelReservations.Where(s => s.Id == entity.CId).FirstOrDefault();
                             if (hotelReservations != null)
                             {
-                                string GovernmentRentCode ="",GovernmentRentName = "", CityTaxCode="",CityTaxName = "", BreakfastCode="", BreakfastName = "";
+                                string GovernmentRentCode = "", GovernmentRentName = "", CityTaxCode = "", CityTaxName = "", BreakfastCode = "", BreakfastName = "";
                                 Sys_SetData sdPaymentCurrency_GovernmentRent = currencyItems.Where(s => s.Id == hotelReservations.GovernmentRentCurrency).FirstOrDefault();
-                                if (sdPaymentCurrency_GovernmentRent!= null)
+                                if (sdPaymentCurrency_GovernmentRent != null)
                                 {
                                     GovernmentRentCode = sdPaymentCurrency_GovernmentRent.Name;
                                     GovernmentRentName = sdPaymentCurrency_GovernmentRent.Remark;
                                 }
 
-                                Sys_SetData sdPaymentCurrency_CityTax = currencyItems.Where(s => s.Id == hotelReservations.CityTaxCurrency).FirstOrDefault(); 
+                                Sys_SetData sdPaymentCurrency_CityTax = currencyItems.Where(s => s.Id == hotelReservations.CityTaxCurrency).FirstOrDefault();
                                 if (sdPaymentCurrency_CityTax != null)
                                 {
                                     CityTaxCode = sdPaymentCurrency_CityTax.Name;
@@ -1411,7 +1420,7 @@ namespace OASystem.API.Controllers
                                                           $"房间说明: {hotelReservations.Remark} <br/>" +
                                                           $"地税: {hotelReservations.GovernmentRent} {GovernmentRentCode} ({GovernmentRentName})<br/>" +
                                                           $"城市税: {hotelReservations.CityTax} {CityTaxCode} ({CityTaxName})<br/>" +
-                                                          $"酒店早餐: {hotelReservations.BreakfastPrice} {BreakfastCode} ({BreakfastName})<br/>"+
+                                                          $"酒店早餐: {hotelReservations.BreakfastPrice} {BreakfastCode} ({BreakfastName})<br/>" +
                                                           $"酒店早餐是否由地接代付: {isoppayStr}";
                                 _detail.PriceNameContent = hotelReservations.HotelName;
                             }
@@ -1426,7 +1435,7 @@ namespace OASystem.API.Controllers
                                     _detail.BusName = touristGuideGroundReservations.BusName;
                                 }
 
-                                
+
                                 _detail.PriceNameContent = touristGuideGroundReservations.Area;
 
                                 List<Grp_CarTouristGuideGroundReservationsContent> touristGuideGroundReservationsContents = _CarTouristGuideGroundReservationsContent
@@ -1462,7 +1471,7 @@ namespace OASystem.API.Controllers
                             Grp_VisaInfo visaInfo = _VisaInfos.Where(s => s.Id == entity.CId).FirstOrDefault();
                             if (visaInfo != null)
                             {
-                                _detail.PriceNameContent = visaInfo.VisaClient;
+                                _detail.PriceNameContent = getClientNameStr(clientNameList, visaInfo.VisaClient);
                                 _detail.PriceMsgContent = "备注:" + visaInfo.Remark;
                             }
 
@@ -1474,7 +1483,7 @@ namespace OASystem.API.Controllers
                             {
 
                                 string ioaCurrencyCode = "Unknown";
-                                string ioaCurrencyName= "Unknown";
+                                string ioaCurrencyName = "Unknown";
 
                                 var currencyData = currencyItems.Where(s => s.Id == invitationOfficialActivities.InviteCurrency && s.IsDel == 0).FirstOrDefault();
                                 if (currencyData != null)
@@ -1484,7 +1493,7 @@ namespace OASystem.API.Controllers
                                 }
 
                                 _detail.PriceNameContent = invitationOfficialActivities.InviterArea;
-                                _detail.PriceMsgContent = "邀请费用:" + invitationOfficialActivities.InviteCost + " "+ ioaCurrencyCode + "("+ ioaCurrencyName+ ")<br/>" +
+                                _detail.PriceMsgContent = "邀请费用:" + invitationOfficialActivities.InviteCost + " " + ioaCurrencyCode + "(" + ioaCurrencyName + ")<br/>" +
                                                           "活动费用:- <br/>" +
                                                           "备注:" + invitationOfficialActivities.Remark + "<br/>";
 
@@ -1496,7 +1505,7 @@ namespace OASystem.API.Controllers
                             Grp_Customers customers = _Customers.Where(s => s.Id == entity.Id && s.IsDel == 0).FirstOrDefault();
                             if (customers != null)
                             {
-                                _detail.PriceNameContent = customers.ClientName;
+                                _detail.PriceNameContent = getClientNameStr(clientNameList, customers.ClientName);
                                 _detail.PriceMsgContent = "备注:" + customers.Remark + "<br/>";
                             }
 
@@ -1529,7 +1538,7 @@ namespace OASystem.API.Controllers
 
                             break;
                         case 751://酒店早餐
-                          
+
                             break;
                         default:
                             break;
@@ -1629,7 +1638,7 @@ namespace OASystem.API.Controllers
                     if (strs.Count > 0)
                     {
                         decimal amountPayable = strs.Sum(it => it.AmountPayable);
-                        
+
                         decimal balancePayment = strs.Sum(it => it.BalancePayment);
                         amountPayableStr += string.Format(@"{0}{1}&nbsp;|", amountPayable.ToString("#0.00"), item.CurrencyName);
 
@@ -1641,7 +1650,7 @@ namespace OASystem.API.Controllers
                         }
                         else
                         {
-                            thisPaymentStr += string.Format(@"{0}{1}&nbsp;|","0.00", item.CurrencyName);
+                            thisPaymentStr += string.Format(@"{0}{1}&nbsp;|", "0.00", item.CurrencyName);
                         }
 
                         balancePaymentStr += string.Format(@"{0}{1}&nbsp;|", balancePayment.ToString("#0.00"), item.CurrencyName);
@@ -1657,7 +1666,6 @@ namespace OASystem.API.Controllers
                         {
                             auditedFundsStr += string.Format(@"{0}{1}&nbsp;|", "0.00", item.CurrencyName);
                         }
-
                     }
                 }
 
@@ -1682,7 +1690,6 @@ namespace OASystem.API.Controllers
             }
         }
 
-
         /// <summary>
         /// 费用审核 
         /// 修改团组费用审核状态
@@ -1742,7 +1749,7 @@ namespace OASystem.API.Controllers
                     string groupNameStr = string.Empty;
                     var groupData = groupDatas.Where(it => it.Id == creditData.DIId).FirstOrDefault();
                     if (groupData != null) groupNameStr = groupData.TeamName;
-                    
+
 
                     string creditTypeStr = string.Empty;
                     var creditTypeData = creditTypeDatas.Where(it => it.Id == creditData.CTable).FirstOrDefault();
@@ -1775,10 +1782,10 @@ namespace OASystem.API.Controllers
                         msgContent = $"[{groupNameStr}({creditTypeStr})]费用申请(金额:{CNYPrice.ToString("0.00")} CNY({creditData.PayMoney.ToString("0.00")} {creditCurrency})) {auditStr}!";
                     }
 
-                     
-                    msgDatas.Add(new {DiId = creditData.DIId, UserId = creditData.CreateUserId, MsgTitle = msgTitle, MsgContent = msgContent });
+
+                    msgDatas.Add(new { DiId = creditData.DIId, UserId = creditData.CreateUserId, MsgTitle = msgTitle, MsgContent = msgContent });
                 }
-                
+
             }
             if (rst == 0)
             {
@@ -1945,11 +1952,44 @@ namespace OASystem.API.Controllers
                 jw.Msg += "请输入正确的diid";
                 return Ok(jw);
             }
-            string sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}",dto.DIID);
-            var arr = _sqlSugar.SqlQueryable<SimplClientInfo>(sql).ToList();
+
+            var arr = getSimplClientList(dto.DIID);
             jw = JsonView(true, "获取成功!", arr);
 
-            return Ok(jw); 
+            return Ok(jw);
+        }
+
+        private List<SimplClientInfo> getSimplClientList(int diId) {
+            string sql = string.Format("select b.Id,b.Pinyin,b.lastName,b.firstName,b.phone from  Grp_TourClientList a, Crm_DeleClient b where a.clientid = b.id and a.isdel = 0 and a.diid = {0}", diId);
+            List<SimplClientInfo> arr = _sqlSugar.SqlQueryable<SimplClientInfo>(sql).ToList();
+            return arr;
+        }
+
+        private string getClientNameStr(List<SimplClientInfo> list, string origin) {
+            string result = origin;
+
+            if (Regex.Match(origin, @"\d+,?").Value.Length > 0) {
+                string[] temparr = origin.Split(',');
+                string fistrStr = temparr[0];
+                int count = temparr.Count();
+
+                int tempId;
+                bool success = int.TryParse(fistrStr, out tempId);
+                if (success) {
+                    SimplClientInfo tempInfo = list.FirstOrDefault(s => s.Id == tempId);
+                    if (tempInfo != null) {
+                        if (count > 1)
+                        {
+                            result = string.Format(@"{0}{1}等{2}人", tempInfo.LastName, tempInfo.FirstName, count);
+                        }
+                        else { 
+                            result = string.Format(@"{0}{1}", tempInfo.LastName, tempInfo.FirstName);
+                        }
+                    }
+                }
+            }
+
+            return result;
         }
 
         /// <summary>
@@ -3352,13 +3392,39 @@ namespace OASystem.API.Controllers
                 var excelTypeData = dataSource.Where(it => it.STid == 73).ToList(); //三公费用-Excel明细类型
                 List<SetDataInfoView> _ExcelTypeData = _mapper.Map<List<SetDataInfoView>>(excelTypeData);
 
+                //默认币种显示
+                List<CurrencyInfo> _currencyInfos = new List<CurrencyInfo>()
+                { 
+                    new CurrencyInfo (){ CurrencyCode="USD",CurrencyName = "美元",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="EUR",CurrencyName = "欧元",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="GBP",CurrencyName = "英镑",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="JPY",CurrencyName = "日元",Rate = 0.0000M },
+                    new CurrencyInfo (){ CurrencyCode="HKD",CurrencyName = "港币",Rate = 0.0000M },
+
+                };
+
+                var _currencyRate = await _juHeApi.PostItemRateAsync(_currencyInfos.Select(it => it.CurrencyCode).ToArray());
+                if (_currencyRate.Count > 0)
+                {
+
+                    foreach (var item in _currencyInfos)
+                    {
+                        var rateInfo = _currencyRate.Where(it => it.Name.Equals(item.CurrencyName)).FirstOrDefault();
+                        if (rateInfo != null)
+                        {
+                            item.Rate = Convert.ToDecimal(rateInfo.FSellPri) / 100.00M;
+                        }
+                    }
+                }
+
+
                 return Ok(JsonView(true, "查询成功!", new
                 {
                     GroupNameData = groupNameData.Data,
                     CurrencyData = _CurrencyData,
                     WordTypeData = _WordTypeData,
-                    ExcelTypeData = _ExcelTypeData
-                    //NationalTravelFeeData = nationalTravelFeeData
+                    ExcelTypeData = _ExcelTypeData,
+                    CurrencyInit = _currencyInfos
                 }));
             }
             catch (Exception ex)
@@ -3443,9 +3509,6 @@ namespace OASystem.API.Controllers
             }
         }
 
-
-
-
         /// <summary>
         /// 团组模块 - 出入境费用 - 子项删除
         /// </summary>
@@ -5607,6 +5670,169 @@ namespace OASystem.API.Controllers
             }));
         }
 
+
+        /// <summary>
+        ///     
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> PostGroupCostModulePrompt(GroupCostModulePromptDto dto)
+        {
+            try
+            {
+                #region 参数验证
+                if (dto.DiId < 0)
+                {
+                    return Ok(JsonView(false, "请传入有效的DiId参数!"));
+                }
+
+                List<int> cTableIds = new List<int>() {
+                    76    ,//酒店预订
+                    77    ,//行程
+                    79    ,//车 / 导游地接
+                    80    ,//签证
+                    81    ,//邀请 / 公务活
+                    82    ,//团组客户保险
+                    85    ,//机票预订
+                    98    ,//其他款项
+                    285   ,//收款退还
+                    751   ,//酒店早餐
+                    1015   // 超支费用
+                };
+
+                if (dto.CTable < 0 && !cTableIds.Contains(dto.CTable))
+                {
+                    return Ok(JsonView(false, "请传入有效的CTable参数!"));
+                }
+                #endregion
+
+                //Grp_GroupCostParameter 预算表 Grp_GroupCost 详细费用列表
+                var _GroupCostParameters = _usersRep._sqlSugar.Queryable<Grp_GroupCostParameter>().Where(it => it.IsDel == 0 && it.DiId == dto.DiId).ToList();
+
+                if (_GroupCostParameters.Count <= 0)
+                {
+                    return Ok(JsonView(true, "暂无该团组成本信息!", new List<dynamic>()));
+                }
+
+                if (_GroupCostParameters[0].IsShare == 0)
+                {
+                    return Ok(JsonView(true, "该团组成本未完成!", new List<dynamic>()));
+                }
+                var _GroupCosts = _usersRep._sqlSugar.Queryable<Grp_GroupCost>().Where(it => it.IsDel == 0 && it.Diid == dto.DiId).ToList();
+
+                //处理date为空问题
+                if (_GroupCosts.Count > 0)
+                {
+                    for (int i = 0; i < _GroupCosts.Count; i++)
+                    {
+                        if (string.IsNullOrEmpty(_GroupCosts[i].Date))
+                        {
+                            if (i > 0)
+                            {
+                                _GroupCosts[i].Date = _GroupCosts[i - 1].Date;
+                            }
+                        }
+                    }
+                }
+                
+                GroupCostModulePromptView _view = new GroupCostModulePromptView()
+                { 
+                    CurrencyCode = _GroupCostParameters[0].Currency,
+                    Rate = _GroupCostParameters[0].Rate
+                };
+
+                List<GroupCostModulePromptInfo> _ModulePromptInfos = new List<GroupCostModulePromptInfo>();
+                foreach (var item in _GroupCostParameters)
+                {
+                    GroupCostModulePromptInfo modulePromptInfo = new GroupCostModulePromptInfo()
+                    {
+                        CostType = item.CostType,
+                        CostTypeStartTime = Convert.ToDateTime(item.CostTypeStartTime).ToString("yyyy-MM-dd"),
+                        CostTypeEndTime = Convert.ToDateTime(item.CostTypeendTime).ToString("yyyy-MM-dd"),
+                        CostTypeNumber = item.CostTypenumber
+                    };
+
+                    List<string> costTypes = new List<string>() { "A","B" };
+
+                    List<Grp_GroupCost> _GroupCostsTypeData = new List<Grp_GroupCost>();
+                    var _GroupCostsDuplicates = _GroupCostParameters.GroupBy(x => x.CostType).Select(y => y.FirstOrDefault());
+                    if (_GroupCostsDuplicates.Count() == 1)
+                    {
+                        _GroupCostsTypeData = _GroupCosts;
+                    }
+                    else
+                    {
+                        _GroupCostsTypeData = _GroupCosts.Where(it => Convert.ToDateTime(it.Date) >= Convert.ToDateTime(item.CostTypeStartTime) &&
+                                                                      Convert.ToDateTime(it.Date) <= Convert.ToDateTime(item.CostTypeendTime)).ToList();
+                    }
+
+                    //var _GroupCostsTypeData = _GroupCosts.Where(it => it.Date)
+                    List<dynamic> datas = new List<dynamic>();
+                    /*
+                     *  76	酒店预订
+                     *  77	行程
+                     *  79	车/导游地接
+                     *  80	签证
+                     *  81	邀请/公务活动
+                     *  82	团组客户保险
+                     *  85	机票预订
+                     *  98	其他款项
+                     *  285	收款退还
+                     *  751	酒店早餐
+                     *  1015	超支费用
+                     */
+                    switch (dto.CTable)
+                    {
+                        case 76: // 酒店预订
+                            datas.AddRange(
+                                _GroupCostsTypeData.Select(it => new
+                                {
+                                    it.DAY,
+                                    it.Date,
+                                    it.ACCON,
+                                    it.ITIN,
+                                    it.SGR,
+                                    it.TBR,
+                                    it.JS_ES,
+                                    it.Suite
+                                })
+                            );
+                            break;
+                        case 79: // 车/导游地接
+                            datas.AddRange(
+                                _GroupCostsTypeData.Select(it => new
+                                {
+                                    it.Date,
+                                    it.CarCost,
+                                    it.TGS,
+                                    it.SGR,
+                                    it.TBR,
+                                    it.JS_ES,
+                                    it.Suite
+                                })
+                            );
+                            break;
+                        default:
+                            break;
+                    }
+
+
+                    modulePromptInfo.Data = datas;
+                    _ModulePromptInfos.Add(modulePromptInfo);
+
+                }
+                _view.ModulePromptInfos = _ModulePromptInfos;
+
+                return Ok(JsonView(true,"操作成功!", _view));
+            }
+            catch (Exception ex)
+            {
+                return Ok(JsonView(false, ex.Message));
+            }
+        }
+
         #endregion
 
         #region 酒店预定 保留

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

@@ -236,12 +236,9 @@ namespace OASystem.API.Controllers
 
             #endregion
 
-
-            string msgSql = $"Select COUNT(*) As UnreadCount From  Sys_MessageReadAuth Where IsRead = 0 And ReadableUId = {dto.UserId}";
-
             try
             {
-                var data = _sqlSugar.SqlQueryable<MessageUnreadTotalCountView>(msgSql).First();
+                var data = await _messageRep.GetUnReadCount(dto.UserId);
                 if (data != null)
                 {
                     return Ok(JsonView(true, "操作成功!", data));
@@ -251,7 +248,6 @@ namespace OASystem.API.Controllers
             }
             catch (Exception ex)
             {
-
                 return Ok(JsonView(false, ex.Message));
             }
 

+ 202 - 82
OASystem/OASystem.Api/OAMethodLib/GeneralMethod.cs

@@ -23,7 +23,7 @@ namespace OASystem.API.OAMethodLib
         //团组信息
         private readonly static DelegationInfoRepository _dirRep = AutofacIocManager.Instance.GetService<DelegationInfoRepository>();
         private readonly static TeamRateRepository _teamRateRep = AutofacIocManager.Instance.GetService<TeamRateRepository>();
-        private readonly static IJuHeApiService _juHeApiService = AutofacIocManager.Instance.GetService<IJuHeApiService>();
+        private readonly static IJuHeApiService _juHeApi = AutofacIocManager.Instance.GetService<IJuHeApiService>();
         private readonly static SetDataRepository _setDataRep = AutofacIocManager.Instance.GetService<SetDataRepository>();
         private readonly static TableOperationRecordRepository _tableOperationRecordRep = AutofacIocManager.Instance.GetService<TableOperationRecordRepository>();
         private readonly static MessageRepository _messageRep = AutofacIocManager.Instance.GetService<MessageRepository>();
@@ -102,7 +102,7 @@ namespace OASystem.API.OAMethodLib
             return notificationStr;
         }
 
-        
+
 
         #endregion
 
@@ -211,7 +211,7 @@ namespace OASystem.API.OAMethodLib
         private static DateTime dateStart = new DateTime(1970, 1, 1, 8, 0, 0);
         private static long longTime = 621355968000000000;
         private static int samllTime = 10000000;
-        
+
         /// <summary>
         /// 时间戳 转 datetime
         /// </summary>
@@ -234,7 +234,7 @@ namespace OASystem.API.OAMethodLib
         /// <param name="userId">用户Id</param>
         /// <param name="PageId">页面Id</param>
         /// <returns></returns>
-        public static async Task<PageFunAuthViewBase> PostUserPageFuncDatas(int userId,int PageId)
+        public static async Task<PageFunAuthViewBase> PostUserPageFuncDatas(int userId, int PageId)
         {
             PageFunAuthViewBase pageFunAuth = new PageFunAuthViewBase();
 
@@ -301,9 +301,9 @@ namespace OASystem.API.OAMethodLib
         /// <param name="userId">用户Id</param>
         /// <param name="CTable">业务模块Id</param>
         /// <returns></returns>
-        public static async Task<Result> PostGroupOperationAuth(int diId, int userId, int CTable )
+        public static async Task<Result> PostGroupOperationAuth(int diId, int userId, int CTable)
         {
-            Result _result = new Result { Code = -1,Msg = "No Operation Authorty!" };
+            Result _result = new Result { Code = -1, Msg = "No Operation Authorty!" };
             if (CTable < 1)
             {
                 _result.Msg = "请填写正确的用户Id!";
@@ -312,7 +312,7 @@ namespace OASystem.API.OAMethodLib
 
             var data = await _dirRep._sqlSugar.Queryable<Grp_GroupsTaskAssignment>().Where(it => it.DIId == diId && it.UId == userId && it.CTId == CTable && it.IsDel == 0).FirstAsync();
 
-            if (data == null) 
+            if (data == null)
             {
                 _result.Msg = "你没有本团下的该业务模块操作,请联系主管分配操作权限!";
             }
@@ -345,93 +345,84 @@ namespace OASystem.API.OAMethodLib
 
             Result result = new() { Code = -2 };
 
-            if (userId < 0)
+            if (userId < 1)
             {
                 result.Msg = string.Format(@"请传入正确的userId");
                 return result;
             }
 
-            if (diId < 0)
+            if (diId < 1)
             {
                 result.Msg = string.Format(@"请传入正确的DiId");
                 return result;
             }
             //美元(USD):1.0000|欧元(EUR):1.0000|墨西哥比索(MXN):1.0000
-            string CNYInit = string.Format(@"人名币(CNY):1.0000");
+            string rateInit = string.Format(@"人名币(CNY):1.0000");
 
-            var gropInfo = await _dirRep._sqlSugar.Queryable<Grp_DelegationInfo>().Where( it => it.IsDel == 0 && it.Id == diId).FirstAsync();
-            if (gropInfo != null)
-            {
-                if (!string.IsNullOrEmpty(gropInfo.VisitCountry))
-                {
-                    var countryCueencyCodes = await _setDataRep.GetSetDataBySTId(_setDataRep, 66);
+            //var gropInfo = _dirRep._sqlSugar.Queryable<Grp_DelegationInfo>().Where(it => it.IsDel == 0 && it.Id == diId).First();
+            //if (gropInfo == null)
+            //{
+            //    result.Msg = $@"未查询到团组信息!";
+            //    return result;
+            //}
 
-                    string countrys = gropInfo.VisitCountry;
-                    string[] countryItems = new string[] { };
-                    if (countrys.Contains("|"))
-                    {
-                        countryItems = countrys.Split('|');
-                    }
-                    else
-                    {
-                        countryItems = new string[] { countrys };
-                    }
+            var juheRateData = await _juHeApi.GetExchangeRateAsync();
 
-                    var countryInfos = await _dirRep._sqlSugar.Queryable<Dis_Country>().Where(it => it.IsDel == 0).ToListAsync();
+            if (juheRateData.Error_code != 0)
+            {
+                result.Msg = juheRateData.Reason;
+                return result;
+            }
+            List<ExchangeRateModel> exchangeRateModels = (List<ExchangeRateModel>)juheRateData.Result;
+            if (exchangeRateModels.Count <= 0)
+            {
+                result.Msg = $@"未查询到聚合接口汇率信息!";
+                return result;
+            }
 
-                    List<string> currencyCodes = new List<string>();
-                    if (countryItems.Length > 0)
+            if (exchangeRateModels.Count > 0)
+            {
+                var codes = _dirRep._sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0 && it.STid == 66).ToList();
+                for (int i = 0; i < exchangeRateModels.Count; i++)
+                {
+                    string currencyName = exchangeRateModels[i].Name;
+                    string code = "";
+                    var currencyData = codes.Where(it => it.Remark == currencyName).FirstOrDefault();
+                    if (currencyData != null)
                     {
-                        foreach (var item in countryItems)
-                        {
-                            Dis_Country country = new Dis_Country();
-                            country = countryInfos.Where(it => it.CnShortName.Equals(item)).FirstOrDefault();
-                            if (country != null)
-                            {
-                                if (!item.Equals("中国"))
-                                {
-                                    currencyCodes.Add(country.CurrencyCode);
-                                }
-                            }
-                        }
-                    }
+                        code = currencyData.Name;
 
-                    if (currencyCodes.Count > 0)
-                    {
-                        List<ExchangeRateModel> exchangeRateModels = await _juHeApiService.PostItemRateAsync(currencyCodes.ToArray());
-                        if (exchangeRateModels.Count > 0)
+                        decimal currRate = 0.00M;
+                        string MSellPri = exchangeRateModels[i].MSellPri;
+                        if (!string.IsNullOrEmpty(MSellPri))
                         {
-                            var codes = await _dirRep._sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0 && it.IsDel == 0).ToListAsync();
-                            for (int i = 0; i < exchangeRateModels.Count; i++)
-                            {
-                                string currencyName = exchangeRateModels[i].Name;
-                                string code = "";
-                                var currencyData = codes.Where(it => it.IsDel == 0 && it.Remark == currencyName).FirstOrDefault();
-                                if (currencyData != null) { 
-                                    code = currencyData.Name;
-                                    CNYInit += string.Format(@"|{0}({1}):{2}", exchangeRateModels[i].Name, code, exchangeRateModels[i].MSellPri);
-                                }
-                            }
+                            currRate = Convert.ToDecimal(MSellPri) / 100M;
                         }
+                        
+                        rateInit += $@"|{currencyName}({code}):{currRate.ToString("#0.0000")}";
                     }
                 }
             }
 
-            List<Grp_TeamRate> grp_TeamRates = new List<Grp_TeamRate>()
+            var cTableIds = _dirRep._sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0 && it.STid == 16).ToList();
+
+            if (cTableIds.Count < 1)
             {
-                new Grp_TeamRate(){ DiId = diId,CTable = 76,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //76	酒店预订
-                new Grp_TeamRate(){ DiId = diId,CTable = 77,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //77	行程
-                new Grp_TeamRate(){ DiId = diId,CTable = 79,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //79	车/导游地接
-                new Grp_TeamRate(){ DiId = diId,CTable = 80,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //80	签证
-                new Grp_TeamRate(){ DiId = diId,CTable = 82,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //82	团组客户保险
-                new Grp_TeamRate(){ DiId = diId,CTable = 85,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //85	机票预订
-                new Grp_TeamRate(){ DiId = diId,CTable = 98,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //98	其他款项
-                new Grp_TeamRate(){ DiId = diId,CTable = 285,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //285	收款退还
-                new Grp_TeamRate(){ DiId = diId,CTable = 751,Remark = CNYInit,CreateUserId = userId, IsDel = 0 }, //751    酒店早餐
-            };
+                result.Msg = $@"未查询到操作模块信息!";
+                return result;
+            }
+
+            List<Grp_TeamRate> grp_TeamRates = new List<Grp_TeamRate>();
+
+            foreach (var item in cTableIds)
+            {
+                grp_TeamRates.Add(
+                    new Grp_TeamRate() { DiId = diId, CTable = item.Id, Remark = rateInit, CreateUserId = userId }
+                    );
+            }
 
             var res = _teamRateRep._sqlSugar.Insertable(grp_TeamRates).ExecuteCommand();
-            if (res < 0)
+            if (res < 1)
             {
 
                 result.Msg = string.Format(@"添加失败!");
@@ -440,9 +431,7 @@ namespace OASystem.API.OAMethodLib
 
             result.Code = 0;
             result.Msg = string.Format(@"操作成功!");
-
             return result;
-
         }
 
         /// <summary>
@@ -476,13 +465,144 @@ namespace OASystem.API.OAMethodLib
                 return result;
             }
 
-            //var depData = await _teamRateRep._sqlSugar.Queryable<Sys_Department>().Where(it => it.IsDel == 0 && it.CompanyId == companyId && it.DepName.Equals("国交部")).FirstAsync();
-            //if (depData != null)
-            //{
-            //    var userData = await _teamRateRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.IsDel == 0 && it.CompanyId == companyId && it.DepId == depData.Id).ToListAsync();
-
-            //}
-
+            var userDatas = await _teamRateRep._sqlSugar
+                                              .Queryable<Sys_Users>()
+                                              .LeftJoin<Sys_Department>((su,sd) => su.DepId == sd.Id && sd.IsDel == 0)
+                                              .LeftJoin<Sys_JobPost>((su,sd,sjp) => su.JobPostId == sjp.Id && sjp.IsDel == 0)
+                                              .Where(su => su.IsDel == 0)
+                                              .Select((su,sd,sjp) => new {
+                                                  su.DepId,
+                                                  sd.DepName,
+                                                  su.JobPostId,
+                                                  sjp.JobName,
+                                                  su.Id,
+                                                  su.CnName
+                                              })
+                                              .ToListAsync();
+
+            /*
+             * 76  酒店预订  --> 国交部门 酒店 岗位
+             * 79  车/导游地接  --> 国交部门 OP 岗位
+             * 80  签证  --> 国交部门 签证 岗位
+             * 81  邀请/公务活动 --> 国交部门 商邀 岗位
+             * 82  团组客户保险 --> 国交部 经理,主管 岗位
+             * 85  机票预订  --> 国交部门 机票 岗位
+             * 98  其他款项  --> 总经办部门 总经理 岗位/国交部门(ALL) 岗位/财务部门(ALL) 岗位/策划部门(ALL) 岗位/人事部门 采购 岗位
+             * 1015 超支费用  --> 财务部门(ALL)岗位
+             */
+            List<Grp_GroupsTaskAssignment> _GroupsTaskAssignments = new List<Grp_GroupsTaskAssignment>();
+            // 76  酒店预订  --> 国交部门(7) 酒店(25) 岗位 
+            _GroupsTaskAssignments.AddRange(
+                userDatas
+                .Where(it => it.DepId == 7 && it.JobPostId == 25)
+                .Select(it => new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 76,
+                    UId = it.Id,
+                    CreateUserId = userId
+                }).ToList()
+            );
+
+            //79  车/导游地接  --> 国交部门(7) OP(28) 岗位
+            _GroupsTaskAssignments.AddRange(
+                userDatas.Where(it => it.DepId == 7 && it.JobPostId == 28)
+                .Select(it => new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 79,
+                    UId = it.Id,
+                    CreateUserId = userId
+                }).ToList()
+            );
+
+
+            //81  邀请/公务活动 --> 国交部门(7) 商邀(27) 岗位
+            _GroupsTaskAssignments.AddRange(
+                userDatas
+                .Where(it => it.DepId == 7 && it.JobPostId == 27)
+                .Select(it => new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 81,
+                    UId = it.Id,
+                    CreateUserId = userId
+                }).ToList()
+            );
+            
+            //80  签证  --> 国交部门(7) 签证(26) 岗位
+            _GroupsTaskAssignments.AddRange(
+                userDatas
+                .Where(it => it.DepId == 7 && it.JobPostId == 26)
+                .Select(it => new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 80,
+                    UId = it.Id,
+                    CreateUserId = userId
+                }).ToList()
+            );
+
+
+            //82  团组客户保险 --> 国交部(7) 经理(32),主管(22) 岗位
+            _GroupsTaskAssignments.AddRange(
+                userDatas
+                .Where(it => it.DepId == 7 && (it.JobPostId == 22 || it.JobPostId == 32))
+                .Select(it => new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 82,
+                    UId = it.Id,
+                    CreateUserId = userId
+                }).ToList()
+            );
+
+            //85  机票预订  --> 国交部门(7) 机票(24) 岗位
+            _GroupsTaskAssignments.AddRange(
+                userDatas
+                .Where(it => it.DepId == 7 && it.JobPostId == 24)
+                .Select(it => new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 85,
+                    UId = it.Id,
+                    CreateUserId = userId
+                }).ToList()
+            );
+
+
+            //98  其他款项  --> 总经办部门(1) 总经理(1) 岗位/国交部门(7)(ALL) 岗位/财务部门(3)(ALL) 岗位/策划部门(5)(ALL) 岗位/人事部门(4) 采购(74) 岗位
+            List<int> depIds = new List<int>() { 7,3,5 };
+            List<int> jobIds = new List<int>() { 1,74};
+            _GroupsTaskAssignments.AddRange(
+                userDatas
+                .Where(it => depIds.Contains(it.DepId) || jobIds.Contains(it.JobPostId))
+                .Select(it => new Grp_GroupsTaskAssignment()
+                    {
+                        DIId = diId,
+                        CTId = 98,
+                        UId = it.Id,
+                        CreateUserId = userId
+                    }).ToList()
+            );
+
+            //1015 超支费用  --> 财务部门(3)(ALL)岗位
+            _GroupsTaskAssignments.AddRange(
+                userDatas
+                .Where(it => it.DepId == 3)
+                .Select(it => new Grp_GroupsTaskAssignment()
+                {
+                    DIId = diId,
+                    CTId = 1015,
+                    UId = it.Id,
+                    CreateUserId = userId
+                }).ToList()
+            );
+
+            if (_GroupsTaskAssignments.Count > 0)
+            {
+                var addId =_teamRateRep._sqlSugar.Fastest<Grp_GroupsTaskAssignment>().PageSize(100000).BulkCopy(_GroupsTaskAssignments);
+            }
 
             result.Code = 0;
             result.Msg = string.Format(@"操作成功!");
@@ -510,7 +630,7 @@ namespace OASystem.API.OAMethodLib
         /// string 
         /// eg: CNY 1.0000 
         /// </returns>
-        public static async Task<string> PostGroupRateByCTableAndCurrency(List<TeamRateModelView> teamRateModels,int cTable,List<string> currencyCodes)
+        public static async Task<string> PostGroupRateByCTableAndCurrency(List<TeamRateModelView> teamRateModels, int cTable, List<string> currencyCodes)
         {
             string str = "";
 
@@ -555,14 +675,14 @@ namespace OASystem.API.OAMethodLib
         /// <param name="diId"></param>
         /// <param name="cTable"></param>
         /// <returns></returns>
-        public static async Task<TeamRateModelGeneralView> PostGroupTeamRateByDiIdAndCTableId( int portType,int diId,int cTable)
+        public static async Task<TeamRateModelGeneralView> PostGroupTeamRateByDiIdAndCTableId(int portType, int diId, int cTable)
         {
 
             TeamRateModelGeneralView _view = new TeamRateModelGeneralView();
             _view = await _teamRateRep.PostGroupTeamRateByDiIdAndCTableId(portType, diId, cTable);
             return _view;
         }
-        
+
 
         #endregion
 
@@ -675,7 +795,7 @@ namespace OASystem.API.OAMethodLib
         /// <param name="dataId"></param>
         /// <param name="remark"></param>
         /// <returns></returns>
-        public static async Task<bool> NewClientOperationRecord(int portType, OperationEnum operationEnum,int userId,int dataId,string remark )
+        public static async Task<bool> NewClientOperationRecord(int portType, OperationEnum operationEnum, int userId, int dataId, string remark)
         {
             Crm_TableOperationRecord _TableOperationRecord = new Crm_TableOperationRecord()
             {

+ 0 - 1
OASystem/OASystem.Api/OAMethodLib/Quartz/Business/TaskNotification.cs

@@ -136,6 +136,5 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
             }
             #endregion
         }
-
     }
 }

+ 0 - 1
OASystem/OASystem.Api/Program.cs

@@ -49,7 +49,6 @@ builder.Services.AddControllers()
         //时间格式化响应
         options.JsonSerializerOptions.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
 
-
         ////decimal 四位小数
         //options.JsonSerializerOptions.Converters.Add(new JsonConverterDecimal(0.0000M));
     });

+ 2 - 2
OASystem/OASystem.Api/appsettings.json

@@ -172,13 +172,13 @@
     {
       "CTableId": 98, //CtableId 其他款项
       "PageIdDatas": [ //页面Id
-
+        69
       ]
     },
     {
       "CTableId": 285, //CtableId 其他款项与收款退还
       "PageIdDatas": [ //页面Id
-        69
+        //69
       ]
     },
     {

+ 21 - 0
OASystem/OASystem.Domain/Dtos/Groups/GroupCostSavaDto.cs

@@ -1305,5 +1305,26 @@ namespace OASystem.Domain.Dtos.Groups
 
 
 
+    }
+
+    public class GroupCostModulePromptDto
+    {
+        public int DiId { get; set; }
+
+        /// <summary>
+        /// 模块分类
+        /// 76	酒店预订
+        /// 77	行程
+        /// 79	车/导游地接
+        /// 80	签证
+        /// 81	邀请/公务活动
+        /// 82	团组客户保险
+        /// 85	机票预订
+        /// 98	其他款项
+        /// 285	收款退还
+        /// 751	酒店早餐
+        /// 1015	超支费用
+        /// </summary>
+        public int CTable { get; set; }
     }
 }

+ 5 - 0
OASystem/OASystem.Domain/Dtos/Groups/GroupListDto.cs

@@ -200,6 +200,11 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public string TellPhone { get; set; }
 
+        /// <summary>
+        /// 微信号
+        /// </summary>
+        public string WeChatNo { get; set; }
+
         /// <summary>
         /// 备注
         /// </summary>

+ 1 - 1
OASystem/OASystem.Domain/Entities/EntityBase.cs

@@ -36,7 +36,7 @@ namespace OASystem.Domain.Entities
         /// <summary>
         /// 备注
         /// </summary>
-        [SugarColumn(IsNullable =true,ColumnDataType ="varchar(500)")]
+        [SugarColumn(IsNullable =true,ColumnDataType ="nvarchar(1000)")]
         public string Remark { get; set; }
         /// <summary>
         /// 是否删除

+ 3 - 3
OASystem/OASystem.Domain/Entities/Groups/Grp_CarTouristGuideGroundReservations.cs

@@ -51,7 +51,7 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// Bus描述
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(1000)")]
         public string BusDescription { get; set; }
 
         /// <summary>
@@ -75,7 +75,7 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// 服务描述
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(1000)")]
         public string ServiceDescription { get; set; }
         /// <summary>
         /// 服务报价
@@ -90,7 +90,7 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// 报价说明
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(1000)")]
         public string QuotedPriceExplanation { get; set; }
         /// <summary>
         /// 公转私转标识

+ 8 - 1
OASystem/OASystem.Domain/Entities/Groups/Grp_DelegationInfo.cs

@@ -141,8 +141,15 @@ namespace OASystem.Domain.Entities.Groups
         /// <summary>
         /// 手机号
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(500)")]
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(300)")]
         public string TellPhone { get; set; }
+
+
+        /// <summary>
+        /// 微信号
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "varchar(300)")]
+        public string WeChatNo { get; set; }
         /// <summary>
         /// 团组客户级别
         /// 数据类型外键

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

@@ -274,6 +274,7 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
         public string CostTypeendTime { get; set; }
+
         /// <summary>
         /// 此段人数
         /// </summary>

+ 2 - 1
OASystem/OASystem.Domain/Entities/Groups/Grp_GroupsTaskAssignment.cs

@@ -35,8 +35,9 @@ namespace OASystem.Domain.Entities.Groups
 
         /// <summary>
         /// 启用标识
+        /// 默认启用  1 
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
-        public int IsEnable { get; set; }
+        public int IsEnable { get; set; } = 1;
     }
 }

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

@@ -346,6 +346,12 @@ namespace OASystem.Domain.ViewModels.Groups
         /// 手机号
         /// </summary>
         public string? TellPhone { get; set; }
+
+        /// <summary>
+        /// 微信号
+        /// </summary>
+        public string WeChatNo { get; set; }
+
         /// <summary>
         /// op提成等级
         /// </summary>

+ 1 - 0
OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostView.cs

@@ -1,4 +1,5 @@
 using OASystem.Domain.Entities.Groups;
+using OASystem.Domain.ViewModels.Financial;
 using System;
 using System.Collections.Generic;
 using System.Data.SqlTypes;

+ 43 - 0
OASystem/OASystem.Domain/ViewModels/Groups/GroupCostParameterView.cs

@@ -0,0 +1,43 @@
+using OASystem.Domain.Entities.Groups;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Groups
+{
+    /// <summary>
+    /// 团组成本
+    /// Return View
+    /// </summary>
+    public class GroupCostParameterView:Grp_GroupCostParameter
+    {
+    }
+
+    /// <summary>
+    /// 团组成本 模块提示 return View
+    /// </summary>
+    public class GroupCostModulePromptView
+    {
+        public string CurrencyCode { get; set; }
+
+        public decimal Rate { get; set; }
+
+        public List<GroupCostModulePromptInfo> ModulePromptInfos { get; set; }
+    }
+
+    public class GroupCostModulePromptInfo
+    {
+        /// <summary>
+        /// 分段成本 A B
+        /// </summary>
+        public string CostType { get; set; }
+
+        public string CostTypeStartTime { get; set; }
+        public string CostTypeEndTime { get; set; }
+        public int CostTypeNumber { get; set; }
+
+        public object Data { get; set; }
+    }
+}

+ 1 - 1
OASystem/OASystem.Domain/ViewModels/System/MessageView.cs

@@ -13,7 +13,7 @@ namespace OASystem.Domain.ViewModels.System
 
     public class MessageUnreadTotalCountView
     {
-        public int UnreadCount { get; set; }
+        public int UnreadCount { get; set; } = 0;
     }
 
     /// <summary>

+ 4 - 17
OASystem/OASystem.Infrastructure/Repositories/Financial/PaymentRefundAndOtherMoneyRepository.cs

@@ -134,24 +134,11 @@ namespace OASystem.Infrastructure.Repositories.Financial
         {
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3)  //1 Web 2 Android 3 Ios
             {
-                dynamic _currencyData = null, _payTypeData = null;
-                Result currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种类型
-                if (currencyData != null)
-                {
-                    if (currencyData.Code == 0)
-                    {
-                        _currencyData = currencyData.Data;
-                    }
-                }
 
-                Result payTypeData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //支付类型
-                if (payTypeData != null)
-                {
-                    if (payTypeData.Code == 0)
-                    {
-                        _payTypeData = payTypeData.Data;
-                    }
-                }
+                var  setDatas = _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToList();
+                dynamic _currencyData = null, _payTypeData = null;
+                _currencyData = setDatas.Where(it => it.STid == 66).Select(it => new { it.Id, it.Name, it.Remark }); //币种类型
+                _payTypeData = setDatas.Where(it => it.STid == 14).Select(it => new { it.Id, it.Name, it.Remark }); //支付类型
 
                 List<dynamic> _priceTypeDatas = new List<dynamic>();
                 _priceTypeDatas.Add(new { Id = 0, Name = "其他", Remark = "" });

+ 23 - 14
OASystem/OASystem.Infrastructure/Repositories/Groups/DelegationInfoRepository.cs

@@ -262,7 +262,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,OpRoyaltyLv,OpRoyaltyRemark,Officialneeds
+	                                                ZZSCBMMC,ZZSCSPWH,Remark,TellPhone,WeChatNo,OpRoyaltyLv,OpRoyaltyRemark,Officialneeds
                                              From Grp_DelegationInfo Where Id = {0} And IsDel = 0", dto.Id);
 
                 var _DelegationInfo = await _sqlSugar.SqlQueryable<DelegationInfoWebView>(sql).FirstAsync();
@@ -404,26 +404,36 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     dynamic? userData1 = null;
                     string userSql = string.Format(@"Select Id,CnName From  Sys_Users Where IsDel = {0}", 0);
-                    var userData = await _sqlSugar.SqlQueryable<UserNameView>(userSql).ToListAsync(); ;
+                    var userData = await _sqlSugar.SqlQueryable<UserNameView>(userSql).ToListAsync(); 
                     if (userData.Count > 0)
                     {
                         userData1 = userData;
                     }
 
+                    //客户单位数据源 来源市场客户资料
+                    dynamic? clientData1 = null;
+                    string clientSql = $@"Select Client,Contact,Telephone,WeChat From Crm_NewClientData Where IsDel = 0";
+                    var clientData = await _sqlSugar.SqlQueryable<Crm_NewClientData>(clientSql).ToListAsync();
+                    if (clientData.Count > 0)
+                    {
+                        clientData1 = clientData.Select(it => new { it.Client,it.Contact,it.Telephone,it.Wechat }).ToList();
+                    }
+
                     result.Code = 0;
                     result.Msg = "成功!";
                     result.Data = new
                     {
                         teamTypeData = teamTypeData1,
                         teamLevData = teamLevData1,
-                        userData = userData1
+                        userData = userData1,
+                        clientData = clientData1
                     };
                 }
             }
-            catch (Exception)
+            catch (Exception ex)
             {
 
-                throw;
+                result.Msg = ex.Message;
             }
 
 
@@ -435,13 +445,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
-        public async Task<Result> GroupOperation(GroupOperationDto dto)
+        public async Task<Result>GroupOperation(GroupOperationDto dto)
         {
             Result result = new Result() { Code = -2, Msg = "未知错误" };
 
             if (dto.PortType == 1 || dto.PortType == 2 || dto.PortType == 3) //web
             {
-
                 #region 添加出访起止时间
                 var startTime = new DateTime();
                 var endTime = new DateTime();
@@ -451,15 +460,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 }
                 #endregion
 
-
                 if (dto.Status == 1) //添加
                 {
                     string selectSql = string.Format(@"Select * From Grp_DelegationInfo 
-                                                   Where IsDel = 0 
-                                                   And TeamName = '{0}'
-                                                   And ClientName = '{1}'
-                                                   And ClientUnit ='{2}'
-                                                   And VisitDate ='{3}'",dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
+                                                       Where IsDel = 0 
+                                                       And TeamName = '{0}'
+                                                       And ClientName = '{1}'
+                                                       And ClientUnit ='{2}'
+                                                       And VisitDate ='{3}'",dto.TeamName, dto.ClientName, dto.ClientUnit, dto.VisitDate);
                     var selectGroupInfo = await _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).FirstAsync();
                     if (selectGroupInfo != null)
                     {
@@ -469,7 +477,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     //string teamCodeSql = string.Format("Select SalesQuoteNo From Grp_DelegationInfo");
                     //var teamCodeItem = await _sqlSugar.SqlQueryable<TeamCodeView>(teamCodeSql).ToListAsync();
-
                     //string SalesQuoteNo = "";
                     //while (true)
                     //{
@@ -510,6 +517,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         Remark = dto.Remark,
                         JietuanOperator = dto.UserId,
                         TellPhone = dto.TellPhone,
+                        WeChatNo = dto.WeChatNo,
                         CGRWSPBMMC = dto.CGRWSPBMMC,
                         CGRWSPWH = dto.CGRWSPWH,
                         ZZSCBMMC = dto.ZZSCBMMC,
@@ -573,6 +581,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         Remark = dto.Remark,
                         JietuanOperator = dto.JietuanOperator,
                         TellPhone = dto.TellPhone,
+                        WeChatNo = dto.WeChatNo,
                         CGRWSPBMMC = dto.CGRWSPBMMC,
                         CGRWSPWH = dto.CGRWSPWH,
                         ZZSCBMMC = dto.ZZSCBMMC,

+ 0 - 4
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -261,10 +261,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
             else result.Msg = ErrorMsg.Error_Port_Msg;
 
-
-
-
-
             return result;
         }
     }

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/TaskAssignmentRepository.cs

@@ -30,7 +30,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             {
                 //团组下拉框
                 List<dynamic> _DelegationInfos = new List<dynamic>();
-                List<Grp_DelegationInfo> grp_DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(a => a.IsDel == 0 && a.TourCode != "" && a.IsState == 0).ToList();
+                List<Grp_DelegationInfo> grp_DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(a => a.IsDel == 0 && a.TourCode != "" && a.IsState == 0).OrderByDescending(s => s.Id).ToList();
                 foreach (var Item in grp_DelegationInfos)
                 {
                     var data = new

+ 3 - 17
OASystem/OASystem.Infrastructure/Repositories/System/MessageRepository.cs

@@ -271,24 +271,10 @@ namespace OASystem.Infrastructure.Repositories.System
         public async Task<int> GetUnReadCount(int userId)
         {
             int _unReadCount = 0;
+            string msgSqlWhere = $"Select COUNT(*) As UnreadCount From  Sys_MessageReadAuth  smra Left Join Sys_Message sm On sm.Id = smra.MsgId Where IsRead = 0 And smra.IsDel = 0 And sm.IsDel = 0 And ReadableUId = {userId}";
+            var _readableMsg = _sqlSugar.SqlQueryable<MessageUnreadTotalCountView>(msgSqlWhere).First();
 
-
-            string msgSqlWhere = string.Format(@"Select sm.Id,sm.Type,sm.Title,sm.Content,sd.DepName issuerDep,su.CnName issuerUser, 
-                                                            sm.ReleaseTime,smra.Id AuthId,smra.ReadableUId,smra.IsRead,smra.ReadTime 
-                                                     From Sys_Message sm 
-                                                     Inner Join Sys_MessageReadAuth smra On sm.Id = smra.MsgId
-                                                     Inner Join Sys_Users su On sm.IssuerId = su.Id
-                                                     Inner Join Sys_Department sd On su.DepId = sd.Id
-                                                     Inner Join Sys_Users suAuth On smra.ReadableUId = suAuth.Id
-                                                     Where sm.IsDel = 0
-                                                     And smra.IsDel = 0 
-                                                     And smra.ReadableUId = {0}
-                                                     Order By ReleaseTime Desc ", userId);
-            var _readableMsgList = await _sqlSugar.SqlQueryable<ReadbleMessageView1>(msgSqlWhere).ToListAsync();
-            if (_readableMsgList.Count > 0)
-            {
-                _unReadCount = _readableMsgList.Where(it => it.IsRead == 0).Count();
-            }
+            _unReadCount = _readableMsg.UnreadCount;
 
             return _unReadCount;
         }

+ 1 - 1
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 ");
+                                                      Inner Join Sys_JobPost sjp On su.JobPostId = sjp.Id Where su.IsDel = 0");
                 var _userList = await _sqlSugar.SqlQueryable<UserInfoWebView>(userSqlWhere).ToListAsync();
 
                 if (_userList.Count != 0)