username@email.com
2024-09-09 cc170291673472d3cda8d7ea77f6bd3a3b5dbb83
增加了一些统计修改
7个文件已修改
93 ■■■■ 已修改文件
CoreCms.Net.IRepository/Order/ICoreCmsPlanOrderRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.IServices/Order/ICoreCmsPlanOrderServices.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Model/Entities/Order/CoreCmsPlanOrder.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Repository/Order/CoreCmsPlanOrderRepository.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Services/Order/CoreCmsPlanOrderServices.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsPlanOrderController.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/wwwroot/views/corecmsplanorder/index.html 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.IRepository/Order/ICoreCmsPlanOrderRepository.cs
@@ -92,7 +92,7 @@
        /// <returns></returns>
        Task<IPageList<CoreCmsPlanOrder>> QueryPageAsync(
            Expression<Func<CoreCmsPlanOrder, bool>> predicate,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, OtherData otherData, int pageIndex = 1,
            int pageSize = 20, bool blUseNoLock = false);
    }
CoreCms.Net.IServices/Order/ICoreCmsPlanOrderServices.cs
@@ -90,7 +90,7 @@
        /// <returns></returns>
        Task<IPageList<CoreCmsPlanOrder>> QueryPageAsync(
            Expression<Func<CoreCmsPlanOrder, bool>> predicate,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, OtherData otherData, int pageIndex = 1,
            int pageSize = 20, bool blUseNoLock = false);
        #endregion
CoreCms.Net.Model/Entities/Order/CoreCmsPlanOrder.cs
@@ -225,5 +225,31 @@
        public System.Decimal huaFeiAmount { get; set; }
        /// <summary>
        /// 调整订单金额
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public System.Decimal orderAmounts { get; set; }
        /// <summary>
        /// 计划订单金额
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public System.Decimal oldOrderAmounts { get; set; }
        /// <summary>
        /// 可用余额
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public System.Decimal keYongAmounts { get; set; }
    }
}
CoreCms.Net.Repository/Order/CoreCmsPlanOrderRepository.cs
@@ -21,6 +21,7 @@
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
using CoreCms.Net.Model.Entities.Order;
using CoreCms.Net.Model.Entities.baifenbingfa.puhuo;
namespace CoreCms.Net.Repository
{
@@ -170,7 +171,7 @@
        /// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
        /// <returns></returns>
        public async Task<IPageList<CoreCmsPlanOrder>> QueryPageAsync(Expression<Func<CoreCmsPlanOrder, bool>> predicate,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression,  OrderByType orderByType, OtherData otherData, int pageIndex = 1,
            int pageSize = 20, bool blUseNoLock = false)
        {
            RefAsync<int> totalCount = 0;
@@ -232,9 +233,28 @@
                    quxianId = p.quxianId,
                    pianqu = p.pianqu,
                    shouhuoAddress = p.shouhuoAddress,
                }).ToPageListAsync(pageIndex, pageSize, totalCount);
            }
            var pagetotal = DbClient.Queryable<CoreCmsPlanOrder>()
               // .GroupBy(it => new { it.CategoryId, it.CategoryName, it.goodsId, it.goodsName, it.productsId, it.productsName, it.price })
               .WhereIF(predicate != null, predicate)
               .Select(p => new CoreCmsPlanOrder
               {
                   oldOrderAmounts = SqlFunc.AggregateSum(p.oldOrderAmount),
                   orderAmounts = SqlFunc.AggregateSum(p.orderAmount),
                   keYongAmounts = SqlFunc.AggregateSum(p.keYongAmount),
               })
                 .First(); // 或者使用 Single/FirstOrDefault 等方法获取结果
            otherData.heji4 = pagetotal.oldOrderAmounts;
            otherData.heji5 = pagetotal.orderAmounts;
            otherData.heji6 = pagetotal.keYongAmounts;
            var list = new PageList<CoreCmsPlanOrder>(page, pageIndex, pageSize, totalCount);
            return list;
        }
CoreCms.Net.Services/Order/CoreCmsPlanOrderServices.cs
@@ -275,10 +275,10 @@
        /// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
        /// <returns></returns>
        public async Task<IPageList<CoreCmsPlanOrder>> QueryPageAsync(Expression<Func<CoreCmsPlanOrder, bool>> predicate,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
            Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, OtherData otherData , int pageIndex = 1,
            int pageSize = 20, bool blUseNoLock = false)
        {
            return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
            return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, otherData, pageIndex, pageSize, blUseNoLock);
        }
        #endregion
CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsPlanOrderController.cs
@@ -260,8 +260,9 @@
            {
                where = where.And(p => p.isdelete == false);
            }
            OtherData otherData = new OtherData();
            //获取数据
            var list = await _CoreCmsPlanOrderServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
            var list = await _CoreCmsPlanOrderServices.QueryPageAsync(where, orderEx, orderBy, otherData, pageCurrent, pageSize, true);
            if (list != null && list.Count > 0)
            {
@@ -278,6 +279,12 @@
            jm.code = 0;
            jm.count = list.TotalCount;
            jm.msg = "数据调用成功!";
            otherData.heji1 = list.Sum(x => x.oldOrderAmount);
            otherData.heji2 = list.Sum(x => x.orderAmount);
            otherData.heji3 = list.Sum(x => x.keYongAmount);
            jm.otherData = otherData;
            return jm;
        }
        #endregion
CoreCms.Net.Web.Admin/wwwroot/views/corecmsplanorder/index.html
@@ -306,28 +306,42 @@
                    text: {none: '暂无相关数据'},
                    cols: [
                        [
                            { type: "checkbox", fixed: "left" },
                            { type: "checkbox" },
                            { field: 'zizeng', width: 50, title: '序号', type: 'numbers' },
                            { field: 'orderId', title: '订单号', sort: false,width: 135 },
                            { field: 'shi', title: '市', sort: false, width: 50 },
                            { field: 'quxian', title: '区县', sort: false, width: 50 },
                            { field: 'pianqu', title: '片区', sort: false, width: 115 },
                            { field: 'pianqu', title: '片区', sort: false, width: 65 },
                         /*   { field: 'userId', title: '用户ID 关联user.id', sort: false,width: 105 },*/
                            { field: 'shipAddress', title: '学校', sort: false, width: 135 },
                            { field: 'shipName', title: '联系人', sort: false,width: 55 },
                            { field: 'shipMobile', title: '联系电话', sort: false, width: 115 },
                            { field: 'shouhuoAddress', title: '收货地址', sort: false, width: 265 },
                            { field: 'shouhuoAddress', title: '收货地址', sort: false, width: 165 },
                            { field: 'oldOrderAmount', title: '计划金额', sort: false, width: 75 },
                            { field: 'orderAmount', title: '调整金额', sort: false, width: 75 },
                            { field: 'keYongAmount', title: '可用余额', sort: false, width: 75 },
                            { field: 'keYongAmount', title: '可用余额', sort: false, width: 65 },
                            { field: 'createTime', title: '建立时间', width: 95, sort: false},
                            { field: 'upDataTime', title: '修改时间', width: 95, sort: false},
                            //{ field: 'createBy', title: '创建人', sort: false,width: 105 },
                            //{ field: 'upDataBy', title: '修改人', sort: false,width: 105 },
                            //{ field: 'isdelete', title: '删除标志', width: 95, templet: '#switch_isdelete', sort: false , unresize: true},
                            { field: 'statusText', title: '订单状态', sort: false, width: 65 },
                            { width: 222, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsPlanOrder-tableBox-bar' }
                            { field: 'statusText', title: '订单状态', sort: false, width: 55 },
                            { width: 222, align: 'center', title:'操作', toolbar: '#LAY-app-CoreCmsPlanOrder-tableBox-bar' }
                        ]
                    ]
                    ], done: function (res, curr, count) {
                        console.log(res);
                        // 创建合计行的HTML
                        var totalRowHtml = '<tr class="layui-table-total" style="background-color: #f2f2f2; font-weight: bold;">\
    <td></td><td></td><td colspan="8">当页合计</td><td>&nbsp;&nbsp;&nbsp;'+ res.otherData.heji1 + '</td><td>&nbsp;&nbsp;&nbsp;' + res.otherData.heji2 + '</td><td>&nbsp;&nbsp;&nbsp;' + res.otherData.heji3 + '</td><td></td><td></td><td></td><td></td>\
  </tr>\
  <tr class="layui-table-total" style="background-color: #e9e9e9; font-weight: bold;">\
    <td></td><td></td><td colspan="8">总合计</td><td>&nbsp;&nbsp;&nbsp;'+ res.otherData.heji4 + '</td><td>&nbsp;&nbsp;&nbsp;' + res.otherData.heji5 + '</td><td>&nbsp;&nbsp;&nbsp;' + res.otherData.heji6 + '</td><td></td><td></td><td></td><td></td>\
  </tr>';
                        // 将合计行添加到表格底部
                        $('#LAY-app-CoreCmsPlanOrder-tableBox').next().find('.layui-table-body tbody').append(totalRowHtml);
                    }
                });
                //监听排序事件
                table.on('sort(LAY-app-CoreCmsPlanOrder-tableBox)', function(obj){