Selaa lähdekoodia

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

leiy 2 vuotta sitten
vanhempi
commit
e0f7d582e8
23 muutettua tiedostoa jossa 409 lisäystä ja 85 poistoa
  1. 5 3
      OASystem/EntitySync/Program.cs
  2. 1 1
      OASystem/OASystem.Api/Controllers/BusinessController.cs
  3. 73 27
      OASystem/OASystem.Api/Controllers/ResourceController.cs
  4. 0 32
      OASystem/OASystem.Api/Controllers/SystemController.cs
  5. 3 3
      OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs
  6. 8 0
      OASystem/OASystem.Api/Program.cs
  7. 11 0
      OASystem/OASystem.Domain/Dtos/Resource/ThreeCodeDto.cs
  8. 41 0
      OASystem/OASystem.Domain/Entities/Business/Bus_ConfItemInfo.cs
  9. 24 0
      OASystem/OASystem.Domain/Entities/Business/Bus_ConfItemListInfo.cs
  10. 3 3
      OASystem/OASystem.Domain/Enums/GrpScheduleEnum.cs
  11. 13 0
      OASystem/OASystem.Domain/ViewModels/Business/Bus_ConfItemListView.cs
  12. 2 1
      OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleCombinView.cs
  13. 1 0
      OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleDetailView.cs
  14. 26 0
      OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleView.cs
  15. 6 0
      OASystem/OASystem.Domain/ViewModels/Resource/HotelDataView.cs
  16. 13 0
      OASystem/OASystem.Domain/ViewModels/Resource/SetDataTypeView.cs
  17. 5 0
      OASystem/OASystem.Domain/ViewModels/Resource/ThreeCodeView.cs
  18. 35 3
      OASystem/OASystem.Infrastructure/Repositories/Groups/GrpScheduleRepository.cs
  19. 1 0
      OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs
  20. 1 0
      OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs
  21. 1 0
      OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs
  22. 24 0
      OASystem/OASystem.Infrastructure/Repositories/Resource/SetDataTypeRepository.cs
  23. 112 12
      OASystem/OASystem.Infrastructure/Repositories/Resource/ThreeCodeRepository.cs

+ 5 - 3
OASystem/EntitySync/Program.cs

@@ -1,4 +1,5 @@
 using OASystem.Domain.Entities;
+using OASystem.Domain.Entities.Business;
 using OASystem.Domain.Entities.Customer;
 using OASystem.Domain.Entities.Groups;
 using OASystem.Domain.Entities.Resource;
@@ -83,11 +84,12 @@ db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
     //typeof(Crm_DeleClient)
     //typeof(Crm_NewClientData)
 
-    typeof(Crm_ClientDataAndUser),
-    typeof(Crm_ClientDataAndBusiness),
+    //typeof(Crm_ClientDataAndUser),
+    //typeof(Crm_ClientDataAndBusiness),
     
     //typeof(Res_ItemDetailInfo),
     //typeof(Res_ItemVendor)
-    typeof(Res_CountryFeeCost)
+    typeof(Bus_ConfItemInfo)
+    //typeof(Res_CountryFeeCost)
 });
 Console.WriteLine("数据库结构同步完成!");

+ 1 - 1
OASystem/OASystem.Api/Controllers/BusinessController.cs

@@ -51,7 +51,7 @@ namespace OASystem.API.Controllers
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> PostConfItemList(int ConfId)
         {
-
+            
 
             return Ok(JsonView(false));
         }

+ 73 - 27
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -19,10 +19,12 @@ namespace OASystem.API.Controllers
         private readonly ResItemInfoRepository _resItemInfoRep;
         private readonly SetDataRepository _setDataRepository;
         private readonly CountryFeeRepository _countryFeeRep;
+        private readonly SetDataTypeRepository _setDataTypeRep;
 
         public ResourceController(IMapper mapper, IConfiguration config, CarDataRepository carDataRep,
             LocalGuideDataRepository localGuideDataRep, ThreeCodeRepository threeCodeRep,
-            HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository, CountryFeeRepository countryFeeRep)
+            HotelDataRepository hotelDataRep, ResItemInfoRepository resItemInfoRep, SetDataRepository setDataRepository,
+            CountryFeeRepository countryFeeRep, SetDataTypeRepository setDataTypeRep)
         {
             _mapper = mapper;
             _config = config;
@@ -33,8 +35,14 @@ namespace OASystem.API.Controllers
             _resItemInfoRep = resItemInfoRep;
             _setDataRepository = setDataRepository;
             _countryFeeRep = countryFeeRep;
+            _setDataTypeRep = setDataTypeRep;
         }
         #region 数据类型资料
+        /// <summary>
+        /// 根据类型查询数据
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> QuerySetData(SetDataDto dto)
@@ -58,6 +66,31 @@ namespace OASystem.API.Controllers
                 throw;
             }
         }
+        /// <summary>
+        /// 数据类型大全
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QuerySetDataType(DtoBase dto)
+        {
+            try
+            {
+                var setDataType = _setDataTypeRep.QueryDto<Sys_SetDataType, SetDataTypeView>().ToList();
+                if (setDataType.Count==0)
+                {
+                    return Ok(JsonView(false, "暂无数据!"));
+                }
+                setDataType = setDataType.OrderByDescending(s => s.CreateTime).ToList();
+                return Ok(JsonView(true, "查询成功!", setDataType));
+            }
+            catch (Exception)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
         #endregion
 
         #region 车公司资料板块
@@ -394,40 +427,19 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> QueryThreeCode(DtoBase dto)
+        public async Task<IActionResult> QueryThreeCode(QueryThreeCodeDto dto)
         {
             try
             {
-                if (dto.PortType == 1)
-                {
-                    var ThreeCode = _localGuideDataRep.QueryDto<Res_ThreeCode, ThreeCodeView>().ToList();
-                    if (ThreeCode.Count == 0)
-                    {
-                        return Ok(JsonView(false, "暂无数据!"));
-                    }
-                    ThreeCode = ThreeCode.OrderByDescending(s => s.CreateTime).ToList();
-                    return Ok(JsonView(true, "查询成功", ThreeCode));
-                }
-                else if (dto.PortType == 2)
+                Result LocalGuide = await _ThreeCodeRep.QueryThreeCode(dto);
+                if (LocalGuide.Code == 0)
                 {
-                    //分页写法
-                    if (dto.PageIndex == 0 || dto.PageSize == 0)
-                    {
-                        return Ok(JsonView(false, "请传入PageIndex和PageSize参数"));
-                    }
-                    JsonView _ThreeCode = await _ThreeCodeRep.QuerThreeCode(dto.PageIndex, dto.PageSize);
-                    if (_ThreeCode.Code != 0)
-                    {
-                        return Ok(JsonView(false, _ThreeCode.Msg));
-                    }
-
-                    return Ok(_ThreeCode);
+                    return Ok(JsonView(true, "查询成功", LocalGuide.Data));
                 }
                 else
                 {
-                    return Ok(JsonView(false, "请传入PortType参数!1:Web,2:Android,3:IOS"));
+                    return Ok(JsonView(false, LocalGuide.Msg));
                 }
-
             }
             catch (Exception ex)
             {
@@ -437,6 +449,40 @@ namespace OASystem.API.Controllers
 
 
         }
+        /// <summary>
+        /// 机场三字码数据城市下拉框数据
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
+        public async Task<IActionResult> QueryThreeCodeSelect()
+        {
+            try
+            {
+                var ThreeCode = _carDataRep.QueryDto<Res_ThreeCode, ThreeCodeSelectView>().ToList();
+                if (ThreeCode.Count == 0)
+                {
+                    return Ok(JsonView(false, "暂无数据!"));
+                }
+                ThreeCode.Add(new ThreeCodeSelectView { Id = 0, City = "全部" });
+                ThreeCode = ThreeCode.Where((x, i) => ThreeCode.FindIndex(z => z.City == x.City && z.City != "") == i).ToList();
+                ThreeCode = ThreeCode.OrderBy(x => x.Id).ToList();
+                List<ThreeCodeSelectView> data = new List<ThreeCodeSelectView>();
+                foreach (ThreeCodeSelectView _ThreeCode in ThreeCode)
+                {
+                    if (!string.IsNullOrWhiteSpace(_ThreeCode.City))
+                    {
+                        data.Add(_ThreeCode);
+                    }
+                }
+                return Ok(JsonView(true, "查询成功", data));
+            }
+            catch (Exception)
+            {
+                return Ok(JsonView(false, "程序错误!"));
+                throw;
+            }
+        }
 
         /// <summary>
         /// 机场三字码资料操作(Status:1.新增,2.修改)

+ 0 - 32
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -134,39 +134,7 @@ namespace OASystem.API.Controllers
         }
         #endregion
 
-        #region 类型表
-        /// <summary>
-        /// 查询类型数据
-        /// </summary>
-        /// <param name="dto"></param>
-        /// <returns></returns>
-        [HttpPost]
-        [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> QuerySetData(SetDataDto dto)
-        {
-            try
-            {
-                if (dto.DataType==0)
-                {
-                    return Ok(JsonView(false, "请传类型Id!"));
-                }
-                var setData = _setDataRepository.QueryDto<Sys_SetData, SetDataView>(s=>s.STid==dto.DataType).ToList();
-                if (setData.Count == 0)
-                {
-                    return Ok(JsonView(false, "暂无数据!"));
-                }
-                return Ok(JsonView(true, "查询成功!",setData));
-            }
-            catch (Exception ex)
-            {
-                return Ok(JsonView(false, "程序错误!"));
-                throw;
-            }
-        }
-
        
-        #endregion
-
         #region 企业操作
         /// <summary>
         /// 查询企业数据

+ 3 - 3
OASystem/OASystem.Api/OAMethodLib/GroupStepForDelegation.cs

@@ -48,7 +48,7 @@ namespace OASystem.API.OAMethodLibs
                 _primary.Leader = _groupConfig.Leader;
                 _primary.PrimaryStep = GrpSchedulePrimaryStepEnum.Wait;
                 _primary.Remark = "请设置各流程负责人、预计开始/结束时间";
-                int _primaryId = await _grpScheduleRep.AddAsync(_primary);
+                int _primaryId = await _grpScheduleRep.AddAsyncReturnId(_primary);
                 if (_primaryId > 0)
                 {
                     #region 子流程
@@ -62,7 +62,7 @@ namespace OASystem.API.OAMethodLibs
                     _model.ExpectBeginDt = dftBeginDt;
                     _model.ExpectEndDt = dftEndDt;
                     _model.Remark = "未设置负责人";
-                    _model.ScheduleId = DiId;
+                    _model.ScheduleId = _primaryId;
                     _model.StepStatus = 0;
                     #endregion
                     #region 经费预算
@@ -361,7 +361,7 @@ Where d.Id={0} And u.Id not in({1})", DepartmentCode.IC, _groupConfig.FilterUser
                         foreach (var item in personList)
                         {
                             item.CreateUserId = _groupConfig.DefaultUser;
-                            item.ScheduleId = DiId;
+                            item.ScheduleId = _primaryId;
                         }
                         _grpScheduleRep.bulkInsert(personList);
                     }

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

@@ -49,6 +49,14 @@ builder.Services.AddCors(policy =>
 #endregion
 
 #region ÉÏ´«Îļþ 
+//builder.Services.AddCors(policy =>
+//{
+//    policy.AddPolicy("Cors", opt => opt
+//    .AllowAnyOrigin()
+//    .AllowAnyHeader()
+//    .AllowAnyMethod()
+//    .WithExposedHeaders("X-Pagination"));
+//});
 
 builder.Services.Configure<FormOptions>(options =>
 {

+ 11 - 0
OASystem/OASystem.Domain/Dtos/Resource/ThreeCodeDto.cs

@@ -6,6 +6,17 @@ using System.Threading.Tasks;
 
 namespace OASystem.Domain.Dtos.Resource
 {
+    public class QueryThreeCodeDto:DtoBase
+    {
+        /// <summary>
+        /// 三字码
+        /// </summary>
+        public string Three { get; set; }
+        /// <summary>
+        /// 城市
+        /// </summary>
+        public string City { get; set; }
+    }
     public class ThreeCodeOperationDto
     {
         /// <summary>

+ 41 - 0
OASystem/OASystem.Domain/Entities/Business/Bus_ConfItemInfo.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Business
+{
+    /// <summary>
+    /// 会务采购物品
+    /// </summary>
+    [SugarTable("Bus_ConfItem")]
+    public class Bus_ConfItemInfo : EntityBase
+    {
+        /// <summary>
+        /// 物料编号
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ItemId { get; set; }
+        /// <summary>
+        /// 清单Id
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int ConfListId { get; set; }
+        /// <summary>
+        /// 采购数量
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Count { get; set; }
+        /// <summary>
+        /// 本次采购金额
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(9,2)")]
+        public decimal CurrCost { get; set; }
+        /// <summary>
+        /// 操作备注
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "nvarchar(500)")]
+        public string OpRemark { get; set; }
+    }
+}

+ 24 - 0
OASystem/OASystem.Domain/Entities/Business/Bus_ConfItemListInfo.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Entities.Business
+{
+    [SugarTable("Bus_ConfItemList")]
+    public class Bus_ConfItemListInfo : EntityBase
+    {
+        /// <summary>
+        /// 团组(会议)编号
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int Diid { get; set; }
+        /// <summary>
+        /// 总计成本
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
+        public decimal TotalCost { get; set; }
+
+    }
+}

+ 3 - 3
OASystem/OASystem.Domain/Enums/GrpScheduleEnum.cs

@@ -15,13 +15,13 @@ namespace OASystem.Domain.Enums
         /// <summary>
         /// 未开始/等待任务分配 I
         /// </summary>
-        [Description("未开始/等待任务分配")]
+        [Description("团组出行")]
         Wait = 0,
 
         /// <summary>
-        /// 确认出团/任务分配 I
+        /// 确认出团/任务分配完成 I
         /// </summary>
-        [Description("确认出团/任务分配完成")]
+        [Description("确认出团")]
         Confirm = 1,
 
         #region 经费预算

+ 13 - 0
OASystem/OASystem.Domain/ViewModels/Business/Bus_ConfItemListView.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Business
+{
+    public class Bus_ConfItemListView
+    {
+        public int MyProperty { get; set; }
+    }
+}

+ 2 - 1
OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleCombinView.cs

@@ -9,7 +9,8 @@ namespace OASystem.Domain.ViewModels.Groups
     public class Grp_ScheduleCombinView
     {
         public Grp_ScheduleView Primary { get; set; }
-        public List<Grp_ScheduleDetailView> ChildList { get; set; }
+        //public List<Grp_ScheduleDetailView> ChildList { get; set; }
         public List<Grp_SchedulePersonView> PersonList { get; set; }
+        public List<Grp_ScheduleRootView> RootList { get; set; }
     }
 }

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

@@ -37,6 +37,7 @@ namespace OASystem.Domain.ViewModels.Groups
         public string Remark { get; set; }
         public int Exception { get; set; }
         public int Level { get; set; }
+        public int StepStatus { get; set; }
         public List<Grp_ScheduleDetailView> ChildList { get; set; }
     }
 }

+ 26 - 0
OASystem/OASystem.Domain/ViewModels/Groups/Grp_ScheduleView.cs

@@ -2,6 +2,7 @@
 using OASystem.Domain.Enums;
 using System;
 using System.Collections.Generic;
+using System.Collections.Specialized;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -66,4 +67,29 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public int Exception { get; set; }
     }
+
+    public class Grp_ScheduleRootView
+    {
+        public int Root { get; set; }
+        public string RootName
+        {
+            get
+            {
+                NameValueCollection nvc = EnumHelper.GetNVCFromEnumValue(typeof(GrpSchedulePrimaryStepEnum));
+                string rst = nvc[this.Root.ToString()];
+                if (string.IsNullOrEmpty(rst))
+                {
+                    rst = Root.ToString();
+                }
+                return rst;
+            }
+        }
+        public List<Grp_ScheduleDetailView> ChildList { get; set; }
+        public GrpConfig Config { get; set; }
+    }
+
+    public class GrpConfig
+    {
+        public string backgroundColor { get; set; }
+    }
 }

