zrg
2024-06-13 f7a99b8d50c3cad18038c88985e8932d0f6a130b
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -575,6 +575,7 @@
                }
                sw.Stop();//结束计时
                LogService.Write($"11.参数查询结束,新增结束,用时" + sw.Elapsed);
                LogService.Write("END--出站单据保存结束,出站单号:" + HBillNo);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "新增单据成功!";
@@ -583,6 +584,7 @@
            }
            catch (Exception e)
            {
                LogService.Write("出站单据保存发生异常,出站单号:" + sArray[0].ToString());
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -2356,8 +2358,17 @@
                    oCn.BeginTran();
                    ds = oCn.RunProcReturn($"select * from Sc_AssemblyBillMain  where HMainSourceInterID={oBill.omodel.HProcExchInterID} and HMainSourceEntryID={oBill.omodel.HProcExchEntryID} and HBarCode_P='{HBardcode}'", "Sc_AssemblyBillMain");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        oCn.RunProc($"delete from Sc_AssemblyBillMain  where HMainSourceInterID={oBill.omodel.HProcExchInterID} and HMainSourceEntryID={oBill.omodel.HProcExchEntryID} and HBarCode_P='{HBardcode}'");
                        oCn.RunProc($"delete from Sc_AssemblyBillMain  where HInterID={ds.Tables[0].Rows[0]["HInterID"].ToString()} and HBarCode_P='{HBardcode}'");
                    }
                    oCn.RunProc("delete from Sc_StationOutBillSub_SN where HInterID=" + HInterID + " and HBarCode='" + HBardcode + "'");
                    oCn.RunProc("update  Sc_StationOutBillMain set HQty-=1 where HInterID=" + HInterID);
                    oCn.Commit();