CargosettlementController

devtools/2024/12/23 2:26:35/

目录

1、 CargosettlementController

1.1、 货商结算

1.1.1、 //登录用户

1.2、 结算单号

1.2.1、 //查询供应商账单

1.2.2、 //单号

1.2.3、 //单据日期

1.2.4、 //付款状态

  1. CargosettlementController 

using QXQPS.Models;

using QXQPS.Vo;

using System;

using System.Collections;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace QXQPS.Areas.AccessoriessalesManagment.Controllers

{

    public class CargosettlementController : Controller

    {

        // GET: AccessoriessalesManagment/Cargosettlement

        QXQPEntities myModels = new Models.QXQPEntities();

    1. 货商结算

        public ActionResult Cargosettlement()//货商结算

        {

            try

            {

                ViewBag.UserName = Session["UserName"].ToString().Trim();

      1. //登录用户

                return View();

            }

            catch (Exception)

            {

                return Redirect("/Home/Login");

            }

        }

    1. 结算单号

        public ActionResult MaintenanceNum()//结算单号

        {

            string MaintenanceNum = "";

            var date = "P" + DateTime.Now.ToString("yyyyMMdd");

            try

            {

                var list = myModels.PW_ProBalance.Where(m => m.Receipt.Contains(date)).OrderBy(m => m.Receipt).ToList();

                if (list.Count != 0)

                {

                    int num = Convert.ToInt32(list.Last().Receipt.Trim().Substring(9)) + 1;

                    if (num < 10)

                    {

                        MaintenanceNum = date + "000" + num;

                    }

                    else if (num > 9 && num < 100)

                    {

                        MaintenanceNum = date + "00" + num;

                    }

                    else if (num > 99 && num < 1000)

                    {

                        MaintenanceNum = date + "0" + num;

                    }

                }

                else

                {

                    MaintenanceNum = date + "0001";

                }

            }

            catch (Exception)

            {

                return Json("", JsonRequestBehavior.AllowGet);

            }

            return Json(MaintenanceNum, JsonRequestBehavior.AllowGet);

        }

        public ActionResult SelectProBalancetDetail(int SuppliersID)

      1. //查询供应商账单

        {

            ArrayList list = new ArrayList();

            try

            {

                var listIncoming = (from tbIncoming in myModels.PW_Incoming

                                    join tbSuppliers in myModels.SYS_Suppliers on tbIncoming.SuppliersID equals tbSuppliers.SuppliersID

                                    join tbDocumentsType in myModels.SYS_DocumentsType on tbIncoming.DocumentsTypeID equals tbDocumentsType.DocumentsTypeID

                                    join tbBalanceState in myModels.SYS_BalanceState on tbIncoming.BalanceStateID equals tbBalanceState.BalanceStateID

                                    where tbIncoming.SuppliersID == SuppliersID && tbBalanceState.BalanceStateID == 2 && tbIncoming.ToAudit == true

                                    select new GppVo

                                    {

                                        SingleNumber=tbIncoming.IncomingNumber,

      1. //单号

                                        DocumentsTypeID=tbDocumentsType.DocumentsTypeID,

                                        BalanceStateID = tbBalanceState.BalanceStateID,

                                        DocumentsDate = tbIncoming.BilDate.ToString(),

      1. //单据日期

                                        ShouldAmount = tbIncoming.Aamount.ToString(),//总金额

                                        DocumentsType = tbDocumentsType.DocumentsType,//单据类型

                                        BalanceState = tbBalanceState.BalanceState

      1. //付款状态

                                    }).ToList();

                var listReturnForm = (from tbReturnForm in myModels.PW_ReturnForm

                                      join tbSuppliers in myModels.SYS_Suppliers on tbReturnForm.SuppliersID equals tbSuppliers.SuppliersID

                                      join tbDocumentsType in myModels.SYS_DocumentsType on tbReturnForm.DocumentsTypeID equals tbDocumentsType.DocumentsTypeID

                                      join tbBalanceState in myModels.SYS_BalanceState on tbReturnForm.BalanceStateID equals tbBalanceState.BalanceStateID

                                      where tbReturnForm.SuppliersID == SuppliersID && tbReturnForm.BalanceStateID == 2 && tbReturnForm.ToAudit == true

                                      select new GppVo

                                      {

                                          SingleNumber=tbReturnForm.ReturnNumber,//单号

                                          DocumentsTypeID = tbDocumentsType.DocumentsTypeID,

                                          BalanceStateID = tbBalanceState.BalanceStateID,

                                          DocumentsDate = tbReturnForm.SheetDate.ToString(),//单据日期

                                          ShouldAmount = tbReturnForm.Amount.ToString(),//总金额

                                          DocumentsType = tbDocumentsType.DocumentsType,//单据类型

                                          BalanceState = tbBalanceState.BalanceState//付款状态

                                      }).ToList();

                list.AddRange(listIncoming);

                list.AddRange(listReturnForm);

            }

            catch (Exception)

            {

                return Json("", JsonRequestBehavior.AllowGet);

            }

            return Json(list, JsonRequestBehavior.AllowGet);

        }


http://www.ppmy.cn/devtools/107426.html

相关文章

使用Natapp内网穿透工具,将内网地址映射为外网地址

最近由于项目需要&#xff0c;测试小程序在手机端的显示效果&#xff0c;自己电脑本地的内网地址访问不到&#xff0c;所以需要将内网地址映射为外网地址&#xff0c;这样外网就能访问我的内网项目地址了。 路由器映射成功之后发现不是公网ip&#xff0c;外网无法访问。在网上…

MySQL5.7.36之高可用架构部署-Atlas读写分离

1、安装Atlas-2.2.1.el6.x86_64.rpm rpm -ivh Atlas-2.2.1.el6.x86_64.rpm 2、进入Atlas目录并且备份配置文件 cd /usr/local/mysql-proxy/conf cp test.cnf test.cnf.bak 3、密码加密采用的是自带的工具 /usr/local/mysql-proxy/bin/encrypt 123456 #因为我的密码是12345…

JVM运行时数据区

JVM运行时数据区 1.概述 内存是非常重要的系统资源&#xff0c;是硬盘和CPU 的中间仓库及桥梁承载着操作系统和应用程序的实时运行。JVM内存布局规定了Java在运行过程中内存申请、分配、管理的策略&#xff0c;保证了JVM的高效稳定运行不同的JVM对于内存的划分方式和管理机制…

2408wtl,解析快捷方式

原文 介绍 快捷方式是扩展名为每个文件都包含一个另一个文件的特殊COM对象的.lnk的文件. 一般,试打开.lnk文件时,系统会打开此快捷方式指向文件. 以下实验.在某处创建一个(扩展名为.txt的文件)文本文件.然后创建一个此文件的快捷方式. 然后试用字打开快捷方式,使用File->…

进程的那些事——了解进程(虚拟地址空间)

目录 前言 一、程序地址空间&#xff08;虚拟地址空间&#xff09; 二、虚拟地址寻找物理内存 1.页表 总结 前言 提示&#xff1a;这里可以添加本文要记录的大概内容&#xff1a; 程序和进程之间的区别&#xff1a; 进程&#xff1a;对用户而言&#xff0c;进程是运行中的…

【gtokentool】什么是数字货币?怎么使用?

一、什么是数字货币 数字货币是一种基于密码学原理&#xff0c;独立于传统银行体系运行的电子货币形式。数字货币具有以下特点&#xff1a; 去中心化&#xff1a;数字货币采用去中心化的交易验证方式&#xff0c;不依赖于任何中央机构或政府。安全性高&#xff1a;通过加密算法…

Windows下安装ELK8(elasticsearch、logstash、kibana)及相关工具插件

目录 概述 ELK简介 安装elasticsearch 下载elasticsearch 解压 配置不用登录及关闭SSL 启动elasticsearch 访问elasticsearch 安装elasticsearch-head 提前准备node.js 下载elasticsearch-head 解压 浏览器打开index.html 安装kibana 下载kibana 解压 运行kib…

Vue Router 和 组合式 API

Vue 的组合式 API 的引入开辟了新的可能性&#xff0c;但要想充分发挥 Vue Router 的潜力&#xff0c;我们需要使用一些新的函数来代替访问 this 和组件内导航守卫。 在 setup 中访问路由和当前路由​ 因为我们在 setup 里面没有访问 this&#xff0c;所以我们不能直接访问 t…