jinghz@oceic.com
2023-07-03 a7290cd76e9fc87988ccfde74194fadf7b46a7df
WebAPI/Controllers/²©ÈÕ×Ô¶¯É¨ÂëÏß/ScanlineAPIController.cs
@@ -84,6 +84,7 @@
                    ds = oCN.RunProcReturn("Select HBarCode barcode,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim() + "'  Order by HItemID ", "Gy_BarCodeBill");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        LogService.Write("当前订单无绑定条码");
                        objJsonResult.status = -1;
                        objJsonResult.msg = "当前订单无绑定条码!";
                        objJsonResult.data = null;
@@ -95,6 +96,7 @@
                    if (strList.Count > 0)
                    {
                        string Str = String.Join(",", strList.ToArray());
                        LogService.Write("条码:" + Str.ToString() + " ä¸åŒ…含在订单:" + list.billno + "中!");
                        objJsonResult.status = -1;
                        objJsonResult.msg = "条码:" + Str.ToString() + " ä¸åŒ…含在订单:" + list.billno + "中!";
                        objJsonResult.data = null;
@@ -106,14 +108,16 @@
                bool IsBarCodePack = oBill.IsBarCodePack(list.packagebarcode);
                if (IsBarCodePack == false)
                {
                    LogService.Write($"箱码:{list.packagebarcode}已存在,不能重复绑定!");
                    objJsonResult.status = -1;
                    objJsonResult.msg = "箱码已存在,不能重复绑定!";
                    objJsonResult.msg = $"箱码:{list.packagebarcode}已存在,不能重复绑定!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + list.packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill");
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    LogService.Write("此箱条码已作废");
                    objJsonResult.status = -1;
                    objJsonResult.msg = "此箱条码已作废";
                    objJsonResult.data = null;
@@ -155,11 +159,12 @@
                for (int i = 0; i < list.barcodes.Count; i++)
                {
                    //判断条码是否存在
                    bool IsBarCode = oBill.IsBarCodePack(list.barcodes[i].barcode);
                    if (IsBarCodePack == false)
                    bool IsBarCode = oBill.IsBarCode(list.barcodes[i].barcode);
                    if (IsBarCode == false)
                    {
                        DataTable dt = oCN.RunProcReturn("Select HBarCode_Pack from Sc_PackUnionBillSub Where  HBarCode='" + list.barcodes[i].barcode + "'", "Sc_PackUnionBillSub").Tables[0];
                        objJsonResult.status = -1;
                        objJsonResult.msg = "条码已存在,不能重复绑定!";
                        objJsonResult.msg = $"条码:{list.barcodes[i].barcode},已存在箱码:{dt.Rows[0]["HBarCode_Pack"]}中,本次绑定箱码为:{list.packagebarcode},绑定失败,不能重复绑定!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
@@ -200,14 +205,16 @@
                }
                if (bResult)
                {
                    LogService.Write("提交成功箱条码:" + list.packagebarcode);
                    Log.LogSaveInfo("提交成功箱条码:" + list.packagebarcode); //记录提交数据
                    objJsonResult.status = 0;
                    objJsonResult.msg = "success";
                    objJsonResult.data = null;
                    Log.LogSaveInfo("提交成功箱条码:" + list.packagebarcode); //记录提交数据
                    return objJsonResult;
                }
                else
                {
                    LogService.Write("保存失败:" +DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.status = -1;
                    objJsonResult.msg = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;