username@email.com
2021-11-29 e9f8d150668099ffe648b7c9ab9df290c3276db8
zhengcaioa/Services/SysCodeService.cs
@@ -33,11 +33,11 @@
                (searchEntity.Comments == "" ? true : s.Comments.Contains(searchEntity.Comments)) &&
                (searchEntity.RecStatus == "" ? s.RecStatus == "A" : s.RecStatus == searchEntity.RecStatus)
                ).ToList();
                if (searchEntity.totalrows == 0)
                {
                //if (searchEntity.totalrows == 0)
                //{
                    //获取总数
                    searchEntity.totalrows = listCode.Count;
                }
                //}
                var list = listCode.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
                var listSysCode = new List<SysCodeEntity>();
                if (list.Count > 0)
@@ -406,11 +406,16 @@
                            select a
                             ).OrderBy(x=>x.Sort).ToList();
            if (searchEntity.totalrows == 0)
            if (!string.IsNullOrEmpty(searchEntity.Sort))
            {
                listCode = listCode.OrderBy(x => x.CodeSn).ToList();
            }
            //if (searchEntity.totalrows == 0)
            //{
                //获取总数
                searchEntity.totalrows = listCode.Count;
            }
            //}
            var list = listCode.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
            var listSysCode = new List<SysCodeDtlEntity>();
@@ -504,6 +509,17 @@
            resultEntity.Result = true;
            try
            {
                if (!string.IsNullOrEmpty(Entity.CodeSn))
                {
                    var list = _context.SysCodeDtls.Where(e => e.CodeSn == Entity.CodeSn && e.RecStatus == "A" && e.Id != Entity.Id && e.CodeId == Entity.CodeId).ToList();
                    if (list.Count > 0)
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "该编码已经存在";
                        return resultEntity;
                    }
                }
                if (!string.IsNullOrEmpty(Entity.Id))
                {