1
yxj
2024-01-31 67290a066ef6a79af58481a2552f5616717bcbd9
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -408,7 +408,7 @@
        }
        //审核
        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
        public bool CheckBill(Int64 lngBillKey,string HBillNo, string procName, string sUser, ref string sReturn)
        {
            try
@@ -419,8 +419,10 @@
                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                DataSet ds,Ds;
                string sql = "";
                ds = oCn.RunProcReturn("select * from  Sc_ICMOReportBillMain where HInterID = " + lngBillKey, "Sc_ICMOReportBillMain");
                string HBillNo = "";
                HBillNo = "";
                if (ds.Tables[0].Rows.Count > 0)
                {
@@ -444,6 +446,8 @@
                    model.Add("FBillNo", HBillNo);
                    JArray Fentity = new JArray();
                    string sErrMsg = "";
                    string sJXCode = "";
                    foreach (DataRow item in Ds.Tables[1].Rows)
                    {                       
                        JObject FentityModel = new JObject();
@@ -491,8 +495,13 @@
                        FentityModel.Add("FBASEFINISHQTY", item["FBASEFINISHQTY"].ToString());//基本单位完成数量
                        FentityModel.Add("FFINISHQTY", item["FFINISHQTY"].ToString());//完成数量
                        FentityModel.Add("FLot", new JObject() { ["FNumber"] = item["FLot"].ToString() });//批号
                        FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组
                        FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 操作员
                                                                                                          //
                        if (oSystemParameter.omodel.WMS_CampanyName == "九菱") //系统参数  客户定制化名称     空白为通用
                        {
                            FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组
                            FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 操作员
                        }
                        FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOM版本
                        //sJson_BatchNo +
@@ -509,7 +518,7 @@
                        FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString());
                        Fentity2.Add(FentityModel2);
                        FentityModel.Add("FEntity_Link", Fentity2);
                        FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); //
                        FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() });
                        Fentity.Add(FentityModel);
                    }
                    model.Add("FEntity", Fentity); //明细信息                       
@@ -587,6 +596,25 @@
                }
                sReturn = "审核单据成功!";
                //审核后控制===============================================Begin================================================================
                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
                ds = oCn.RunProcReturn(sql, procName);
                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;
                }
                //审核后控制===============================================End================================================================
                oCn.Commit();
                sReturn = "";
@@ -601,9 +629,10 @@
        }
        //反审核
        public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
        public bool AbandonCheck(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
        {
            string sql = "";
            DataSet ds;
            try
            {
                string HChecker = DBUtility.ClsPub.CurUserName;
@@ -612,6 +641,25 @@
                //还原单据状态为未审核状态
                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString());
                sReturn = "反审核单据成功!";
                //审核后控制===============================================Begin================================================================
                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
                ds = oCn.RunProcReturn(sql, procName);
                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;
                }
                //审核后控制===============================================End================================================================
                oCn.Commit();
                sReturn = "";
                return true;