+ 6 - 0
OASystem/OASystem.Domain/ViewModels/Resource/HotelDataView.cs

@@ -11,7 +11,13 @@ namespace OASystem.Domain.ViewModels.Resource
     {
     }
     public class QueryHotelDataSelect {
+        /// <summary>
+        /// id
+        /// </summary>
         public int Id { get; set; }
+        /// <summary>
+        /// 城市名
+        /// </summary>
         public string City { get; set; }
     }
 

+ 13 - 0
OASystem/OASystem.Domain/ViewModels/Resource/SetDataTypeView.cs

@@ -0,0 +1,13 @@
+using OASystem.Domain.Entities.System;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.ViewModels.Resource
+{
+    public class SetDataTypeView: Sys_SetDataType
+    {
+    }
+}

+ 5 - 0
OASystem/OASystem.Domain/ViewModels/Resource/ThreeCodeView.cs

@@ -10,4 +10,9 @@ namespace OASystem.Domain.ViewModels.Resource
     public class ThreeCodeView:Res_ThreeCode
     {
     }
+    public class ThreeCodeSelectView
+    {
+        public int Id { get; set; }
+        public string City { get; set; }
+    }
 }

+ 35 - 3
OASystem/OASystem.Infrastructure/Repositories/Groups/GrpScheduleRepository.cs

