yangle
2023-02-28 81bb23d6d09943a41bac424ae284e659dae13dfc
瑞琪 同步删除 工序出站单
3个文件已修改
94 ■■■■■ 已修改文件
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_ProcessMangementController.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -1220,6 +1220,72 @@
        }
        #endregion
        #region 根据单据号 同步报错删除出站单
        [Route("Cj_StationOutBill/DelStationOutBill")]
        [HttpGet]
        public object DelStationOutBill(string HInterID)
        {
            try
            {
                DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                DataTable DTable;
                int num = 0;
                //判断入库是否同步
                 DTable = oCN.RunProcReturn("select * from  Sc_StationOutBillMain where HInterID='" + HInterID + "' and  HRelationQty=0", "Sc_StationOutBillMain").Tables[0];
                if (DTable.Rows.Count != 0)
                {
                    num++;
                }
                //判断本次报废是否同步
                DTable = oCN.RunProcReturn("select * from  Sc_StationOutBillMain where  HProcExchInterID='" + DTable.Rows[0]["HProcExchInterID"].ToString() + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0];
                if (DTable.Rows.Count != 0)
                {
                    num++;
                }
                if (num > 0)
                {
                    if (!oBill.DeleteBill(long.Parse(HInterID), 0, 0, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "无须删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "异常!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 编辑前判断
        [Route("Cj_StationOutBill/set_ShowBillJudge")]
        [HttpGet]
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -466,7 +466,6 @@
                    oBill.DetailColl.Clear();
                    if (!bResult)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -624,6 +624,19 @@
                ////根据工序汇报单主ID获取工序汇报入库单的数据
                //DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc");
                //DataRow dr = ds.Tables[0].Rows[0];
                //判断入库的合格数量是否为0
                var DTable = oCN.RunProcReturn("select * from  Sc_StationOutBillMain where HBillNo='"+ BillNo + "' ", "Sc_StationOutBillMain").Tables[0];
                if (double.Parse(DTable.Rows[0]["HQty"].ToString()) == 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "合格数量为0,不需要入库!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //保存
                oCN.BeginTran();
                //生产汇报单主表
@@ -885,6 +898,20 @@
                ////根据工序汇报单主ID获取工序汇报入库单的数据
                //DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc");
                //DataRow dr = ds.Tables[0].Rows[0];
                //判断本次报废总数量是否为0
                var DTable = oCN.RunProcReturn("select sum(HWasterQty) HWasterQty from  Sc_StationOutBillMain where  HProcExchBillNo='"+ BillNo + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0];
                if (double.Parse(DTable.Rows[0]["HWasterQty"].ToString()) == 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "报废数量为0,不需要入库!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //保存
                oCN.BeginTran();
                //生产汇报单主表