Kaynağa Gözat

Merge branch 'DuGuYang' into feature-dgy-功能优化

DuGuYang 2 yıl önce
ebeveyn
işleme
f0d0d9d1dd

+ 2 - 8
AppStart/Helper/SIMPosMerchantTradeService.cs

@@ -213,16 +213,11 @@ namespace MySystem
         {
             while (true)
             {
-                string Info = RedisDbconn.Instance.RPop<string>("SIMActInfo");
-                if (!string.IsNullOrEmpty(Info))
+                string time = RedisDbconn.Instance.RPop<string>("SIMActInfo");
+                if (!string.IsNullOrEmpty(time))
                 {
                     try
                     {
-                        var time = function.ReadInstance("/GetSIMActInfo/LastDate.txt");
-                        if(string.IsNullOrEmpty(time))
-                        {
-                            time = "2024-03-18";
-                        }
                         string check = function.ReadInstance("/GetSIMActInfo/check" + time + ".txt");
                         if (string.IsNullOrEmpty(check))
                         {
@@ -270,7 +265,6 @@ namespace MySystem
                                 }
                             }
                         }
-                        function.WritePage("/GetSIMActInfo/", "LastDate.txt", DateTime.Now.ToString("yyyy-MM-dd"));
                     }
                     catch (Exception ex)
                     {

+ 34 - 3
Areas/Admin/Controllers/MainServer/CustomQueryController.cs

@@ -350,9 +350,19 @@ namespace MySystem.Areas.Admin.Controllers
                 string[] fieldData = m.Value.Replace("${", "").Replace("}$", "").Split('|');
                 string fieldName = fieldData[0];
                 string Title = fieldData[1];
+                string Control = "text";
+                string Option = "";
+                if(fieldData.Length > 2)
+                {
+                    Control = fieldData[2];
+                    if(Control == "select")
+                    {
+                        Option = fieldData[3];
+                    }
+                }
                 if(!query.ContainsKey(fieldName))
                 {
-                    query.Add(fieldName, Title);
+                    query.Add(fieldName, Title + "#cut#" + Control + "#cut#" + Option);
                 }
             }
             List<CustomQuerySub> subItems = db.CustomQuerySub.Where(m => m.ParentId == Id).ToList();
@@ -365,9 +375,19 @@ namespace MySystem.Areas.Admin.Controllers
                     string[] fieldData = m.Value.Replace("${", "").Replace("}$", "").Split('|');
                     string fieldName = fieldData[0];
                     string Title = fieldData[1];
+                    string Control = "text";
+                    string Option = "";
+                    if(fieldData.Length > 2)
+                    {
+                        Control = fieldData[2];
+                        if(Control == "select")
+                        {
+                            Option = fieldData[3];
+                        }
+                    }
                     if(!query.ContainsKey(fieldName))
                     {
-                        query.Add(fieldName, Title);
+                        query.Add(fieldName, Title + "#cut#" + Control + "#cut#" + Option);
                     }
                 }
             }
@@ -501,7 +521,18 @@ namespace MySystem.Areas.Admin.Controllers
                 string val = redisCommandList[2];
                 if(kind == "lpush")
                 {
-                    new CustomRedisDbconn(ConnectStr).AddList(key, val);
+                    if(val.Contains("\n"))
+                    {
+                        string[] vals = val.TrimEnd('\n').Split('\n');
+                        foreach(string sub in vals)
+                        {
+                            new CustomRedisDbconn(ConnectStr).AddList(key, sub);
+                        }
+                    }
+                    else
+                    {
+                        new CustomRedisDbconn(ConnectStr).AddList(key, val);
+                    }
                 }
                 else if(kind == "set")
                 {

+ 6 - 2
Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs

@@ -81,6 +81,10 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     condition += " and UserId=0 and BuyUserId=0";
                 }
+                if (int.Parse(IsStoreSelect) == 0)
+                {
+                    condition += " and UserId>0 and BuyUserId>0";
+                }
             }
             //绑定状态
             if (!string.IsNullOrEmpty(BindingStateSelect))
@@ -789,7 +793,7 @@ namespace MySystem.Areas.Admin.Controllers
             decimal AmountYks = 0;//已扣
             decimal AmountDks = 0;//待扣
             var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-            string condition = " and Status>-1 and RecycEndDate<'" + time + "' and ScanQrTrade>0 and ScanQrTrade<999 and BindingState=0";
+            string condition = " and Status>-1 and RecycEndDate<'" + time + "' and BindingState=0";
 
             //所属创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
@@ -817,7 +821,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             if (!string.IsNullOrEmpty(PosSn))
             {
-                condition += " and PosSn =" + PosSn + "";
+                condition += " and PosSn ='" + PosSn + "'";
             }
 
             if (!string.IsNullOrEmpty(RecycEndDateData))

+ 30 - 23
Areas/Admin/Controllers/MainServer/TradeRecordController.cs

@@ -385,29 +385,6 @@ namespace MySystem.Areas.Admin.Controllers
         #endregion
 
 
