chenhaozhe
7 天以前 431755b402c18ccccee6461bfd734bba1f909a23
WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
@@ -885,25 +885,25 @@
                }
                //审核前控制================================================================================
                string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                //ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl");
                //if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 1;
                //    objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 1;
                //    objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //================================================================================
                //审核
@@ -965,20 +965,20 @@
                }
                //审核后控制================================================================================
                string sql = "exec h_p_StationEntrustOutBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "审核过程中出错,请与网络管理人员联系";
                    oCN.RollBack();
                    return false;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
                    oCN.RollBack();
                    return false;
                }
                //string sql = "exec h_p_StationEntrustOutBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                //ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterCheckCtrl");
                //if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                //{
                //    sReturn = "审核过程中出错,请与网络管理人员联系";
                //    oCN.RollBack();
                //    return false;
                //}
                //if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                //{
                //    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
                //    oCN.RollBack();
                //    return false;
                //}
                //================================================================================
@@ -1379,5 +1379,48 @@
            }
        }
        #endregion
        [Route("Cj_StationEntrustOutBill/setOtherProperty")]
        [HttpGet]
        public object setOtherProperty(int HInterID, int HQty,string user)
        {
            try
            {
                DataSet ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain where HInterID="+ HInterID, "Sc_StationOutBillMain");
                if(ds.Tables.Count>0)
                {
                    if(HQty>0)
                    {
                        oCN.BeginTran();
                        oCN.RunProc($"update Sc_StationOutBillMain set HQty={HQty},HMaker='{user}' where HInterID={HInterID} ");
                        oCN.Commit();
                    }
                    set_CheckBill(HInterID, user);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
    }
}