Selaa lähdekoodia

Merge branch 'feature-dgy-设置押金记录' into DuGuYang

DuGuYang 3 vuotta sitten
vanhempi
commit
f08e230971

+ 3 - 44
AppStart/ExcelHelper.cs

@@ -329,6 +329,7 @@ namespace MySystem
                                                                         CreateDate = DateTime.Now,
                                                                         CreateMan = Operator,
                                                                         UserId = store.UserId, //创客
+                                                                        ToUserId = tostore.UserId, //收货创客
                                                                         BrandId = BrandId, //产品类型
                                                                         ChangeRecordNo = ChangeNo, //变更记录单号
                                                                         BizBatchNo = BatchNo, //业务批次号
@@ -343,33 +344,10 @@ namespace MySystem
                                                                         FromDate = DateTime.Now, //出库时间
                                                                         FromRemark = OutNote, //出库备注
                                                                         SourceStoreId = machine.SourceStoreId, //源仓库
+                                                                        ToStoreId = tostore.Id, //收货仓库
                                                                         StoreId = store.Id, //仓库
                                                                     });
 
-                                                                    db.StoreChangeHistory.Add(new StoreChangeHistory()
-                                                                    {
-                                                                        CreateDate = DateTime.Now,
-                                                                        CreateMan = Operator,
-                                                                        UserId = tostore.UserId, //创客
-                                                                        BrandId = BrandId, //产品类型
-                                                                        ChangeRecordNo = ChangeNo, //变更记录单号
-                                                                        BizBatchNo = BatchNo, //业务批次号
-                                                                        TransType = 1, //交易类型
-                                                                        SnNo = SnNo, //SN编号
-                                                                        SnType = machine.PosSnType, //SN机具类型
-                                                                        StockOpDirect = 0, //库存操作方向
-                                                                        DeviceVendor = machine.DeviceName, //设备厂商
-                                                                        DeviceModel = machine.DeviceKind, //设备型号
-                                                                        DeviceType = machine.DeviceType, //设备类型
-                                                                        ToUserId = tostore.UserId, //收货创客
-                                                                        ToStoreId = tostore.Id, //创客退货收货仓库
-                                                                        ToDate = DateTime.Now, //入库时间
-                                                                        ToRemark = OutNote, //入库备注
-                                                                        SourceStoreId = machine.SourceStoreId, //源仓库
-                                                                        StoreId = tostore.Id, //仓库
-                                                                    });
-                                                                    db.SaveChanges();
-
                                                                     // RemoveClass.DeletePosMachineList("PosMachineTwoList:" + storefor.StoreId, machine.Id);
                                                                     // RedisDbconn.Instance.AddList("PosMachineTwoList:" + tostorefor.StoreId, machine);
 
@@ -654,6 +632,7 @@ namespace MySystem
                                                                 CreateDate = DateTime.Now,
                                                                 CreateMan = Operator,
                                                                 UserId = store.UserId, //创客
+                                                                ToUserId = touser.Id, //收货创客
                                                                 BrandId = BrandId, //产品类型
                                                                 ChangeRecordNo = ChangeNo, //变更记录单号
                                                                 BizBatchNo = BatchNo, //业务批次号
@@ -671,26 +650,6 @@ namespace MySystem
                                                                 StoreId = store.Id, //仓库
                                                             });
 
