移动系统liao
2024-08-15 f43970a061d3c90520b4e8f48caa17a204d9a085
CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs
@@ -1,7 +1,7 @@
/***********************************************************************
 *            Project: CoreCms
 *            Project: baifenBinfa
 *        ProjectName: 百分兵法管理系统                               
 *                Web: hhtp://chuanyin.com
 *                Web: http://chuanyin.com
 *             Author:                                        
 *              Email:                               
 *         CreateTime: 202403/02   
@@ -16,6 +16,7 @@
using CoreCms.Net.DTO.ComponentsDTO;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices.baifenbingfa;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.FromBody;
@@ -23,6 +24,7 @@
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Newtonsoft.Json;
using NPOI.POIFS.Properties;
using SqlSugar;
namespace CoreCms.Net.Repository
@@ -32,8 +34,10 @@
    /// </summary>
    public class CoreCmsGoodsRepository : BaseRepository<CoreCmsGoods>, ICoreCmsGoodsRepository
    {
        public CoreCmsGoodsRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
        private readonly IBfbfComAPIService _bfbfComAPIService;
        public CoreCmsGoodsRepository(IUnitOfWork unitOfWork,IBfbfComAPIService bfbfComAPIService) : base(unitOfWork)
        {
             _bfbfComAPIService = bfbfComAPIService;
        }
@@ -181,6 +185,7 @@
                        obj.goodsId = id;
                        obj.barcode = goods.bn;
                        obj.sn = p.sn;
                        obj.price = p.price;
                        obj.costprice = p.costprice;
                        obj.mktprice = p.mktprice;
@@ -194,6 +199,11 @@
                        obj.isDefalut = p.isDefalut;
                        obj.isDel = false;
                        obj.images = p.images;
                        //百分兵法添加
                        obj.distributionCutMoney = p.distributionCutMoney;
                        obj.cutMoney = p.cutMoney;
                        obj.distributionPrice= p.distributionPrice;
                        obj.isCustomizable = p.isCustomizable;
                        products.Add(obj);
                        var pd = new CoreCmsProductsDistribution();
@@ -202,6 +212,7 @@
                        pd.levelOne = p.levelOne;
                        pd.levelTwo = p.levelTwo;
                        pd.levelThree = p.levelThree;
                        pds.Add(pd);
                    });
@@ -244,7 +255,10 @@
                    obj.isDefalut = true;
                    obj.isDel = false;
                    obj.images = oldObj.images;
                    obj.distributionCutMoney = oldObj.distributionCutMoney;
                    obj.cutMoney = oldObj.cutMoney;
                    obj.distributionPrice = oldObj.distributionPrice;
                    obj.isCustomizable = oldObj.isCustomizable;
                    if (string.IsNullOrEmpty(obj.images))
                    {
                        obj.images = goods.image;
@@ -535,6 +549,10 @@
                                    p.points = child.points;
                                    p.stock = child.stock;
                                    p.weight = child.weight;
                                    p.distributionPrice = child.distributionPrice;
                                    p.cutMoney = child.cutMoney;
                                    p.distributionCutMoney = child.distributionCutMoney;
                                    p.isCustomizable= child.isCustomizable;
                                }
                            });
@@ -618,6 +636,10 @@
                            obj.points = p.points;
                            obj.isDefalut = p.isDefalut;
                            obj.images = p.images;
                            obj.distributionPrice = p.distributionPrice;
                            obj.cutMoney = p.cutMoney;
                            obj.distributionCutMoney = p.distributionCutMoney;
                            obj.isCustomizable  =p.isCustomizable;
                            if (string.IsNullOrEmpty(p.images))
                            {
                                obj.images = oldModel.image;
@@ -675,6 +697,10 @@
                            obj.images = newObj.images;
                            obj.isDefalut = true;
                            obj.isDel = false;
                            obj.distributionPrice = newObj.distributionPrice;
                            obj.cutMoney = newObj.cutMoney;
                            obj.distributionCutMoney = newObj.distributionCutMoney;
                            obj.isCustomizable = newObj.isCustomizable;
                            if (string.IsNullOrEmpty(newObj.images))
                            {
                                obj.images = oldModel.image;
@@ -707,6 +733,10 @@
                        obj.spesDesc = "";
                        obj.isDefalut = true;
                        obj.isDel = false;
                        obj.distributionPrice = newObj.distributionPrice;
                        obj.cutMoney = newObj.cutMoney;
                        obj.distributionCutMoney = newObj.distributionCutMoney;
                        obj.isCustomizable = newObj.isCustomizable;
                        if (string.IsNullOrEmpty(newObj.images))
                        {
                            obj.images = oldModel.image;
@@ -1709,6 +1739,9 @@
                        isRecommend = good.isRecommend,
                        isHot = good.isHot,
                        price = pd.price,
                        distributionCutMoney = pd.distributionCutMoney,
                        cutMoney = pd.cutMoney,
                        distributionPrice = pd.distributionPrice,
                        mktprice = pd.mktprice,
                        stock = pd.stock,
                        pointsDeduction = pd.pointsDeduction,
@@ -1716,6 +1749,9 @@
                        weight = pd.weight,
                        initialSales = good.initialSales,
                         areaCode = good.areaCode,
                         publisherId= good.publisherId,
                        auditStatus = good.auditStatus,
                    })
                    .With(SqlWith.NoLock)
                    .MergeTable()
@@ -1751,6 +1787,9 @@
                        createTime = good.createTime,
                        isRecommend = good.isRecommend,
                        isHot = good.isHot,
                        distributionCutMoney = pd.distributionCutMoney,
                        cutMoney = pd.cutMoney,
                        distributionPrice = pd.distributionPrice,
                        price = pd.price,
                        mktprice = pd.mktprice,
                        stock = pd.stock,
@@ -1758,6 +1797,8 @@
                        points = pd.points,
                        weight = pd.weight,
                        initialSales = good.initialSales,
                        publisherId= good.publisherId,
                        auditStatus= good.auditStatus,
                    })
                    .MergeTable()
                    .Where(predicate)
@@ -2216,6 +2257,9 @@
                        labelIds = good.labelIds,
                        createTime = good.createTime,
                        isRecommend = good.isRecommend,
                        distributionPrice = pd.distributionPrice,
                        distributionCutMoney = pd.distributionCutMoney,
                         cutMoney = pd.cutMoney,
                        isHot = good.isHot,
                        price = pd.price,
                        mktprice = pd.mktprice,
@@ -2262,6 +2306,9 @@
                        isRecommend = good.isRecommend,
                        isHot = good.isHot,
                        price = pd.price,
                        distributionPrice = pd.distributionPrice,
                        distributionCutMoney = pd.distributionCutMoney,
                        cutMoney = pd.cutMoney,
                        mktprice = pd.mktprice,
                        stock = pd.stock,
                        pointsDeduction = pd.pointsDeduction,
@@ -2322,6 +2369,9 @@
                        labelIds = good.labelIds,
                        createTime = good.createTime,
                        isRecommend = good.isRecommend,
                        distributionCutMoney = pd.distributionCutMoney,
                        cutMoney = pd.cutMoney,
                        distributionPrice=pd.distributionPrice,
                        isHot = good.isHot,
                        price = pd.price,
                        mktprice = pd.mktprice,
@@ -2368,6 +2418,9 @@
                        isRecommend = good.isRecommend,
                        isHot = good.isHot,
                        price = pd.price,
                        distributionCutMoney = pd.distributionCutMoney,
                        cutMoney = pd.cutMoney,
                        distributionPrice = pd.distributionPrice,
                        mktprice = pd.mktprice,
                        stock = pd.stock,
                        pointsDeduction = pd.pointsDeduction,