DuGuYang hace 3 años
padre
commit
27cddcd835

+ 14 - 9
Areas/Admin/Controllers/MainServer/MerchantDepositReturnsController.cs

@@ -52,7 +52,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 商户退押金申请记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(MerchantDepositReturns data, string StatusSelect, string CreateDateData, int page = 1, int limit = 30)
+        public JsonResult IndexData(MerchantDepositReturns data, string CreateDateData, string StatusSelect = "0", int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -90,7 +90,6 @@ namespace MySystem.Areas.Admin.Controllers
                 dic.Remove("MerchantId");
                 int Status = int.Parse(dic["Status"].ToString());
                 if (Status == 0) dic["StatusName"] = "待处理";
-                if (Status == 3) dic["StatusName"] = "处理中";
                 if (Status == 1) dic["StatusName"] = "成功";
                 if (Status == 2) dic["StatusName"] = "失败";
                 if (Status == 4) dic["StatusName"] = "通过";
@@ -285,16 +284,18 @@ namespace MySystem.Areas.Admin.Controllers
         {
             ExcelData = HttpUtility.UrlDecode(ExcelData);
             JsonData list = JsonMapper.ToObject(ExcelData);
+            string error = "";
             for (int i = 1; i < list.Count; i++)
             {
                 JsonData dr = list[i];
-                int Id = int.Parse(dr[0].ToString()); // 记录Id
-                string SeoDescription = dr[1].ToString(); // 退押订单编号
-                string AlipayAccountNo = dr[2].ToString(); // 支付宝帐号
-                string ReturnAmount = dr[3].ToString(); // 退还金额
-                var s = dr[4].ToString();
-                int Status = int.Parse(dr[4].ToString()); // 审核结果
-                var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.Id == Id && m.Status == 0) ?? new MerchantDepositReturns();
+                string SeoDescription = dr[0].ToString(); // 退押订单编号
+                int Status = int.Parse(dr[1].ToString()); // 审核结果
+                var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.SeoDescription == SeoDescription && m.Status == 0) ?? new MerchantDepositReturns();
+                if (true)
+                {
+                    merchantDepositReturns.Id = 0;
+                    error += "以下操作失败" + SeoDescription + ',' + "该订单未找到或不符合规则" + '\n';
+                }
                 if (Status == 1)
                 {
                     Status = 4;
@@ -311,6 +312,10 @@ namespace MySystem.Areas.Admin.Controllers
                 merchantDepositReturns.UpdateDate = DateTime.Now;
                 merchantDepositReturns.SeoTitle = SysUserName + "-" + SysRealName;
             }
+            if (!string.IsNullOrEmpty(error))
+            {
+                return "Warning|" + error;
+            }
             db.SaveChanges();
             return "success";
         }

+ 1 - 2
Areas/Admin/Views/MainServer/MerchantDepositReturns/Index.cshtml

@@ -69,8 +69,7 @@
                         <div class="layui-input-inline">
                             <select id="StatusSelect" name="StatusSelect" lay-search="">
                                 <option value="">全部...</option>
-                                <option value="0">待处理</option>
-                                <option value="3">处理中</option>
+                                <option value="0" selected="selected">待处理</option>
                                 <option value="2">失败</option>
                                 <option value="1">成功</option>
                                 <option value="4">通过</option>

+ 7 - 2
wwwroot/layuiadmin/modules_main/MerchantDepositReturns_Admin.js

@@ -10,6 +10,11 @@ function ConfirmImport() {
                 layer.msg("导入成功", { time: 2000 }, function () {
                     window.location.reload();
                 });
+            } else if (data.indexOf("Warning") == 0) {
+                var datalist = data.split('|');
+                layer.alert(datalist[1], { time: 20000 }, function () {
+                    window.location.reload();
+                });
             } else {
                 layer.msg(data);
             }
@@ -94,12 +99,12 @@ layui.config({
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'StatusName', width: 200, title: '状态', sort: true }
-            , { field: 'OperateMan', width: 200, title: '操作人', sort: true }
+            , { field: 'SeoTitle', width: 200, title: '操作人', sort: true }
             , { field: 'SeoKeyword', width: 200, title: '退押订单号', sort: true }
             , { field: 'AlipayAccountNo', width: 200, title: '支付宝账号', sort: true }
             , { field: 'ReturnAmount', width: 200, title: '返还金额', sort: true }
 
-            , { title: '操作', align: 'center', width: 400, fixed: 'right', toolbar: '#table-list-tools' }
+            // , { title: '操作', align: 'center', width: 400, fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , where: {
 

BIN
wwwroot/users/退押结果模版.xlsx