| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | DataSet ds; |
| | | |
| | | #region é½å¥åæä¿¡æ¯æç»å表 |
| | |
| | | /// <returns></returns> |
| | | [Route("JIT_Complete/JIT_CompleteDetailList")] |
| | | [HttpGet] |
| | | public object JIT_CompleteDetailList(string sWhere, string HMainICMOEntryID) |
| | | public object JIT_CompleteDetailList(string sWhere, string HMainICMOEntryID,string HMainICMOInterID,string HICMOInterID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_JIT_MOMaterReadysBill where 主ç产订ååå
ç = '" + HMainICMOEntryID + "' " + sWhere + " order by æ¥è®¡åæ¥æ,ç©æID desc ", "h_v_JIT_MOMaterReadysBill"); |
| | | string sql = ""; |
| | | if (HMainICMOEntryID != "-1" && HMainICMOInterID != "-1" && HICMOInterID != "-1") |
| | | { |
| | | sql = "and 主ç产订ååå
ç = '" + HMainICMOEntryID + "' and 主ç产订å主å
ç ='" + HMainICMOInterID + "' and æ¥è®¡å订å主å
ç ='" + HICMOInterID + "'"; |
| | | } |
| | | ds = oCN.RunProcReturn("select * from h_v_JIT_MOMaterReadysBill where 1=1 " +sql + sWhere + " order by æ¥è®¡åæ¥æ,ç©æID desc ", "h_v_JIT_MOMaterReadysBill"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region é½å¥ç©æä¿¡æ¯æç»å表 |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="sWhere">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="HMainICMOEntryID">ç产订åæç»è¡¨id</param> |
| | | /// <returns></returns> |
| | | [Route("JIT_Complete/JIT_CompleteMaterlDetailList")] |
| | | [HttpGet] |
| | | public object JIT_CompleteMaterlDetailList(string sWhere ) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_MaterDetailList " + sWhere, "h_p_JIT_MaterDetailList"); |
| | | |
| | | |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory"); |
| | | |
| | | string Ret = ""; |
| | | oSystemParameter.ShowBill(ref Ret); |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "å¯è´å¥ç¹") |
| | | { |
| | | ds = oCN.RunProcReturn("select top 1000 * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region é½å¥åææ¥è¡¨ |
| | | public class ReportMOMaterReadysBill |
| | | { |
| | | public int? HORGID;//ç»ç» |
| | | public int? HMATERIALID;//ç©æ |
| | | public int? HDeptID;//çäº§è½¦é´ |
| | | public int? HSCZYID;//çäº§èµæº |
| | | public string HXQD;//éæ±åå· |
| | | public string HMOBILLNO;//ç产订åå· |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("JIT_Complete/ReportMOMaterReadysBillList")] |
| | | [HttpGet] |
| | | public object ReportMOMaterReadysBillList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ReportMOMaterReadysBill Report = JsonConvert.DeserializeObject<ReportMOMaterReadysBill>(sWhere); |
| | | |
| | | ds = oCN.RunProcReturn($"exec PR_Complete_Report '{Report.HXQD}','{Report.HMOBILLNO}',{Report.HORGID},{Report.HDeptID},{Report.HSCZYID},{Report.HMATERIALID}", "PR_Complete_Report"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |