| | |
| | | [HttpPost] |
| | | public object SaveGetMouldScrapOutHouseBillList([FromBody] JObject msg) |
| | | { |
| | | oCN.BeginTran(); |
| | | DAL.ClsSc_MouldScrapOutBill oBill = new DAL.ClsSc_MouldScrapOutBill(); |
| | | |
| | | oCn.BeginTran(); |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | |
| | | //编辑权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, HMaker)) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "您没有该模块新增/编辑权限,请与管理员联系!"; |
| | |
| | | //单据号是否重复 |
| | | if (oBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, oItem.HInterID)) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据号重复!不允许保存!"; |
| | |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oItem.HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s; |
| | |
| | | //保存 |
| | | if (oBill.omodel.HInterID == 0) //新增保存 |
| | | { |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "海诚") |
| | | { |
| | | |
| | | bResult = oBill.AddBillWithWebs(ref DBUtility.ClsPub.sExeReturnInfo, oCn); |
| | | |
| | | if (bResult) |
| | | { |
| | | if (!setOutBill(msg,oBill.omodel.HInterID, ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "金蝶单据保存失败!" + DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "四维尔") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "获取系统参数失败! " + sErrMsg; |
| | |
| | | |
| | | if (bResult) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "海城") |
| | | { |
| | | |
| | | if (setOutBill(msg, ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //成功! |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "金蝶单据保存失败!"+ DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | oCN.Commit(); |
| | | oCn.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; //成功! |
| | |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!" + e.Message; |
| | |
| | | } |
| | | } |
| | | |
| | | public bool setOutBill([FromBody] JObject msg, ref string sErrInfo) |
| | | public bool setOutBill([FromBody] JObject msg,long HInterID,ref string sErrInfo) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | |
| | | string sMainStr = sArray[0].ToString(); //主表数据 |
| | | string sSubStr = sArray[1].ToString(); //子表数据 |
| | | string HMaker = sArray[2].ToString(); //制单人 |
| | | long id; |
| | | DataSet ds = oCn.RunProcReturn("select max(HInterID) HInterID from Sc_MouldStockBillMain ", "Sc_MouldStockBillMain"); |
| | | try |
| | | { |
| | | //List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>(); |
| | |
| | | //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | string sSourceBillType = "3832"; |
| | | if(lsmain[0].HInterID==0) |
| | | { |
| | | |
| | | id = Convert.ToInt64(ds.Tables[0].Rows[0]["HInterID"]); |
| | | |
| | | WebAPI.WebS.ClsKf_OtherOutBillMain websLsmain = new WebS.ClsKf_OtherOutBillMain(); |
| | | websLsmain.HInterID = id; |
| | | websLsmain.HInterID = HInterID; |
| | | websLsmain.HDate = lsmain[0].HDate; |
| | | websLsmain.HBillNo = lsmain[0].HBillNo; |
| | | websLsmain.HSupID = lsmain[0].HSupID; |
| | |
| | | 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; |
| | | } |
| | | } |
| | | 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; |
| | | DBUtility.ClsPub.sErrInfo = "上传失败!" + e.ToString(); |
| | | return false; |
| | | } |
| | | } |