소스 검색

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

LEIYI 1 주 전
부모
커밋
fa8803a1fa

+ 64 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -16087,6 +16087,70 @@ FROM
             return Ok(jw);
         }
 
+        /// <summary>
+        /// 复制团组成本信息
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<IActionResult> CopyGroupCost(CopyGroupCostDto dto)
+        {
+            if (dto.Diid <= 0 || dto.Userid <= 0 || dto.ToGroupId <= 0)
+            {
+                return Ok(JsonView(false,"参数有误!"));
+            }
+
+            #region 复制团组成本
+            dto.Diid = dto.ToGroupId;
+            dto.CheckBoxs.ForEach(x =>
+            {
+                x.Diid = dto.ToGroupId;
+            });
+            dto.GroupCosts.ForEach(x =>
+            {
+                x.Diid = dto.ToGroupId;
+            });
+            dto.CostTypeHotelNumbers.ForEach(x =>
+            {
+                x.Diid = dto.ToGroupId;
+            });
+            dto.GroupCostParameters.ForEach(x =>
+            {
+                x.DiId = dto.ToGroupId;
+            });
+            #endregion
+
+            JsonView jw = null;
+            bool isTrue = false;
+
+            var Grp_groups = _mapper.Map<List<Grp_GroupCost>>(dto.GroupCosts);
+            Grp_groups.ForEach(x => { x.CreateUserId = dto.Userid; x.CreateTime = DateTime.Now; }); //.ToString("yyyy-MM-dd HH:mm:ss")
+            var Grp_CheckBoxs = _mapper.Map<List<Grp_CheckBoxs>>(dto.CheckBoxs);
+            Grp_CheckBoxs.ForEach(x => { x.CreateUserId = dto.Userid; x.CreateTime = DateTime.Now; });
+            var Grp_HotelNumber = _mapper.Map<List<Grp_CostTypeHotelNumber>>(dto.CostTypeHotelNumbers);
+            var Grp_CostParameters = _mapper.Map<List<Grp_GroupCostParameter>>(dto.GroupCostParameters);
+
+            try
+            {
+                _sqlSugar.BeginTran();
+                isTrue = await _GroupCostRepository.
+                    SaveGroupCostList(Grp_groups, dto.Diid, dto.Userid); //列表
+                isTrue = await _checkBoxs.SaveCheckBoxs(Grp_CheckBoxs, dto.Diid); //选中项
+                isTrue = await _CostTypeHotelNumberRepository.SaveHotelNumber(Grp_HotelNumber, dto.Userid, dto.Diid); //酒店房间数量
+                isTrue = await _GroupCostParameterRepository.SaveAsync(Grp_CostParameters, dto.Userid, dto.Diid); //系数
+
+                _sqlSugar.CommitTran();
+                jw = JsonView(true, "保存成功!", isTrue);
+            }
+            catch (Exception)
+            {
+                _sqlSugar.RollbackTran();
+                jw = JsonView(false);
+            }
+
+            return Ok(jw);
+        }
+
         /// <summary>
         /// 司兼导数据
         /// </summary>

+ 2 - 2
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1435,7 +1435,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
 
             var ExcludedKeyStr = new string[] { "快递费" };
             var ClientKeyStr = new string[] { "邀请函翻译" };
-            var columns = "Id,UnitName,Contact";
+            var columns = "Id,UnitName,Contact,City";
 
             try
             {
@@ -1472,7 +1472,7 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                     EncryptionProcessor.DecryptProperties(item);
                 }
                 InvitationOfficialActivityDataList = InvitationOfficialActivityDataList
-                    .WhereIF(!string.IsNullOrWhiteSpace(dto.Country), x => !string.IsNullOrWhiteSpace(x.Country) && x.Country.Contains(dto.Country))
+                    .WhereIF(!string.IsNullOrWhiteSpace(dto.Country), x => (!string.IsNullOrWhiteSpace(x.Country) && x.Country.Contains(dto.Country)) || (!string.IsNullOrWhiteSpace(x.City) && x.City.Contains(dto.Country)))
                     .WhereIF(!string.IsNullOrWhiteSpace(dto.UnitName), x => !string.IsNullOrWhiteSpace(x.UnitName) && x.UnitName.Contains(dto.UnitName))
                     .WhereIF(!string.IsNullOrWhiteSpace(dto.Contact), x => !string.IsNullOrWhiteSpace(x.Contact) && x.Contact.Contains(dto.Contact))
                     .WhereIF(!string.IsNullOrWhiteSpace(dto.Delegation), x => !string.IsNullOrWhiteSpace(x.Delegation) && x.Delegation.Contains(dto.Delegation))

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

@@ -1429,4 +1429,10 @@ namespace OASystem.Domain.Dtos.Groups
         }
     }
 
+
+    public class CopyGroupCostDto : GroupCostSavaDto
+    {
+        public int ToGroupId { get; set; }
+    }
+
 }