@@ -59,6 +59,29 @@ namespace OASystem.Infrastructure.Repositories.Groups
             #endregion
             _view.Primary = primary;
 
+            #region 主流程节点
+
+            List<Grp_ScheduleRootView> rootList = new List<Grp_ScheduleRootView>()
+            {
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Wait },
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Confirm},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Budget},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Feedback},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Puote},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Visa},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Business},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.CostAudit},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Pay},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Training},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.DropOff},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.PickUp},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Collect},
+                  new Grp_ScheduleRootView() { Root = (int)GrpSchedulePrimaryStepEnum.Finish}
+            };
+
+
+            #endregion
+
             #region 子节点
 
             //子节点
@@ -82,6 +105,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 temp.Remark = item.Remark;
                 temp.Root = item.ParentStep;
                 temp.Step = item.Step;
+                temp.StepStatus = item.StepStatus;
 
                 List<Grp_ScheduleDetailInfo> tempLv3List = LV3List.Where(s => s.ParentStep == item.Step).ToList();
                 List<Grp_ScheduleDetailView> tempChildList = new List<Grp_ScheduleDetailView>();
@@ -101,14 +125,22 @@ namespace OASystem.Infrastructure.Repositories.Groups
                         temp2.Remark = item2.Remark;
                         temp2.Root = item2.ParentStep;
                         temp2.Step = item2.Step;
+                        temp2.StepStatus = item2.StepStatus;
                         tempChildList.Add(temp2);
                     }
                 }
                 temp.ChildList = new List<Grp_ScheduleDetailView>(tempChildList);
+
+
                 childList.Add(temp);
             }
             #endregion
-            _view.ChildList = new List<Grp_ScheduleDetailView>(childList);
+            foreach (var item in rootList)
+            {
+                item.ChildList = new List<Grp_ScheduleDetailView>(childList.Where(s => s.Root == item.Root).ToList());
+            }
+
+            _view.RootList = new List<Grp_ScheduleRootView>(rootList);
 
             #region 流程人员
             List<Grp_SchedulePersonInfo> personEntityList = _sqlSugar.Queryable<Grp_SchedulePersonInfo>().Where(s => s.IsDel != 1 && s.ScheduleId == _dto.ScheduleId).ToList();
@@ -118,7 +150,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 Grp_SchedulePersonView temp = new Grp_SchedulePersonView();
                 temp.JobStr = item.JobStr;
                 temp.PersonId = item.Id;
-                temp.PersonRemark=item.Remark;
+                temp.PersonRemark = item.Remark;
                 temp.SysUserId = item.SysUserId;
                 temp.SysUserName = item.SysUserName;
                 personList.Add(temp);
