wtt
7 小时以前 e1ef8b7895ff3d5b0f36c7678fbe529a569fa4ac
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -800,40 +800,62 @@
        }
        [Route("Cg_POOrderBill/jindieCloud")]
        [HttpPost]
        public bool jindieCloud(int HSupID,int MaterID)
        public object jindieCloud(int HSupID,int MaterID)
        {
            Int64 HInterID = 0;
            string HBillNo = "";
            string sErrMsg = "";
            HInterID = DBUtility.ClsPub.CreateBillID_Prod("1102", ref sErrMsg);
            HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("1102", ref sErrMsg, true);
            WebS.ClsCg_POOrderBillMain websLsmain = new WebS.ClsCg_POOrderBillMain();
            try
            {
                oCN.BeginTran();
                Int64 HInterID = 0;
                string HBillNo = "";
                string sErrMsg = "";
                HInterID = DBUtility.ClsPub.CreateBillID_Prod("1102", ref sErrMsg);
                HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("1102", ref sErrMsg, true);
                WebS.ClsCg_POOrderBillMain websLsmain = new WebS.ClsCg_POOrderBillMain();
            
            websLsmain.HInterID = HInterID;
            websLsmain.HDate = DateTime.Now;
            websLsmain.HBillNo = HBillNo;
            websLsmain.HSupID = HSupID;
            websLsmain.HEmpID = MaterID;
            websLsmain.HSTOCKORGID = 100038;
            //websLsmain.HBillType = mainList[0].HBillType;
            if (!oWebs.set_Bill_New(websLsmain, "1100", ref DBUtility.ClsPub.sErrInfo))
            {
                objJsonResult.code = "0";
                websLsmain.HInterID = HInterID;
                websLsmain.HDate = DateTime.Now;
                websLsmain.HBillNo = HBillNo;
                websLsmain.HSupID = HSupID;
                websLsmain.HEmpID = MaterID;
                websLsmain.HSTOCKORGID = 100038;
                //websLsmain.HBillType = mainList[0].HBillType;
                objJsonResult = AddBillMould(HBillNo, MaterID, HSupID);
                if (objJsonResult.code == "0")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = objJsonResult.Message;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (!oWebs.set_Bill_New(websLsmain, "1100", ref DBUtility.ClsPub.sErrInfo))
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "返回金蝶单据失败";  //成功!
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回金蝶单据失败";  //成功!
                objJsonResult.Message = "提交成功";  //成功!
                objJsonResult.data = null;
                return false;
                return objJsonResult;
            }
            objJsonResult = AddBillMould(HBillNo, MaterID, HSupID);
            if (objJsonResult.code == "0")
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = objJsonResult.Message;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = null;
                return false;
                return objJsonResult;
            }
            return true;
        }
        public json AddBillMould(string HBillNo,int MaterID,int HSupID)
        {