| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.DLL.BLL; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Models.InventoryModel; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | | namespace VueWebCoreApi.Controllers |
| | |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[T8入库记录表头] |
| | | /// <summary> |
| | | /// T8入库记录表头 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <param name="hbillno">入库单号</param> |
| | | /// <param name="hbdate">单据日期</param> |
| | | /// <param name="username">操作人员</param> |
| | | /// <param name="userdate">操作时间</param> |
| | | /// <returns></returns> |
| | | [Route(template: "StorageRecordMainSearch")] |
| | | [HttpGet] |
| | | public JsonResult StorageRecordMainSearch(int page, int rows, string prop, string order, string hbillno = null, string hbdate = null, string username = null, string userdate = null) |
| | | { |
| | | string hbdateopendate = ""; //单据开始时间 |
| | | string hbdateclosedate = ""; //单据结束时间 |
| | | string userdateopendate = ""; //操作开始时间 |
| | | string userdateclosedate = ""; //操作结束时间 |
| | | if (hbdate != "" && hbdate != null) |
| | | { |
| | | hbdateopendate = hbdate.Split('~')[0].ToString(); |
| | | hbdateclosedate = hbdate.Split('~')[1].ToString(); |
| | | } |
| | | if (userdate != "" && userdate != null) |
| | | { |
| | | userdateopendate = userdate.Split('~')[0].ToString(); |
| | | userdateclosedate = userdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ReportManagerBLL.StorageRecordMainSearch(hbillno, username, hbdateopendate, hbdateclosedate, userdateopendate, userdateclosedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[T8入库记录表体] |
| | | /// <summary> |
| | | /// T8入库记录表体 |
| | | /// </summary> |
| | | /// <param name="hbillno">入库单号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "StorageRecordSubSearch")] |
| | | [HttpGet] |
| | | public JsonResult StorageRecordSubSearch(string hbillno = null) |
| | | { |
| | | mes = ReportManagerBLL.StorageRecordSubSearch(hbillno); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[T8入库记录删除] |
| | | /// <summary> |
| | | /// T8入库记录删除 |
| | | /// </summary> |
| | | /// <param name="dt">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "StorageRecordDelete")] |
| | | [HttpPost] |
| | | public JsonResult StorageRecordDelete(DataTable dt) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = ReportManagerBLL.StorageRecordDelete(dt, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[入库记录删除] |
| | | /// <summary> |
| | | /// 入库记录删除 |
| | | /// </summary> |
| | | /// <param name="json">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteStorageRecord")] |
| | | [HttpPost] |
| | | [ApiExplorerSettings(IgnoreApi =true)] //隐藏接口 |
| | | public JsonResult DeleteStorageRecord(List<StorageRecord> json) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = ReportManagerBLL.DeleteStorageRecord(json, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[入库记录导出] |
| | | /// <summary> |
| | | /// 入库记录导出 |
| | | /// </summary> |
| | | /// <param name="hbillno">入库单号</param> |
| | | /// <param name="sono">销售单号</param> |
| | | /// <param name="mono">订单号</param> |
| | | /// <param name="wocode">工单号</param> |
| | | /// <param name="partcode">产品编码</param> |
| | | /// <param name="partname">产品名称</param> |
| | | /// <param name="stockcode">仓库编码</param> |
| | | /// <param name="responddate">单据日期</param> |
| | | /// <returns></returns> |
| | | [Route(template: "StorageRecordExcelSearch")] |
| | | [HttpGet] |
| | | [ApiExplorerSettings(IgnoreApi = true)] //隐藏接口 |
| | | public JsonResult StorageRecordExcelSearch(string hbillno = null, string sono = null, string mono = null, string wocode = null, string partcode = null,string partname=null, string stockcode = null, string responddate = null) |
| | | { |
| | | string respondopendate = ""; //单据开始时间 |
| | | string respondclosedate = ""; //单据结束时间 |
| | | if (responddate != "" && responddate != null) |
| | | { |
| | | respondopendate = responddate.Split('~')[0].ToString(); |
| | | respondclosedate = responddate.Split('~')[1].ToString(); |
| | | } |
| | | mes = ReportManagerBLL.StorageRecordExcelSearch(hbillno, sono, mono, wocode, partcode, partname, stockcode, respondopendate, respondclosedate); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[T+入库记录表头] |
| | | /// <summary> |
| | | /// T+入库记录表头 |
| | | /// </summary> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <param name="hbillno">入库单号</param> |
| | | /// <param name="hbdate">单据日期</param> |
| | | /// <param name="username">操作人员</param> |
| | | /// <param name="userdate">操作时间</param> |
| | | /// <returns></returns> |
| | | [Route(template: "InStorageRecordMainSearch")] |
| | | [HttpGet] |
| | | public JsonResult InStorageRecordMainSearch(int page, int rows, string prop, string order, string hbillno = null, string hbdate = null, string username = null, string userdate = null) |
| | | { |
| | | string hbdateopendate = ""; //单据开始时间 |
| | | string hbdateclosedate = ""; //单据结束时间 |
| | | string userdateopendate = ""; //操作开始时间 |
| | | string userdateclosedate = ""; //操作结束时间 |
| | | if (hbdate != "" && hbdate != null) |
| | | { |
| | | hbdateopendate = hbdate.Split('~')[0].ToString(); |
| | | hbdateclosedate = hbdate.Split('~')[1].ToString(); |
| | | } |
| | | if (userdate != "" && userdate != null) |
| | | { |
| | | userdateopendate = userdate.Split('~')[0].ToString(); |
| | | userdateclosedate = userdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ReportManagerBLL.InStorageRecordMainSearch(hbillno, username, hbdateopendate, hbdateclosedate, userdateopendate, userdateclosedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[T+入库记录表体] |
| | | /// <summary> |
| | | /// T+入库记录表体 |
| | | /// </summary> |
| | | /// <param name="hbillno">入库单号</param> |
| | | /// <returns></returns> |
| | | [Route(template: "InStorageRecordSubSearch")] |
| | | [HttpGet] |
| | | public JsonResult InStorageRecordSubSearch(string hbillno = null) |
| | | { |
| | | mes = ReportManagerBLL.InStorageRecordSubSearch(hbillno); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[T+入库记录删除] |
| | | /// <summary> |
| | | /// T+入库记录删除 |
| | | /// </summary> |
| | | /// <param name="dt">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteInStorageRecord")] |
| | | [HttpPost] |
| | | public JsonResult DeleteInStorageRecord(DataTable dt) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | //var token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyY29kZSI6Ijk5OTkiLCJ1c2VybmFtZSI6Iuezu-e7n-euoeeQhuWRmCIsInN0b3JnX2NvZGUiOiIiLCJzdG9yZ19uYW1lIjoiIiwiaXNfc3lzdGVtX2FkbWluIjoiWSIsInJvbGVfY29kZSI6IiIsInJvbGVfZGF0YXBlcm1pc3Npb25zIjoiIiwidXNlcnR5cGUiOiJQQyIsInJlZGlza2V5IjoiTmV3TUVTTG9naW5Vc2VySURQQzk5OTkiLCJtZXNTZXR0aW5nIjoie1wicm91dGVcIjp0cnVlLFwiaXNPcmRlclwiOnRydWUsXCJkZXZpY2VcIjp0cnVlLFwidGVjaFwiOnRydWUsXCJ3b3JrT3JkZXJcIjp0cnVlLFwiZXZlcnlcIjpmYWxzZSxcImxhc3RcIjpmYWxzZX0iLCJ0aW1lb3V0IjoiMjAyNC0xMC0yNFQxMjozNTo1MC4zNDI1NzE2KzA4OjAwIn0.Nbc-1sXd4QLLsnj8wH9XC7iWEmP0wDG82gwLxIh94e4"; |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = ReportManagerBLL.DeleteInStorageRecord(dt, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |