| | |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | |
| | | public class WEBSController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetUser_Json")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public object GetUser_Json(string HUserNumber, string HPassWord, Int64 HStockOrgID, string HStockOrgName) |
| | | { |
| | | try |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if(!oSystemParameter.ShowBill(ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç»å½å¼å¸¸ï¼Token çæå¼å¸¸ï¼æ æ³è·åå
¬å¸ä¿¡æ¯ï¼"; |
| | | } |
| | | |
| | | string tokenStr = JWTHelper.GenerateToken(ds.Tables[0].Rows[0]["Czybm"].ToString(), ds.Tables[0].Rows[0]["Czymc"].ToString()); |
| | | |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ç»å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | JObject jobjJsonResult = JObject.FromObject(objJsonResult); |
| | | jobjJsonResult["token"] = tokenStr; |
| | | return jobjJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region æ«ç æ¨¡å æ ¹æ®æ¡ç å é¤ç¼åå表ä¸å¯¹åºæ¡ç è®°å½ |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ç æ´æ°æ¡ç åºå
¥åºç¼å表æ°é |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_UpdatePonderationBillMain_Temp_BarCode_Json")] |
| | | [HttpGet] |
| | | public object set_UpdatePonderationBillMain_Temp_BarCode_Json(long HInterID, string HBillType, string HBarCode, double HQty, long HItemID) |
| | | { |
| | | try |
| | | { |
| | | //(HBarCode_Pack <> '' and HInterID = { HInterID.ToString() } and HBillType = '{HBillType}' and HBarCode_Pack = '{HBarCode}') or |
| | | // (HBarCode <> '' and HInterID ={ HInterID.ToString()} |
| | | //and HBillType = '{HBillType}' and HBarCode = '{HBarCode}') |
| | | // æ ¹æ®ææ¡ç åæ®µåæ¡ç åæ®µ 夿 æ´æ°çæ¡ç æ°éæ¯å¦å¤§äºæå¤§æ°éæå°äº0 |
| | | ds = oCn.RunProcReturn($@"select * from KF_PonderationBillMain_Temp where |
| | | HItemID = {HItemID} |
| | | ", "KF_PonderationBillMain_Temp"); |
| | | |
| | | if(ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | // ææ«æ¡ç ä¸åå¨ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°å¤±è´¥ï¼ææ«æ¡ç ä¸åå¨..."; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if(HQty < 0) |
| | | { |
| | | // æ´æ°çæ¡ç æ°éå°äº0 |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°å¤±è´¥ï¼æ´æ°æ°éå°äº0..."; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if(Double.Parse(ds.Tables[0].Rows[0]["HQtyMust"].ToString()) < HQty) |
| | | //{ |
| | | //// æ´æ°çæ¡ç æ°éæ¯å¦å¤§äºæå¤§æ°é |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = $"æ´æ°å¤±è´¥ï¼æ¡ç æ°é{HQty}å¤§äºæå¤§å¯æ«æ°é{ds.Tables[0].Rows[0]["HQtyMust"].ToString()}..."; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | |
| | | //æ ¹æ®ææ¡ç åæ®µæ´æ°æ¬åæ¡ç åºå
¥åºç¼åè¡¨æ°æ® |
| | | //oCn.RunProc($"Update KF_PonderationBillMain_Temp set HQty = {HQty} where HBarCode_Pack<>'' and HInterID={HInterID.ToString()} and HBillType='{HBillType}' and HBarCode_Pack='{HBarCode}'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //æ ¹æ®æ¡ç åæ®µæ´æ°æ¬åæ¡ç åºå
¥åºç¼åè¡¨æ°æ® |
| | | //oCn.RunProc($"Update KF_PonderationBillMain_Temp set HQty = {HQty} where HBarCode<>'' and HInterID={HInterID.ToString()} and HBillType='{HBillType}' and HBarCode='{HBarCode}'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //æ ¹æ®æ¡ç èªå¢å æ´æ° æ¡ç åºå
¥åºç¼åè¡¨æ°æ® |
| | | oCn.RunProc($"exec h_p_KF_PonderationBillMain_Temp_Update {HInterID}, '{HBillType}', '{HBarCode}', {HQty}, {HItemID}", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ´æ°æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°æ¡ç åºå
¥åºç¼åå表æ¡ç è®°å½å¤±è´¥ï¼" + e.Message.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region æ«ç æ¨¡å æ ¹æ®HItemIDå é¤ç¼åå表ä¸å¯¹åºæ¡ç è®°å½ |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | if (isSuccess == 1) |
| | | { |
| | | string result = InvokeHelper.Save("QM_InspectBill", sJson); //ä¿å |
| | | |
| | | sRemark = sRemark + " ï¼çæCLOUDåæ®" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | HReturn = result.ToString(); |
| | |
| | | else |
| | | { |
| | | sRemark = sRemark + sJson; |
| | | // æäº¤åä¿ååæ® |
| | | string result1 = string.Empty; |
| | | string result2 = string.Empty; |
| | | var fID = JObject.Parse(result)["Result"]["Id"].ToString(); |
| | | var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString(); |
| | | var json = new |
| | | { |
| | | Ids = fID, |
| | | }; |
| | | |
| | | result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//æäº¤ |
| | | result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//å®¡æ ¸ |
| | | if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | oCn.RollBack(); |
| | | sErrMsg = $"æ¥ææ£éªåå·ï¼{fBillNo}ï¼æäº¤å¤±è´¥" + result; |
| | | return false; |
| | | } |
| | | oCn.Commit(); |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | WebSoBar = oWebs.get_SourceBarCode_OtherIn(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> |
| | | /// åæå å·¥å
¥åº æ«ææºåæ¡ç |
| | | /// </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"; |
| | |
| | | { |
| | | 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.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ«æåæ®æ¡ç å¤±è´¥ï¼æ ç»å®è´¨æ£æ¹æ¡ä¿¡æ¯"; |
| | | 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; |
| | | } |
| | |
| | | [HttpGet] |
| | | public object get_BarCode_PackUnionCarryUp(int sInterID, string HBillType, string sBillNo, string sHBarCode_Pack, string sMaker, int HStockOrgID) |
| | | { |
| | | var oBar = oWebs.get_BarCode_PackUnionCarryUp(sInterID, HBillType, sBillNo, sHBarCode_Pack, sMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); |
| | | var oBar = oWebs.get_BarCode_PackUnionCarryUp(sInterID, sBillNo, HBillType, sHBarCode_Pack, sMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); |
| | | if (oBar == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //æåï¼ |
| | | objJsonResult.data = oDs.Tables[0]; |
| | | return objJsonResult; |