基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅

毕业设计:2023-2024年计算机专业毕业设计选题汇总(建议收藏)

毕业设计:2023-2024年最新最全计算机专业毕设选题推荐汇总

感兴趣的可以先收藏起来,点赞、关注不迷路,大家在毕设选题,项目以及论文编写等相关问题都可以给我留言咨询,希望帮助同学们顺利毕业 。

1、项目介绍

技术栈:
Python语言、Django框架、Echarts可视化、MySQL数据库、HTML、报表、物流信息、多角色登录、物流管理

这篇文章提出了一种新型的物流管理系统,旨在帮助物流公司更好地掌握和运营各种物流数据。该系统采用python和django两种常见的框架,通过MVT来实现对数据集成和分析,从而更好地满足各种需求。此外,该系统还支持多种数据访问,如订单、运输、仓储、配送、销售、服务。通过使用该客户端,我们可以轻松获取有关物流的各种详细信息,并且可以通过输入相应的物流编码来快速检索。该系统的结构紧凑,可有效地帮助物流企业实现有序的运营。
系统的测试表明,本系统可以方便快捷地实现物流管理中的货物登记、出库入库、组车运送等工作,使物流管理工作井井有条,为企业的健康发展创造良好的条件。

2、项目界面

(1)数据可视化大屏

基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅_第1张图片

(2)运单详情信息

基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅_第2张图片

(3)发货库存信息
基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅_第3张图片

(4)运单详情信息

基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅_第4张图片

(4)用户权限管理

基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅_第5张图片

(5)系统登录界面

基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅_第6张图片

(6)后台数据管理

基于python物流管理系统 Echarts可视化 Django框架 大数据 毕业设计(源码)✅_第7张图片

3、项目说明

随着全球经济的蓬勃发展,WTO的成立也给全球的商业活动带来了新的挑战,因此,企业需要充分发挥自身的优势,运用最新的科学技术,在互联网、信息科学的指导下,完善现有的管理体系,实现全面的创新,从而在激烈的市场竞争中取胜。当公司的规模不断增长时,仓储管理系统的地位也会变得更加突出。一个高效、简单的仓储管理系统能够给公司的运转带来更多的保障,并且能够给公司的生产与运营带来更多的帮助。
这篇文章提出了一种新型的物流管理系统,旨在帮助物流公司更好地掌握和运营各种物流数据。该系统采用python和django两种常见的框架,通过MVT来实现对数据集成和分析,从而更好地满足各种需求。此外,该系统还支持多种数据访问,如订单、运输、仓储、配送、销售、服务。通过使用该客户端,我们可以轻松获取有关物流的各种详细信息,并且可以通过输入相应的物流编码来快速检索。该系统的结构紧凑,可有效地帮助物流企业实现有序的运营。
系统的测试表明,本系统可以方便快捷地实现物流管理中的货物登记、出库入库、组车运送等工作,使物流管理工作井井有条,为企业的健康发展创造良好的条件。

4、核心代码


class WaybillSearchView(View):

    form_class = forms.WaybillSearchForm
    template_name = ""
    need_login = True
    need_permissions = ()

    def __init__(self, *args, **kwargs):
        assert getattr(self, "template_name"), (
            "Subclasses inherited must specify the 'template_name' property when defining!"
        )
        assert isinstance(self.form_class(), forms.WaybillSearchForm)
        super().__init__(*args, **kwargs)

    def get(self, request, *args, **kwargs):
        return render(
            request,
            self.template_name,
            {
                "form": self.form_class.init_from_request(request),
                "waybill_list": [],
                "logged_user_type": get_logged_user_type(request),
            }
        )

    def post(self, request, *args, **kwargs):
        form = self.form_class.init_from_request(request, data=request.POST)
        waybill_list = []
        if form.is_valid():
            try:
                waybill_list = form.gen_waybill_list_to_queryset()
            except:
                if settings.DEBUG:
                    raise
        return render(
            request,
            self.template_name,
            {
                "form": form,
                "waybill_list": waybill_list,
                "logged_user_type": get_logged_user_type(request),
            }
        )

    def dispatch(self, request, *args, **kwargs):
        if self.need_login and not request.session.get("user"):
            return redirect("wuliu:login")
        for perm in self.need_permissions:
            if not is_logged_user_has_perm(request, perm):
                return HttpResponseForbidden()
        return super().dispatch(request, *args, **kwargs)

def _transport_out_detail_view(request, render_path):
    transport_out_id = request.GET.get("transport_out_id")
    if not transport_out_id:
        return HttpResponseBadRequest()
    transport_out = get_object_or_404(TransportOut, pk=transport_out_id)
    to_dic = transport_out_to_dict(transport_out)
    # 注: 此处只能通过data参数传入TransportOut的字典格式, 不能使用instance参数传入TransportOut对象
    # 否则前端渲染时仍然是从instance中取值, 导致某些表单字段不显示
    form = forms.TransportOutForm.init_from_request(request, data=to_dic)
    # form = forms.TransportOutForm.init_from_request(request, instance=transport_out)
    form.add_id_field(id_=transport_out.id, id_full=transport_out.get_full_id)
    form.change_to_detail_form()
    return render(
        request,
        render_path,
        {
            "form": form,
            "detail_view": True,
            "waybills_info_list": transport_out.waybills.all().select_related("src_department", "dst_department"),
        }
    )

def _transport_out_search_view(request, render_path, search_mode):
    assert search_mode in ("src", "dst"), 'search_mode参数只能为"src"或"dst"'
    if request.method == "GET":
        form = forms.TransportOutSearchForm.init_from_request(request, search_mode=search_mode)
        return render(
            request,
            render_path,
            {
                "form": form,
                "transport_out_list": [],
            }
        )
    if request.method == "POST":
        form = forms.TransportOutSearchForm.init_from_request(request, data=request.POST, search_mode=search_mode)
        transport_out_list = []
        if form.is_valid():
            try:
                transport_out_list = form.gen_transport_out_list_to_queryset()
            except ValueError:
                pass
        return render(
            request,
            render_path,
            {
                "form": form,
                "transport_out_list": transport_out_list,
            }
        )

def login(request):

    def _login_abort(message_text):
        messages.error(request, message_text)
        return redirect("wuliu:login")

    if request.method == "GET":
        if request.session.get('user'):
            return redirect("wuliu:welcome")
        return render(request, 'wuliu/login.html')
    if request.method == "POST":
        username = request.POST.get('username')
        password = request.POST.get('password')
        try:
            user = User.objects.get(name=username)
        except User.DoesNotExist:
            return _login_abort('用户名或密码错误,请重新输入!')
        if not user.enabled:
            return _login_abort('该用户未被启用,请联系管理员!')
        if not check_password(password, user.password):
            return _login_abort('用户名或密码错误,请重新输入!')
        request.session['user'] = {
            "logged_in_time": timezone.make_naive(timezone.now()).strftime("%Y-%m-%d %H:%M:%S"),
            "id": user.id,
            "name": user.name,
            "department_id": user.department_id,
            "department_name": user.department.name,
        }
        return redirect("wuliu:welcome")

def logout(request):
    request.session.flush()
    request.COOKIES.clear()
    return redirect("wuliu:login")

@login_required()
def welcome(request):
    # messages.debug(request, "Test debug message...")
    # messages.info(request, "Test info message...")
    # messages.success(request, "Test success message...")
    # messages.warning(request, "Test warning message...")
    # messages.error(request, "Test error message...")
    logged_user_type = get_logged_user_type(request)
    dic = {
        "today": {"waybill": 0, "transport_out": 0, "arrival": 0, "sign_for": 0},
        "wait": {"waybill": 0, "transport_out": 0, "arrival": 0, "sign_for": 0},
    }
    today_start_datetime = timezone.make_aware(
        timezone.datetime.combine(datetime_.date.today(), datetime_.time(0, 0))
    )
    today_end_datetime = timezone.make_aware(
        timezone.datetime.combine(datetime_.date.today(), datetime_.time(23, 59, 59))
    )
    today_weekday = timezone.now().isoweekday()
    weekdays = [
        {1: "周一", 2: "周二", 3: "周三", 4: "周四", 5: "周五", 6: "周六", 7: "周日"}.get(
            today_weekday-i if today_weekday-i > 0 else today_weekday+7-i
        )
        for i in range(7)[::-1]
    ]
    # 14天内每天新增运单数和运费收入
    # 分支机构和货场只统计自己部门的新增运单数(虽然货场没有开票权限...)
    if logged_user_type == User.Types.GoodsYard:
        waybill_num_in_past_two_weeks = [0] * 14
        waybill_fee_in_past_two_weeks = [0] * 14
    else:
        waybill_num_in_past_two_weeks = []
        waybill_fee_in_past_two_weeks = []
        for i in range(14)[::-1]:
            queryset = Waybill.objects.only("pk", "fee").filter(
                    create_time__gte=today_start_datetime - timezone.timedelta(days=i),
                    create_time__lte=today_end_datetime - timezone.timedelta(days=i),
                ).exclude(status=Waybill.Statuses.Dropped)
            if logged_user_type == User.Types.Branch:
                queryset = queryset.filter(src_department__id=request.session["user"]["department_id"])
            day_info = queryset.aggregate(fee_total=Sum("fee"), count=Count("pk"))
            waybill_num_in_past_two_weeks.append(day_info["count"])
            waybill_fee_in_past_two_weeks.append(day_info["fee_total"] or 0)
    # 今日新增
    dic["today"]["waybill"] = waybill_num_in_past_two_weeks[-1]
    # 今日发车
    today_transport_out = TransportOut.objects.filter(
        start_time__gte=today_start_datetime,
        start_time__lte=today_end_datetime,
        status__in=(TransportOut.Statuses.OnTheWay, TransportOut.Statuses.Arrived),
    )
    if logged_user_type not in (User.Types.Administrator, User.Types.Company):
        today_transport_out = today_transport_out.filter(src_department__id=request.session["user"]["department_id"])
    dic["today"]["transport_out"] = today_transport_out.aggregate(_=Count("waybills"))["_"] or 0
    # 今日到货
    today_arrival = Waybill.objects.filter(
        arrival_time__gte=today_start_datetime, arrival_time__lte=today_end_datetime,
    )
    if logged_user_type not in (User.Types.Administrator, User.Types.Company):
        today_arrival = today_arrival.filter(dst_department__id=request.session["user"]["department_id"])
    dic["today"]["arrival"] = today_arrival.count() or 0
    # 今日签收
    today_sign_for = Waybill.objects.filter(
        sign_for_time__gte=today_start_datetime, sign_for_time__lte=today_end_datetime,
    )
    if logged_user_type not in (User.Types.Administrator, User.Types.Company):
        today_sign_for = today_sign_for.filter(dst_department__id=request.session["user"]["department_id"])
    dic["today"]["sign_for"] = today_sign_for.count()
    # 待确认订单
    dic["wait"]["waybill"] = 0
    # 待发车
    if logged_user_type == User.Types.GoodsYard:
        dic["wait"]["transport_out"] = Waybill.objects.filter(
                status__in=(Waybill.Statuses.GoodsYardArrived, Waybill.Statuses.GoodsYardLoaded)
            ).count()
    elif logged_user_type == User.Types.Branch:
        dic["wait"]["transport_out"] = Waybill.objects.filter(
                src_department__id=request.session["user"]["department_id"],
                status__in=(Waybill.Statuses.Created, Waybill.Statuses.Loaded),
            ).count()
    else:
        dic["wait"]["transport_out"] = Waybill.objects.filter(
                status__in=(Waybill.Statuses.Created, Waybill.Statuses.Loaded)
            ).count()
    # 待到车
    wait_arrival = TransportOut.objects.filter(status=TransportOut.Statuses.OnTheWay)
    if logged_user_type not in (User.Types.Administrator, User.Types.Company):
        wait_arrival = wait_arrival.filter(dst_department__id=request.session["user"]["department_id"])
    dic["wait"]["arrival"] = wait_arrival.count()
    # 待签收
    wait_sign_for = Waybill.objects.filter(status=Waybill.Statuses.Arrived)
    if logged_user_type not in (User.Types.Administrator, User.Types.Company):
        wait_sign_for = wait_sign_for.filter(dst_department__id=request.session["user"]["department_id"])
    dic["wait"]["sign_for"] = wait_sign_for.count()

    return render(
        request,
        "wuliu/welcome.html",
        {
            "data_dic": dic,
            "weekdays": weekdays,
            "waybill_num_last_week": waybill_num_in_past_two_weeks[:7],
            "waybill_num_this_week": waybill_num_in_past_two_weeks[7:],
            "waybill_num_this_week_total": sum(waybill_num_in_past_two_weeks[7:]),
            "waybill_num_change_rate_percentage": (
                (sum(waybill_num_in_past_two_weeks[7:]) / sum(waybill_num_in_past_two_weeks[:7]) - 1) * 100
                if sum(waybill_num_in_past_two_weeks[:7]) else (
                    100 if sum(waybill_num_in_past_two_weeks[7:]) else 0
                )
            ),
            "waybill_fee_last_week": waybill_fee_in_past_two_weeks[:7],
            "waybill_fee_this_week": waybill_fee_in_past_two_weeks[7:],
            "waybill_fee_this_week_total": sum(waybill_fee_in_past_two_weeks[7:]),
            "waybill_fee_change_rate_percentage": (
                (sum(waybill_fee_in_past_two_weeks[7:]) / sum(waybill_fee_in_past_two_weeks[:7]) - 1) * 100
                if sum(waybill_fee_in_past_two_weeks[:7]) else (
                    100 if sum(waybill_fee_in_past_two_weeks[7:]) else 0
                )
            ),
        }
    )


5、源码获取

由于篇幅限制,获取完整文章或源码、代做项目的,查看我的【用户名】、【专栏名称】、【顶部选题链接】就可以找到我啦

感兴趣的可以先收藏起来,点赞、关注不迷路,下方查看获取联系方式

你可能感兴趣的:(biyesheji0001,biyesheji0002,毕业设计,python,echarts,django,毕业设计,大数据,物流,管理系统)