|  |  |  | 
|---|
|  |  |  | using DBUtility; | 
|---|
|  |  |  | using Model; | 
|---|
|  |  |  | using Newtonsoft.Json; | 
|---|
|  |  |  | using Newtonsoft.Json.Linq; | 
|---|
|  |  |  | using SQLHelper; | 
|---|
|  |  |  | using System; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 生产汇报/扫条码/直接调用webservice | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | [Route("ICMOReportBill/get_CheckTypeByBarCode_Json1")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public Object get_CheckTypeByBarCode_Json1(string sCode, Int64 sInterID, string sBillType, string sBillNo, string sMaker, Int64 WhID, Int64 SPID, Double sQty, bool sRedBlue, bool SourceFlag, string sSourceBillNo, string sSourceType, Int64 HOWNERID) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //if (sRedBlue == true) | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | //    HBillType = "1239"; | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | //oBar = webserver.get_CheckTypeByBarCode(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, ref DBUtility.ClsPub.sErrInfo); | 
|---|
|  |  |  | WebS.WebService1 oWebs = new WebS.WebService1(); | 
|---|
|  |  |  | WebS.ClsKf_ICStockBill_WMS WebSoBar = new WebS.ClsKf_ICStockBill_WMS(); | 
|---|
|  |  |  | string sExpressNumber = ""; | 
|---|
|  |  |  | WebSoBar = oWebs.get_CheckTypeByBarCode_All(sCode, sInterID, sBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, 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 = DBUtility.ClsPub.sErrInfo; | 
|---|
|  |  |  | objJsonResult.data = WebSoBar; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = e.Message + ";" + e.StackTrace; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 一键扫码红字 | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="HSourceBillNo"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | [Route("ICMOReportBill/set_SaveICMOReportBill")] | 
|---|
|  |  |  | [Route("ICMOReportBill/set_SavePonderationBillMain_Temp_Source_Fast_Json_New")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object set_SaveICMOReportBill(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo) | 
|---|
|  |  |  | public object set_SavePonderationBillMain_Temp_Source_Fast_Json_New(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | LogService.Write("执行成功!"); | 
|---|
|  |  |  | // DataSet ds = new DataSet(); | 
|---|
|  |  |  | // WebServer webserver = new WebServer(); | 
|---|
|  |  |  | string sWhere = " Where 单据号 like '%" + HSourceBillNo.Trim() + "'"; | 
|---|
|  |  |  | 
|---|
|  |  |  | { | 
|---|
|  |  |  | HDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]); | 
|---|
|  |  |  | HDeptName = Convert.ToString(ds.Tables[0].Rows[0]["HDeptName"]); | 
|---|
|  |  |  | if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, HBillType, HSourceBillNo, HSourceBillType, "蓝字", ref DBUtility.ClsPub.sErrInfo)) | 
|---|
|  |  |  | if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, "3711", HSourceBillNo, HSourceBillType, "蓝字", ref DBUtility.ClsPub.sErrInfo)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | websLsmain.HInterID = lsmain[0].HInterID; | 
|---|
|  |  |  | websLsmain.HBillNo = lsmain[0].HBillNo; | 
|---|
|  |  |  | websLsmain.HBillType = "1201";//固定值 | 
|---|
|  |  |  | websLsmain.HBillType = "3711";//固定值 | 
|---|
|  |  |  | websLsmain.HDate = lsmain[0].HDate; | 
|---|
|  |  |  | websLsmain.HDeptID = lsmain[0].HDeptID; | 
|---|
|  |  |  | websLsmain.HEmpID = 0; | 
|---|
|  |  |  | 
|---|
|  |  |  | ds = webserver.GetSPInfoByIDandHWHIDandOrg(HSpID, HWHID, HStockOrgID, ref sErrMsg); | 
|---|
|  |  |  | if (ds == null || ds.Tables[0].Rows.Count <= 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "没有返回任何记录!"; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //[Route("POStockInBillList/confirm")] | 
|---|
|  |  |  | //public object confirm(string hmainid) | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | 
|---|
|  |  |  | //            FentityModel.Add("FSRCENTRYID", item["FHPOOrderEntryID"].ToString());//源单分录内码 | 
|---|
|  |  |  | //            FentityModel.Add("FORDERBILLNO", item["FHPOOrderBillNo"].ToString());//源单单号 | 
|---|
|  |  |  | //            FentityModel.Add("FPOORDERENTRYID", item["FHPOOrderEntryID"].ToString());//源单分录内码 | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //            JArray Fentity2 = new JArray(); | 
|---|
|  |  |  | //            JObject FentityModel2 = new JObject(); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region [收料通知单审核] | 
|---|
|  |  |  | //收料通知单审核 扫条码 | 
|---|
|  |  |  | [Route("POStockInBillList/Get_ReciveBillCheckDate")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object Get_ReciveBillCheckDate(string HBarCode) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); | 
|---|
|  |  |  | DataSet Ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_Temp_Add_POInStockCheck2 '" + HBarCode + "'", "h_p_KF_PonderationBillMain_Temp_Add_POInStockCheck2"); | 
|---|
|  |  |  | if (Ds == null || Ds.Tables[0].Rows.Count == 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "没有返回任何记录!"; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "Sucess!"; | 
|---|
|  |  |  | objJsonResult.data = Ds.Tables[0]; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //收料通知单审核 审核提交 | 
|---|
|  |  |  | [Route("POStockInBillList/Exec_ReciveBillCheck")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object Exec_ReciveBillCheck(string HBarCode) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //修改金蝶生产单的状态 | 
|---|
|  |  |  | //访问金蝶 | 
|---|
|  |  |  | var loginRet = InvokeHelper.Login(); | 
|---|
|  |  |  | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (isSuccess == 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "操作失败,金蝶账号登录异常。" + loginRet; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var json = new | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //CreateOrgId = 0, | 
|---|
|  |  |  | Numbers = HBarCode, | 
|---|
|  |  |  | //Ids = (EntyID).Split('-')[0], | 
|---|
|  |  |  | //PkEntryIds = (EntyID).Split('-')[1] | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | string result1 = string.Empty; | 
|---|
|  |  |  | string result2 = string.Empty; | 
|---|
|  |  |  | DataSet Ds = oCn.RunProcReturn("select FDOCUMENTSTATUS,FID from  AIS20210811135644..T_PUR_RECEIVE where FBILLNO='" + HBarCode+"'", "AIS20210811135644..T_PUR_RECEIVE"); | 
|---|
|  |  |  | //判断当前收料通知单状态——已创建则先提交再审核、以提交则只审核 | 
|---|
|  |  |  | if (Ds.Tables[0].Rows[0][0].ToString() == "A"|| Ds.Tables[0].Rows[0][0].ToString() == "D") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | result1 = InvokeHelper.Submit("PUR_ReceiveBill", JsonConvert.SerializeObject(json)); | 
|---|
|  |  |  | result2 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(json)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Ds.Tables[0].Rows[0][0].ToString() == "B") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | result2 = InvokeHelper.Audit("PUR_ReceiveBill", JsonConvert.SerializeObject(json)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //判断审核是否成功 | 
|---|
|  |  |  | if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "审核收料通知单失败!单据号:" + HBarCode; | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "审核成功!"; | 
|---|
|  |  |  | objJsonResult.data = 1; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region PDA销售出库 | 
|---|
|  |  |  | //PDA销售出库整托删除 | 
|---|
|  |  |  | [Route("POStockInBillList/SellOutBillSDeleCode")] | 
|---|
|  |  |  | [HttpGet] | 
|---|
|  |  |  | public object SellOutBillSDeleCode(string HBarCode,string HInterID) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | try | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //根据条码在条码档案中找到对应的托条码,再在临时表中删除该托条码的全部记录 | 
|---|
|  |  |  | string sql = string.Format(@"delete from KF_PonderationBillMain_Temp where HBillType=1205 and HInterID=" + HInterID + " and HBarCode" + | 
|---|
|  |  |  | " in (select HBarCode from Gy_BarCodeBill where HBarCode_Pack = (select HBarCode_Pack from Gy_BarCodeBill where HBarCode = '"+ HBarCode + "'))"); | 
|---|
|  |  |  | oCn.RunProc(sql); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | objJsonResult.code = "1"; | 
|---|
|  |  |  | objJsonResult.count = 1; | 
|---|
|  |  |  | objJsonResult.Message = "整托删除成功!"; | 
|---|
|  |  |  | objJsonResult.data = 1; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | catch (Exception e) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | objJsonResult.code = "0"; | 
|---|
|  |  |  | objJsonResult.count = 0; | 
|---|
|  |  |  | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); | 
|---|
|  |  |  | objJsonResult.data = null; | 
|---|
|  |  |  | return objJsonResult; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|