-                                                            db.StoreChangeHistory.Add(new StoreChangeHistory()
-                                                            {
-                                                                CreateDate = DateTime.Now,
-                                                                CreateMan = Operator,
-                                                                UserId = touser.Id, //创客
-                                                                BrandId = BrandId, //产品类型
-                                                                ChangeRecordNo = ChangeNo, //变更记录单号
-                                                                BizBatchNo = BatchNo, //业务批次号
-                                                                TransType = 0, //交易类型
-                                                                SnNo = SnNo, //SN编号
-                                                                SnType = machine.PosSnType, //SN机具类型
-                                                                StockOpDirect = 0, //库存操作方向
-                                                                DeviceVendor = machine.DeviceName, //设备厂商
-                                                                DeviceModel = machine.DeviceKind, //设备型号
-                                                                DeviceType = machine.DeviceType, //设备类型
-                                                                ToUserId = touser.Id, //收货创客
-                                                                ToDate = DateTime.Now, //入库时间
-                                                                ToRemark = OutNote, //入库备注
-                                                                SourceStoreId = machine.SourceStoreId, //源仓库
-                                                            });
                                                             machine.BuyUserId = touser.Id;
                                                             machine.UserId = touser.Id;
                                                             machine.TransferTime = DateTime.Now;

+ 48 - 25
Areas/Admin/Controllers/HomeController.cs

@@ -148,36 +148,59 @@ namespace MySystem.Areas.Admin.Controllers
         /// <returns></returns>
         [HttpPost]
         public string Login(string UserName, string Pwd, string CheckCode)
