| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Web.Http; |
| | | using ViewAPI; |
| | | using WebAPI.Models; |
| | | namespace WebAPI.Controllers |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_MouldMaintainBillList_s(sWhere); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | |
| | | ds = Sc_MouldDotCheckPlanBillList_s(sWhere); |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "无数据"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | ds = Sc_MouldDotCheckBillList_s(sWhere); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_MouldConkBookBillList_s(sWhere); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_MouldRepairWorkBillList_s(sWhere); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_MoveStockBillList"); |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "无数据"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | #region 调拨单 删除 |
| | | [Route("Kf_MoveStockBill/DelteteGetMoveStockBill")] |
| | | [HttpGet] |
| | | public object DelteteGetMoveStockBill(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | //判断是否有删除权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无权限删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 销售出库单列表 |
| | |
| | | } |
| | | } |
| | | |
| | | #region 其他出库单 删除 |
| | | [Route("Kf_OtherOutBill/DelteteGetOtherOutBill")] |
| | | [HttpGet] |
| | | public object DelteteGetOtherOutBill(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | //判断是否有删除权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无权限删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 委外出库单列表 |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_ProductInBillList"); |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "无数据"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | #region 条码明细 |
| | | [Route("Kf_ICStockBillSub_WMS/Kf_ICStockBillSub_WMS_List")] |
| | | [HttpGet] |
| | | public object Kf_ICStockBillSub_WMS_List(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn(@"Select m.HNumber 物料代码,m.HName 物料名称,m.HModel 规格型号 |
| | | ,wms.HBarCode 条码,wms.HQty 数量,w.HNumber 仓库代码,w.HName 仓库名称 from Kf_ICStockBillSub_WMS wms |
| | | left join h_v_IF_Material m on wms.HMaterID = m.HItemID |
| | | left join h_v_IF_Warehouse w on wms.HWhID = w.HItemID where 1=1 "+ sWhere, "Kf_ICStockBillSub_WMS"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | ///产品入库单删除功能 |
| | | /// </summary> |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | |
| | | |
| | | string UserName = ""; |
| | |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | |
| | | //保养项表体数据 |
| | | //按 },{来拆分数组 //去掉【和】 |
| | | msg5 = msg5.Substring(1, msg5.Length - 2); |
| | | msg5 = msg5.Replace("\\", ""); |
| | | msg5 = msg5.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "’"); |
| | | List<Model.ClsSc_MouldMaintainPlanBillSub_Item> ls1 = new List<Model.ClsSc_MouldMaintainPlanBillSub_Item>(); |
| | | ls1 = oListModels.getObjectByJson_Gy_MouldMaintainPlanBillSub_Item(msg5); |
| | | int j = 0; |
| | | foreach (Model.ClsSc_MouldMaintainPlanBillSub_Item item in ls1) |
| | | { |
| | | |
| | | j++; |
| | | item.HEntryID = j; |
| | | //oItemSub.HCloseMan = ""; //行关闭 |
| | | item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | item.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | | item.HSourceInterID = 0; // 源单主内码 |
| | | item.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | item.HRelationQty = 0; //关联数量 |
| | | oBill.DetailCol.Add(item); |
| | | |
| | | } |
| | | |
| | | //表体数据 |
| | | //按 },{来拆分数组 //去掉【和】 |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | |
| | | [HttpGet] |
| | | public object Sc_MouldMaintainPlanBillListProjectDetai(string sqlWhere) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds, ds1; |
| | | List<object> list = new List<object>(); |
| | | |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,a.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,a.HQty,a.HQtyMust,a.HRemark from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID", "Sc_MouldMaintainPlanBillSub"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,a.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,a.HQty,a.HQtyMust,a.HRemark from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainPlanBillSub"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | //获取保养项目编辑数据 |
| | | string sql = "select 保养项目ID HMaintainItemID, 保养项目代码 HMaintainItemNumber,保养项目 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,负责人ID,负责人代码 HManagerNumber,负责人名称 HManagerName,子备注2 HRemark,HMouldMaintainRuleID,HEquipDotCheckNo from h_v_Sc_MouldMaintainPlanBillSub_Item where 1 = 1 " + sqlWhere + ""; |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainPlanBillSub_Item"); |
| | | //获取配件项目编辑数据 |
| | | string sql1 = "select 配件ID HMaterID, 配件代码 HMaterNumber,配件名称 HMaterName,单位ID HUnitID,计量单位代码 HUnitNumber,计量单位名称 HUnitName,用量 HQty,标准用量 HQtyMust,子备注1 HRemark,规格型号 HMaterSpec from h_v_Sc_MouldMaintainPlanBillSub where 1 = 1 " + sqlWhere + ""; |
| | | ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainPlanBillSub"); |
| | | |
| | | list.Add(ds.Tables[0]); |
| | | list.Add(ds1.Tables[0]); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.data = null; |
| | | objJsonResult.list = list; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具点检记录表选择点检计划带出表格数据] |
| | | [Route("Sc_MouldDotCheckBill/Sc_MouldDotCheckSubBillListByPlan")] |
| | | [HttpGet] |
| | | public object Sc_MouldDotCheckSubBillListByPlan(string HPlanInterID) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql1 = "select hsubid HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckPlanBillList where hmainid =" + HPlanInterID; |
| | | ds = oCN.RunProcReturn(sql1, "h_v_Sc_MouldDotCheckPlanBillList"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | #region [模具点检记录表删除功能] |
| | | /// <summary> |
| | | /// 模具点检记录删除功能 |
| | |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); |
| | | oCn.RunProc(sql); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改成功 |
| | | //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); |
| | | oCn.RunProc(sql); |
| | | } |
| | | if (bResult) |
| | | { |
| | | string sql = $"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "; |
| | | oCn.RunProc(sql); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | |
| | | string sql1 = string.Format(@"select * from h_v_Sc_MouldScrapOutHouseBillList where 库存组织='" + Organization + "'"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by hmainid desc", "h_v_Sc_MouldScrapOutHouseBillList"); |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql1 + " order by 制单日期 desc", "h_v_Sc_MouldScrapOutHouseBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + "order by hmainid desc"; |
| | | string sql = sql1 + sWhere + " order by 制单日期 desc"; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList"); |
| | | } |
| | | } |
| | |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); |
| | | oCn.RunProc(sql); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改成功 |
| | | //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); |
| | | oCn.RunProc(sql); |
| | | } |
| | | if (bResult) |
| | | { |
| | | string sql = $"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "; |
| | | oCn.RunProc(sql); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //删除前查找当前单据的所有器具ID |
| | | //string swhere = ""; |
| | | //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub"); |
| | | //for (var i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | //{ |
| | | // swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString()+","; |
| | | //} |
| | | //swhere = swhere.Substring(0, swhere.Length - 1); |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | //删除成功修改器具档案位置 |
| | | //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 0,0,'{swhere}' "); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); |
| | | oCn.RunProc(sql); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | string sql1 = string.Format(@"select * from h_v_Sc_MouldProdBackBillList where 库存组织='" + Organization + "'"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by hmainid desc", "h_v_Sc_MouldProdBackBillList"); |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldProdBackBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + "order by hmainid desc"; |
| | | string sql = sql1 + sWhere + "order by 制单日期 desc"; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList"); |
| | | } |
| | | |
| | |
| | | ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, |
| | | 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, |
| | | 单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID, |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList"); |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList"); |
| | | |
| | | } |
| | | else |
| | |
| | | string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, |
| | | 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, |
| | | 单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID, |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList where 1 = 1 "); |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdBackBillList where 1 = 1 "); |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList"); |
| | | |
| | |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | string sql1 = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "); |
| | | oCn.RunProc(sql1); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改成功 |
| | | //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); |
| | | oCn.RunProc(sql); |
| | | } |
| | | if (bResult) |
| | | { |
| | | string sql = $"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' "; |
| | | string sql =string.Format($"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ") ; |
| | | oCn.RunProc(sql); |
| | | string sql1 = $"exec h_p_Sc_MouldChangeFileStatus 'in','{oBill.omodel.HInterID.ToString()}' "; |
| | | oCn.RunProc(sql1); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //删除前查找当前单据的所有器具ID |
| | | //string swhere = ""; |
| | | //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub"); |
| | | //for (var i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | //{ |
| | | // swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString()+","; |
| | | //} |
| | | //swhere = swhere.Substring(0, swhere.Length - 1); |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | //删除成功修改器具档案位置 |
| | | //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 0,0,'{swhere}' "); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); |
| | | oCn.RunProc(sql); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | string sql1 = string.Format(@"select * from h_v_Sc_MouldProdOutHouseBillList where 库存组织='" + Organization + "'"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by hmainid desc", "h_v_Sc_MouldProdOutHouseBillList"); |
| | | Log.LogInfo(sql1); |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldProdOutHouseBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + "order by hmainid desc"; |
| | | string sql = sql1 + sWhere + "order by 制单日期 desc"; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList"); |
| | | } |
| | | |
| | |
| | | ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, |
| | | 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, |
| | | 单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID, |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList"); |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList"); |
| | | |
| | | } |
| | | else |
| | |
| | | string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo, |
| | | 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, |
| | | 单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID, |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 "); |
| | | 仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码 HUnitCode,计量单位 HUnitName FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 "); |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList"); |
| | | } |
| | |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "); |
| | | oCn.RunProc(sql); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //修改成功 |
| | | //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 1,{oBill.omodel.HInterID.ToString()},' ' "); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); |
| | | oCn.RunProc(sql); |
| | | } |
| | | if (bResult) |
| | | { |
| | | string sql = $"exec h_p_Sc_MouldChangeFileStatus 'out','{oBill.omodel.HInterID.ToString()}' "; |
| | | oCn.RunProc(sql); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //删除前查找当前单据的所有器具ID |
| | | //string swhere = ""; |
| | | //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub"); |
| | | //for (var i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | //{ |
| | | // swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString() + ","; |
| | | //} |
| | | //swhere = swhere.Substring(0, swhere.Length - 1); |
| | | bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (IsDete) |
| | | { |
| | | //删除成功修改器具档案位置 |
| | | // string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID 0,0,'{swhere}' "); |
| | | string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID "); |
| | | oCn.RunProc(sql); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeChangeBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_GetMouldLifeChangeBill(sWhere); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "返回记录成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具 HMaterName,规格型号 HMaterSpec,HPropertyID,辅助属性代码 HPropertyCode,辅助属性 HPropertyName, |
| | | HSecUnitID, 辅助计量单位代码 HSecUnitCode, 辅助计量单位 HSecUnitName,换算率 HSecUnitRate, |
| | | HUnitID, 计量单位代码 HUnitCode, 计量单位 HUnitName, |
| | | 设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLife,表体备注 HRemark |
| | | 设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLeaveLife,表体备注 HRemark |
| | | FROM h_v_Sc_MouldLifeChangeBillList_Edit"), "h_v_Sc_MouldLifeChangeBillList_Edit"); |
| | | |
| | | objJsonResult.code = "0"; |
| | |
| | | string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具 HMaterName,规格型号 HMaterSpec,HPropertyID,辅助属性代码 HPropertyCode,辅助属性 HPropertyName, |
| | | HSecUnitID, 辅助计量单位代码 HSecUnitCode, 辅助计量单位 HSecUnitName,换算率 HSecUnitRate, |
| | | HUnitID, 计量单位代码 HUnitCode, 计量单位 HUnitName, |
| | | 设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLife,表体备注 HRemark |
| | | 设计寿命 HDesignLife, 原剩余寿命 HLeaveLife, 新剩余寿命 HNewLeaveLife,表体备注 HRemark |
| | | FROM h_v_Sc_MouldLifeChangeBillList_Edit where 1 = 1 "); |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldLifeChangeBillList_Edit"); |