Просмотр исходного кода

Merge branch 'DuGuYang' into develop

lichunlei 3 лет назад
Родитель
Сommit
dd65d9d2ab

+ 13 - 3
Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs

@@ -485,16 +485,26 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BindingState == 0) dic["BindingState"] = "未绑定";
                 if (BindingState == 1) dic["BindingState"] = "已绑定";
                 //绑定时间
-                DateTime BindingTime = Convert.ToDateTime(dic["BindingTime"].ToString());
+                if (!string.IsNullOrEmpty(dic["BindingTime"].ToString()))
+                {
+                    DateTime BindingTime = Convert.ToDateTime(dic["BindingTime"].ToString());
+                }
+
                 //激活状态
                 int ActivationState = int.Parse(dic["ActivationState"].ToString());
                 if (ActivationState == 0) dic["ActivationState"] = "未激活";
                 if (ActivationState == 1) dic["ActivationState"] = "已激活";
                 //激活时间
-                DateTime ActivationTime = Convert.ToDateTime(dic["ActivationTime"].ToString());
+                if (!string.IsNullOrEmpty(dic["ActivationTime"].ToString()))
+                {
+                    DateTime ActivationTime = Convert.ToDateTime(dic["ActivationTime"].ToString());
+                }
 
                 //划拨时间
-                DateTime TransferTime = Convert.ToDateTime(dic["TransferTime"].ToString());
+                if (!string.IsNullOrEmpty(dic["TransferTime"].ToString()))
+                {
+                    DateTime TransferTime = Convert.ToDateTime(dic["TransferTime"].ToString());
+                }
                 //所属创客
                 int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
                 Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();

+ 40 - 4
Areas/Admin/Controllers/MainServer/SysRechargeRecordController.cs

@@ -51,14 +51,14 @@ namespace MySystem.Areas.Admin.Controllers
         /// 创客奖励记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(SysRechargeRecord data, string MakerCode, string RealName, string StatusSelect, string SyncStatusSelect, int page = 1, int limit = 30)
+        public JsonResult IndexData(SysRechargeRecord data, string MakerCode, string RealName, string RechargeRecNo, string BatchCode, string BizTimeData, string StatusSelect, string SyncStatusSelect, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
-            Fields.Add("RechargeRecNo", "1"); //奖励单号
+            // Fields.Add("RechargeRecNo", "1"); //奖励单号
             Fields.Add("BizType", "0"); //业务类型
-            Fields.Add("BatchCode", "1"); //批次号
-            Fields.Add("BizTime", "3"); //奖励时间
+            // Fields.Add("BatchCode", "1"); //批次号
+            // Fields.Add("BizTime", "3"); //奖励时间
 
             string condition = " and Status>-1";
             //创客编号
@@ -71,6 +71,21 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
             }
+            //奖励单号
+            if (!string.IsNullOrEmpty(RechargeRecNo))
+            {
+                condition += " and RechargeRecNo=" + RechargeRecNo;
+            }
+            //批次号
+            if (!string.IsNullOrEmpty(BatchCode))
+            {
+                condition += " and BatchCode=" + BatchCode;
+            }
+            //业务类型
+            // if (BizType > 0) 
+            // {
+            //     condition += " and BizType=" + BizType;
+            // }
             //状态
             if (!string.IsNullOrEmpty(StatusSelect))
             {
@@ -81,6 +96,13 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and SyncStatus=" + SyncStatusSelect;
             }
+            if(!string.IsNullOrEmpty(BizTimeData))
+            {
+                string[] datelist = BizTimeData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and BizTime>='" + start + " 00:00:00' and BizTime<='" + end + " 23:59:59'";
+            }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("SysRechargeRecord", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
@@ -104,6 +126,8 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, object> other = new Dictionary<string, object>();
             string BizAmount30 = "0.00";//红包奖励
             string BizAmount31 = "0.00";//活动奖励
+            string BizAmount114 = "0.00";//私董会分红
+            string BizAmount115 = "0.00";//分仓奖励
             DataTable dt = OtherMySqlConn.dtable("select sum(Amount) from SysRechargeRecord where BizType=30" + condition);
             if (dt.Rows.Count > 0)
             {
@@ -114,8 +138,20 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 BizAmount31 = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
             }
+            dt = OtherMySqlConn.dtable("select sum(Amount) from SysRechargeRecord where BizType=114" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                BizAmount114 = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            dt = OtherMySqlConn.dtable("select sum(Amount) from SysRechargeRecord where BizType=115" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                BizAmount115 = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
             other.Add("BizAmount30", BizAmount30);
             other.Add("BizAmount31", BizAmount31);
+            other.Add("BizAmount114", BizAmount114);
+            other.Add("BizAmount115", BizAmount115);
             obj.Add("other", other);
             return Json(obj);
         }

+ 21 - 22
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -1437,7 +1437,7 @@ namespace MySystem.Areas.Admin.Controllers
 
             string condition = " and Status>-1";
             string con = " and Status>-1";
-            string cons = " and Status>=-1";
+            // string cons = " and Status>=-1";
             string sort = "Id desc";
             //创客编号
             if (!string.IsNullOrEmpty(MakerCode))
@@ -1457,7 +1457,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             if (!string.IsNullOrEmpty(BrandSelect.ToString()))
             {
-                cons += " and BrandId='" + BrandId + "'";
+                con += " and BrandId='" + BrandId + "'";
             }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Users", Fields, sort, "True", page, limit, condition);
@@ -1502,8 +1502,8 @@ namespace MySystem.Areas.Admin.Controllers
             int JCountwd = 0;
             decimal YAmtwd = 0;
 
-            int BCount = 0;
-            int ACount = 0;
+            // int BCount = 0;
+            // int ACount = 0;
 
             WebCMSEntities db = new WebCMSEntities();
             Dictionary<string, object> other = new Dictionary<string, object>();
@@ -1568,16 +1568,16 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
             }
-            dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND ActivationState=0 AND UserId= '" + ParentId + "'" + cons);
-            if (dt.Rows.Count > 0)
-            {
-                BCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
-            }
-            dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND ActivationState=1 AND UserId= '" + ParentId + "'" + cons);
-            if (dt.Rows.Count > 0)
-            {
-                ACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
-            }
+            // dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND ActivationState=0 AND UserId= '" + ParentId + "'" + cons);
+            // if (dt.Rows.Count > 0)
+            // {
+            //     BCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
+            // }
+            // dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND ActivationState=1 AND UserId= '" + ParentId + "'" + cons);
+            // if (dt.Rows.Count > 0)
+            // {
+            //     ACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
+            // }
 
             other.Add("TotalAmtfc", TotalAmtfc);
             other.Add("DAmtfc", DAmtfc);
@@ -1593,8 +1593,8 @@ namespace MySystem.Areas.Admin.Controllers
             other.Add("JCountwd", JCountwd);
             other.Add("YAmtwd", YAmtwd);
 
-            other.Add("BCount", BCount);
-            other.Add("ACount", ACount);
+            // other.Add("BCount", BCount);
+            // other.Add("ACount", ACount);
             db.Dispose();
             obj.Add("other", other);
 
@@ -1610,6 +1610,7 @@ namespace MySystem.Areas.Admin.Controllers
             if (!string.IsNullOrEmpty(BrandId.ToString()) && BrandId > 0)
             {
                 condition += " and BrandId =" + BrandId;
+                cons += " and BrandId =" + BrandId;
             }
             //创客Id
             if (!string.IsNullOrEmpty(UserId.ToString()))
@@ -1620,15 +1621,13 @@ namespace MySystem.Areas.Admin.Controllers
             if (!string.IsNullOrEmpty(sTradeDate))
             {
                 condition += " and TradeDate >=" + Convert.ToInt32(sTradeDate);
+                cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') >=" + Convert.ToInt32(sTradeDate);
             }
             //结束时间
             if (!string.IsNullOrEmpty(eTradeDate))
             {
                 condition += " and TradeDate <=" + Convert.ToInt32(eTradeDate);
-            }
-            if (!string.IsNullOrEmpty(BrandId.ToString()))
-            {
-                cons += " and BrandId='" + BrandId + "'";
+                cons += " and DATE_FORMAT(BindingTime,'%Y%m%d') <=" + Convert.ToInt32(eTradeDate);
             }
 
             //扶持期
@@ -1713,12 +1712,12 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 YAmtwd = Convert.ToDecimal(function.CheckNum(dt.Rows[0][0].ToString()));
             }
-            dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND ActivationState=0 AND UserId= '" + UserId + "'" + cons);
+            dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND UserId= '" + UserId + "'" + cons);
             if (dt.Rows.Count > 0)
             {
                 BCount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));
             }
