1.修改仓位信息列表接口
2.新增仓库库位基础资料接口
3.修改模具出入库提交接口(增加库位) 、模具清单增加库位
4.新增模具上下机记录报表、模具借还记录报表
| | |
| | | /// <summary> |
| | | /// ä»ä½ä¿¡æ¯å表 |
| | | /// </summary> |
| | | /// <param name="flag">éä¸å·¦ä¾§æ 忝å¦ä»åº(Y/N)</param> |
| | | /// <param name="stckcode">ä»åºç¼ç å符串é</param> |
| | | /// <param name="locacode">ä»ä½ç¼ç </param> |
| | | /// <param name="locaname">ä»ä½åç§°</param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "TSecLocaData")] |
| | | [HttpGet] |
| | | public JsonResult TSecLocaData(string stckcode, string locacode, string locaname, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public JsonResult TSecLocaData(string flag, string stckcode, string locacode, string locaname, 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 = BasicSettingBLL.TSecLocaData(stckcode, locacode, locaname, startNum, endNum, prop, order); |
| | | mes = BasicSettingBLL.TSecLocaData(flag,stckcode, locacode, locaname, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä»åºåºä½åºç¡èµæ] |
| | | /// <summary> |
| | | /// ä»åºåºä½åºç¡èµæ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "WareHouseLocation")] |
| | | [HttpGet] |
| | | public JsonResult WareHouseLocation() |
| | | { |
| | | mes = GeneralBasicDataBLL.WareHouseLocation(); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä»åºæ¥æ¾ä»ä½ä¿¡æ¯] |
| | | /// <summary> |
| | | /// ä»åºæ¥æ¾ä»ä½ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="warhousecode">ä»åºç¼ç </param> |
| | | /// <returns></returns> |
| | | [Route(template: "WareHouseSelectLocation")] |
| | | [HttpGet] |
| | | public JsonResult WareHouseSelectLocation(string warhousecode) |
| | | { |
| | | mes = GeneralBasicDataBLL.WareHouseSelectLocation(warhousecode); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[å·¥åºåºç¡èµæ] |
| | | /// <summary> |
| | | /// å·¥åºåºç¡èµæ |
| | |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | string mouldcode = obj["mouldcode"].ToString(); //模å
·ç¼ç |
| | | string warehousecode = obj["warehousecode"].ToString(); //ä»åºç¼ç |
| | | string locationcode = obj["locationcode"].ToString(); //åºä½ç¼ç |
| | | string description = obj["description"].ToString(); //å
¥åºæè¿° |
| | | mes = MouldManagerBLL.MouldInWareHouseSave(mouldcode, warehousecode,description, us); |
| | | mes = MouldManagerBLL.MouldInWareHouseSave(mouldcode, warehousecode, locationcode, description, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | string mouldcode = obj["mouldcode"].ToString(); //模å
·ç¼ç |
| | | string warehousecode = obj["warehousecode"].ToString(); //ä»åºç¼ç |
| | | string locationcode = obj["locationcode"].ToString(); //åºä½ç¼ç |
| | | string description = obj["description"].ToString(); //åºåºæè¿° |
| | | mes = MouldManagerBLL.MouldOutWareHouseSave(mouldcode, warehousecode, description, us); |
| | | mes = MouldManagerBLL.MouldOutWareHouseSave(mouldcode, warehousecode, locationcode, description, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模å
·ä¸ä¸æºè®°å½æ¥è¯¢] |
| | | /// <summary> |
| | | /// 模å
·ä¸ä¸æºè®°å½æ¥è¯¢ |
| | | /// </summary> |
| | | /// <param name="mouldcode">模å
·ç¼ç </param> |
| | | /// <param name="mouldname">模å
·åç§°</param> |
| | | /// <param name="mouldspec">è§æ ¼åå·</param> |
| | | /// <param name="type">æä½ç±»å(䏿º:UP 䏿º:DOWN)</param> |
| | | /// <param name="devicecode">设å¤ç¼ç </param> |
| | | /// <param name="operuser">æä½äººå</param> |
| | | /// <param name="operdate">æä½æ¶é´</param> |
| | | /// <param name="page">页ç </param> |
| | | /// <param name="rows">æ¯é¡µæ¾ç¤ºæ¡æ°</param> |
| | | /// <param name="prop">æåºå段</param> |
| | | /// <param name="order">æåºè§æ ¼</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MouldUpDownMachinesSearch")] |
| | | [HttpGet] |
| | | public JsonResult MouldUpDownMachinesSearch(int page, int rows, string prop, string order, string mouldcode = null, string mouldname = null, string mouldspec = null, string type = null,string devicecode=null,string operuser=null, string operdate = null) |
| | | { |
| | | string opendate = ""; //å¼å§æ¶é´ |
| | | string closedate = ""; //ç»ææ¶é´ |
| | | if (operdate != "" && operdate != null) |
| | | { |
| | | opendate = operdate.Split('~')[0].ToString(); |
| | | closedate = operdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //èµ·å§è®°å½rowNum |
| | | int endNum = rows * page; //ç»æè®°å½ rowNum |
| | | mes = MouldManagerBLL.MouldUpDownMachinesSearch(mouldcode, mouldname, mouldspec,type,devicecode,operuser,opendate,closedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[模å
·ä¸ä¸æºè®°å¯¼åº] |
| | | /// <summary> |
| | | /// 模å
·ä¸ä¸æºè®°å¯¼åº |
| | | /// </summary> |
| | | /// <param name="mouldcode">模å
·ç¼ç </param> |
| | | /// <param name="mouldname">模å
·åç§°</param> |
| | | /// <param name="mouldspec">è§æ ¼åå·</param> |
| | | /// <param name="type">æä½ç±»å(䏿º:UP 䏿º:DOWN)</param> |
| | | /// <param name="devicecode">设å¤ç¼ç </param> |
| | | /// <param name="operuser">æä½äººå</param> |
| | | /// <param name="operdate">æä½æ¶é´</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MouldUpDownMachinesOutExcel")] |
| | | [HttpGet] |
| | | public JsonResult MouldUpDownMachinesOutExcel(string mouldcode = null, string mouldname = null, string mouldspec = null, string type = null, string devicecode = null, string operuser = null, string operdate = null) |
| | | { |
| | | string opendate = ""; //å¼å§æ¶é´ |
| | | string closedate = ""; //ç»ææ¶é´ |
| | | if (operdate != "" && operdate != null) |
| | | { |
| | | opendate = operdate.Split('~')[0].ToString(); |
| | | closedate = operdate.Split('~')[1].ToString(); |
| | | } |
| | | mes = MouldManagerBLL.MouldUpDownMachinesOutExcel(mouldcode, mouldname, mouldspec, type, devicecode, operuser, opendate, closedate); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模å
·åè¿è®°å½æ¥è¯¢] |
| | | /// <summary> |
| | | /// 模å
·åè¿è®°å½æ¥è¯¢ |
| | | /// </summary> |
| | | /// <param name="mouldcode">模å
·ç¼ç </param> |
| | | /// <param name="mouldname">模å
·åç§°</param> |
| | | /// <param name="mouldspec">è§æ ¼åå·</param> |
| | | /// <param name="type">æä½ç±»å</param> |
| | | /// <param name="operuser">æä½äººå</param> |
| | | /// <param name="operdate">æä½æ¶é´</param> |
| | | /// <param name="page">页ç </param> |
| | | /// <param name="rows">æ¯é¡µæ¾ç¤ºæ¡æ°</param> |
| | | /// <param name="prop">æåºå段</param> |
| | | /// <param name="order">æåºè§æ ¼</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MouldCirculateMachinesSearch")] |
| | | [HttpGet] |
| | | public JsonResult MouldCirculateMachinesSearch(int page, int rows, string prop, string order, string mouldcode = null, string mouldname = null, string mouldspec = null, string type = null, string operuser = null, string operdate = null) |
| | | { |
| | | string opendate = ""; //å¼å§æ¶é´ |
| | | string closedate = ""; //ç»ææ¶é´ |
| | | if (operdate != "" && operdate != null) |
| | | { |
| | | opendate = operdate.Split('~')[0].ToString(); |
| | | closedate = operdate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //èµ·å§è®°å½rowNum |
| | | int endNum = rows * page; //ç»æè®°å½ rowNum |
| | | mes = MouldManagerBLL.MouldCirculateMachinesSearch(mouldcode, mouldname, mouldspec, type, operuser, opendate, closedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[模å
·åè¿è®°å½å¯¼åº] |
| | | /// <summary> |
| | | /// 模å
·åè¿è®°å½å¯¼åº |
| | | /// </summary> |
| | | /// <param name="mouldcode">模å
·ç¼ç </param> |
| | | /// <param name="mouldname">模å
·åç§°</param> |
| | | /// <param name="mouldspec">è§æ ¼åå·</param> |
| | | /// <param name="type">æä½ç±»å</param> |
| | | /// <param name="operuser">æä½äººå</param> |
| | | /// <param name="operdate">æä½æ¶é´</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MouldCirculateMachinesOutExcel")] |
| | | [HttpGet] |
| | | public JsonResult MouldCirculateMachinesOutExcel(string mouldcode = null, string mouldname = null, string mouldspec = null, string type = null, string operuser = null, string operdate = null) |
| | | { |
| | | string opendate = ""; //å¼å§æ¶é´ |
| | | string closedate = ""; //ç»ææ¶é´ |
| | | if (operdate != "" && operdate != null) |
| | | { |
| | | opendate = operdate.Split('~')[0].ToString(); |
| | | closedate = operdate.Split('~')[1].ToString(); |
| | | } |
| | | mes = MouldManagerBLL.MouldCirculateMachinesOutExcel(mouldcode, mouldname, mouldspec, type, operuser, opendate, closedate); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | #endregion |
| | | |
| | | #region[ä»ä½ä¿¡æ¯å表] |
| | | public static ToMessage TSecLocaData(string stckcode, string locacode, string locaname, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage TSecLocaData(string flag, string stckcode, string locacode, string locaname, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return BasicSettingDAL.TSecLocaData(stckcode, locacode, locaname, startNum, endNum, prop, order); |
| | | return BasicSettingDAL.TSecLocaData(flag,stckcode, locacode, locaname, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä»åºåºä½åºç¡èµæ] |
| | | public static ToMessage WareHouseLocation() |
| | | { |
| | | return GeneralBasicDataDAL.WareHouseLocation(); |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä»åºæ¥æ¾ä»ä½ä¿¡æ¯] |
| | | public static ToMessage WareHouseSelectLocation(string warhousecode) |
| | | { |
| | | return GeneralBasicDataDAL.WareHouseSelectLocation(warhousecode); |
| | | } |
| | | #endregion |
| | | |
| | | #region[å·¥åºåºç¡èµæ] |
| | | public static ToMessage StepData() |
| | | { |
| | |
| | | #endregion |
| | | |
| | | #region[模å
·å
¥åºæäº¤] |
| | | public static ToMessage MouldInWareHouseSave(string mouldcode, string warehousecode, string description, User us) |
| | | public static ToMessage MouldInWareHouseSave(string mouldcode, string warehousecode,string locationcode, string description, User us) |
| | | { |
| | | return MouldManagerDAL.MouldInWareHouseSave(mouldcode, warehousecode, description, us); |
| | | return MouldManagerDAL.MouldInWareHouseSave(mouldcode, warehousecode, locationcode, description, us); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region[模å
·åºåºæäº¤] |
| | | public static ToMessage MouldOutWareHouseSave(string mouldcode, string warehousecode, string description, User us) |
| | | public static ToMessage MouldOutWareHouseSave(string mouldcode, string warehousecode,string locationcode, string description, User us) |
| | | { |
| | | return MouldManagerDAL.MouldOutWareHouseSave(mouldcode, warehousecode, description, us); |
| | | return MouldManagerDAL.MouldOutWareHouseSave(mouldcode, warehousecode, locationcode, description, us); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | return MouldManagerDAL.MouldUpdateSearch(mouldcode, mouldname, mouldspec, reportuser, repairuser, vrifcatuser, reportopendate, reportclosedate, repairopendate, repairclosedate, vrifcatopendate, vrifcatclosedate); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模å
·ä¸ä¸æºè®°å½æ¥è¯¢] |
| | | public static ToMessage MouldUpDownMachinesSearch(string mouldcode, string mouldname, string mouldspec, string type, string devicecode, string operuser, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return MouldManagerDAL.MouldUpDownMachinesSearch(mouldcode, mouldname, mouldspec, type, devicecode, operuser, opendate, closedate, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | | #region[模å
·ä¸ä¸æºè®°å¯¼åºExcel] |
| | | public static ToMessage MouldUpDownMachinesOutExcel(string mouldcode, string mouldname, string mouldspec, string type, string devicecode, string operuser, string opendate, string closedate) |
| | | { |
| | | return MouldManagerDAL.MouldUpDownMachinesOutExcel(mouldcode, mouldname, mouldspec, type, devicecode, operuser, opendate, closedate); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模å
·åè¿è®°å½æ¥è¯¢] |
| | | public static ToMessage MouldCirculateMachinesSearch(string mouldcode, string mouldname, string mouldspec, string type, string operuser, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return MouldManagerDAL.MouldCirculateMachinesSearch(mouldcode, mouldname, mouldspec, type, operuser, opendate, closedate, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | | #region[模å
·åè¿è®°å½å¯¼åº] |
| | | public static ToMessage MouldCirculateMachinesOutExcel(string mouldcode, string mouldname, string mouldspec, string type, string operuser, string opendate, string closedate) |
| | | { |
| | | return MouldManagerDAL.MouldCirculateMachinesOutExcel(mouldcode, mouldname, mouldspec, type, operuser, opendate, closedate); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | //è·åå¼å¯ä»ä½ç®¡æ§çä»åºä¿¡æ¯ |
| | | sql = @"select S.code,S.name,'-1' as idparent from TSecStck S where S.ishasPosition='1' |
| | | sql = @"select S.code,S.name,'-1' as idparent,S.code as warhouse from TSecStck S where S.ishasPosition='1' |
| | | union all |
| | | select L.code,L.name,case when L.idparent is NULL or L.idparent='' then L.idwarehouse else L.idparent end as idparent |
| | | select L.code,L.name,case when L.idparent is NULL or L.idparent='' then L.idwarehouse else L.idparent end as idparent,L.idwarehouse as warhouse |
| | | from TSecLoca L "; |
| | | var data = DapperHelper.selecttable(sql); |
| | | mes.code = "200"; |
| | |
| | | #endregion |
| | | |
| | | #region[ä»ä½ä¿¡æ¯å表] |
| | | public static ToMessage TSecLocaData(string stckcode, string locacode, string locaname, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage TSecLocaData(string flag, string stckcode, string locacode, string locaname, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = "", sql = ""; |
| | | IEnumerable<object> data; |
| | | try |
| | | { |
| | | if (flag == "Y") |
| | | { |
| | | if (stckcode != "" && stckcode != null) |
| | | { |
| | | string[] classcode = Array.ConvertAll<string, string>(stckcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //stringåå²è½¬string[] |
| | | search += "and C.idparent in @classcode "; |
| | | dynamicParams.Add("@classcode", classcode); |
| | | } |
| | | |
| | | } |
| | | if (flag == "N") |
| | | { |
| | | if (stckcode != "" && stckcode != null) |
| | | { |
| | | string[] classcode = Array.ConvertAll<string, string>(stckcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //stringåå²è½¬string[] |
| | | search += "and C.idparent in @classcode and C.endpnt=@endpnt"; |
| | | dynamicParams.Add("@classcode", classcode); |
| | | dynamicParams.Add("@endpnt", classcode); |
| | | } |
| | | } |
| | | if (locacode != "" && locacode != null) |
| | | { |
| | |
| | | search += "and C.name like '%'+@locaname+'%' "; |
| | | dynamicParams.Add("@locaname", locaname); |
| | | } |
| | | sql = @"select C.code,C.name,C.status,C.description,C.idwarehouse as stckcode,T.name as stckname,C.idparent as parentcode,L.name as parentname, |
| | | sql = @"select C.code,C.name,C.status,C.description,C.idwarehouse as stckcode,T.name as stckname,C.idparent as parentcode,L.name as parentname,C.endpnt, |
| | | C.lm_user as usercode,U.username,C.lm_date,C.data_sources |
| | | from ( |
| | | select L.code,L.name,L.idwarehouse,L.status,L.description,L.lm_user,L.lm_date,L.data_sources,case when L.idparent is NULL or L.idparent='' then L.idwarehouse else L.idparent end as idparent |
| | | select L.code,L.name,L.idwarehouse,L.status,L.description,L.lm_user,L.lm_date,L.data_sources,case when L.idparent is NULL or L.idparent='' then L.idwarehouse else L.idparent end as idparent,L.idparent as endpnt |
| | | from TSecLoca L |
| | | ) as C |
| | | left join TSecStck T on C.idwarehouse=T.code |
| | |
| | | } |
| | | if (OperType == "Update") |
| | | { |
| | | //夿ä¸çº§è´§ä½ç¼ç æ¯å¦çäºè´§ä½ç¼ç |
| | | if (locacode == parentlocacode) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "ä¸çº§è´§ä½ä¸è½æ¯åºä½æ¬èº«ï¼"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | //夿徿¥åä½åç§°æ¯å¦éå¤ |
| | | sql = @"select * from TSecLoca where code<>@code and name=@name"; |
| | | dynamicParams.Add("@code", locacode); |
| | |
| | | using System.Data.SqlClient; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Models.UnitMaterial; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä»åºåºä½åºç¡èµæ] |
| | | public static ToMessage WareHouseLocation() |
| | | { |
| | | string sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | | List<WareHouseLocation> list = new List<WareHouseLocation>(); |
| | | try |
| | | { |
| | | //è·åä»åºæ°æ® |
| | | sql = @"select code,name from TSecStck where status='0'"; |
| | | var data = DapperHelper.selecttable(sql); |
| | | for (int i = 0; i < data.Rows.Count; i++) |
| | | { |
| | | WareHouseLocation warhouse = new WareHouseLocation(); |
| | | warhouse.value = data.Rows[i]["code"].ToString(); |
| | | warhouse.text = data.Rows[i]["name"].ToString(); |
| | | warhouse.children = new List<LocationData>(); |
| | | //è·ååºä½ |
| | | sql = @"select code,name from TSecLoca where status='0' and idwarehouse=@idwarehouse"; |
| | | dynamicParams.Add("@idwarehouse", data.Rows[i]["code"].ToString()); |
| | | var data0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | for (int j = 0; j < data0.Rows.Count; j++) |
| | | { |
| | | LocationData locat = new LocationData(); |
| | | locat.value = data0.Rows[j]["code"].ToString(); |
| | | locat.text = data0.Rows[j]["name"].ToString(); |
| | | warhouse.children.Add(locat); |
| | | } |
| | | list.Add(warhouse); |
| | | } |
| | | mes.code = "200"; |
| | | mes.Message = "æ¥è¯¢æå!"; |
| | | mes.data = list; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä»åºæ¥æ¾ä»ä½ä¿¡æ¯] |
| | | public static ToMessage WareHouseSelectLocation(string warhousecode) |
| | | { |
| | | var sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | sql = @"select code,name from TSecLoca where status='0' and idwarehouse=@idwarehouse"; |
| | | dynamicParams.Add("@idwarehouse", warhousecode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | mes.code = "200"; |
| | | mes.Message = "æ¥è¯¢æå!"; |
| | | mes.data = data; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[å·¥åºåºç¡èµæ] |
| | | public static ToMessage StepData() |
| | | { |
| | |
| | | } |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.status,A.usestatus,A.code,A.name,A.spec,A.warehousecode,S.name as warehousename, |
| | | var sql = @"select A.status,A.usestatus,A.code,A.name,A.spec,A.warehousecode,S.name as warehousename,A.location_code,L.name as location_name, |
| | | A.surp_life,(select isnull(sum(usecount_life),0) from TMould_UpDownReord R where R.mould_code=A.code) as serlife, |
| | | A.resi_life,(case when isnull(M.mouldcode,'')='' then 'N' else 'Y' end) as is_part, |
| | | STUFF((SELECT ',' + B.partcode |
| | |
| | | A.lm_user as usercode,U.username,A.lm_date |
| | | from TMouldInfo A |
| | | left join TSecStck S on A.warehousecode=S.code |
| | | left join TSecLoca L on A.location_code=L.code |
| | | left join ( |
| | | select distinct mouldcode from TMouldInfoPart |
| | | ) M on A.code=M.mouldcode |
| | |
| | | #endregion |
| | | |
| | | #region[模å
·å
¥åºæäº¤] |
| | | public static ToMessage MouldInWareHouseSave(string mouldcode, string warehousecode, string description, User us) |
| | | public static ToMessage MouldInWareHouseSave(string mouldcode, string warehousecode,string locationcode, string description, User us) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | |
| | | { |
| | | list.Clear(); |
| | | //åå
¥æ¨¡å
·åºå
¥åºè®°å½è¡¨(å
¥åºæä½) |
| | | sql = @"insert into TMould_InOutReord(mould_code,type,warehouse_code,description,lm_user,lm_date) |
| | | values(@mould_code,@type,@warehouse_code,@description,@lm_user,@lm_date)"; |
| | | sql = @"insert into TMould_InOutReord(mould_code,type,warehouse_code,location_code,description,lm_user,lm_date) |
| | | values(@mould_code,@type,@warehouse_code,@location_code,@description,@lm_user,@lm_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | mould_code = mouldcode, |
| | | type = "IN", |
| | | warehouse_code = warehousecode, |
| | | location_code = locationcode, |
| | | description = description, |
| | | lm_user = us.usercode, |
| | | lm_date = DateTime.Now.ToString() |
| | |
| | | }); |
| | | |
| | | //å忍¡å
·æ¸
å,使ç¨ç¶æ(å
¥åº),ä»åºç¼ç |
| | | sql = @"update TMouldInfo set usestatus='0',warehousecode=@warehousecode where code=@mouldcode"; |
| | | list.Add(new { str = sql, parm = new { mouldcode = mouldcode, warehousecode = warehousecode } }); |
| | | sql = @"update TMouldInfo set usestatus='0',warehousecode=@warehousecode,location_code=@location_code where code=@mouldcode"; |
| | | list.Add(new { str = sql, parm = new { mouldcode = mouldcode, warehousecode = warehousecode, location_code = locationcode } }); |
| | | |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | |
| | | { |
| | | //夿å½å模å
·æ¯å¦å¨å¤åç¶æ |
| | | sql = @"select M.code as mould_code,M.name as mould_name,M.spec as mould_spec, |
| | | M.surp_life,M.resi_life,M.warehousecode,C.name as warehousename |
| | | M.surp_life,M.resi_life,M.warehousecode,C.name as warehousename,M.location_code,L.name as location_name |
| | | from TMouldInfo M |
| | | left join TSecStck C on M.warehousecode=C.code |
| | | left join TSecLoca L on M.location_code=L.code |
| | | where M.code=@mouldcode and M.usestatus='0'"; |
| | | dynamicParams.Add("@mouldcode", mouldcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | |
| | | #endregion |
| | | |
| | | #region[模å
·åºåºæäº¤] |
| | | public static ToMessage MouldOutWareHouseSave(string mouldcode, string warehousecode, string description, User us) |
| | | public static ToMessage MouldOutWareHouseSave(string mouldcode, string warehousecode,string locationcode, string description, User us) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | |
| | | { |
| | | list.Clear(); |
| | | //åå
¥æ¨¡å
·åºå
¥åºè®°å½è¡¨(åºåºæä½) |
| | | sql = @"insert into TMould_InOutReord(mould_code,type,warehouse_code,description,lm_user,lm_date) |
| | | values(@mould_code,@type,@warehouse_code,@description,@lm_user,@lm_date)"; |
| | | sql = @"insert into TMould_InOutReord(mould_code,type,warehouse_code,location_code,description,lm_user,lm_date) |
| | | values(@mould_code,@type,@warehouse_code,@location_code,@description,@lm_user,@lm_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | mould_code = mouldcode, |
| | | type = "OUT", |
| | | warehouse_code = warehousecode, |
| | | location_code= locationcode, |
| | | description = description, |
| | | lm_user = us.usercode, |
| | | lm_date = DateTime.Now.ToString() |
| | |
| | | }); |
| | | |
| | | //å忍¡å
·æ¸
å,使ç¨ç¶æ(åºåº),æ¸
é¤ä»åºç¼ç |
| | | sql = @"update TMouldInfo set usestatus='1',warehousecode=@warehousecode where code=@mouldcode"; |
| | | list.Add(new { str = sql, parm = new { mouldcode = mouldcode, warehousecode ="" } }); |
| | | sql = @"update TMouldInfo set usestatus='1',warehousecode=@warehousecode,location_code=@location_code where code=@mouldcode"; |
| | | list.Add(new { str = sql, parm = new { mouldcode = mouldcode, warehousecode ="", location_code="" } }); |
| | | |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | |
| | | search += "and A.maint_result=@repairresult "; |
| | | dynamicParams.Add("@repairresult", repairresult); |
| | | } |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.bywo,A.mould_code,E.name as mould_name,E.spec as mould_spec,M.code as stanedcode,M.name as stanedname, |
| | | var sql = @"select A.id,A.bywo,A.mould_code,E.name as mould_name,E.spec as mould_spec,M.code as stanedcode,M.name as stanedname, |
| | | U.username as maint_user,A.maint_result,A.maint_date |
| | | from TMouldmaint_Proc_Main A |
| | | left join TMouldInfo E on A.mould_code=E.code |
| | |
| | | { |
| | | search += "and A.maint_result=@repairresult "; |
| | | dynamicParams.Add("@repairresult", repairresult); |
| | | } |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | |
| | | search += "and A.verify_date between @vrifcatopendate and @vrifcatclosedate "; |
| | | dynamicParams.Add("@vrifcatopendate", vrifcatopendate + " 00:00:00"); |
| | | dynamicParams.Add("@vrifcatclosedate", vrifcatclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | |
| | | dynamicParams.Add("@vrifcatopendate", vrifcatopendate + " 00:00:00"); |
| | | dynamicParams.Add("@vrifcatclosedate", vrifcatclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模å
·ä¸ä¸æºè®°å½æ¥è¯¢] |
| | | public static ToMessage MouldUpDownMachinesSearch(string mouldcode, string mouldname, string mouldspec, string type, string devicecode, string operuser, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (mouldcode != "" && mouldcode != null) |
| | | { |
| | | search += "and A.mould_code like '%'+@mouldcode+'%' "; |
| | | dynamicParams.Add("@mouldcode", mouldcode); |
| | | } |
| | | if (mouldname != "" && mouldname != null) |
| | | { |
| | | search += "and M.name like '%'+@mouldname+'%' "; |
| | | dynamicParams.Add("@mouldname", mouldname); |
| | | } |
| | | if (mouldspec != "" && mouldspec != null) |
| | | { |
| | | search += "and M.spec like '%'+@mouldspec+'%' "; |
| | | dynamicParams.Add("@mouldspec", mouldspec); |
| | | } |
| | | if (type != "" && type != null) |
| | | { |
| | | search += "and A.type=@type "; |
| | | dynamicParams.Add("@type", type); |
| | | } |
| | | if (devicecode != "" && devicecode != null) |
| | | { |
| | | search += "and A.eqp_code=@devicecode "; |
| | | dynamicParams.Add("@devicecode", devicecode); |
| | | } |
| | | if (operuser != "" && operuser != null) |
| | | { |
| | | search += "and U.username like '%'+@operuser+'%' "; |
| | | dynamicParams.Add("@operuser", operuser); |
| | | } |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and A.lm_date between @opendate and @closedate "; |
| | | dynamicParams.Add("@opendate", opendate + " 00:00:00"); |
| | | dynamicParams.Add("@closedate", closedate + " 23:59:59"); |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.mould_code,M.name as mould_name,M.spec as mould_spec, |
| | | (case when A.type='UP' then '䏿º' else '䏿º' end) as type,A.usecount_life, |
| | | A.eqp_code,E.name as eqp_name,U.username as lm_user,A.lm_date |
| | | from TMould_UpDownReord A |
| | | left join TMouldInfo M on A.mould_code=M.code |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | left join TUser U on A.lm_user=U.usercode |
| | | where 1=1 " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.Message = "æ¥è¯¢æå!"; |
| | | mes.count = total; |
| | | mes.data = data.ToList(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模å
·ä¸ä¸æºè®°å¯¼åºExcel] |
| | | public static ToMessage MouldUpDownMachinesOutExcel(string mouldcode, string mouldname, string mouldspec, string type, string devicecode, string operuser, string opendate, string closedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (mouldcode != "" && mouldcode != null) |
| | | { |
| | | search += "and A.mould_code like '%'+@mouldcode+'%' "; |
| | | dynamicParams.Add("@mouldcode", mouldcode); |
| | | } |
| | | if (mouldname != "" && mouldname != null) |
| | | { |
| | | search += "and M.name like '%'+@mouldname+'%' "; |
| | | dynamicParams.Add("@mouldname", mouldname); |
| | | } |
| | | if (mouldspec != "" && mouldspec != null) |
| | | { |
| | | search += "and M.spec like '%'+@mouldspec+'%' "; |
| | | dynamicParams.Add("@mouldspec", mouldspec); |
| | | } |
| | | if (type != "" && type != null) |
| | | { |
| | | search += "and A.type=@type "; |
| | | dynamicParams.Add("@type", type); |
| | | } |
| | | if (devicecode != "" && devicecode != null) |
| | | { |
| | | search += "and A.eqp_code=@devicecode "; |
| | | dynamicParams.Add("@devicecode", devicecode); |
| | | } |
| | | if (operuser != "" && operuser != null) |
| | | { |
| | | search += "and U.username like '%'+@operuser+'%' "; |
| | | dynamicParams.Add("@operuser", operuser); |
| | | } |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and A.lm_date between @opendate and @closedate "; |
| | | dynamicParams.Add("@opendate", opendate + " 00:00:00"); |
| | | dynamicParams.Add("@closedate", closedate + " 23:59:59"); |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.mould_code as '模å
·ç¼ç ',M.name as '模å
·åç§°',M.spec as '模å
·è§æ ¼', |
| | | (case when A.type='UP' then '䏿º' else '䏿º' end) as 'æä½ç±»å',A.usecount_life as 'æ¬æ¬¡ä½¿ç¨', |
| | | A.eqp_code as '设å¤ç¼ç ',E.name as '设å¤åç§°',U.username as 'æä½äººå',A.lm_date as 'æä½æ¶é´' |
| | | from TMould_UpDownReord A |
| | | left join TMouldInfo M on A.mould_code=M.code |
| | | left join TEqpInfo E on A.eqp_code=E.code |
| | | left join TUser U on A.lm_user=U.usercode |
| | | where 1=1 " + search; |
| | | DataTable data = DapperHelper.selectdata(sql, dynamicParams); |
| | | data.TableName = "Table"; //设置DataTableçåç§° |
| | | string msg = DownLoad.DataTableToExcel(data, "模å
·ä¸ä¸æºè®°å½æ¥è¡¨"); |
| | | mes.code = "200"; |
| | | mes.Message = "æ¥è¯¢æå!"; |
| | | mes.count = total; |
| | | mes.data = msg; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模å
·åè¿è®°å½æ¥è¯¢] |
| | | public static ToMessage MouldCirculateMachinesSearch(string mouldcode, string mouldname, string mouldspec, string type, string operuser, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (mouldcode != "" && mouldcode != null) |
| | | { |
| | | search += "and A.mould_code like '%'+@mouldcode+'%' "; |
| | | dynamicParams.Add("@mouldcode", mouldcode); |
| | | } |
| | | if (mouldname != "" && mouldname != null) |
| | | { |
| | | search += "and M.name like '%'+@mouldname+'%' "; |
| | | dynamicParams.Add("@mouldname", mouldname); |
| | | } |
| | | if (mouldspec != "" && mouldspec != null) |
| | | { |
| | | search += "and M.spec like '%'+@mouldspec+'%' "; |
| | | dynamicParams.Add("@mouldspec", mouldspec); |
| | | } |
| | | if (type != "" && type != null) |
| | | { |
| | | search += "and A.type=@type "; |
| | | dynamicParams.Add("@type", type); |
| | | } |
| | | if (operuser != "" && operuser != null) |
| | | { |
| | | search += "and U.username like '%'+@operuser+'%' "; |
| | | dynamicParams.Add("@operuser", operuser); |
| | | } |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and A.lm_date between @opendate and @closedate "; |
| | | dynamicParams.Add("@opendate", opendate + " 00:00:00"); |
| | | dynamicParams.Add("@closedate", closedate + " 23:59:59"); |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.mould_code,M.name as mould_name,M.spec as mould_spec, |
| | | (case when A.type='OUT' then 'å¤å' else 'å½è¿' end) as type, |
| | | A.description,U.username as lm_user,A.lm_date |
| | | from TMould_LendOutReord A |
| | | left join TMouldInfo M on A.mould_code=M.code |
| | | left join TUser U on A.lm_user=U.usercode |
| | | where 1=1 " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.Message = "æ¥è¯¢æå!"; |
| | | mes.count = total; |
| | | mes.data = data.ToList(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模å
·åè¿è®°å½å¯¼åº] |
| | | public static ToMessage MouldCirculateMachinesOutExcel(string mouldcode, string mouldname, string mouldspec, string type, string operuser, string opendate, string closedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (mouldcode != "" && mouldcode != null) |
| | | { |
| | | search += "and A.mould_code like '%'+@mouldcode+'%' "; |
| | | dynamicParams.Add("@mouldcode", mouldcode); |
| | | } |
| | | if (mouldname != "" && mouldname != null) |
| | | { |
| | | search += "and M.name like '%'+@mouldname+'%' "; |
| | | dynamicParams.Add("@mouldname", mouldname); |
| | | } |
| | | if (mouldspec != "" && mouldspec != null) |
| | | { |
| | | search += "and M.spec like '%'+@mouldspec+'%' "; |
| | | dynamicParams.Add("@mouldspec", mouldspec); |
| | | } |
| | | if (type != "" && type != null) |
| | | { |
| | | search += "and A.type=@type "; |
| | | dynamicParams.Add("@type", type); |
| | | } |
| | | if (operuser != "" && operuser != null) |
| | | { |
| | | search += "and U.username like '%'+@operuser+'%' "; |
| | | dynamicParams.Add("@operuser", operuser); |
| | | } |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and A.lm_date between @opendate and @closedate "; |
| | | dynamicParams.Add("@opendate", opendate + " 00:00:00"); |
| | | dynamicParams.Add("@closedate", closedate + " 23:59:59"); |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.mould_code as '模å
·ç¼ç ',M.name as '模å
·åç§°',M.spec as 'è§æ ¼åå·', |
| | | (case when A.type='OUT' then 'å¤å' else 'å½è¿' end) as 'æä½ç±»å', |
| | | A.description as 'æè¿°',U.username as 'æä½äººå',A.lm_date as 'æä½æ¶é´' |
| | | from TMould_LendOutReord A |
| | | left join TMouldInfo M on A.mould_code=M.code |
| | | left join TUser U on A.lm_user=U.usercode |
| | | where 1=1 " + search; |
| | | DataTable data = DapperHelper.selectdata(sql, dynamicParams); |
| | | data.TableName = "Table"; //设置DataTableçåç§° |
| | | string msg = DownLoad.DataTableToExcel(data, "模å
·åè¿è®°å½æ¥è¡¨"); |
| | | mes.code = "200"; |
| | | mes.Message = "æ¥è¯¢æå!"; |
| | | mes.count = total; |
| | | mes.data = msg; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace VueWebCoreApi.Models |
| | | { |
| | | public class WareHouseLocation |
| | | { |
| | | public string text { get; set; } |
| | | public string value { get; set; } |
| | | public List<LocationData> children { get; set; } |
| | | } |
| | | public class LocationData |
| | | { |
| | | public string text { get; set; } |
| | | public string value { get; set; } |
| | | } |
| | | } |
| | |
| | | using Quartz; |
| | | using Quartz.Impl; |
| | | using Quartz.Spi; |
| | | using Swashbuckle.AspNetCore.SwaggerUI; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | |
| | | { |
| | | typeof(OpenApiGroup).GetEnumNames().ToList().ForEach(version => |
| | | { |
| | | |
| | | c.SwaggerDoc(version, new OpenApiInfo() |
| | | { |
| | | Title = $"æ°å¯è¿ªMesApiææ¡£:{version}", |
| | | Version = version, |
| | | Description = $"Panda.Sewerage : {version} " |
| | | Description = $"Panda.Sewerage : {version} ", |
| | | }); |
| | | }); |
| | | |
| | | string basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); |
| | | string xmlPath = Path.Combine(basePath, "VueWebCoreApi.xml"); |
| | | c.IncludeXmlComments(xmlPath, true); |
| | | }); |
| | | #endregion |
| | | |
| | | // 设置é
ç½® |
| | | AppSetting.SetAppSetting(Configuration.GetSection("ConnectionStrings")); |
| | | //log4neté
ç½® |
| | |
| | | { |
| | | c.SwaggerEndpoint($"/swagger/{version}/swagger.json", $"{version}"); |
| | | }); |
| | | |
| | | }); |
| | | #endregion |
| | | app.UseHttpsRedirection(); |