zzr99
2022-01-10 15b364b579decda5633197ecb86307a93f6aee78
WebAPI/Controllers/SCGL/Sc_PackUnionBillController.cs
@@ -102,23 +102,57 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                ds = oCn.RunProcReturn("Select * from Sc_PackUnionBillMain where HinterID='" + lngBillKey, "Sc_PackUnionBillMain");
                var HBarCode_Pack = ds.Tables[0].Rows[0]["HBarCode_Pack"].ToString();
                if (ds.Tables.Count < 1)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "不存在箱码";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                    //判断是否入库
                    ds = oCn.RunProcReturn("select * from Sc_ScanLineInStock where HBarCode_Pack='" + HBarCode_Pack + "'", "Sc_ScanLineInStock");
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "-1";
                        objJsonResult.Message = "该箱条码已入库不允许取消!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    ds = oCn.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + HBarCode_Pack + "'", "Gy_BarCodeBill");
                    if (ds == null && ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "-1";
                        objJsonResult.Message = "无效箱条码!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    ds = oCn.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + HBarCode_Pack + "' and HStopflag='1'", "Gy_BarCodeBill");
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "-1";
                        objJsonResult.Message = "此箱条码已作废!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                oCn.BeginTran();
                oCn.RunProc("Update  Gy_BarCodeBill set HStopflag='1'  where HBarCode='" + HBarCode_Pack + "'");
                oCn.RunProc("Delete From Sc_PackUnionBillSub_Sum  where HBarCode_Pack='" + HBarCode_Pack + "'");
                oCn.RunProc("Delete From Sc_PackUnionBillSub  where HInterID='" + lngBillKey + "'");
                oCn.RunProc("Delete From Sc_PackUnionBillMain  where HInterID='" + lngBillKey + "'");
                oCn.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功";
                objJsonResult.data = null;
                return objJsonResult;
            }
            else
            {
@@ -149,4 +183,4 @@
        }
        #endregion
    }
}
}