wtt
2025-11-17 6ef126d9a9271afae02ee36469b1512e144bc555
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Xs_SendGoodsPlanBillController.cs
@@ -113,21 +113,24 @@
                    {
                        error += $"没有符合条件得销售订单信息,客户订单号:{ tb2.Rows[i]["客户订单号"].ToString()},产品代码:{tb2.Rows[i]["物料编码"].ToString()}";
                    }
                }
                if (error.Length > 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = ErrorResult += $"Excel模板存在错误,{error}\r\n"; ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                    if (error.Length > 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = ErrorResult += $"Excel模板存在错误,行数{i + 1}:{error}\r\n"; ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        tb2.Rows[i]["HMaterID"] = ds.Tables[0].Rows[0]["HMaterID"].ToString();
                        tb2.Rows[i]["SeOrderHInterID"] = ds.Tables[0].Rows[0]["FID"].ToString();//销售订单主id
                        tb2.Rows[i]["SeOrderHEntryID"] = ds.Tables[0].Rows[0]["FENTRYID"].ToString();//销售订单子id
                    }
                //查询销售表判断有没有销售订单信息
                for (int i = 0; i < tb2.Rows.Count; i++)
                {
                    tb2.Rows[i]["HMaterID"] = ds.Tables[0].Rows[0]["HMaterID"].ToString();
                    tb2.Rows[i]["SeOrderHInterID"] = ds.Tables[0].Rows[0]["FID"].ToString();//销售订单主id
                    tb2.Rows[i]["SeOrderHEntryID"] = ds.Tables[0].Rows[0]["FENTRYID"].ToString();//销售订单子id
                    //查找是否存在对应发货计划工单
                    var dt = oCN.RunProcReturn($"select * from Xs_SendGoodsPlanBillMain where HSeOrderInterID in({ds.Tables[0].Rows[0]["FID"].ToString()}) and  HSeOrderEntryID in({ds.Tables[0].Rows[0]["FENTRYID"].ToString()})", "Xs_SendGoodsPlanBillMain");
                    if (dt.Tables[0].Rows.Count > 0)
@@ -332,6 +335,14 @@
                        }
                        oCN.Commit();//结束事务
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "当前单据不存在,无法删除!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -339,50 +350,8 @@
                objJsonResult.data = null;
                return objJsonResult;
                
                //else if (DataType == 2)
                //{
                //    var NumData = HInterID.Split(',');
                //    //获取系统参数
                //    string sReturn = "";
                //    oSystemParameter.ShowBill(ref sReturn);
                //    for (int i = 0; i < NumData.Length; i++)
                //    {
                //        ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList_Left where 1=1 and hmainid=" + NumData[i], "h_v_JIT_Sc_WorkBillSortBillList");
                //        if (ds.Tables[0].Rows.Count > 0)
                //        {
                //            if (ds.Tables[0].Rows[0]["单据状态"].ToString() != "1")
                //            {
                //                objJsonResult.code = "0";
                //                objJsonResult.count = 0;
                //                objJsonResult.Message = "当前单据不能删除!";
                //                objJsonResult.data = null;
                //                return objJsonResult;
                //            }
                //            oCN.BeginTran();//开启事务
                //            oCN.RunProc($"delete from Sc_WorkBillSortBillMain where HInterID={ NumData[i]}");
                //            oCN.Commit();//结束事务
                //        }
                //    }
                //    objJsonResult.code = "1";
                //    objJsonResult.count = 1;
                //    objJsonResult.Message = "删除成功!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "当前单据不存在,无法删除!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {