移动系统liao
2024-05-20 45c6d6e44e9e8428718fc635d71e0869556da2c3
no message
14个文件已修改
231 ■■■■■ 已修改文件
CoreCms.Net.IServices/baifenbingfa/IBfbfComAPIService.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Model/Entities/Good/CoreCmsGoodsCategoryPartial.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Model/Entities/Good/CoreCmsProductsPartial.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Repository/baifenbingfa/CoreCmsProductsRepository.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Services/baifenbingfa/BfbfComAPIService.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Task/RefreshWeChatAccessTokenJob.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/Controllers/Api/CommonAPIController.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/Controllers/Distribution/CoreCmsDistributionController.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/Controllers/baifenbingfa/CoreCmsProductsController.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/corecmsproducts/index.html 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/offlinedistributor/create.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/offlinedistributor/edit.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/offlinedistributor/index.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.IServices/baifenbingfa/IBfbfComAPIService.cs
@@ -1,4 +1,5 @@
using System;
using CoreCms.Net.Model.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -18,6 +19,12 @@
        /// <param name="s"></param>
        /// <returns></returns>
        Task<List<SearchUserData>> SearchUserData(string s);
        /// <summary>
        /// 获取商品分类
        /// </summary>
        /// <returns></returns>
        Task<List<CoreCmsGoodsCategory>> GetGoodsCategory();
        /// <summary>
        /// 检查用户是否是经销商
        /// </summary>
CoreCms.Net.Model/Entities/Good/CoreCmsGoodsCategoryPartial.cs
@@ -8,7 +8,9 @@
 *        Description: 暂无
 ***********************************************************************/
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.Model.Entities
@@ -24,5 +26,11 @@
        [Display(Name = "类别名称")]
        [SugarColumn(IsIgnore = true)]
        public string typeName { get; set; }
        /// <summary>
        /// 子树
        /// </summary>
        [SqlSugar.SugarColumn(IsIgnore = true)]
        public List<CoreCmsGoodsCategory> children { get; set; }
    }
}
CoreCms.Net.Model/Entities/Good/CoreCmsProductsPartial.cs
@@ -150,5 +150,12 @@
        [Display(Name = "商品分类")]
        [SugarColumn(IsIgnore = true)]
        public string Category { get; set; }
        /// <summary>
        ///    商品分类ID
        /// </summary>
        [Display(Name = "商品分类ID")]
        [SugarColumn(IsIgnore = true)]
        public int?  CategoryID { get; set; }
    }
}
CoreCms.Net.Repository/baifenbingfa/CoreCmsProductsRepository.cs
@@ -295,6 +295,7 @@
                            distributionPrice = product.distributionPrice,
                        cutMoney = product.cutMoney,
                        distributionCutMoney = product.distributionCutMoney,
                        CategoryID = Category.id,
                        Category =  (SqlFunc.Subqueryable<CoreCmsGoodsCategory> ().Where(x=>x.id==Category.parentId).Select(x=>x.name)+"-"+  Category.name)?? Category.name,
                    }).With(SqlWith.NoLock)
                    .MergeTable()
@@ -337,6 +338,7 @@
                        distributionPrice = product.distributionPrice,
                        cutMoney = product.cutMoney,
                        distributionCutMoney = product.distributionCutMoney,
                        CategoryID = Category.id,
                        Category = (SqlFunc.Subqueryable<CoreCmsGoodsCategory>().Where(x => x.id == Category.parentId).Select(x => x.name) + "-" + Category.name) ?? Category.name,
                    })
                    .MergeTable()
@@ -397,6 +399,7 @@
                        distributionPrice = product.distributionPrice,
                        cutMoney = product.cutMoney,
                        distributionCutMoney = product.distributionCutMoney,
                        CategoryID = Category.id,
                        Category = (SqlFunc.Subqueryable<CoreCmsGoodsCategory>().Where(x => x.id == Category.parentId).Select(x => x.name) + "-" + Category.name) ?? Category.name,
                    }).With(SqlWith.NoLock)
                    .MergeTable()
@@ -439,6 +442,7 @@
                        distributionPrice = product.distributionPrice,
                        cutMoney = product.cutMoney,
                        distributionCutMoney = product.distributionCutMoney,
                        CategoryID = Category.id,
                        Category = (SqlFunc.Subqueryable<CoreCmsGoodsCategory>().Where(x => x.id == Category.parentId).Select(x => x.name) + "-" + Category.name) ?? Category.name,
                    })
                    .MergeTable()
CoreCms.Net.Services/baifenbingfa/BfbfComAPIService.cs
@@ -32,7 +32,7 @@
           var ListData= await  _unitOfWork.GetDbClient().Queryable<CoreCmsUser>().Where(x => x.isDelete == false).Select(x => new SearchUserData
            {
                Id = x.id,
                name = x.mobile + "|" + x.userName + "|" + x.nickName,
                name = x.mobile /*+ "|" + x.userName*/ + "|" + x.nickName,
            }).WithCache(50).ToListAsync();
            if (string.IsNullOrEmpty(s))
@@ -58,5 +58,10 @@
            return false;
        }
        public async Task<List<CoreCmsGoodsCategory>> GetGoodsCategory()
        {
         return await   _unitOfWork.GetDbClient().Queryable<CoreCmsGoodsCategory>().Where(x=>x.isShow==true).WithCache(10).ToTreeAsync(x=>x.children, x=>x.parentId,0);
        }
    }
}
CoreCms.Net.Task/RefreshWeChatAccessTokenJob.cs
@@ -142,6 +142,7 @@
                if (!string.IsNullOrEmpty(_weChatOptions.WxOpenAppId) && !string.IsNullOrEmpty(_weChatOptions.WxOpenAppSecret))
                {
                    var entity = await _weChatAccessTokenServices.QueryByClauseAsync(p => p.appId == _weChatOptions.WxOpenAppId && p.appType == (int)GlobalEnumVars.AccessTokenEnum.WxOpenAccessToken);
                    if (entity == null || entity.expireTimestamp <= DateTimeOffset.Now.ToUnixTimeSeconds())
                    {
                        var client = _weChatApiHttpClientFactory.CreateWxOpenClient();
@@ -203,6 +204,18 @@
                    }
                    else
                    {
                      var value=  await _redisOperationRepository.Get<WeChatAccessToken>(
                               GlobalEnumVars.AccessTokenEnum.WxOpenAccessToken.ToString());
                        if (value == null)
                        {
                            //重新设置key
                            await _redisOperationRepository.SetAsync(
                            GlobalEnumVars.AccessTokenEnum.WxOpenAccessToken.ToString(), entity,
                            TimeSpan.FromMinutes(120));
                        }
                        //插入日志
                        var model = new SysTaskLog
                        {
CoreCms.Net.Web.Admin/Controllers/Api/CommonAPIController.cs
@@ -46,5 +46,30 @@
              
            return ret;
        }
    /// <summary>
    /// 获取商品分类列表  已上架的
    /// </summary>
    [HttpPost]
    [Description("获取商品分类列表")]
    [AllowAnonymous]
    public async Task<AdminUiCallBack> GetGoodsCategory()
    {
        var ret = new AdminUiCallBack();
        var data = await _comapiservice.GetGoodsCategory();
        if (data != null)
        {
            ret.code = 0;
            ret.data = data;
        }
        else
        {
            ret.msg = "读取用户数据失败";
        }
        return ret;
    }
    }
}
CoreCms.Net.Web.Admin/Controllers/Distribution/CoreCmsDistributionController.cs
@@ -32,6 +32,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis.Operations;
using NPOI.SS.Formula.Functions;
using SqlSugar;
using ZstdSharp.Unsafe;
@@ -437,6 +438,7 @@
                }
                await _coreCmsDistributionServices.InsertAsync(model);
                _unitOfWork.CommitTran();
@@ -738,11 +740,76 @@
                jm.msg = GlobalConstVars.DataisNo;
                return jm;
            }
            try
            {
                _unitOfWork.BeginTran();
                    //如果是取消审核
                    var allConfigs = await _coreCmsSettingServices.GetConfigDictionaries();
                    var kc = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DictionaryUserGroupKey);
                var group = await _userGradeServices.GetUserGradeByValueKey(kc);
                var defgroup = await _userGradeServices.GetDefaultUserGrade();
                    if (defgroup != null)
                    {
                        var olduser = await _userServices.QueryByIdAsync(model.userId);
                        if (olduser != null)
                        {//处理用户等级
                            if (olduser.grade == group.id)
                            {
                                if (defgroup != null)
                                {
                                    olduser.grade = defgroup.id;
                                }
                                else
                                {
                                    olduser.grade = 0;
                                }
                                olduser.updataTime = DateTime.Now;
                                await _userServices.UpdateAsync(olduser);
                            }
                        }
                        var store = await _coreCmsStoreServices.QueryByClauseAsync(x => x.userID == model.userId);
                        //处理店铺  取消已有店铺的使能
                       if(store != null )
                        {
                        // var clerk= await _unitOfWork.GetDbClient().Queryable<CoreCmsClerk>().Where(x => x.storeId == store.id).ToListAsync();
                        //删除店铺员工
                         await _unitOfWork.GetDbClient().Deleteable<CoreCmsClerk>().Where(x=>x.storeId==store.id).ExecuteCommandAsync();
                        //删除店铺
                        await _coreCmsStoreServices.DeleteByIdAsync(store.id);
                    }
                    }
            var bl = await _coreCmsDistributionServices.DeleteByIdAsync(entity.id);
                _unitOfWork.CommitTran();
            jm.code = bl ? 0 : 1;
            jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
            return jm;
            }
            catch (Exception)
            {
                _unitOfWork.RollbackTran();
                jm.code = 1;
                jm.msg = GlobalConstVars.DeleteFailure;
                return jm;
            }
        }
@@ -817,5 +884,10 @@
        }
        #endregion
    }
}
CoreCms.Net.Web.Admin/Controllers/baifenbingfa/CoreCmsProductsController.cs
@@ -32,6 +32,9 @@
using SqlSugar;
using CoreCms.Net.Web.Admin.Infrastructure;
using Microsoft.IdentityModel.Tokens;
using NPOI.SS.Formula.PTG;
using CoreCms.Net.IServices.baifenbingfa;
using CoreCms.Net.Services;
namespace CoreCms.Net.Web.Admin.Controllers
{
@@ -47,16 +50,23 @@
    {
        private readonly IWebHostEnvironment _webHostEnvironment;
        private readonly ICoreCmsbaifenProductsServices _CoreCmsProductsServices;
        private  readonly IBfbfComAPIService _fbfComAPIService;
        private readonly ICoreCmsGoodsCategoryServices _coreCmsGoodsCategoryServices;
        /// <summary>
        /// 构造函数
        ///</summary>
        public CoreCmsbaifenProductsController(IWebHostEnvironment webHostEnvironment
            ,ICoreCmsbaifenProductsServices CoreCmsProductsServices
            )
            , IBfbfComAPIService bfbfComAPIService
,
ICoreCmsGoodsCategoryServices coreCmsGoodsCategoryServices)
        {
            _webHostEnvironment = webHostEnvironment;
            _CoreCmsProductsServices = CoreCmsProductsServices;
            _fbfComAPIService = bfbfComAPIService;
            _coreCmsGoodsCategoryServices=
            _coreCmsGoodsCategoryServices = coreCmsGoodsCategoryServices;
        }
        #region 获取列表============================================================
@@ -128,10 +138,10 @@
                where = where.And(p => p.price == price);
            }
            //商品分类 decimal
            var Category = Request.Form["category"].FirstOrDefault();
            if (!string.IsNullOrEmpty(Category))
            var Category = Request.Form["categoryId"].FirstOrDefault().ToInt32OrDefault();
            if (Category>0)
            {
                where = where.And(p => p.Category.Contains(Category));
                where = where.And(p => p.CategoryID== Category);
            }
            //货品成本价 decimal
            var costprice = Request.Form["costprice"].FirstOrDefault().ObjectToDecimal(0);
@@ -254,10 +264,13 @@
        /// <returns></returns>
        [HttpPost]
        [Description("首页数据")]
        public AdminUiCallBack GetIndex()
        public async Task< AdminUiCallBack> GetIndex()
        {
            //返回数据
            var jm = new AdminUiCallBack { code = 0 };
             var categories =  await _coreCmsGoodsCategoryServices.QueryListByClauseAsync(p => p.isShow, p => p.sort, OrderByType.Asc, true, true);
            jm.data = GoodsHelper.GetTree(categories, false);
            return jm;
        }
        #endregion
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/corecmsproducts/index.html
@@ -30,7 +30,8 @@
            <div class="layui-inline">
                <label class="layui-form-label" for="category">商品分类</label>
                <div class="layui-input-inline">
                    <input type="text" name="category"  placeholder="请输入商品分类关键字" class="layui-input">
                    <div id="sel_category_ptindes555" class="ew-xmselect-tree" lay-reqText="请选择商品分类"></div>
                </div>
            </div>
            <div class="layui-inline">
@@ -200,8 +201,11 @@
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d); }
        indexData = d.data;
        layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
        indexData = d.data .data
        if (debug) { console.log(indexData); }
        layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper','xmSelect'],
            function () {
                var $ = layui.$
                    , admin = layui.admin
@@ -210,6 +214,7 @@
                    , laydate = layui.laydate
                    , setter = layui.setter
                    , coreHelper = layui.coreHelper
                    ,xmSelect = layui.xmSelect
                    , util = layui.util
                    , view = layui.view;
                
@@ -223,6 +228,7 @@
                        //执行重载
                        table.reloadData('LAY-app-CoreCmsbaifenProducts-tableBox',{ where: field });
                    });
                //数据绑定
                table.render({
                    elem: '#LAY-app-CoreCmsbaifenProducts-tableBox',
@@ -278,6 +284,27 @@
                        ]
                    ]
                });
            xmSelect.render({
                    el: '#sel_category_ptindes555',
                    height: '250px',
                    data: indexData,
                    //initValue: mData ? [mData.parentId] : [],
                    //model: { label: { type: 'text' } },
                    name: 'categoryId',
                    prop: {
                        name: 'title',
                        value: 'id'
                    },
                    radio: true,
                    clickClose: true,
                    tree: {
                        show: true,
                        indent: 15,
                        strict: false,
                        expandedKeys: true
                    }
                });
                //监听排序事件
                table.on('sort(LAY-app-CoreCmsbaifenProducts-tableBox)', function(obj){
                    table.reloadData('LAY-app-CoreCmsbaifenProducts-tableBox', {
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/offlinedistributor/create.html
@@ -256,6 +256,10 @@
              title: "小卖部",
              id: 103,
            },
            {
              title: "其他",
              id: 104,
            },
          ],
          click: function (obj) {
            this.elem.val(obj.title);
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/offlinedistributor/edit.html
@@ -484,6 +484,10 @@
              title: "小卖部",
              id: 103,
            },
            {
              title: "其他",
              id: 104,
            },
          ],
          click: function (obj) {
            this.elem.val(obj.title);
CoreCms.Net.Web.Admin/wwwroot/views/baifenbingfa/offlinedistributor/index.html
@@ -419,6 +419,10 @@
              title: "小卖部",
              id: 103,
            },
            {
              title: "其他",
              id: 104,
            },
          ],
          click: function (obj) {
            this.elem.val(obj.title);
CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html
@@ -295,7 +295,7 @@
                            },
                            { field: 'orderAmount', title: '订单总额', width: 120, align: 'center', templet: '#orderAmount', totalRow: true },
                            {
                                field: 'item', title: '货品', align: 'center', width: 330, templet: "#orderItems"
                                field: 'item', title: '货品', align: 'center', width: 550, templet: "#orderItems"
                            },
                            {
                                field: 'orderAmount',
@@ -378,6 +378,9 @@
                                templet: function (data) {
                                    for (var i = 0; i < d.data.shipStatus.length; i++) {
                                        if (data.shipStatus == d.data.shipStatus[i].value) {
                                            if(d.data.shipStatus[i].description == "已发货")
                                            return "√"
                                            return d.data.shipStatus[i].description;
                                        }
                                    }
@@ -391,6 +394,8 @@
                                templet: function (data) {
                                    for (var i = 0; i < d.data.confirmStatus.length; i++) {
                                        if (data.confirmStatus == d.data.confirmStatus[i].value) {
                                            if(d.data.confirmStatus[i].description == "已确认收货")
                                            return "√"
                                            return d.data.confirmStatus[i].description;
                                        }
                                    }
@@ -1300,15 +1305,18 @@
    <div class="order-min-table">
        <table class="layui-table" lay-size="sm">
            <colgroup>
                <col width="500">
                <col width="40">
                <col width="200">
                <col width="300">
                <col width="40">
                <col width="40">
                <col width="40">
            </colgroup>
            <thead>
                <tr>
                    <th colspan="2" style="width: 200px;">货品</th>
                    <th colspan="1" style="width: 400px;">商品名称</th>
                    <th colspan="2" style="width: 300px;">货品</th>
                    <th style="width: 40px;">数量</th>
                    <th style="width: 40px;">单价</th>
                    <th style="width: 40px;">优惠</th>
@@ -1317,8 +1325,12 @@
            </thead>
            <tbody>
                {{# layui.each(d.items, function(index, item){ }}
                <tr lay-tips="{{item.name}}">
                    <td>
                        {{item.name}}
                    </td>
                    <td>
                        <a href="javascript:void(0);" onclick="layui.coreHelper.viewImage('{{item.imageUrl}}')"><image style="max-width: 30px; max-height: 30px;" src="{{item.imageUrl}}" /></a>
                    </td>
                    <td style="text-align: left">