SourceCode/RFrameGenerate.BLL/Logistics/ShippingMethodManage.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using RFrameGenerate.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RFramework.SQLQuery;

namespace RFrameGenerate.BLL.Logistics
{
    public class ShippingMethodManage
    {
        #region 读取数据

        /// <summary>
        /// 获取运送方式列表
        /// </summary>
        public static List<T_BAS_ShippingMethod> GetListByTemplate(Guid templatesGuid)
        {
            if (templatesGuid == Guid.Empty) return new List<T_BAS_ShippingMethod>();

            using (var query = Factory.CreateT_BAS_ShippingMethod())
            {
                return query.GetList(m => m.TemplatesGuid == templatesGuid);
            }
        }
        #endregion

        #region 逻辑处理

        /// <summary>
        /// 获取对应运费方式
        /// </summary>
        public static T_BAS_ShippingMethod GetShippingMethod(Guid templatesGuid, string areaCode)
        {
            if (string.IsNullOrEmpty(areaCode)) return GetDefaultMethod(templatesGuid);

            var method = GetMethodByAreaCode(templatesGuid, areaCode);

            if (method != null) return method;

            return GetDefaultMethod(templatesGuid);
        }

        /// <summary>
        /// 计算指定方式运费
        /// </summary>
        public static PriceResult GetFreightByMethod(T_BAS_ShippingMethod method, int total)
        {
            if (method == null) return new PriceResult(false, "指定运送方式不能为空!");

            if (method.FirstArticleNum == null) return new PriceResult(false, "指定运送方式首次数量不能为空!");

            if (method.FirstArticlePrice == null) return new PriceResult(false, "指定运送方式首次运费不能为空");

            if (method.ContinueArticleNum == null) return new PriceResult(false, "指定运送方式续件数量不能为空!");

            if (method.ContinueArticlePrice == null) return new PriceResult(false, "指定运送方式续件价格不能为空!");

            if (total <= method.FirstArticleNum.Value) return new PriceResult(true, method.FirstArticlePrice.Value);

后面还有 33 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。