From b3b54f994b5f17b850413c6398e63e25744635e9 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 26 十一月 2021 08:51:37 +0800
Subject: [PATCH] 提交

---
 zhengcaioa/Services/ExpertService.cs                         |    4 ++--
 zhengcaioa/zhengcaioa/Views/SysCode/Editzhuanjiaquyu.cshtml  |    2 +-
 zhengcaioa/zhengcaioa/Views/Expert/Indexziliao.cshtml        |   13 +++++++------
 zhengcaioa/DTO/SysCodeDTO.cs                                 |    5 +++++
 zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs |    3 ++-
 zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs       |    1 +
 zhengcaioa/Services/SysCodeService.cs                        |   16 ++++++++++++++++
 zhengcaioa/zhengcaioa/Views/SysCode/Indexzhuanjiaquyu.cshtml |    2 +-
 8 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/zhengcaioa/DTO/SysCodeDTO.cs b/zhengcaioa/DTO/SysCodeDTO.cs
index 3e5adbb..4f4d09a 100644
--- a/zhengcaioa/DTO/SysCodeDTO.cs
+++ b/zhengcaioa/DTO/SysCodeDTO.cs
@@ -45,6 +45,11 @@
 
         public string WentiId { set; get; }
 
+        /// <summary>
+        /// 鎺掑簭
+        /// </summary>
+        public string Sort { set; get; }
+
     }
 
     public class SysCodeSearchEntity : SearchEntity
diff --git a/zhengcaioa/Services/ExpertService.cs b/zhengcaioa/Services/ExpertService.cs
index e24376f..9ac0256 100644
--- a/zhengcaioa/Services/ExpertService.cs
+++ b/zhengcaioa/Services/ExpertService.cs
@@ -293,11 +293,11 @@
             }
             if (!string.IsNullOrEmpty(searchEntity.CertiNumber))
             {
-                query = query.Where(m => m.CertiNumber.Contains(searchEntity.CertiNumber)).ToList();
+                query = query.Where(m => m.CertiNumber != null && m.CertiNumber.Contains(searchEntity.CertiNumber)).ToList();
             }
             if (!string.IsNullOrEmpty(searchEntity.Phone1))
             {
-                query = query.Where(m => m.Phone1.Contains(searchEntity.Phone1)).ToList();
+                query = query.Where(m => m.Phone1 != null &&  m.Phone1.Contains(searchEntity.Phone1)).ToList();
             }
             if (!string.IsNullOrEmpty(searchEntity.Creater))
             {
diff --git a/zhengcaioa/Services/SysCodeService.cs b/zhengcaioa/Services/SysCodeService.cs
index c838a9f..59459b6 100644
--- a/zhengcaioa/Services/SysCodeService.cs
+++ b/zhengcaioa/Services/SysCodeService.cs
@@ -406,6 +406,11 @@
                             select a
                              ).OrderBy(x=>x.Sort).ToList();
 
+            if (!string.IsNullOrEmpty(searchEntity.Sort))
+            {
+                listCode = listCode.OrderBy(x => x.CodeSn).ToList();
+            }
+
             //if (searchEntity.totalrows == 0)
             //{
                 //鑾峰彇鎬绘暟
@@ -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))
                 {
diff --git a/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs b/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs
index c781cd9..e4e68ec 100644
--- a/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs
@@ -119,7 +119,8 @@
 
             ViewBag.users = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList();
             ViewBag.YearJiou = _liaotianService.GetSYScode("experts", "year_jiou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
-            ViewBag.Createtime = DateTime.Now.ToString("yyyy-MM-dd"); ;
+            ViewBag.Createtime = DateTime.Now.ToString("yyyy-MM-dd");
+            ViewBag.Createtimebe = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd"); 
             return View();
         }
 
diff --git a/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs b/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs
index ee94a1c..f1af035 100644
--- a/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs
+++ b/zhengcaioa/zhengcaioa/Controllers/SysCodeController.cs
@@ -493,6 +493,7 @@
             //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
             searchEntity.CodeTable = "experts";
             searchEntity.CodeField = "City";
+            searchEntity.Sort = "CodeSn";
             return new JsonResult(_sysCodeService.SearchSysCodeDtlPaging(searchEntity));
         }
 
