| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using System.Web.Script.Serialization; |
| | | using VueWebApi.DLL.BLL; |
| | | using VueWebApi.Models; |
| | | using VueWebApi.Tools; |
| | |
| | | |
| | | [RoutePrefix(prefix: "api/ProductModel")] |
| | | [ControllerGroup("制造模型", "在线接口")] |
| | | //[ChannelActionFilter] |
| | | public class ProductModelController : ApiController |
| | | { |
| | | //定义全局信息返回变量 |
| | |
| | | |
| | | |
| | | |
| | | #region[物料清单主列表查询] |
| | | /// <summary> |
| | | /// 物料清单主列表查询 |
| | | /// </summary> |
| | | /// <param name="parentpartcode">母件编码</param> |
| | | /// <param name="parentpartname">母件名称</param> |
| | | /// <param name="parentpartspec">母件规格</param> |
| | | /// <param name="status">启用状态</param> |
| | | /// <param name="version">版本号</param> |
| | | /// <param name="createusername">创建人员</param> |
| | | /// <param name="createdate">创建日期</param> |
| | | /// <param name="page">页码</param> |
| | | /// <param name="rows">分页条数</param> |
| | | /// <param name="prop">排序字段</param> |
| | | /// <param name="order">排序规格</param> |
| | | /// <returns></returns> |
| | | [Route(template: "BoIventorySelect")] |
| | | [HttpGet] |
| | | public HttpResponseMessage BoIventorySelect(string parentpartcode = null, string parentpartname = null,string parentpartspec=null,string parttype=null, string status = null, string version = null, string createusername = null, string createdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | string createopendate = ""; //开始时间 |
| | | string createclosedate = ""; //结束时间 |
| | | if (createdate != "" && createdate != null) |
| | | { |
| | | createopendate = createdate.Split('~')[0].ToString(); |
| | | createclosedate = createdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //起始记录rowNum |
| | | int endNum = rows * page; //结束记录 rowNum |
| | | mes = ProductModelBLL.BoIventorySelect(parentpartcode, parentpartname, parentpartspec, parttype, status, version, createusername, createopendate, createclosedate, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[物料清单编辑显示及预览] |
| | | /// <summary> |
| | | /// 物料清单编辑显示及预览 |
| | | /// </summary> |
| | | /// <param name="bomid">Bom主表id</param> |
| | | /// <returns></returns> |
| | | [Route(template: "BoIventorySelectView")] |
| | | [HttpGet] |
| | | public HttpResponseMessage BoIventorySelectView(string bomid) |
| | | { |
| | | mes = ProductModelBLL.BoIventorySelectView(bomid); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[物料清单新增时获取最大版本号] |
| | | /// <summary> |
| | | /// 物料清单新增时获取最大版本号 |
| | | /// </summary> |
| | | /// <param name="parentpartcode">母件编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MaterielDetailedVsion")] |
| | | [HttpGet] |
| | | public HttpResponseMessage MaterielDetailedVsion(string parentpartcode) |
| | | { |
| | | mes = ProductModelBLL.MaterielDetailedVsion(parentpartcode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[物料清单新增/编辑提交] |
| | | /// <summary> |
| | | /// 物料清单新增/编辑提交 |
| | | /// </summary> |
| | | /// <param name="obj">提交数据</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateBoIventory")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateBoIventory([FromBody] JObject obj) |
| | | { |
| | | string bomid = obj["bomid"].ToString(); //母件id |
| | | string parentpartcode = obj["parentpartcode"].ToString(); //母件编码 |
| | | string parentpartname = obj["parentpartname"].ToString(); //母件名称 |
| | | string parentpartspec = obj["parentpartspec"].ToString(); //母件规格 |
| | | string status = obj["status"].ToString();//启用状态 |
| | | string uomcode = obj["uomcode"].ToString(); //计量单位编码 |
| | | string quantity = obj["quantity"].ToString(); //基础数量 |
| | | string startdate = obj["startdate"].ToString(); //基础数量 |
| | | string version = obj["version"].ToString(); //基础数量 |
| | | string worklist = obj["worklist"].ToString(); //基础数量 |
| | | string opertype = obj["opertype"].ToString(); //基础数量 |
| | | string username = HttpContext.Current.Request.Cookies["admin"].Value.ToString(); //操作人员 |
| | | List<BomSub> objs = Newtonsoft.Json.JsonConvert.DeserializeObject<List<BomSub>>(worklist); |
| | | mes = ProductModelBLL.AddUpdateBoIventory(bomid,parentpartcode, parentpartname, parentpartspec, status, uomcode, quantity, startdate, version, username, opertype, objs); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | #region[工序下拉查询接口] |
| | | /// <summary> |
| | | /// 工序下拉查询接口 |