zhengcaioa/Services/ProjectService.cs
@@ -1400,5 +1400,48 @@
            return resultEntity;
        }
        public ResultEntity GetZhengfuProjectDTOByTitle(string Title, string Id, DateTime? NoticeTime)
        {
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = true;
            if(!string.IsNullOrWhiteSpace(Title) && NoticeTime.HasValue)
            {
                var checkUserSn = _webcontext.ZhengfuProjects.Where(x => x.Title == Title && x.RecStatus == "A" && x.Id != Id && x.NoticeTime >= NoticeTime.Value.AddDays(-1) && x.NoticeTime <= NoticeTime.Value.AddDays(1)).FirstOrDefault();
                if (checkUserSn != null && (string.IsNullOrWhiteSpace(Id) || (!string.IsNullOrWhiteSpace(Id) && checkUserSn.Id != Id)))
                {
                    resultEntity.Result = false;
                    resultEntity.Message = "该页面已经存在";
                }
            }
            return resultEntity;
        }
        public ResultEntity saveProjectfasongxiaoxi(Projectfasongxiaoxi project)
        {
            ResultEntity resultEntity = new ResultEntity();
            try
            {
                project.Id = Guid.NewGuid().ToString();
                _context.Projectfasongxiaoxis.Add(project);
                _context.SaveChanges();
                resultEntity.ReturnID = project.Id;
                resultEntity.Result = true;
            }
            catch (Exception ex)
            {
                resultEntity.Result = false;
                resultEntity.Message = "保存失败,请联系管理员";
            }
            return resultEntity;
        }
    }
}