| | |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | |
| | | public class WEBSController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | |
| | | objJsonResult.Message = "ç»å½å¼å¸¸ï¼Token çæå¼å¸¸ï¼æ æ³è·åå
¬å¸ä¿¡æ¯ï¼"; |
| | | } |
| | | |
| | | string tokenStr = JWTHelper.GenerateToken(ds.Tables[0].Rows[0]["Czybm"].ToString(), ds.Tables[0].Rows[0]["Czmm"].ToString()); |
| | | string tokenStr = JWTHelper.GenerateToken(ds.Tables[0].Rows[0]["Czybm"].ToString(), ds.Tables[0].Rows[0]["Czymc"].ToString()); |
| | | |
| | | |
| | | objJsonResult.code = "0"; |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°æ¡ç åºå
¥åºç¼åå表æ¡ç è®°å½å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.Message = "æ´æ°æ¡ç åºå
¥åºç¼åå表æ¡ç è®°å½å¤±è´¥ï¼" + e.Message.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | sFormId = "STK_MISCELLANEOUS"; |
| | | } |
| | | //åæå å·¥å
¥åºå |
| | | else if (HBillType == "1212") |
| | | { |
| | | sFormId = "STK_OEMInStock"; |
| | | } |
| | | //颿åºåºå |
| | | else if (HBillType == "1204") |
| | | { |
| | |
| | | else if (HBillType == "1255") |
| | | { |
| | | sFormId = "SUB_FEEDMTRL"; |
| | | } |
| | | //åæå å·¥åºåºåï¼åæå å·¥éæï¼ |
| | | else if (HBillType == "1213") |
| | | { |
| | | sFormId = "STK_OEMInStockRETURN"; |
| | | } |
| | | //ç´æ¥è°æ¨å |
| | | else if (HBillType == "1207") |
| | |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SavePOStockInBill_Json")] |
| | | [HttpPost] |
| | | [Permission(HModName = "Kf_POStockInBill", Operate = "_Edit")] |
| | | public object set_SavePOStockInBill_Json([FromBody] JObject oMain) |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å
¶ä»å
¥åºæ ¡éªå¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region åæå å·¥å
¥åº ä¸ä¼ çå |
| | | |
| | | #region åæå å·¥å
¥åº æ°å¢æ¨¡å¼ |
| | | |
| | | /// <summary> |
| | | /// åæå å·¥å
¥åºæ°å¢ä¸ä¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveInceptEntInBill_Json")] |
| | | [HttpPost] |
| | | public object set_SaveInceptEntInBill_Json([FromBody] JObject oMain) |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | try |
| | | { |
| | | List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>(); |
| | | ListModels oListModels = new ListModels(); |
| | | lsmain = oListModels.getICStockBillMainByJson(msg1); |
| | | WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain(); |
| | | string sSourceType = lsmain[0].HMainSourceBillType; |
| | | websLsmain.HInterID = lsmain[0].HInterID; |
| | | websLsmain.HBillNo = lsmain[0].HBillNo; |
| | | websLsmain.HBillType = lsmain[0].HBillType; |
| | | websLsmain.HDate = lsmain[0].HDate; |
| | | websLsmain.HDeptID = lsmain[0].HDeptID; |
| | | websLsmain.HWHID = lsmain[0].HWHID; |
| | | websLsmain.HSCWHID = lsmain[0].HSCWHID; |
| | | websLsmain.HSupID = lsmain[0].HSupID; |
| | | websLsmain.HKeeperID = lsmain[0].HKeeperID; |
| | | websLsmain.HSecManagerID = lsmain[0].HSecManagerID; |
| | | websLsmain.HEmpID = lsmain[0].HEmpID; |
| | | websLsmain.HManagerID = lsmain[0].HManagerID; |
| | | websLsmain.HRemark = lsmain[0].HRemark; |
| | | websLsmain.HExplanation = lsmain[0].HExplanation; |
| | | websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo; |
| | | websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag; |
| | | websLsmain.HStockStyle = lsmain[0].HStockStyle; |
| | | websLsmain.HBillSubType = lsmain[0].HBillSubType; |
| | | if (lsmain[0].HMainSourceBillType == "1130") |
| | | { |
| | | websLsmain.HMainSourceBillType = "åæå å·¥æ¶æéç¥å"; |
| | | } |
| | | else |
| | | { |
| | | websLsmain.HMainSourceBillType = "æå·¥å½å
¥"; |
| | | } |
| | | websLsmain.HMaker = lsmain[0].HMaker; |
| | | websLsmain.HBillerID = lsmain[0].HBillerID; |
| | | websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; |
| | | websLsmain.HOWNERID = lsmain[0].HSTOCKORGID; |
| | | |
| | | if (oWebs.set_SaveInceptEntInBill_New(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //æåï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //å¤±è´¥ï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæå å·¥å
¥åºåä¸ä¼ 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å§å¤è¡¥ææ ¡éªå¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region åæå å·¥åºåº ä¸ä¼ çå |
| | | |
| | | #region åæå å·¥åºåº æ ¡éªæ¨¡å¼ |
| | | |
| | | /// <summary> |
| | | /// åæå å·¥åºåºæ ¡éªä¸ä¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveInceptEntOutBill_BillCheck_Json")] |
| | | [HttpPost] |
| | | public object set_SaveInceptEntOutBill_BillCheck_Json([FromBody] JObject oMain) |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | |
| | | try |
| | | { |
| | | List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>(); |
| | | ListModels oListModels = new ListModels(); |
| | | lsmain = oListModels.getICStockBillMainByJson(msg1); |
| | | WebAPI.WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain(); |
| | | websLsmain.HInterID = lsmain[0].HInterID; |
| | | websLsmain.HBillNo = lsmain[0].HBillNo; |
| | | websLsmain.HBillType = "1213"; |
| | | websLsmain.HMaker = lsmain[0].HMaker; |
| | | websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID; |
| | | |
| | | if (oWebs.set_SaveInceptEntOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //æåï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //å¤±è´¥ï¼ |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæå å·¥åºåºæ ¡éªå¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region åæå å·¥å
¥åº æ«ææºåæ¡ç |
| | | |
| | | /// <summary> |
| | | /// åæå å·¥å
¥åº æ«ææºåæ¡ç |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/Get_SourceBarCode_InceptEntIn_Json")] |
| | | [HttpGet] |
| | | public object get_SourceBarCode_InceptEntIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | WebSoBar = oWebs.get_SourceBarCode_InceptEntIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); |
| | | if (WebSoBar == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = WebSoBar; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ«ææºåæ¡ç 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region çäº§é¢æ æ«ææºåæ¡ç |
| | | |
| | | /// <summary> |
| | |
| | | sAutoBarCode = "Y"; |
| | | } |
| | | } |
| | | //åæå å·¥å
¥åºå |
| | | else if (HBillType == "1212") |
| | | { |
| | | //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") |
| | | { |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | //å
æ«ç©ææ¡ç 模å¼ï¼'Y'ä¸ºä¸æ«ç©ææ¡ç ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_AutoBarCode.ToUpper() == "Y") |
| | | { |
| | | sAutoBarCode = "Y"; |
| | | } |
| | | } |
| | | //颿åºåºå |
| | | else if (HBillType == "1204") |
| | | { |
| | |
| | | } |
| | | //å
æ«ç©ææ¡ç 模å¼ï¼'Y'ä¸ºä¸æ«ç©ææ¡ç ï¼ |
| | | if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_AutoBarCode.ToUpper() == "Y") |
| | | { |
| | | sAutoBarCode = "Y"; |
| | | } |
| | | } |
| | | //åæå å·¥åºåºå |
| | | else if (HBillType == "1213") |
| | | { |
| | | //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") |
| | | { |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | //å
æ«ç©ææ¡ç 模å¼ï¼'Y'ä¸ºä¸æ«ç©ææ¡ç ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_AutoBarCode.ToUpper() == "Y") |
| | | { |
| | | sAutoBarCode = "Y"; |
| | | } |
| | |
| | | { |
| | | sFIFOCtl = "Y"; |
| | | } |
| | | //åæå å·¥åºåºå-å
è¿å
åºæ§å¶ |
| | | if (HBillType == "1213" |
| | | && oSystemParameter.omodel.Kf_InceptEntOutBillCheck_AutoBarCode.ToUpper() == "N" //å
æ«ç©ææ¡ç 模å¼ï¼'Y'ä¸ºä¸æ«ç©ææ¡ç ï¼ |
| | | && oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "N" //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | && (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl == "1" || oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl == "2" || oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl == "3")) |
| | | { |
| | | sFIFOCtl = "Y"; |
| | | } |
| | | //ç´æ¥è°æ¨å-å
è¿å
åºæ§å¶ |
| | | if (HBillType == "1207" |
| | | && oSystemParameter.omodel.Kf_MoveStockBillCheck_AutoBarCode.ToUpper() == "N" //å
æ«ç©ææ¡ç 模å¼ï¼'Y'ä¸ºä¸æ«ç©ææ¡ç ï¼ |
| | |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | } |
| | | //åæå å·¥å
¥åºå |
| | | else if (HBillType == "1212") |
| | | { |
| | | //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") |
| | | { |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | } |
| | | //颿åºåºå |
| | | else if (HBillType == "1204") |
| | | { |
| | |
| | | } |
| | | //å
è¿å
åºæ§å¶ |
| | | sFIFOCtl = oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_FIFOCtl; |
| | | } |
| | | //åæå å·¥åºåºå |
| | | else if (HBillType == "1213") |
| | | { |
| | | //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") |
| | | { |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | //å
è¿å
åºæ§å¶ |
| | | sFIFOCtl = oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl; |
| | | } |
| | | //ç´æ¥è°æ¨å |
| | | else if (HBillType == "1207") |
| | |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | } |
| | | //åæå å·¥å
¥åºå |
| | | else if (HBillType == "1212") |
| | | { |
| | | //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_SourceBarCodeCtl.ToUpper() == "Y") |
| | | { |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | } |
| | | //颿åºåºå |
| | | else if (HBillType == "1204") |
| | | { |
| | |
| | | { |
| | | //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") |
| | | { |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | | } |
| | | //åæå å·¥åºåºå |
| | | else if (HBillType == "1213") |
| | | { |
| | | //æ ¡éª-æ¯å¦è¿è¡æºåå¯¹åºæ¡ç æ ¸å¯¹ï¼'Y'ä¸ºæ ¸å¯¹ï¼ |
| | | if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y") |
| | | { |
| | | sSourceBarCodeCtl = "Y"; |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region WMSæ¯æ¥è¿è¡ç¶æåæï¼æ¯æ¥å¶åæ°éï¼ |
| | | [Route("WEBSController/GetKf_WMSDailyRunStateReport_Json")] |
| | | [HttpGet] |
| | | public object GetKf_WMSDailyRunStateReport_Json(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | |
| | | Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere); |
| | | |
| | | string HBeginDate = dic["HBeginDate"].ToString(); |
| | | string HEndDate = dic["HEndDate"].ToString(); |
| | | |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCn.RunProcReturn("exec h_p_Kf_WMSDailyRunStateReport '" + HBeginDate + "','" + HEndDate + "'", "h_p_Kf_WMSDailyRunStateReport"); |
| | | |
| | | if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | { |
| | | //æ·»å åå |
| | | 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; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ°æ®"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | |
| | | { |
| | | string sErrMsg = ""; |
| | | oSystemParameter.ShowBill(ref sErrMsg); |
| | | // åèå®¢æ· |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "åè") |
| | | // åèå®¢æ· å·¥åºè¿ç«æ¥æ¶å å·¥åºå§å¤æ¥æ¶å ç产订å å·¥åºæµè½¬å¡ |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "åè" && HSourceBillType != 3790 && HSourceBillType != 3793 && HSourceBillType != 3710 && HSourceBillType != 3772) |
| | | { |
| | | if (!string.IsNullOrWhiteSpace(HBarCode)) |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Columns.Contains("HBack") && DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "åè") |
| | | { |