-        #region 获取激活信息
-        /// <summary>
-        /// 获取激活信息
-        /// </summary>
-        /// <param name="key"></param>
-        /// <returns></returns>
-        public string GetActInfo()
-        {
-            string check = RedisDbconn.Instance.Get<string>("CheckSIMActInfo:" + SysId);
-            if (!string.IsNullOrEmpty(check))
-            {
-                return "请勿重复操作";
-            }
-            else
-            {
-                RedisDbconn.Instance.Set("CheckSIMActInfo:" + SysId, "1");
-                RedisDbconn.Instance.SetExpire("CheckSIMActInfo:" + SysId, 10);
-                RedisDbconn.Instance.AddList("SIMActInfo", SysId);
-                return "success";
-            }
-        }
-        #endregion
-
 
         #region 导入数据
         public IActionResult Import(string right)
@@ -905,5 +882,35 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 获取激活信息
+        public IActionResult GetSimTrade(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            return View();
+        }
+
+        public string GetSimTradePost(string DateStr)
+        {
+            string check = RedisDbconn.Instance.Get<string>("CheckSIMActInfo:" + SysId);
+            if (!string.IsNullOrEmpty(check))
+            {
+                return "请勿重复操作";
+            }
+            if(DateTime.Parse(DateStr) >= DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")))
+            {
+                return "请输入早于今天的日期";
+            }
+            RedisDbconn.Instance.Set("CheckSIMActInfo:" + SysId, "1");
+            RedisDbconn.Instance.SetExpire("CheckSIMActInfo:" + SysId, 10);
+            RedisDbconn.Instance.AddList("SIMActInfo", DateStr);
+            AddSysLog("0", "TradeRecord", "GetSimTrade");
+            return "success";
+        }
+        #endregion
+
+
+
     }
 }

+ 46 - 4
Areas/Admin/Views/MainServer/CustomQuery/Confirm.cshtml

@@ -3,6 +3,7 @@
     string right = ViewBag.right as string;
     string Id = ViewBag.Id as string;
     Dictionary<string, string> query = ViewBag.query as Dictionary<string, string>;
+    string dateJs = "";
 }
 <!DOCTYPE html>
 <html>
@@ -29,11 +30,40 @@
                     <div class="layui-tab-item layui-show">
                         @foreach(string key in query.Keys)
                         {
+                            string[] dataList = query[key].Split(new string[] { "#cut#" }, StringSplitOptions.None);
+                            string text = dataList[0];
+                            string control = dataList[1];
+                            if(control == "datetime" || control == "date" || control == "time" || control == "month")
+                            {
+                                dateJs += key + "_" + control + "|";
+                            }
                             <div class="layui-form-item">
-                                <label class="layui-form-label">@(query[key])</label>
+                                <label class="layui-form-label">@(text)</label>
+                                @if(control == "textarea")
+                                {
                                 <div class="layui-input-block">
-                                    <input class="layui-input" type="text" id="@(key)" name="@(key)" lay-verify="required|" autocomplete="off" placeholder="请输入@(query[key])">
+                                    <textarea class="layui-textarea" id="@(key)" name="@(key)" lay-verify="required|" placeholder="请输入@(text)" style="height: 300px;"></textarea>
                                 </div>
+                                }
+                                else if(control == "select")
+                                {
+                                    string[] options = dataList[2].Split(',');
+                                    <div class="layui-input-block">
+                                        <select id="@(key)" name="@(key)" lay-search="" lay-verify="required|" placeholder="请选择@(text)">
+                                            <option value="">请选择</option>
+                                            @foreach (string option in options)
+                                            {
+                                                <option value="@option">@option</option>
+                                            }
+                                        </select>
+                                    </div>
+                                }
+                                else
+                                {
+                                <div class="layui-input-block">
+                                    <input class="layui-input" type="text" id="@(key)" name="@(key)" lay-verify="required|" autocomplete="off" placeholder="请输入@(text)">
+                                </div>
+                                }
                             </div>
                         }
                     </div>
@@ -48,7 +78,6 @@
     </div>
 
     <script src="/layuiadmin/layui/layui.js"></script>
-    <script src="/other/mybjq/lang/zh_CN.js"></script>
     <script>
         
         layui.config({
@@ -63,7 +92,8 @@
                 , laydate = layui.laydate
                 , croppers = layui.croppers
                 , transfer = layui.transfer
-                , util = layui.util;
+                , util = layui.util
+                , element = layui.element
         
             //Hash地址的定位
             var layid = location.hash.replace(/^#test=/, '');
@@ -73,6 +103,18 @@
             });
     
             //日期
+            var dateJs = "@(dateJs.TrimEnd('|'))";
+            if(dateJs != "") {
+                var dateJsList = dateJs.split('|');
+                for(var i=0;i<dateJsList.length;i++){
+                    var dataList = dateJsList[i].split('_');
+                    laydate.render({
+                        elem: '#' + dataList[0],
+                        type: dataList[1],
+                        trigger: 'click'
+                    });
+                }
+            }
             
 
             //上传文件

+ 95 - 0
Areas/Admin/Views/MainServer/TradeRecord/GetSimTrade.cshtml

@@ -0,0 +1,95 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    
+}
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>交易记录(增加)</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <script src="/admin/js/LAreaData2.js"></script>
+</head>
+<body>
+
+    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
+        
+        <div class="layui-card">
+          <div class="layui-card-body">
+            <div class="layui-tab" lay-filter="mytabbar">
+                <ul class="layui-tab-title">
+                    <li class="layui-this" lay-id="1">基本信息</li>
+                </ul>
+                <div class="layui-tab-content mt20">
+                    <div class="layui-tab-item layui-show">
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">日期</label>
+                            <div class="layui-input-inline">
+                                <input class="layui-input" type="text" id="DateStr" name="DateStr"
+                                    lay-verify="" autocomplete="off" placeholder="请输入日期">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="layui-form-item layui-hide">
+                <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
+            </div>
+          </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script>
+        
+        layui.config({
+            base: '/layuiadmin/' //静态资源所在路径
+        }).extend({
+            index: 'lib/index' //主入口模块
+        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
+            var $ = layui.$
+                , form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , croppers = layui.croppers
+                , transfer = layui.transfer
+                , util = layui.util
+                , element = layui.element
+        
+            //Hash地址的定位
+            var layid = location.hash.replace(/^#test=/, '');
+            element.tabChange('test', layid);
+            element.on('tab(test)', function (elem) {
+                location.hash = 'test=' + $(this).attr('lay-id');
+            });
+    
+            //日期
+            laydate.render({
+                elem: '#DateStr',
+                type: 'date',
+                trigger: 'click'
+            });
+            
+
+            //上传文件
+            
+
+            //穿梭框
+            
+
+            //TreeView,比如权限管理
+            
+
+            //省市区
+            
+        })
+
+    </script>
+</body>
+</html>

+ 7 - 0
Areas/Admin/Views/MainServer/TradeRecord/ImportTrade.cshtml

@@ -37,7 +37,14 @@
                         <div class="layui-form-item">
                             <label class="layui-form-label">模板下载</label>
                             <div class="layui-form-mid layui-word-aux" id="excelTemp">
+                                @if(ExcelKind == "1")
+                                {
+                                <a href="https://kexiaoshuang.oss-cn-chengdu.aliyuncs.com/ExcelTmplate/%E5%B9%BF%E7%94%B5%E5%8D%A1%E6%BF%80%E6%B4%BB%E8%A1%A8%E6%A0%BC%E6%A8%A1%E6%9D%BF.xlsx">点击下载入库模版</a>
+                                }
+                                else
+                                {
                                 <a href="https://kexiaoshuang.oss-cn-chengdu.aliyuncs.com/ExcelTmplate/%E5%B9%BF%E7%94%B5%E5%8D%A1%E4%BA%A4%E6%98%93%E8%A1%A8%E6%A0%BC%E6%A8%A1%E6%9D%BF.xlsx">点击下载入库模版</a>
+                                }
                             </div>
                         </div>
                         <div class="layui-form-item">

+ 1 - 33
Areas/Admin/Views/MainServer/TradeRecord/Index.cshtml

@@ -148,7 +148,7 @@
                             <button class="layui-btn" data-type="ImportTrade">
                                 <i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导交易
                             </button>
-                            <button class="layui-btn" onclick="GetActInfo()">
+                            <button class="layui-btn" data-type="GetActInfo">
                                 <i class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>获取激活信息
                             </button>
                             }
@@ -201,37 +201,5 @@
     <script>
         var BrandId = '@BrandId';
     </script>
-    <script>
-        function GetActInfo() {
-            var index = layer.confirm('确定操作该功能吗?', function (index) {
-                var indexs = layer.load(1, {
-                    shade: [0.5, '#000']
-                });
-                var userdata = $("#confirmFrm").serialize();
-                $.ajax({
-                    type: "POST",
-                    url: "/Admin/TradeRecord/GetActInfo?r=" + Math.random(1),
-                    data: userdata,
-                    dataType: "text",
-                    success: function (data) {
-                        layer.close(index); //关闭弹层
-                        if (data == "success") {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg('成功', {
-                                time: 1000
-                            }, function () {
-                                window.location.reload();
-                            });
-                        } else {
-                            layer.close(indexs); //关闭弹层
-                            layer.msg(data, { time: 1000 }, function () {
-                                window.location.reload();
-                            });
-                        }
-                    }
-                });
-            });
-        }
-    </script>
 </body>
 </html>

+ 54 - 0
wwwroot/layuiadmin/modules_main/TradeRecord_Admin.js

@@ -669,6 +669,60 @@ layui.config({
                 });
             }
         }
+        , GetActInfo: function () {
+            var perContent = layer.open({
+                type: 2
+                , title: '获取广电卡激活数据'
+                , content: 'GetSimTrade'
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/TradeRecord/GetSimTradePost?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    layer.msg("提交成功");
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+        }
     };
 
     $('.layui-btn').on('click', function () {