Browse Source

部分代码修改

yuanrf 11 months ago
parent
commit
afb3148da8

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

@@ -111,7 +111,8 @@ namespace OASystem.API.Controllers
 
             if (msgData.Code != 0)
             {
-                return Ok(JsonView(false, msgData.Msg));
+
+                return Ok(JsonView(400, msgData.Msg, new string[0]));
             }
 
             return Ok(JsonView(msgData.Data));

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

@@ -143,6 +143,11 @@ namespace OASystem.Domain.Dtos.Groups
         /// 创建人Id
         /// </summary>
         public int CreateUserId { get; set; }
+
+        /// <summary>
+        /// 选中的列
+        /// </summary>
+        public List<string> SelectCheck { get; set; }
     }
     public class OPContentList
     {

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

@@ -97,5 +97,11 @@ namespace OASystem.Domain.Entities.Groups
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int OrbitalPrivateTransfer{get;set; }
+
+        /// <summary>
+        /// 选中的复选框
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "选中的复选框", ColumnDataType = "nvarchar(1000)")]
+        public string SelectCheck { get; set; }
     }
 }

+ 26 - 14
OASystem/OASystem.Infrastructure/Repositories/Groups/CarTouristGuideGroundRepository.cs

@@ -251,29 +251,38 @@ namespace OASystem.Infrastructure.Repositories.Groups
                      {"翻译费", "I/F"},
                 };
 
-                //获取成本选中
-                var checkTopArr = _checkRep.GetCheckBoxsByDiid(grpCarOp.DiId);
                 var checkedItem = new List<string>();
-                if (checkTopArr.Count > 0)
+
+                if (string.IsNullOrWhiteSpace(grpCarOp.SelectCheck))
                 {
-                    var FindTop = checkTopArr.Find(x => x.CbType == "Top");
-                    if (FindTop != null)
+                    //获取成本选中
+                    var checkTopArr = _checkRep.GetCheckBoxsByDiid(grpCarOp.DiId);
+                    if (checkTopArr.Count > 0)
                     {
-                        var selectName = FindTop.CbValues.Split(',').ToList<string>();
-                        foreach (var soureKey in soureDic.Keys)
+                        var FindTop = checkTopArr.Find(x => x.CbType == "Top");
+                        if (FindTop != null)
                         {
-                            var find =  selectName.Find(x => x == soureDic[soureKey]);
-                            if (find == null)
-                            {
-                                var Lindex =  carTouristGuides.FindIndex(x=>x.SidName == soureKey);
-                                //carTouristGuides.RemoveRange(Lindex, day + 1);
-                            } else
+                            var selectName = FindTop.CbValues.Split(',').ToList<string>();
+                            foreach (var soureKey in soureDic.Keys)
                             {
-                                checkedItem.Add(soureKey);
+                                var find = selectName.Find(x => x == soureDic[soureKey]);
+                                if (find == null)
+                                {
+                                    var Lindex = carTouristGuides.FindIndex(x => x.SidName == soureKey);
+                                    //carTouristGuides.RemoveRange(Lindex, day + 1);
+                                }
+                                else
+                                {
+                                    checkedItem.Add(soureKey);
+                                }
                             }
                         }
                     }
                 }
+                else
+                {
+                    checkedItem = grpCarOp.SelectCheck.Split(",").ToList<string>();
+                }
 
                 var data = new
                 {
@@ -606,6 +615,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
                     CId = dto.Currency,
                     ServiceQuotedPrice = c.PayMoney,
                     OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer,
+                    SelectCheck = string.Join(',', dto.SelectCheck)
+
                 }).ExecuteCommandAsync();
 
                 if (CarTouristGuideCTable == 0)
@@ -618,6 +629,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             }
             catch (Exception ex)
             {
+                RollbackTran();
                 return result = new Result() { Code = -2, Msg = "未知错误" };
             }
             return result;