移动系统liao
2024-05-09 5d6cb15ac86d9174393cb9d1538d69b567e2c26c
修改货品编辑bug
5个文件已修改
84 ■■■■ 已修改文件
CoreCms.Net.IServices/baifenbingfa/ICoreCmsProductsServices.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Repository/baifenbingfa/CoreCmsProductsRepository.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Services/baifenbingfa/CoreCmsProductsServices.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/Controllers/baifenbingfa/CoreCmsProductsController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/corecmsproducts/index.html 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.IServices/baifenbingfa/ICoreCmsProductsServices.cs
@@ -116,5 +116,12 @@
        /// <returns></returns>
        public Task<List<CoreCmsProducts>> QueryDetaiListAsync(Expression<Func<CoreCmsProducts, bool>> predicate,
            Expression<Func<CoreCmsProducts, object>> orderByExpression, OrderByType orderByType, bool blUseNoLock = false);
        /// <summary>
        ///     获取编辑相关字段
        /// </summary>
        /// <returns></returns>
        public Task<CoreCmsProducts> QueryEditByID(int  id);
    }
}
CoreCms.Net.Repository/baifenbingfa/CoreCmsProductsRepository.cs
@@ -62,6 +62,7 @@
        {
            var jm = new AdminUiCallBack();
            var oldModel = await DbClient.Queryable<CoreCmsProducts>().In(entity.id).SingleAsync();
            if (oldModel == null)
            {
@@ -69,23 +70,23 @@
            return jm;
            }
            //事物处理过程开始
            oldModel.id = entity.id;
            oldModel.goodsId = entity.goodsId;
            oldModel.barcode = entity.barcode;
            oldModel.sn = entity.sn;
            oldModel.price = entity.price;
            oldModel.costprice = entity.costprice;
            oldModel.mktprice = entity.mktprice;
            oldModel.marketable = entity.marketable;
            oldModel.pointsDeduction = entity.pointsDeduction;
            oldModel.points = entity.points;
            //oldModel.marketable = entity.marketable;
            //oldModel.pointsDeduction = entity.pointsDeduction;
            //oldModel.points = entity.points;
            oldModel.weight = entity.weight;
            oldModel.stock = entity.stock;
            oldModel.freezeStock = entity.freezeStock;
            oldModel.spesDesc = entity.spesDesc;
            oldModel.isDefalut = entity.isDefalut;
            oldModel.images = entity.images;
            oldModel.isDel = entity.isDel;
            //oldModel.stock = entity.stock;
            //oldModel.freezeStock = entity.freezeStock;
            oldModel.distributionPrice = entity.distributionPrice;
            oldModel.cutMoney = entity.cutMoney;
            oldModel.distributionCutMoney = entity.distributionCutMoney;
@@ -161,7 +162,7 @@
        }
        #endregion
        #region 重写根据条件查询分页数据
        /// <summary>
CoreCms.Net.Services/baifenbingfa/CoreCmsProductsServices.cs
@@ -20,6 +20,7 @@
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
using static CoreCms.Net.Configuration.GlobalEnumVars;
namespace CoreCms.Net.Services
@@ -151,6 +152,43 @@
        {
            return await _dal.QueryDetaiListAsync(predicate, orderByExpression, orderByType, blUseNoLock);
        }
        public async Task<CoreCmsProducts> QueryEditByID(int id)
        {
            return  await _unitOfWork.GetDbClient().Queryable<CoreCmsGoods, CoreCmsProducts>((good, product) => new JoinQueryInfos(
                     JoinType.Inner, good.id == product.goodsId
           )
            ).Where((good, product) =>product.id==id)
                .Select((good, product) => new CoreCmsProducts
                {
                    id = product.id,
                    goodsId = product.goodsId,
                    barcode = product.barcode,
                    sn = product.sn,
                    price = product.price,
                    costprice = product.costprice,
                    mktprice = product.mktprice,
                    marketable = product.marketable,
                    weight = product.weight,
                    stock = product.stock,
                    freezeStock = product.freezeStock,
                    pointsDeduction = product.pointsDeduction,
                    points = product.points,
                    spesDesc = product.spesDesc,
                    isDefalut = product.isDefalut,
                    images = product.images,
                    isDel = good.isDel,
                    name = good.name,
                    bn = good.bn,
                    isMarketable = good.isMarketable,
                    unit = good.unit,
                    distributionPrice = product.distributionPrice,
                    cutMoney = product.cutMoney,
                    distributionCutMoney = product.distributionCutMoney,
                }).With(SqlWith.NoLock)
                .FirstAsync();
        }
        #endregion
CoreCms.Net.Web.Admin/Controllers/baifenbingfa/CoreCmsProductsController.cs
@@ -307,7 +307,7 @@
        {
            var jm = new AdminUiCallBack();
            var model = await _CoreCmsProductsServices.QueryByIdAsync(entity.id, false);
            var model = await _CoreCmsProductsServices.QueryEditByID(entity.id);
            if (model == null)
            {
                jm.msg = "不存在此信息";
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/corecmsproducts/index.html
@@ -286,10 +286,10 @@
                    });
                });
                //监听行双击事件
                table.on('rowDouble(LAY-app-CoreCmsbaifenProducts-tableBox)', function (obj) {
                    //查看详情
                    doDetails(obj);
                });
                // table.on('rowDouble(LAY-app-CoreCmsbaifenProducts-tableBox)', function (obj) {
                //     //查看详情
                //     doDetails(obj);
                // });
                //头工具栏事件
                table.on('pagebar(LAY-app-CoreCmsbaifenProducts-tableBox)', function (obj) {
                    var checkStatus = table.checkStatus(obj.config.id);