@@ -143,7 +175,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             return _viewList;
         }
 
-        public void bulkInsert<T>(List<T> list)
+        public void bulkInsert<T>(List<T> list) where T : class, new()
         {
             _sqlSugar.Insertable(list).UseParameter().ExecuteCommand();
         }

+ 1 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/CarDataRepository.cs

@@ -41,6 +41,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 {
                     sqlWhere += string.Format(@" And ContactTel like '%{0}%'", dto.ContactTel);
                 }
+                sqlWhere += string.Format(@" And IsDel={0}", 0);
                 if (!string.IsNullOrEmpty(sqlWhere.Trim()))
                 {
                     Regex r = new Regex("And");

+ 1 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/HotelDataRepository.cs

@@ -101,6 +101,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 {
                     sqlWhere += string.Format(@" And ContactPhone like '%{0}%'", dto.ContactPhone);
                 }
+                sqlWhere += string.Format(@" And IsDel={0}", 0);
                 if (!string.IsNullOrEmpty(sqlWhere.Trim()))
                 {
                     Regex r = new Regex("And");

+ 1 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/LocalGuideDataRepository.cs

@@ -108,6 +108,7 @@ namespace OASystem.Infrastructure.Repositories.Resource
                 {
                     sqlWhere += string.Format(@" And ContactTel like '%{0}%'", dto.ContactTel);
                 }
+                sqlWhere += string.Format(@" And IsDel={0}", 0);
                 if (!string.IsNullOrEmpty(sqlWhere.Trim()))
                 {
                     Regex r = new Regex("And");

+ 24 - 0
OASystem/OASystem.Infrastructure/Repositories/Resource/SetDataTypeRepository.cs

@@ -0,0 +1,24 @@
+using AutoMapper;
+using OASystem.Domain;
+using OASystem.Domain.Dtos.Resource;
+using OASystem.Domain.Entities.Resource;
+using OASystem.Domain.ViewModels.Resource;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Infrastructure.Repositories.Resource
+{
+    public class SetDataTypeRepository: BaseRepository<Sys_SetDataType, SetDataTypeView>
+    {
+        private readonly IMapper _mapper;
+        public SetDataTypeRepository(SqlSugarClient sqlSugar, IMapper mapper) : base(sqlSugar)
+        {
+            _mapper = mapper;
+        }
+     
+    }
+   
+}

+ 112 - 12
OASystem/OASystem.Infrastructure/Repositories/Resource/ThreeCodeRepository.cs

@@ -21,31 +21,131 @@ namespace OASystem.Infrastructure.Repositories.Resource
         /// <param name="PageSize"></param>
         /// <returns></returns>
 
-        public async Task<JsonView> QuerThreeCode(int PageIndex, int PageSize)
+        public async Task<Result> QueryThreeCode(QueryThreeCodeDto dto)
         {
-            JsonView result = new JsonView();
+            Result result = new Result() { Code = -2, Msg = "未知错误" };
             try
             {
-               
-                int totalCount = 0;
-                List<Res_ThreeCode> page = _sqlSugar.Queryable<Res_ThreeCode>().ToPageList(PageIndex, PageSize, ref totalCount);
-                if (page.Count != 0)
+                string sqlWhere = string.Empty;
+                if (!string.IsNullOrWhiteSpace(dto.City))
+                {
+                    sqlWhere += string.Format(@" And City like '%{0}%'", dto.City);
+                }
+                if (!string.IsNullOrWhiteSpace(dto.Three))
+                {
+                    sqlWhere += string.Format(@" And Three like '%{0}%'", dto.Three);
+                }
+                sqlWhere += string.Format(@" And IsDel={0}", 0);
+                if (!string.IsNullOrEmpty(sqlWhere.Trim()))
                 {
-                    result=new JsonView(){Code=200,Msg = "查询成功!",Data = page,Count = totalCount };
+                    Regex r = new Regex("And");
+                    sqlWhere = r.Replace(sqlWhere, "Where", 1);
+                }
+                if (dto.PortType == 1)
+                {
+                    string sql = string.Format(@"select * from Res_ThreeCode  {0}", sqlWhere);
+                    List<Res_ThreeCode> ThreeCode = await _sqlSugar.SqlQueryable<Res_ThreeCode>(sql).ToListAsync();
+                    if (ThreeCode.Count == 0)
+                    {
+                        return result = new Result() { Code = -1, Msg = "暂无数据" };
+                    }
+                    ThreeCode = ThreeCode.OrderByDescending(x => x.CreateTime).ToList();
+
+                    if (dto.PageSize == 0 && dto.PageIndex == 0)
+                    {
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = ThreeCode,
+                        };
+                    }
+                    else
+                    {
+                        int count = ThreeCode.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<Res_ThreeCode> _ThreeCode = new List<Res_ThreeCode>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < ThreeCode.Count)
+                            {
+                                _ThreeCode.Add(ThreeCode[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _ThreeCode },
+                        };
+                    }
+
+                }
+                else if (dto.PortType == 2)
+                {
+                    string sql = string.Format(@"select * from Res_ThreeCode  {0}", sqlWhere);
+                    List<Res_ThreeCode> ThreeCode = await _sqlSugar.SqlQueryable<Res_ThreeCode>(sql).ToListAsync();
+                    if (ThreeCode.Count == 0)
+                    {
+                        return result = new Result() { Code = -1, Msg = "暂无数据" };
+                    }
+                    ThreeCode = ThreeCode.OrderByDescending(x => x.CreateTime).ToList();
+
+                    if (dto.PageSize == 0 && dto.PageIndex == 0)
+                    {
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = ThreeCode,
+                        };
+                    }
+                    else
+                    {
+                        int count = ThreeCode.Count;
+                        float totalPage = (float)count / dto.PageSize;//总页数
+                        if (totalPage == 0) totalPage = 1;
+                        else totalPage = (int)Math.Ceiling((double)totalPage);
+
+                        List<Res_ThreeCode> _ThreeCode = new List<Res_ThreeCode>();
+                        for (int i = 0; i < dto.PageSize; i++)
+                        {
+                            var RowIndex = i + (dto.PageIndex - 1) * dto.PageSize;
+                            if (RowIndex < ThreeCode.Count)
+                            {
+                                _ThreeCode.Add(ThreeCode[RowIndex]);
+                            }
+                            else
+                            {
+                                break;
+                            }
+                        }
+                        return result = new Result()
+                        {
+                            Code = 0,
+                            Msg = "查询成功",
+                            Data = new { pageCount = count, totalPage = (int)totalPage, pageIndex = dto.PageIndex, pageSize = dto.PageSize, pageSource = _ThreeCode },
+                        };
+                    }
                 }
                 else
                 {
-                    result = new JsonView(){ Code = 400, Msg = "查询失败!", Data = page, Count = totalCount };
+                    return result = new Result() { Code = -2, Msg = "请传入PortType参数!1:Web,2:Android,3:IOS" };
                 }
             }
             catch (Exception)
             {
-                result = new JsonView() { Code = 400, Msg = "程序错误!", Data = null, Count = 0 };
+                return result;
                 throw;
             }
-            
-           
-            return result;
         }
 
         /// <summary>