-        {
+        {// string result = "";
+            // if (function.GetCookie(_accessor.HttpContext, "checkcode") != CheckCode)
+            // {
+            //     result = "验证码错误!!";
+            // }
+            // else
+            // {
+            //     Pwd = function.MD5_32(Pwd);
+            //     var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
+            //     if (user != null)
+            //     {
+            //         user.LastLoginDate = DateTime.Now;
+            //         db.SaveChanges();
+            //         function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
+            //         function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
+            //         function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
+            //         int RoleId = int.Parse(function.CheckInt(user.Role));
+            //         BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
+            //         string RightInfo = function.CheckNull(Role.RightInfo);
+            //         function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
+            //         string UserId = user.Id.ToString();
+            //         function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
+            //         function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
+            //         result = "success";
+            //     }
+            //     else
+            //     {
+            //         result = "用户名或密码错误";
+            //     }
+            // }
+
             string result = "";
-            if (function.GetCookie(_accessor.HttpContext, "checkcode") != CheckCode)
+            Pwd = function.MD5_32(Pwd);
+            var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
+            if (user != null)
             {
-                result = "验证码错误!!";
+                user.LastLoginDate = DateTime.Now;
+                db.SaveChanges();
+                function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
+                function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
+                function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
+                int RoleId = int.Parse(function.CheckInt(user.Role));
+                BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
+                string RightInfo = function.CheckNull(Role.RightInfo);
+                function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
+                string UserId = user.Id.ToString();
+                function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
+                function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
+                result = "success";
             }
             else
             {
-                Pwd = function.MD5_32(Pwd);
-                var user = db.SysAdmin.FirstOrDefault(m => m.AdminName == UserName && m.Password == Pwd);
-                if (user != null)
-                {
-                    user.LastLoginDate = DateTime.Now;
-                    db.SaveChanges();
-                    function.WriteCookie(_accessor.HttpContext, "SysUserName", user.AdminName);
-                    function.WriteCookie(_accessor.HttpContext, "SysRealName", user.RealName);
-                    function.WriteCookie(_accessor.HttpContext, "SysRealRole", user.Role);
-                    int RoleId = int.Parse(function.CheckInt(user.Role));
-                    BsModels.SysAdminRole Role = db.SysAdminRole.FirstOrDefault(m => m.Id == RoleId) ?? new BsModels.SysAdminRole();
-                    string RightInfo = function.CheckNull(Role.RightInfo);
-                    function.WriteSession(_accessor.HttpContext, "RightInfo", RightInfo);
-                    string UserId = user.Id.ToString();
-                    function.WriteCookie(_accessor.HttpContext, "SysId", UserId);
-                    function.WriteSession(_accessor.HttpContext, "IsLogin", "1");
-                    result = "success";
-                }
-                else
-                {
-                    result = "用户名或密码错误";
-                }
+                result = "用户名或密码错误";
             }
 
             // string result = "";

+ 18 - 4
Areas/Admin/Controllers/MainServer/MerchantDepositSetController.cs

@@ -51,13 +51,13 @@ namespace MySystem.Areas.Admin.Controllers
         /// 商户押金设置记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(MerchantDepositSet data, string UserIdMakerCode, string UserIdRealName, int page = 1, int limit = 30)
+        public JsonResult IndexData(MerchantDepositSet data, string UserIdMakerCode, string UserIdRealName, string CreateDateData, string Sort, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
 
-            Fields.Add("CreateDate", "3"); //时间
-            Fields.Add("MerNo", "1"); //商户编号
+            // Fields.Add("CreateDate", "3"); //时间
+            // Fields.Add("MerNo", "1"); //商户编号
             Fields.Add("SnNo", "1"); //机具SN
 
 
@@ -72,7 +72,19 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
-
+            //创建时间
+            if(!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+            //品牌
+            if (!string.IsNullOrEmpty(Sort))
+            {
+                condition += " and Sort =" + Sort;
+            }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositSet", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
@@ -84,6 +96,8 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["UserIdMakerCode"] = userid_Users.MakerCode;
                 dic["UserIdRealName"] = userid_Users.RealName;
                 dic.Remove("UserId");
+                //产品类型
+                dic["Sort"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["Sort"].ToString()));
 
             }
             return Json(obj);

+ 11 - 11
Areas/Admin/Controllers/MainServer/StoreChangeHistoryController.cs

@@ -118,6 +118,12 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["UserIdMakerCode"] = userid_Users.MakerCode;
                 dic["UserIdRealName"] = userid_Users.RealName;
                 dic.Remove("UserId");
+                //接收创客
+                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
+                Users tuserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["TUserIdMakerCode"] = tuserid_Users.MakerCode;
+                dic["TUserIdRealName"] = tuserid_Users.RealName;
+                dic.Remove("ToUserId");
                 //产品类型
                 dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
                 //交易类型
@@ -135,13 +141,7 @@ namespace MySystem.Areas.Admin.Controllers
                 int StockOpDirect = int.Parse(dic["StockOpDirect"].ToString());
                 if (StockOpDirect == 0) dic["StockOpDirect"] = "入库";
                 if (StockOpDirect == 1) dic["StockOpDirect"] = "出库";
-                //收货创客
-                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
-                StoreHouse touserid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToUserId) ?? new StoreHouse();
-                dic["ToUserIdStoreNo"] = touserid_StoreHouse.StoreNo;
-                dic["ToUserIdStoreName"] = touserid_StoreHouse.StoreName;
-                dic.Remove("ToUserId");
-                //创客退货收货仓库
+                //创客收货仓库
                 int ToStoreId = int.Parse(function.CheckInt(dic["ToStoreId"].ToString()));
                 StoreHouse tostoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToStoreId) ?? new StoreHouse();
                 dic["ToStoreIdStoreNo"] = tostoreid_StoreHouse.StoreNo;
@@ -442,11 +442,11 @@ namespace MySystem.Areas.Admin.Controllers
                 int StockOpDirect = int.Parse(dic["StockOpDirect"].ToString());
                 if (StockOpDirect == 0) dic["StockOpDirect"] = "入库";
                 if (StockOpDirect == 1) dic["StockOpDirect"] = "出库";
-                //收创客
+                //收创客
                 int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
-                StoreHouse touserid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToUserId) ?? new StoreHouse();
-                dic["ToUserIdStoreNo"] = touserid_StoreHouse.StoreNo;
-                dic["ToUserIdStoreName"] = touserid_StoreHouse.StoreName;
+                Users tuserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["TUserIdMakerCode"] = tuserid_Users.MakerCode;
+                dic["TUserIdRealName"] = tuserid_Users.RealName;
                 dic.Remove("ToUserId");
                 //创客退货收货仓库
                 int ToStoreId = int.Parse(function.CheckInt(dic["ToStoreId"].ToString()));

+ 4 - 0
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -787,6 +787,8 @@ namespace MySystem.Areas.Admin.Controllers
                                 {
                                     CreateDate = DateTime.Now,
                                     UserId = user.Id, //创客
+                                    FromUserId = user.Id,//来源创客
+                                    ToUserId = toStore.UserId,//接收创客
                                     StoreId = fromStore.Id, //出货仓库
                                     ToStoreId = toStore.Id, //发货仓库
                                     BrandId = Convert.ToInt32(BrandId), //产品类型
@@ -888,6 +890,8 @@ namespace MySystem.Areas.Admin.Controllers
                                 {
                                     CreateDate = DateTime.Now,
                                     UserId = user.Id, //创客
+                                    FromUserId = user.Id,//来源创客
+                                    ToUserId = toStore.UserId,//接收创客
                                     StoreId = fromStore.Id, //出货仓库
                                     ToStoreId = toStore.Id, //发货仓库
                                     BrandId = Convert.ToInt32(BrandId), //产品类型

+ 2 - 2
Areas/Admin/Views/Home/Login.cshtml

@@ -26,11 +26,11 @@
                     <label for="password">密码 / Password</label>
                     <input class="form-input" type="password" name="Pwd" id="Pwd" onKeyUp="if(event.keyCode==13){$('#CheckCode').focus();}" placeholder="请填写密码">
                 </div>
-                <div class="form-group pb10">
+                @* <div class="form-group pb10">
                     <label for="password">验证码 / Verification</label>
                     <input class="form-input" type="text" name="CheckCode" id="CheckCode" onkeyup="if(event.keyCode==13){syslogin();}" placeholder="请填写验证码" style="width: 70%; display: inline-block; margin-right: 2%">
                     <img src="/Api/PublicMethod/CheckCode" onclick="$(this).attr('src','/Api/PublicMethod/CheckCode?r='+Math.random())" style="width: 26%; height:38px;" />
-                </div>
+                </div> *@
                 @*<div class="form-group pb10 cf">
                         <label class="remembermetext fl" for="rememberme">
                             <input type="checkbox" checked name="rememberme">&nbsp;记住我的登录

+ 13 - 7
Areas/Admin/Views/MainServer/MerchantDepositSet/Index.cshtml

@@ -45,13 +45,13 @@
             <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                 <div class="layui-form-item">
                     <div class="layui-inline">
-                        <label class="layui-form-label">设置人创客编号</label>
+                        <label class="layui-form-label">创客编号</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="UserIdMakerCode" autocomplete="off">
                         </div>
                     </div>
                     <div class="layui-inline">
-                        <label class="layui-form-label">设置人真实姓名</label>
+                        <label class="layui-form-label">真实姓名</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="UserIdRealName" autocomplete="off">
                         </div>
@@ -64,18 +64,24 @@
                         </div>
                     </div>
                     <div class="layui-inline">
-                        <label class="layui-form-label">商户编号</label>
+                        <label class="layui-form-label">机具SN</label>
                         <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="MerNo" placeholder="" autocomplete="off">
+                            <input class="layui-input" type="text" name="SnNo" placeholder="" autocomplete="off">
                         </div>
                     </div>
+                    @{Dictionary<string, string> ProfitObjectsActivesDic = new MySystem.DictionaryClass().getKqProductBrandDic();}
                     <div class="layui-inline">
-                        <label class="layui-form-label">机具SN</label>
+                        <label class="layui-form-label">品牌</label>
                         <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="SnNo" placeholder="" autocomplete="off">
+                            <select id="Sort" name="Sort" lay-search="">
+                                <option value="">全部...</option>
+                                @foreach (string key in ProfitObjectsActivesDic.Keys)
+                                {
+                                <option value="@key">@ProfitObjectsActivesDic[key]</option>
+                                }
+                            </select>
                         </div>
                     </div>
-
                     <div class="layui-inline ml50">
                         <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
                             <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询

+ 2 - 2
Startup.cs

@@ -154,11 +154,11 @@ namespace MySystem
         {
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
             Library.OtherMySqlConn.connstr = Configuration["Setting:SqlConnStr"];
-            System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer'");
+            System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer2'");
             foreach (System.Data.DataRow subtable in tablecollection.Rows)
             {
                 Dictionary<string, string> Columns = new Dictionary<string, string>();
-                System.Data.DataTable columncollection = Library.OtherMySqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
+                System.Data.DataTable columncollection = Library.OtherMySqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer2' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
                 foreach (System.Data.DataRow column in columncollection.Rows)
                 {
                     string datatype = column["DATA_TYPE"].ToString();

+ 5 - 5
wwwroot/layuiadmin/modules_main/MerchantDepositSet_Admin.js

@@ -32,7 +32,7 @@ layui.config({
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
         elem: '#CreateDate',
-        type: 'datetime',
+        type: 'date',
         range: true,
         trigger: 'click',
         change: function (value, date, endDate) {
@@ -92,15 +92,15 @@ layui.config({
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            , { field: 'Sort', width: 200, title: '品牌', sort: true }
             , { field: 'UserIdMakerCode', width: 200, title: '设置人创客编号', sort: true }
             , { field: 'UserIdRealName', width: 200, title: '设置人真实姓名', sort: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
-            , { field: 'MerNo', width: 200, title: '商户编号', sort: true }
             , { field: 'SnNo', width: 200, title: '机具SN', sort: true }
+            , { field: 'SeoTitle', width: 200, title: '变更前押金金额', sort: true }
             , { field: 'DepositAmount', width: 200, title: '押金金额', sort: true }
-
-            , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
-            , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+            // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
+            // , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , where: {
 

+ 4 - 4
wwwroot/layuiadmin/modules_main/StoreChangeHistory_Admin.js

@@ -95,15 +95,15 @@ $('#CreateDate').val(value);
             ,{field:'StoreIdStoreName', width: 200, title:'仓库名称', sort: true}
             ,{field:'UserIdMakerCode', width: 200, title:'创客编号', sort: true}
             ,{field:'UserIdRealName', width: 200, title:'创客姓名', sort: true}
+            ,{field:'TUserIdMakerCode', width: 200, title:'收货创客编号', sort: true}
+            ,{field:'TUserIdRealName', width: 200, title:'收货创客姓名', sort: true}
             ,{field:'BrandId', width: 200, title:'产品类型', sort: true}
             ,{field:'TransType', width: 200, title:'交易类型', sort: true}
             ,{field:'SnNo', width: 200, title:'SN编号', sort: true}
             ,{field:'SnType', width: 200, title:'SN机具类型', sort: true}
             ,{field:'StockOpDirect', width: 200, title:'库存操作方向', sort: true}
-            ,{field:'ToUserIdStoreNo', width: 200, title:'收货创客仓库编号', sort: true}
-            ,{field:'ToUserIdStoreName', width: 200, title:'收货创客仓库名称', sort: true}
-            ,{field:'ToStoreIdStoreNo', width: 200, title:'创客退货收货仓库编号', sort: true}
-            ,{field:'ToStoreIdStoreName', width: 200, title:'创客退货收货仓库名称', sort: true}
+            ,{field:'ToStoreIdStoreNo', width: 200, title:'收货仓库编号', sort: true}
+            ,{field:'ToStoreIdStoreName', width: 200, title:'收货仓库名称', sort: true}
             ,{field:'SourceStoreIdStoreNo', width: 200, title:'源仓库编号', sort: true}
             ,{field:'SourceStoreIdStoreName', width: 200, title:'源仓库名称', sort: true}
             ,{field:'CreateDate', width: 200, title:'变动时间', sort: true}