| | |
| | | |
| | | #endregion |
| | | |
| | | #region éå®éè´§ ä¸ä¼ çå |
| | | |
| | | #region éå®éè´§ æ°å¢æ¨¡å¼ |
| | | |
| | | /// <summary> |
| | | /// éå®éè´§æ°å¢ä¸ä¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveSellOutBackBill_Json")] |
| | | [HttpPost] |
| | | public object set_SaveSellOutBackBill_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.HBillSubType = lsmain[0].HBillSubType; |
| | | if (lsmain[0].HMainSourceBillType == "1403") |
| | | { |
| | | websLsmain.HMainSourceBillType = "éè´§éç¥å"; |
| | | } |
| | | else if (lsmain[0].HMainSourceBillType == "1401") |
| | | { |
| | | 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_SaveSellOutBackBill_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; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region çäº§ç»æå ä¸ä¼ çå |
| | | |
| | | /// <summary> |
| | |
| | | try |
| | | { |
| | | WebSoBar = oWebs.get_SourceBarCode_MateOutBack(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_SellOutBack_Json")] |
| | | [HttpGet] |
| | | public object Get_SourceBarCode_SellOutBack_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | WebSoBar = oWebs.get_SourceBarCode_SellOutBack(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo); |
| | | if (WebSoBar == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | HSourceBillNo_TB = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]); |
| | | HSourceInterID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HSourceInterID"]); |
| | | //æ ¹æ®å
¥åºç³è¯·ååå·å¤æåæ®ä¿¡æ¯æ¯å¦å·²ç»åæ¥å°éè¶ |
| | | sql = string.Format(@"select FID,FBILLNO from {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName); |
| | | sql = string.Format(@"select FID,FBILLNO,FDOCUMENTSTATUS from {0}..TFKO_t_Cust100009 with(nolock) where FBILLNO = '" + HSourceBillNo_TB + "'", HDataBaseName); |
| | | |
| | | ds = oCn.RunProcReturn(sql, "TFKO_t_Cust100009"); |
| | | //å
¥åºç³è¯·å没æåæ¥å°éè¶åè¿è¡åæ¥ |
| | |
| | | LogService.Write("åçå¼å¸¸ï¼å
¥åºç³è¯·å忥è·åç»å½è´¦å·å¯ç 失败ï¼ï¼" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); |
| | | return "åçå¼å¸¸ï¼å
¥åºç³è¯·å忥è·åç»å½è´¦å·å¯ç 失败ï¼"; |
| | | } |
| | | LogService.Write("å
¶ä»å
¥åº,å³å°ç»å½éè¶"); |
| | | var loginRet = InvokeHelper.Login(); |
| | | LogService.Write("å
¶ä»å
¥åº,ç»å½éè¶ç»æ1ï¼" + loginRet); |
| | | LogService.Write("å
¶ä»å
¥åº,ç»å½éè¶ç»æ2ï¼" + JObject.Parse(loginRet)["LoginResultType"].Value<int>()); |
| | | |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | if (isSuccess == 0) |
| | |
| | | } |
| | | |
| | | //æ´æ°æ¡ç æºåidä¿¡æ¯ |
| | | sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a left join AIS20220609121235..TFKO_t_Cust100009 b on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'"); |
| | | sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a with(nolock) left join AIS20220609121235..TFKO_t_Cust100009 b with(nolock) on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c with(nolock) on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'"); |
| | | //æ§è¡æ´æ°è¯å¥ |
| | | oCn.RunProc(sql); |
| | | |
| | | } |
| | | //夿ç产å
¥åºç³è¯·åæ¯å¦æ¯å®¡æ ¸ç¶æï¼è¥æªå®¡æ ¸åæ§è¡æäº¤å®¡æ ¸æ¹æ³ |
| | | else |
| | | { |
| | | //--Z æåï¼A å建ï¼B å®¡æ ¸ä¸ï¼C å·²å®¡æ ¸ï¼D éæ°å®¡æ ¸ |
| | | |
| | | //è·åå
¥åºç³è¯·ååæ®å· |
| | | string HBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FBILLNO"]); |
| | | //å
è£
线çæçç产å
¥åºç³è¯·ååä¸èªå¨å®¡æ ¸ |
| | | if (HBillNo.Substring(0,2) == "RK" ) |
| | | { |
| | | //è·åå
¥åºç³è¯·ååæ®ç¶æ |
| | | string HBillStatus = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["FDOCUMENTSTATUS"]); |
| | | //è·åå
¥åºç³è¯·åID |
| | | var json = new |
| | | { |
| | | Ids = ds.Tables[0].Rows[0]["FID"].ToString(), |
| | | }; |
| | | LogService.Write("æäº¤å®¡æ ¸IDï¼" + DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["FID"])); |
| | | |
| | | //ä»é
ç½®æä»¶è·å CLOUDç½åãè´¦å¥ä¿¡æ¯ãç»å½ç¨æ·ãç»å½å¯ç |
| | | if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo)) |
| | | { |
| | | LogService.Write("åçå¼å¸¸ï¼å
¥åºç³è¯·å忥è·åç»å½è´¦å·å¯ç 失败ï¼ï¼" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); |
| | | return "åçå¼å¸¸ï¼å
¥åºç³è¯·å忥è·åç»å½è´¦å·å¯ç 失败ï¼"; |
| | | } |
| | | |
| | | //ç»å½éè¶ |
| | | var loginRet = InvokeHelper.Login(); |
| | | //夿æ¯å¦ç»å½æå |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | if (isSuccess == 0) |
| | | { |
| | | LogService.Write("å
¶ä»å
¥åº,ç»å½éè¶å¤±è´¥ï¼" + sBarCode + "," + HSourceBillNo_TB + "," + HSourceInterID); |
| | | return "åçå¼å¸¸ï¼ç»å½éè¶å¤±è´¥ï¼"; |
| | | } |
| | | |
| | | //æäº¤å®¡æ ¸ |
| | | string result1 = string.Empty; |
| | | string result2 = string.Empty; |
| | | //å建ï¼éæ°å®¡æ ¸ç¶æè°ç¨æäº¤ï¼å®¡æ ¸æé® |
| | | if (HBillStatus == "A" || HBillStatus == "D") |
| | | { |
| | | LogService.Write("ç产å
¥åºç³è¯·åå·ï¼" + HBillNo + ",éæ°è¿è¡æäº¤å®¡æ ¸"); |
| | | result1 = InvokeHelper.Submit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//æäº¤ |
| | | result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//å®¡æ ¸ |
| | | |
| | | if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | LogService.Write("å
¥åºç³è¯·ååå·:" + ",æäº¤å¤±è´¥" + result1); |
| | | return "åçå¼å¸¸ï¼å
¥åºç³è¯·ååå·:" + ",æäº¤å¤±è´¥" + result1; |
| | | } |
| | | |
| | | if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | LogService.Write("å
¥åºç³è¯·ååå·:" + ",å®¡æ ¸å¤±è´¥" + result2); |
| | | return "åçå¼å¸¸ï¼å
¥åºç³è¯·ååå·:" + ",å®¡æ ¸å¤±è´¥" + result2; |
| | | } |
| | | } |
| | | //å®¡æ ¸ä¸ç¶æè°ç¨å®¡æ ¸æé® |
| | | else if (HBillStatus == "B") |
| | | { |
| | | LogService.Write("ç产å
¥åºç³è¯·åå·ï¼" + HBillNo + ",éæ°è¿è¡å®¡æ ¸"); |
| | | result2 = InvokeHelper.Audit("k18d2ab4f14034c569576ec8e0835a80c", JsonConvert.SerializeObject(json));//å®¡æ ¸ |
| | | if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | LogService.Write("å
¥åºç³è¯·ååå·:" + ",å®¡æ ¸å¤±è´¥" + result2); |
| | | return "åçå¼å¸¸ï¼å
¥åºç³è¯·ååå·:" + ",å®¡æ ¸å¤±è´¥" + result2; |
| | | } |
| | | } |
| | | |
| | | //æ´æ°æ¡ç æºåidä¿¡æ¯ |
| | | sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a with(nolock) left join AIS20220609121235..TFKO_t_Cust100009 b with(nolock) on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c with(nolock) on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'"); |
| | | //æ§è¡æ´æ°è¯å¥ |
| | | oCn.RunProc(sql); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | HReturnResult = sBarCode; |