leiy 1 年之前
父节点
当前提交
edd0757d0a

+ 26 - 47
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -564,6 +564,7 @@ namespace OASystem.API.Controllers
 
         /// <summary>
         /// 接团流程操作(增改)
+        /// 安卓端使用 建团时添加客户名单
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -600,7 +601,31 @@ namespace OASystem.API.Controllers
                 if (dto.Status == 1) //添加
                 {
                     diId = groupData.Data;
+                    //添加默认币种
                     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)
+                    {
+                        userIds.Add(208);
+                        //创建团组管控
+                        GroupStepForDelegation.CreateWorkStep(diId);
+                        //发送消息
+                        string groupName = dto.TeamName;
+                        string createGroupUser = string.Empty;
+
+                        var userInfo = _usersRep._sqlSugar.Queryable<Sys_Users>().Where(it => it.IsDel == 0 && it.Id == dto.UserId).First();
+                        if (userInfo != null) createGroupUser = userInfo.CnName;
+
+                        string title = $"新建团组";
+                        string content = $"团组[{groupName}(创建人:{createGroupUser})]创建成功,请前往页面进行下一步操作!";
+                        await GeneralMethod.MessageIssueAndNotification(MessageTypeEnum.GroupBusinessOperations, title, content, userIds, diId);
+                    }
                 }
 
 
@@ -632,53 +657,6 @@ namespace OASystem.API.Controllers
             }
         }
 
-        /// <summary>
-        /// 建团添加默认工作人员团组权限测试
-        /// </summary>
-        /// <param name="dto"></param>
-        /// <returns></returns>
-        [HttpPost]
-        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> PostGroupAuthAddInit(int userId, int diId)
-        {
-            try
-            {
-                GeneralMethod.PostGroupAuthAddInit(userId, diId);
-
-                return Ok(JsonView(true));
-            }
-            catch (Exception ex)
-            {
-
-                Logs(ex.Message);
-                return Ok(JsonView(false, ex.Message));
-            }
-        }
-
-
-        /// <summary>
-        /// 建团添加默认币种测试
-        /// </summary>
-        /// <param name="dto"></param>
-        /// <returns></returns>
-        [HttpPost]
-        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> GroupOperation11(int userId, int diId)
-        {
-            try
-            {
-                GeneralMethod.PostGroupRateAddInit(userId, diId);
-
-                return Ok(JsonView(true));
-            }
-            catch (Exception ex)
-            {
-
-                Logs(ex.Message);
-                return Ok(JsonView(false, ex.Message));
-            }
-        }
-
         /// <summary>
         /// 接团信息 操作(删除)
         /// </summary>
@@ -1901,6 +1879,7 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
+        
         /// <summary>
         /// 根据舱位类型查询接团客户名单信息
         /// </summary>

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

@@ -468,7 +468,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                                                        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();
+                    var selectGroupInfo =  _sqlSugar.SqlQueryable<Grp_DelegationInfo>(selectSql).First();
                     if (selectGroupInfo != null)
                     {
                         result.Msg = "数据已存在,请勿重复添加!";
@@ -547,7 +547,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         VisitEndDate = endTime,
                     };
 
-                    var addId = await _sqlSugar.Insertable(delegationInfo).ExecuteReturnIdentityAsync();
+                    var addId = _sqlSugar.Insertable(delegationInfo).ExecuteReturnIdentity();
                     if (addId > 0)
                     {
                         result.Code = 0;