-            dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE BindingState=1 AND ActivationState=1 AND UserId= '" + UserId + "'" + cons);
+            dt = OtherMySqlConn.dtable("SELECT COUNT(0) count FROM PosMachinesTwo WHERE ActivationState=1 AND UserId= '" + UserId + "'" + cons);
             if (dt.Rows.Count > 0)
             {
                 ACount = Convert.ToInt32(function.CheckNum(dt.Rows[0][0].ToString()));

+ 6 - 2
Areas/Admin/Views/MainServer/SysRechargeRecord/Index.cshtml

@@ -69,8 +69,10 @@
                         <div class="layui-input-inline">
                             <select id="BizType" name="BizType" lay-search="">
                                 <option value="">全部...</option>
-                                <option value="1">红包奖励</option>
-                                <option value="2">活动奖励</option>
+                                <option value="30">红包奖励</option>
+                                <option value="31">活动奖励</option>
+                                <option value="114">私董会分红</option>
+                                <option value="115">分仓奖励</option>
                             </select>
                         </div>
                     </div>
@@ -128,6 +130,8 @@
                 </div>
                 <blockquote class="layui-elem-quote layui-text">
                     红包奖励(元):<span style="color: #f00;" id="BizAmount30">0.00</span> | 活动奖励(元):<span style="color: #f00;" id="BizAmount31">0.00</span>
+                    <br>
+                    私董会分红(元):<span style="color: #f00;" id="BizAmount114">0.00</span> | 分仓奖励(元):<span style="color: #f00;" id="BizAmount115">0.00</span>
                 </blockquote>
                 
                 <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>

+ 96 - 94
wwwroot/layuiadmin/modules_main/SysRechargeRecord_Admin.js

@@ -31,76 +31,76 @@ layui.config({
     //- 筛选条件-日期
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
-elem: '#CreateDate',
-type: 'date',
-range: true,
-trigger: 'click',
-change: function (value, date, endDate) {
-var op = true;
-if (date.year == endDate.year && endDate.month - date.month <= 1) {
-if (endDate.month - date.month == 1 && endDate.date > date.date) {
-op = false;
-layCreateDate.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-} else {
-op = false;
-layCreateDate.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-if (op) {
-$('#CreateDate').val(value);
-}
-}
-});
-var layBizTime = laydate.render({
-elem: '#BizTime',
-trigger: 'click',
-type: 'date',
-range: true,
-change: function (value, date, endDate) {
-var op = true;
-if (date.year == endDate.year && endDate.month - date.month <= 1) {
-if (endDate.month - date.month == 1 && endDate.date > date.date) {
-op = false;
-layBizTime.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-} else {
-op = false;
-layBizTime.hint('日期范围请不要超过1个月');
-setTimeout(function () {
-$(".laydate-btns-confirm").addClass("laydate-disabled");
-}, 1);
-}
-if (op) {
-$('#BizTime').val(value);
-}
-}
-});
+        elem: '#CreateDate',
+        type: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+    var layBizTime = laydate.render({
+        elem: '#BizTime',
+        trigger: 'click',
+        type: 'date',
+        range: true,
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layBizTime.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layBizTime.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#BizTime').val(value);
+            }
+        }
+    });
 
 
     //excel导入
-    excel = layui.excel;        
+    excel = layui.excel;
     $('#ExcelFile').change(function (e) {
         var files = e.target.files;
-        excel.importExcel(files, { }, function (data) {
+        excel.importExcel(files, {}, function (data) {
             ExcelData = data[0].Sheet1;
         });
     });
 
     //监听单元格编辑
-    table.on('edit(LAY-list-manage)', function(obj){
+    table.on('edit(LAY-list-manage)', function (obj) {
         var value = obj.value //得到修改后的值
-        ,data = obj.data //得到所在行所有键值
-        ,field = obj.field; //得到字段
-        if(field == "Sort"){
+            , data = obj.data //得到所在行所有键值
+            , field = obj.field; //得到字段
+        if (field == "Sort") {
             $.ajax({
                 type: "POST",
                 url: "/Admin/SysRechargeRecord/Sort?r=" + Math.random(1),
@@ -111,28 +111,28 @@ $('#BizTime').val(value);
             });
         }
     });
-    
+
     //列表数据
     table.render({
         elem: '#LAY-list-manage'
         , url: '/Admin/SysRechargeRecord/IndexData' //模拟接口
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
-            ,{field:'RechargeRecNo', width: 200, title:'奖励单号', sort: true}
-            ,{field:'BatchCode', width: 200, title:'批次号', sort: true}
-            ,{field:'MakerCode', width: 200, title:'创客编号', sort: true}
-            ,{field:'RealName', width: 200, title:'创客姓名', sort: true}
-            ,{field:'BizType', width: 200, title:'业务类型', sort: true}
-            ,{field:'ProductType', width: 200, title:'产品类型', sort: true}
-            ,{field:'Amount', width: 200, title:'奖励金额(元)', sort: true}
-            ,{field:'Status', width: 200, title:'状态', sort: true}
-            ,{field:'SeoDescription', width: 200, title:'备注', sort: true}
-            ,{field:'BizTime', width: 200, title:'奖励时间', sort: true}
-            ,{field:'SyncStatus', width: 200, title:'同步状态', sort: true}
-            ,{field:'CreateMan', width: 200, title:'操作员', sort: true}
+            , { field: 'RechargeRecNo', width: 200, title: '奖励单号', sort: true }
+            , { field: 'BatchCode', width: 200, title: '批次号', sort: true }
+            , { field: 'MakerCode', width: 200, title: '创客编号', sort: true }
+            , { field: 'RealName', width: 200, title: '创客姓名', sort: true }
+            , { field: 'BizType', width: 200, title: '业务类型', sort: true }
+            , { field: 'ProductType', width: 200, title: '产品类型', sort: true }
+            , { field: 'Amount', width: 200, title: '奖励金额(元)', sort: true }
+            , { field: 'Status', width: 200, title: '状态', sort: true }
+            , { field: 'SeoDescription', width: 200, title: '备注', sort: true }
+            , { field: 'BizTime', width: 200, title: '奖励时间', sort: true }
+            , { field: 'SyncStatus', width: 200, title: '同步状态', sort: true }
+            , { field: 'CreateMan', width: 200, title: '操作员', sort: true }
         ]]
         , where: {
-            
+
         }
         , page: true
         , limit: 30
@@ -141,6 +141,8 @@ $('#BizTime').val(value);
         , done: function (res, curr, count) {
             $("#BizAmount30").text(res.other.BizAmount30);
             $("#BizAmount31").text(res.other.BizAmount31);
+            $("#BizAmount114").text(res.other.BizAmount114);
+            $("#BizAmount115").text(res.other.BizAmount115);
             $(".layui-none").text("无数据");
         }
     });
@@ -156,7 +158,7 @@ $('#BizTime').val(value);
                     data: "Id=" + data.Id,
                     dataType: "text",
                     success: function (data) {
-                        if (data == "success") {                            
+                        if (data == "success") {
                             obj.del();
                             layer.close(index);
                         } else {
@@ -179,20 +181,20 @@ $('#BizTime').val(value);
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () { 
+                    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) {
@@ -203,7 +205,7 @@ $('#BizTime').val(value);
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-                        
+
                         $.ajax({
                             type: "POST",
                             url: "/Admin/SysRechargeRecord/Edit?r=" + Math.random(1),
@@ -296,20 +298,20 @@ $('#BizTime').val(value);
                         , submitID = 'LAY-list-front-submit'
                         , submit = layero.find('iframe').contents().find('#' + submitID);
 
-                    setTimeout(function () { 
+                    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) {
@@ -320,7 +322,7 @@ $('#BizTime').val(value);
                         }
                         //提交 Ajax 成功后,静态更新表格中的数据
                         //$.ajax({});
-                        
+
                         $.ajax({
                             type: "POST",
                             url: "/Admin/SysRechargeRecord/Add?r=" + Math.random(1),
@@ -376,9 +378,9 @@ $('#BizTime').val(value);
         , Open: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if(data.length < 1){
+            if (data.length < 1) {
                 parent.layer.msg("请选择要开启的项");
-            }else{
+            } else {
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";
@@ -405,9 +407,9 @@ $('#BizTime').val(value);
         , Close: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if(data.length < 1){
+            if (data.length < 1) {
                 parent.layer.msg("请选择要关闭的项");
-            }else{
+            } else {
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";
@@ -434,9 +436,9 @@ $('#BizTime').val(value);
         , sycn: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if(data.length < 1){
+            if (data.length < 1) {
                 parent.layer.msg("请选择要同步的项");
-            }else{
+            } else {
                 var ids = "";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";