| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldScrapOutHouseBillList " + page + "," + size + ",''", "h_p_Sc_MouldScrapOutHouseBillList"); |
| | | } |
| | | else |
| | | { |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_MouldScrapOutHouseBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MouldScrapOutHouseBillList"); |
| | | } |
| | | |
| | |
| | | |
| | | if (bResult) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "海城") |
| | | { |
| | | if (setOutBill(msg)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //成功! |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "金蝶单据保存失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //成功! |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public bool setOutBill([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string sMainStr = sArray[0].ToString(); //主表数据 |
| | | string sSubStr = sArray[1].ToString(); //子表数据 |
| | | string HMaker = sArray[2].ToString(); //制单人 |
| | | try |
| | | { |
| | | //List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>(); |
| | | ListModels oListModels = new ListModels(); |
| | | sMainStr = sMainStr.Replace("\\", ""); |
| | | sMainStr = sMainStr.Replace("\n", ""); |
| | | sMainStr = "[" + sMainStr.ToString() + "]"; |
| | | //lsmain = oListModels.getOtherOutBillMainByJson(sMainStr); |
| | | List<Model.ClsSc_MouldStockBillMain> lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldStockBillMain>>(sMainStr); |
| | | //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | string sSourceBillType = "3832"; |
| | | |
| | | WebAPI.WebS.ClsKf_OtherOutBillMain websLsmain = new WebS.ClsKf_OtherOutBillMain(); |
| | | websLsmain.HInterID = lsmain[0].HInterID; |
| | | websLsmain.HDate = lsmain[0].HDate; |
| | | websLsmain.HBillNo = lsmain[0].HBillNo; |
| | | websLsmain.HSupID = lsmain[0].HSupID; |
| | | websLsmain.HDeptID = lsmain[0].HDeptID; |
| | | websLsmain.HEmpID = lsmain[0].HKeeperID; |
| | | websLsmain.HKeeperID = lsmain[0].HKeeperID; |
| | | websLsmain.HSecManagerID = lsmain[0].HSecManagerID; |
| | | websLsmain.HRemark = lsmain[0].HRemark??"test"; |
| | | websLsmain.HMaker = lsmain[0].HMaker; |
| | | websLsmain.HBillerID = 0; |
| | | websLsmain.HSTOCKORGID = 100038; |
| | | websLsmain.HOWNERID = 100038; |
| | | websLsmain.HBillType = "1206";//固定值 |
| | | websLsmain.HBillSubType = "test"; |
| | | WebS.WebService1 oWebs = new WebS.WebService1(); |
| | | WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain(); |
| | | if (oWebs.set_SaveOtherOutBill_New_haicheng(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! |
| | | objJsonResult.data = null; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //失败! |
| | | objJsonResult.data = null; |
| | | return false; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "上传失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region [模具处理出库单删除功能] |
| | |
| | | [HttpPost] |
| | | public object UploadFile_Gy_QCVerification() |
| | | { |
| | | |
| | | string path = ""; |
| | | string HBillNo = HttpContext.Current.Request.Params["HBillNo"]; //单据号 |
| | | string HRemark = HttpContext.Current.Request.Params["HRemark"]; //备注 |
| | | string HUserName = HttpContext.Current.Request.Params["HUserName"]; //创建人 |
| | | HttpPostedFile files = HttpContext.Current.Request.Files["file"]; |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/Gy_QCVerification/" + HBillNo); |
| | | HttpPostedFile files = HttpContext.Current.Request.Files["file"]; |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") |
| | | { |
| | | path = "D:/网站发布/LAYUI/Files/Gy_QCVerification/" + HBillNo; |
| | | } |
| | | else |
| | | { |
| | | path = HttpContext.Current.Server.MapPath("~/../Files/Gy_QCVerification/" + HBillNo); |
| | | } |
| | | } |
| | | dynamic dyResult = UploadFile_Gy_QCVerification(files, path, HBillNo, HRemark, HUserName); |
| | | if (dyResult != null && dyResult.result == 1) |
| | | { |
| | |
| | | { |
| | | File.Delete(fileurl); //删除指定文件 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/Gy_QCVerification/" + HBillNo + "/" + filename; |
| | | string StrPath = ""; |
| | | |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") |
| | | { |
| | | StrPath = "D:/网站发布/LAYUI/Files/Gy_QCVerification/" + HBillNo + "/" + filename; |
| | | } |
| | | else |
| | | { |
| | | StrPath = "/files/Gy_QCVerification/" + HBillNo + "/" + filename; |
| | | } |
| | | } |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //这里可以执行一些其它的操作,比如更新数据库 |
| | |
| | | [HttpGet] |
| | | public object Gy_QCVerification_Filelist(string HBillNo) |
| | | { |
| | | var url = fileip + "/Files/Gy_QCVerification/" + HBillNo + "/"; |
| | | |
| | | string Ret = ""; |
| | | var url = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") |
| | | { |
| | | url = "D:/网站发布/LAYUI/Files/Gy_QCVerification/" + HBillNo + "/"; |
| | | } |
| | | else |
| | | { |
| | | url = fileip + "/Files/Gy_QCVerification/" + HBillNo + "/"; |
| | | } |
| | | } |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url from MES_AccessoriesList where HSourceBillNo='" + HBillNo + "'", "MES_AccessoriesList"); |
| | |
| | | { |
| | | |
| | | oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID); |
| | | string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Gy_QCVerification/" + HSourceBillNo), HFileName); |
| | | File.Delete(fileurl); //删除指定文件 |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |