| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[存货分类信息] |
| | | /// <summary> |
| | | /// 存货分类信息 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "TMaterielClassTree")] |
| | | [HttpGet] |
| | | public JsonResult TMaterielClassTree() |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = ProductModelBLL.TMaterielClassTree(); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[存货分类新增/编辑提交] |
| | | /// <summary> |
| | | /// 存货分类新增/编辑提交 |
| | | /// </summary> |
| | | /// <param name="data_sources">数据来源:ERP/MES</param> |
| | | /// <param name="inventoryclasscode">存货分类编码</param> |
| | | /// <param name="inventoryclassname">存货分类名称</param> |
| | | /// <param name="parentcode">上级分类编码</param> |
| | | /// <param name="OperType">操作类型:Add/Update</param> |
| | | /// <returns></returns> |
| | | [Route(template: "TMaterielClassTreeAddUpdate")] |
| | | [HttpPost] |
| | | public JsonResult TMaterielClassTreeAddUpdate(string data_sources, string inventoryclasscode, string inventoryclassname,string parentcode,string OperType) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = ProductModelBLL.TMaterielClassTreeAddUpdate(data_sources,inventoryclasscode, inventoryclassname, parentcode, OperType, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[存货分类删除] |
| | | /// <summary> |
| | | /// 存货分类删除 |
| | | /// </summary> |
| | | /// <param name="inventoryclasscode">存货分类编码字串集</param> |
| | | /// <returns></returns> |
| | | [Route(template: "TMaterielClassTreeDelete")] |
| | | [HttpPost] |
| | | public JsonResult TMaterielClassTreeDelete(string inventoryclasscode) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = ProductModelBLL.TMaterielClassTreeDelete(inventoryclasscode,us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[存货信息列表] |
| | | /// <summary> |
| | | /// 存货信息列表 |
| | | /// </summary> |
| | | /// <param name="inventoryclasscode">存货分类编码字符串集</param> |
| | | /// <param name="partcode">存货编码</param> |
| | | /// <param name="partname">存货名称</param> |
| | | /// <param name="partspec">存货规格</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">每页显示条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规则</param> |
| | | /// <returns></returns> |
| | | [Route(template: "TMaterielData")] |
| | | [HttpGet] |
| | | public JsonResult TMaterielData(string inventoryclasscode,string partcode,string partname,string partspec, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductModelBLL.TMaterielData(inventoryclasscode, partcode,partname,partspec, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[存货信息新增/编辑保存] |
| | | /// <summary> |
| | | /// 存货信息新增/编辑保存 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "TMaterielData")] |
| | | [HttpPost] |
| | | public JsonResult TMaterielAddUpdate([FromBody] JObject obj) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | string data_sources = obj["data_sources"].ToString(); //数据来源:ERP/MES |
| | | string partcode = obj["partcode"].ToString(); //存货编码 |
| | | string partname = obj["partname"].ToString(); //存货名称 |
| | | string partspec = obj["partspec"].ToString(); //规格型号 |
| | | string inventoryclasscode = obj["inventoryclasscode"].ToString(); //存货类型编码 |
| | | string unittypcode = obj["unittypcode"].ToString(); //计量方式(0:多计量1:单计量) |
| | | string unitcode = obj["unitcode"].ToString(); //计量单位编码/计量单位组编码 |
| | | string unitsubcode = obj["unitsubcode"].ToString(); //计量单位组子项编码 |
| | | string idSubUnitByReport= obj["idSubUnitByReport"].ToString(); //报表辅单位编码 |
| | | string idUnitByStock = obj["idUnitByStock"].ToString(); //库存常用单位编码 |
| | | string idUnitByPurchase = obj["idUnitByPurchase"].ToString(); //采购常用单位编码 |
| | | string idUnitBySale = obj["idSubUnitByReport"].ToString(); //销售常用单位编码 |
| | | string idunitbymanufacture= obj["idunitbymanufacture"].ToString(); //生产常用单位 |
| | | string isPurchase= obj["isPurchase"].ToString(); //是否外购:0(否)1(是) |
| | | string isSale = obj["isSale"].ToString(); //是否销售:0(否)1(是) |
| | | string isMadeSelf = obj["isMadeSelf"].ToString(); //是否自制:0(否)1(是) |
| | | string isMaterial = obj["isMaterial"].ToString(); //是否生产耗用:0(否)1(是) |
| | | string isMadeRequest = obj["isMadeRequest"].ToString(); //是否委外:0(否)1(是) |
| | | string idwarehouse= obj["idwarehouse"].ToString(); //仓库编码 |
| | | string status=obj["status"].ToString(); //使用状态:正常(0)停用(1) |
| | | string OperType = obj["OperType"].ToString(); //操作类型 |
| | | mes = ProductModelBLL.TMaterielAddUpdate(data_sources,partcode,partname,partspec, inventoryclasscode, unittypcode, unitcode, unitsubcode, idSubUnitByReport, |
| | | idUnitByStock, idUnitByPurchase,idUnitBySale, idunitbymanufacture, isPurchase, isSale, isMadeSelf, isMaterial, isMadeRequest, idwarehouse, status, OperType,us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |