Explorar el Código

Merge branch 'feature-dgy-机具回收' into feature-dgy-后台优化

DuGuYang hace 3 años
padre
commit
57dd391059

+ 72 - 0
AppStart/Helper/TimeOutPosChargeReturnService.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 过期购买机具循环截止时间超过15天激活扣费退还
+    /// </summary>
+    public class TimeOutPosChargeReturnService
+    {
+        public readonly static TimeOutPosChargeReturnService Instance = new TimeOutPosChargeReturnService();
+        private TimeOutPosChargeReturnService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour < 18)
+                {
+                    try
+                    {
+                        string check = function.ReadInstance("/TimeOutPosChargeReturn/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/TimeOutPosChargeReturn/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            DataTable dt = CustomerSqlConn.dtable("SELECT a.Id Id FROM ToChargeBackRecord a LEFT JOIN PosMachinesTwo b ON a.Remark=b.PosSn WHERE a.`Status`=1 AND b.PosSnType=0  AND b.BindingState=1 AND b.ActivationState=1", MysqlConn.connstr);//循环过期超过15天激活机具退费创客
+                            foreach (DataRow item in dt.Rows)
+                            {
+                                int Id = int.Parse(item["Id"].ToString());
+                                var toChargeBackRecord = db.ToChargeBackRecord.FirstOrDefault(m => m.Id == Id && m.Status == 1) ?? new ToChargeBackRecord();
+                                var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == toChargeBackRecord.UserId) ?? new UserAccount();
+                                var userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord
+                                {
+                                    CreateDate = DateTime.Now,
+                                    UserId = toChargeBackRecord.UserId,
+                                    BeforeBalanceAmount = userAccount.BalanceAmount,
+                                    AfterBalanceAmount = userAccount.BalanceAmount + toChargeBackRecord.ChargeAmount,
+                                    ChangeAmount = toChargeBackRecord.ChargeAmount,
+                                    ChangeType = 126,//过期购买机具超过15天激活扣费退还
+                                    Remark = "机具货款退还",
+
+                                }).Entity;
+                                toChargeBackRecord.Status = 2;//过期购买机具循环截止时间超过15天激活扣费退还标识
+                                userAccount.BalanceAmount += toChargeBackRecord.ChargeAmount;
+                                db.SaveChanges();
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期购买机具超过15天激活扣费退还");
+                    }
+                }
+                Thread.Sleep(1000);
+            }
+        }
+    }
+}

+ 111 - 0
AppStart/Helper/TimeOutPosChargeService.cs

@@ -0,0 +1,111 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 过期机具执行扣费
+    /// </summary>
+    public class TimeOutPosChargeService
+    {
+        public readonly static TimeOutPosChargeService Instance = new TimeOutPosChargeService();
+        private TimeOutPosChargeService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour < 18)
+                {
+                    try
+                    {
+                        string check = function.ReadInstance("/TimeOutPosCharge/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/TimeOutPosCharge/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            var date = DateTime.Now.AddDays(-15).ToString("yyyy-MM-dd 00:00:00");//过期限制时间
+                            var time = DateTime.Parse(date);//过期限制时间
+
+                            DataTable dt = CustomerSqlConn.dtable("SELECT BuyUserId FROM PosMachinesTwo WHERE `Status`>-1 AND BuyUserId>0 AND BindingState=0 AND ActivationState=0 AND RecycEndDate <'" + date + "' GROUP BY BuyUserId", MysqlConn.connstr);//扣费创客
+                            var query = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BuyUserId > 0 && m.BindingState == 0 && m.ActivationState == 0 && m.RecycEndDate < time).ToList();//循环过期超过15天机具
+                            var brandInfo = db.KqProducts.ToList();
+                            foreach (DataRow item in dt.Rows)
+                            {
+                                int BuyUserId = int.Parse(item["BuyUserId"].ToString());
+                                var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == BuyUserId) ?? new UserAccount();
+                                var posInfo = query.Where(m => m.BuyUserId == BuyUserId);
+                                var amount = 0;
+                                foreach (var pos in posInfo)
+                                {
+                                    var Brand = brandInfo.FirstOrDefault(m => m.Id == pos.BrandId);
+                                    if (Brand.Name.Contains("电签"))
+                                    {
+                                        amount = 200;
+                                    }
+                                    if (Brand.Name.Contains("大POS"))
+                                    {
+                                        amount = 300;
+                                    }
+                                    userAccount.ToChargeAmount += amount;//增加预扣款
+                                    var toChargeBackRecord = db.ToChargeBackRecord.Add(new ToChargeBackRecord
+                                    {
+                                        CreateDate = DateTime.Now,
+                                        UserId = BuyUserId,
+                                        ChargeAmount = amount,
+                                        ChargeType = 124,//过期机具货款扣费
+                                        Remark = pos.PosSn,
+
+                                    }).Entity;
+                                    db.SaveChanges();
+                                }
+                            }
+                            var info = db.ToChargeBackRecord.Where(m => m.Status == 0).ToList();//过期机具扣费记录
+                            foreach (var items in info)
+                            {
+                                var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == items.UserId) ?? new UserAccount();
+                                var record = info.FirstOrDefault(m => m.Id == items.Id);
+                                if (userAccount.BalanceAmount >= record.ChargeAmount)
+                                {
+                                    var userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord
+                                    {
+                                        CreateDate = DateTime.Now,
+                                        UserId = items.UserId,
+                                        BeforeBalanceAmount = userAccount.BalanceAmount,
+                                        AfterBalanceAmount = userAccount.BalanceAmount - record.ChargeAmount,
+                                        ChangeAmount = record.ChargeAmount,
+                                        ChangeType = 124,//过期机具货款扣费
+                                        Remark = "扣机具货款",
+
+                                    }).Entity;
+                                    record.Status = 1;
+                                    userAccount.ToChargeAmount -= record.ChargeAmount;//扣减预扣款
+                                    userAccount.BalanceAmount -= record.ChargeAmount;//扣减余额
+                                    db.SaveChanges();
+                                }
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具执行扣费异常");
+                    }
+                }
+                Thread.Sleep(1000);
+            }
+        }
+    }
+}

+ 83 - 0
AppStart/Helper/TimeOutPosSendMessageService.cs

@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 过期机具预扣费消息推送
+    /// </summary>
+    public class TimeOutPosSendMessageService
+    {
+        public readonly static TimeOutPosSendMessageService Instance = new TimeOutPosSendMessageService();
+        private TimeOutPosSendMessageService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour < 18)
+                {
+                    try
+                    {
+                        string check = function.ReadInstance("/TimeOutPosSendMessage/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/TimeOutPosSendMessage/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            var date = DateTime.Now.AddDays(-10).ToString("yyyy-MM-dd 00:00:00");//过期限制时间
+                            var time = DateTime.Parse(date);//过期限制时间
+
+                            DataTable dt = CustomerSqlConn.dtable("SELECT BuyUserId FROM PosMachinesTwo WHERE `Status`>-1 AND BuyUserId>0 AND BindingState=0 AND ActivationState=0 AND RecycEndDate <'" + date + "' GROUP BY BuyUserId", MysqlConn.connstr);//消息推送创客
+                            var query = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BuyUserId > 0 && m.BindingState == 0 && m.ActivationState == 0 && m.RecycEndDate < time).ToList();//循环过期超过10天机具
+                            var brandInfo = db.KqProducts.ToList();
+                            foreach (DataRow item in dt.Rows)
+                            {
+                                int BuyUserId = int.Parse(item["BuyUserId"].ToString());
+                                var BrandName = "";
+                                var PosSn = "";
+                                var SendInfo = "";
+                                foreach (var items in brandInfo)
+                                {
+                                    int BrandId = int.Parse(items.Id.ToString());
+                                    BrandName = items.Name.ToString();
+                                    var posInfo = query.Where(m => m.BuyUserId == BuyUserId && m.BrandId == BrandId);
+                                    foreach (var pos in posInfo)
+                                    {
+                                        PosSn += BrandName +":"+pos.PosSn + "," + "<br/>";
+                                    }
+                                }
+                                SendInfo = PosSn.TrimEnd(',') + "<br/>";
+                                RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
+                                {
+                                    UserId = BuyUserId, //创客
+                                    Title = "机具循环过期提醒", //标题
+                                    Content = "<div class='f16'>尊敬的创客您好:<br/>您的" + SendInfo + "循环已过期十天以上,请在五日内完成激活或通过机具回收回寄该机具。</ div > ",//内容
+                                    Summary = "系统检测到您的部分机具可回收,请及时处理!",
+                                    CreateDate = DateTime.Now,
+                                }));
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具预扣费消息推送异常");
+                    }
+                }
+                Thread.Sleep(1000);
+            }
+        }
+    }
+}

+ 5 - 9
Areas/Admin/Controllers/MainServer/RecycMachineOrderController.cs

@@ -66,17 +66,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
-            }
-            //创客真实姓名
-            if (!string.IsNullOrEmpty(UserIdRealName))
-            {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //退回仓库编号
             if (!string.IsNullOrEmpty(RecycStoreIdStoreNo))
             {
-                condition += " and RecycStoreId in (select RecycStoreId from StoreHouseForStoreNo where StoreNo='" + RecycStoreIdStoreNo + "')";
+                condition += " and RecycStoreId in (select StoreId from StoreForCode where Code='" + RecycStoreIdStoreNo + "')";
             }
             //寄回方式
             if (!string.IsNullOrEmpty(PostTypeSelect))
@@ -119,6 +114,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (PostType == 1) dic["PostType"] = "邮寄";
                 if (PostType == 2) dic["PostType"] = "送货上门";
                 if (PostType == 0) dic["PostType"] = "";
+                dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
 
             }
             return Json(obj);
@@ -349,12 +345,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //退回仓库仓库编号
             if (!string.IsNullOrEmpty(RecycStoreIdStoreNo))

+ 8 - 4
Areas/Admin/Controllers/MainServer/RecycMachineOrderPosController.cs

@@ -52,7 +52,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 机具回收明细列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(RecycMachineOrderPos data, string OrderIdSelect, string CreateDateData, string BrandIdSelect, string StatusSelect, int page = 1, int limit = 30)
+        public JsonResult IndexData(RecycMachineOrderPos data, string OrderNo, string CreateDateData, string BrandIdSelect, string StatusSelect, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -70,10 +70,11 @@ namespace MySystem.Areas.Admin.Controllers
                 string end = datelist[1];
                 condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
-            //申请订单Id
-            if (!string.IsNullOrEmpty(OrderIdSelect))
+            //申请订单
+            if (!string.IsNullOrEmpty(OrderNo))
             {
-                condition += " and OrderId=" + OrderIdSelect;
+                var recycMachineOrder = db.RecycMachineOrder.FirstOrDefault(m => m.RecycOrderNo == OrderNo) ?? new RecycMachineOrder();
+                condition += " and OrderId=" + recycMachineOrder.Id;
             }
             //机具品牌
             if (!string.IsNullOrEmpty(BrandIdSelect))
@@ -101,6 +102,9 @@ namespace MySystem.Areas.Admin.Controllers
                 if (Status == 1) dic["Status"] = "已确认";
                 if (Status == 2) dic["Status"] = "驳回";
 
+                int OrderId = int.Parse(dic["OrderId"].ToString());
+                var recycMachineOrder = db.RecycMachineOrder.FirstOrDefault(m => m.Id == OrderId) ?? new RecycMachineOrder();
+                dic["OrderNo"] = recycMachineOrder.RecycOrderNo;
             }
             return Json(obj);
         }

+ 69 - 6
Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs

@@ -290,7 +290,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         #endregion
 
-        #region 导入数据
+        #region 机具扣款退还
         /// <summary>
         /// 导入数据
         /// </summary>
@@ -301,10 +301,6 @@ namespace MySystem.Areas.Admin.Controllers
             JsonData list = JsonMapper.ToObject(ExcelData);
             var info = "";
             var error = "";
-            if (!string.IsNullOrEmpty(error))
-            {
-                return "Warning|" + error;
-            }
             for (int i = 1; i < list.Count; i++)
             {
                 JsonData dr = list[i];
@@ -333,14 +329,81 @@ namespace MySystem.Areas.Admin.Controllers
                     info += toChargeBackRecord.Remark + "," + toChargeBackRecord.ChargeAmount + "<br/>";
                 }
             }
+            if (!string.IsNullOrEmpty(error))
+            {
+                return "Warning|" + error;
+            }
+            string text = string.Format("退款信息: '" + info + "',Time'" + DateTime.Now + "'");
+            function.WriteLog(text, "机具扣款退还");//机具扣款退还
+            db.SaveChanges();
+            AddSysLog("0", "ToChargeBackRecord", "Import");
+            return "success";
+        }
+        #endregion
+
+
+        #region 机具回收确认退还
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData"></param>
+        public string Imports(string ExcelData)
+        {
+            ExcelData = HttpUtility.UrlDecode(ExcelData);
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            var info = "";
+            var error = "";
+            for (int i = 1; i < list.Count; i++)
+            {
+                JsonData dr = list[i];
+                string PosSn = dr[0].ToString(); // 机具Sn
+                var toChargeBackRecord = db.ToChargeBackRecord.FirstOrDefault(m => m.Remark == PosSn) ?? new ToChargeBackRecord();
+                var recycMachineOrderPos = db.RecycMachineOrderPos.FirstOrDefault(m => m.Status == 1 && m.SnNo == PosSn) ?? new RecycMachineOrderPos();
+                if (recycMachineOrderPos.Id == 0)
+                {
+                    error += "以下操作失败" + PosSn + ',' + "不符合退还条件" + '\n';
+                }
+                else
+                {
+                    var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == toChargeBackRecord.UserId) ?? new UserAccount();
+                    //已扣款
+                    if (toChargeBackRecord.Status == 1)
+                    {
+                        var userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord
+                        {
+                            CreateDate = DateTime.Now,
+                            UserId = toChargeBackRecord.UserId,
+                            BeforeBalanceAmount = userAccount.BalanceAmount,
+                            AfterBalanceAmount = userAccount.BalanceAmount + toChargeBackRecord.ChargeAmount,
+                            ChangeAmount = toChargeBackRecord.ChargeAmount,
+                            ChangeType = 126,
+                            Remark = "机具货款退还",
+
+                        }).Entity;
+                        userAccount.BalanceAmount += toChargeBackRecord.ChargeAmount;
+                        toChargeBackRecord.Status = 2;
+                        info += toChargeBackRecord.Remark + "," + toChargeBackRecord.ChargeAmount + "<br/>";
+                    }
+                    //未扣款
+                    if (toChargeBackRecord.Status == 0)
+                    {
+                        toChargeBackRecord.Status = 2;
+                    }
+                }
+            }
+            if (!string.IsNullOrEmpty(error))
+            {
+                return "Warning|" + error;
+            }
             string text = string.Format("退款信息: '" + info + "',Time'" + DateTime.Now + "'");
-            function.WriteLog(text, "人工退还过期机具扣款");//人工退还过期机具扣款
+            function.WriteLog(text, "机具回收确认退还");//机具回收确认退还
             db.SaveChanges();
             AddSysLog("0", "ToChargeBackRecord", "Import");
             return "success";
         }
         #endregion
 
+
         #region 导出Excel
 
         /// <summary>

+ 0 - 6
Areas/Admin/Views/MainServer/RecycMachineOrder/Index.cshtml

@@ -50,12 +50,6 @@
                             <input class="layui-input" type="text" name="UserIdMakerCode" autocomplete="off">
                         </div>
                     </div>
-                    <div class="layui-inline">
-                        <label class="layui-form-label">创客真实姓名</label>
-                        <div class="layui-input-inline">
-                            <input class="layui-input" type="text" name="UserIdRealName" autocomplete="off">
-                        </div>
-                    </div>
                     <div class="layui-inline">
                         <label class="layui-form-label">创建时间</label>
                         <div class="layui-input-inline">

+ 3 - 5
Areas/Admin/Views/MainServer/RecycMachineOrderPos/Index.cshtml

@@ -46,11 +46,9 @@
             <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">申请订单Id</label>
+                        <label class="layui-form-label">申请订单</label>
                         <div class="layui-input-inline">
-                            <select id="OrderIdSelect" name="OrderIdSelect" lay-search="">
-                                <option value="">全部...</option>
-                            </select>
+                            <input class="layui-input" type="text" name="OrderNo" placeholder="" autocomplete="off">
                         </div>
                     </div>
                     <div class="layui-inline">
@@ -67,7 +65,7 @@
                         </div>
                     </div>
                     <div class="layui-inline">
-                        <label class="layui-form-label">激活状态</label>
+                        <label class="layui-form-label">状态</label>
                         <div class="layui-input-inline">
                             <select id="StatusSelect" name="StatusSelect" lay-search="">
                                 <option value="">全部...</option>

+ 5 - 0
Areas/Admin/Views/MainServer/ToChargeBackRecord/Index.cshtml

@@ -112,6 +112,11 @@
                         <button class="layui-btn" data-type="ImportData"><i
                             class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>机具扣款退还</button>
                     }