diff --git a/zhengcaioa/zhengcaioa/Views/Expert/Indexziliao.cshtml b/zhengcaioa/zhengcaioa/Views/Expert/Indexziliao.cshtml
index cb8adec..6a821e1 100644
--- a/zhengcaioa/zhengcaioa/Views/Expert/Indexziliao.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/Expert/Indexziliao.cshtml
@@ -13,7 +13,8 @@
         var users = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.users))';
         var YearJiou = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.YearJiou))';
         var Createtime = '@Html.Raw(ViewBag.Createtime)';
-        
+         var Createtimebe = '@Html.Raw(ViewBag.Createtimebe)';
+
         loseherght = 60;
         gridConfig = { multiselect: true, selectcol: "Id" };
         dataCol = [
@@ -42,7 +43,7 @@
             { label: '淇敼鏃堕棿', name: 'Modifytime', labtype: 'txt', hidden: true }
 
         ];
-        dataUrl = "/Expert/GetList?Province=510000&City=510100";
+        dataUrl = "/Expert/GetList?Province=510000&City=510100&Createtime=" + Createtimebe + "|" + Createtime;
         searchCol = [
             { label: '鐪�', name: 'Province', labtype: 'combox', hidden: false, data: JSON.parse(Province), cwidth: '5%', cccwidth: '6.5%' },
             { label: '甯�', name: 'City', labtype: 'combox', hidden: false, data: JSON.parse('[]'), cwidth: '1%', cccwidth: '7%' },
@@ -213,13 +214,13 @@
                 error: function () { }
             });
 
-           
+
             $("#PBSCreatetimeend").val(Createtime);
 
-             
-          
+            $("#PBSCreatetimestart").val(Createtimebe);
 
-         
+
+
 
         });
     </script>
diff --git a/zhengcaioa/zhengcaioa/Views/SysCode/Editzhuanjiaquyu.cshtml b/zhengcaioa/zhengcaioa/Views/SysCode/Editzhuanjiaquyu.cshtml
index ee2502c..c7e3b8a 100644
--- a/zhengcaioa/zhengcaioa/Views/SysCode/Editzhuanjiaquyu.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/SysCode/Editzhuanjiaquyu.cshtml
@@ -131,7 +131,7 @@
 
                                         </div>
                                     </div>
-                                    <div class="clearfix layer-area" style="padding-bottom:15px;">
+                                    <div class="clearfix layer-area" style="padding-bottom:15px;display:none;" >
                                         <label class="text-right col-sm-1 col-md-1 control-label">鎺掑簭</label>
                                         <div class="col-sm-2 col-md-2" style="width:5%;">
                                             <input class="form-control" label="鎺掑簭" id="Sort" name="Sort" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="flase" type="text" value="@Model.Sort" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
diff --git a/zhengcaioa/zhengcaioa/Views/SysCode/Indexzhuanjiaquyu.cshtml b/zhengcaioa/zhengcaioa/Views/SysCode/Indexzhuanjiaquyu.cshtml
index 70190b8..69dd9b0 100644
--- a/zhengcaioa/zhengcaioa/Views/SysCode/Indexzhuanjiaquyu.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/SysCode/Indexzhuanjiaquyu.cshtml
@@ -17,7 +17,7 @@
 
             },
             {
-                label: '鎺掑簭', name: 'Sort', labtype: 'txt', hidden: false, width: 50,
+                label: '鎺掑簭', name: 'Sort', labtype: 'txt', hidden: true, width: 50,
 
             },
             {

--
Gitblit v1.9.1