+                    @if (RightInfo.Contains("," + right + "_import,"))
+                    {
+                        <button class="layui-btn" data-type="ImportDatas"><i
+                            class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>机具回收确认退还</button>
+                    }
                 </div>
 
                 <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>

+ 3 - 0
Startup.cs

@@ -142,6 +142,9 @@ namespace MySystem
             OpExcelHelper.Instance.Start();
             TestHelper.Instance.Start();
             
+            TimeOutPosSendMessageService.Instance.Start();//过期机具循环截止时间超过10天预扣费消息推送
+            TimeOutPosChargeService.Instance.Start();//过期机具循环截止时间超过15天执行扣费
+            // TimeOutPosChargeReturnService.Instance.Start();//过期购买机具循环截止时间超过15天激活扣费退还
         }
 
 

BIN
wwwroot/.DS_Store


+ 7 - 4
wwwroot/layuiadmin/modules_main/RecycMachineOrderPos_Admin.js

@@ -93,13 +93,16 @@ layui.config({
             { type: 'checkbox', fixed: 'left' }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'UpdateDate', width: 200, title: '最后操作时间', sort: true }
+            , { field: 'Status', width: 200, title: '状态', sort: true }
+            , { field: 'OrderNo', width: 200, title: '订单号', sort: true }
             , { field: 'SnNo', width: 200, title: '机具SN', sort: true }
-            , { field: 'ResultDate', width: 200, title: '确认或驳回时间', sort: true }
-            , { field: 'CancelDate', width: 200, title: '创客撤销时间', sort: true }
+            // , { field: 'ResultDate', width: 200, title: '确认或驳回时间', sort: true }
+            // , { field: 'CancelDate', width: 200, title: '创客撤销时间', sort: true }
             , { field: 'BrandId', 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: {
             OrderId: OrderId

+ 5 - 3
wwwroot/layuiadmin/modules_main/RecycMachineOrder_Admin.js

@@ -95,17 +95,19 @@ layui.config({
             , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
             , { field: 'UserIdRealName', width: 200, title: '创客真实姓名', sort: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'UpdateDate', width: 200, title: '最后操作时间', sort: true }
+            , { field: 'BrandId', width: 200, title: '品牌', sort: true }
             , { field: 'RecycStoreIdStoreNo', width: 200, title: '退回仓库编号', sort: true }
             , { field: 'RecycStoreIdStoreName', width: 200, title: '退回仓库名称', sort: true }
             , { field: 'RecycStoreIdManageMobile', width: 200, title: '退回仓库管理者手机号', sort: true }
             , { field: 'PostType', width: 200, title: '寄回方式', sort: true }
             , { field: 'ErpName', width: 200, title: '快递名称', sort: true }
             , { field: 'ErpCode', width: 200, title: '快递单号', sort: true }
-            , { field: 'ResultDate', width: 200, title: '确认或驳回时间', sort: true }
-            , { field: 'CancelDate', width: 200, title: '创客撤销时间', sort: true }
+            // , { field: 'ResultDate', width: 200, title: '确认或驳回时间', sort: true }
+            // , { field: 'CancelDate', width: 200, title: '创客撤销时间', sort: true }
             , { field: 'RecycOrderNo', width: 200, title: '申请单号', sort: true }
 
-            , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
+            // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
             , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , where: {

+ 38 - 0
wwwroot/layuiadmin/modules_main/ToChargeBackRecord_Admin.js

@@ -1,4 +1,5 @@
 var ExcelData, ExcelKind;
+//机具扣款退还
 function ConfirmImport() {
     $.ajax({
         type: "POST",
@@ -22,6 +23,30 @@ function ConfirmImport() {
     });
 }
 
+//机具回收确认退还
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/ToChargeBackRecord/Imports?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else if (data.indexOf("warning") == 0) {
+                var datalist = data.split('|');
+                layer.alert(datalist[0], { time: 20000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
 var excel;
 layui.config({
     base: '/layuiadmin/' //静态资源所在路径
@@ -330,6 +355,19 @@ layui.config({
             });
             $("#excelTemp").html('<a href="/users/机具扣款退还模版.xlsx">点击下载机具扣款退还模版文件</a>');
         }
+        , ImportDatas: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/users/机具扣款退还模版.xlsx">点击下载机具扣款退还模版文件</a>');
+        }
         , ExportExcel: function () {
             var userdata = '';
             $(".layuiadmin-card-header-auto input").each(function (i) {