| | |
| | | |
| | | public static DataSet Sc_MouldMaintainBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainBillList ", "h_v_Sc_MouldMaintainBillList"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintain", "h_v_Sc_MouldMaintain"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldMaintain where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldMaintain"); |
| | | |
| | | } |
| | | //return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainBillList ", "h_v_Sc_MouldMaintainBillList"); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | |
| | | ds = Sc_MouldConkBookBillList_s(sWhere); |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "返回记录成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | |
| | | public static DataSet Sc_MouldConkBookBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList ", "h_v_Sc_MouldConkBookBillList"); |
| | | DataSet ds; |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList " + sWhere, "h_v_Sc_MouldConkBookBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldConkBookBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldConkBookBillList"); |
| | | } |
| | | return ds; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = Sc_MouldRepairCheckBillList_s(sWhere); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | |
| | | public static DataSet Sc_MouldRepairCheckBillList_s(string sWhere) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairCheckBillList ", "h_v_Sc_MouldRepairCheckBillList"); |
| | | DataSet ds; |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldRepairCheckBillList_Edit " + sWhere, "h_v_Sc_MouldRepairCheckBillList_Edit"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldRepairCheckBillList_Edit where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairCheckBillList_Edit"); |
| | | } |
| | | return ds; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | { |
| | | //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub"); |
| | | ds = oCN.RunProcReturn("select HRepairSonID HRepairID, 子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | ds = oCN.RunProcReturn("select HRepairID, 子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!"; |
| | |
| | | else |
| | | { |
| | | //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark from Sc_MouldRepairWorkBillSub where 1 = 1 "; |
| | | string sql1 = "select HRepairSonID HRepairID, 子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; |
| | | string sql1 = "select HRepairID,子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit"); |
| | | objJsonResult.code = "0"; |
| | |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | |
| | | |
| | | string UserName = ""; |
| | |
| | | lsmain = oListModels.getObjectByJson_Gy_MouldRepairCheckBillMain(msg2); |
| | | foreach (Model.ClsSc_MouldRepairCheckBillMain oItem in lsmain) |
| | | { |
| | | //oItem.HMaker = ""; |
| | | oItem.HMaker = msg4; |
| | | UserName = oItem.HMaker; //制单人 |
| | | oItem.HBillType = "3817"; |
| | | oItem.HBillSubType = "3817"; |
| | |
| | | { |
| | | //oItem.HMaker = ""; |
| | | UserName = oItem.HMaker; //制单人 |
| | | DBUtility.ClsPub.CurUserName = UserName; |
| | | oItem.HBillType = "3815"; |
| | | oItem.HBillSubType = "3815"; |
| | | //oItem.HBillNo = ""; //单据号 |
| | |
| | | { |
| | | |
| | | //ds = oCN.RunProcReturn("select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub", "Sc_MouldRepairCheckBillSub"); |
| | | ds = oCN.RunProcReturn("select HConkReasonID,故障原因代码 HConkReasonCode,故障原因 HHConkReasonName,故障原因描述 HConkExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,备注 HRemark from h_v_Sc_MouldConkBookBillList_Edit", "h_v_Sc_MouldConkBookBillList_Edit"); |
| | | ds = oCN.RunProcReturn("select HConkReasonID,故障原因代码 HConkReasonCode,故障原因 HConkReasonName,故障原因描述 HConkExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,备注 HRemark from h_v_Sc_MouldConkBookBillList_Edit", "h_v_Sc_MouldConkBookBillList_Edit"); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | { |
| | | |
| | | //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; |
| | | string sql1 = "select HConkReasonID,故障原因代码 HConkReasonCode,故障原因 HHConkReasonName,故障原因描述 HConkExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,备注 HRemark from h_v_Sc_MouldConkBookBillList_Edit where 1 = 1 "; |
| | | string sql1 = "select HConkReasonID,故障原因代码 HConkReasonCode,故障原因 HConkReasonName,故障原因描述 HConkExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,备注 HRemark from h_v_Sc_MouldConkBookBillList_Edit where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldConkBookBillList_Edit"); |
| | | |
| | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 模具保养记录表 |
| | | |
| | | #region 模具保养记录表 保存/编辑 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[模具保养记录表编辑时获取表头数据] |
| | | [Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListCheckDetai")] |
| | | [HttpGet] |
| | |
| | | return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet }; |
| | | } |
| | | #endregion |
| | | |
| | | #region[模具保养记录表编辑时获取表题数据] |
| | | [Route("Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetai")] |
| | | [HttpGet] |
| | |
| | | string sql = "select HMaintainItemID, 保养项目代码 HMaintainItemNumber,保养项目名称 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,表体备注 HRemark from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + ""; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainBillListItem"); |
| | | //获取配件项目编辑数据 |
| | | string sql1 = "select HMaterID, 配件代码 HMaterNumber,配件名称 HMaterName,规格型号 HMaterSpec,HUnitID,单位代码 HUnitNumber,单位名称 HUnitName,实际用量 HQty,标准用量 HQtyMust,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,表体备注 HRemark from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + ""; |
| | | ds1 = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainBillListItem"); |
| | | string sql1 = "select HMaterID, 配件代码 HMaterNumber,配件名称 HMaterName,规格型号 HMaterSpec,HUnitID,单位代码 HUnitNumber,单位名称 HUnitName,实际用量 HQty,标准用量 HQtyMust,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,表体备注 HRemark from h_v_Sc_MouldMaintainBillList where 1 = 1 " + Swhere + ""; |
| | | ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainBillList"); |
| | | list.Add(ds.Tables[0]); |
| | | list.Add(ds1.Tables[0]); |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region [模具保养记录表删除功能] |
| | | #region [模具保养记录表删除功能] |
| | | /// <summary> |
| | | /// 模具维修单删除功能 |
| | | /// </summary> |
| | |
| | | [HttpGet] |
| | | public object DeltetSc_MouldMaintainBill(string HInterID) |
| | | { |
| | | //编辑权限 |
| | | //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "无删除权限!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | if (lngBillKey == 0) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 模具点检记录表 |
| | | |
| | | #region 模具点检记录表 保存/编辑 |
| | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 模具点检计划表 |
| | | |
| | | #region 模具点检计划表 保存/编辑 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region [模具处理出库单审核、反审核] |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">单据ID</param> |
| | | /// <param name="IsAudit">审核(0),反审核(1)</param> |
| | | /// <param name="CurUserName">审核人</param> |
| | | /// <returns></returns> |
| | | [Route("Sc_MouldScrapOutHouseBill/AuditMouldScrapOutList")] |
| | | [HttpGet] |
| | | public object AuditMouldScrapOutList(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "Sc_MouldScrapOutBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | //审核权限 |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (HInterID <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID小于0!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill(); |
| | | //查看是否已审核,关闭,作废 |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已关闭!不能再次审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已作废!不能再次审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //审核判断 |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已审核!不能再次审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //反审核判断 |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未审核!不需要反审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (IsAudit == 0) //审核提交 |
| | | { |
| | | //审核提交 |
| | | if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核成功"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsAudit == 1) //反审核提交 |
| | | { |
| | | //反审核提交AbandonCheck |
| | | if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核成功"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 模具退库单 |
| | |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldProdBackBillList_Edit ", "h_v_Sc_MouldProdBackBillList_Edit"); |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldProdBackBillList ", "h_v_Sc_MouldProdBackBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_MouldProdBackBillList_Edit where 1 = 1 "; |
| | | string sql1 = "select * from h_v_Sc_MouldProdBackBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList_Edit"); |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList"); |
| | | } |
| | | |
| | | } |
| | |
| | | return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldProdBackBillList_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldProdBackBillList_Edit"); |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldProdBackBillList where hmainid= " + HID + " ", "h_v_Sc_MouldProdBackBillList"); |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataSet> { code = -1, msg = "不存在退库单号" }; |
| | | |
| | |
| | | HUnitID, 计量单位代码 HUnitCode, 计量单位名称 HUnitName, 批次 HBatchNo, |
| | | 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife,应收数量 HQtyMust, 实收数量 HQty, 单价 HPrice, 金额 HMoney, HWHID1 HWHID, 收料仓库代码 HWHCode, 收料仓库名称 HWHName, |
| | | HSPID, 仓位代码 HSPCode, 仓位名称 HSPName,模具新规格 HNewModel,壁厚 HWallThickness,硬度 HHardness,最后生产产品 HLastProdModel, 直径 HDiameter,退库类型 HBackFlag, |
| | | 表体备注 HRemark FROM h_v_Sc_MouldProdBackBillList_Edit"), "h_v_Sc_MouldProdBackBillList_Edit"); |
| | | 表体备注 HRemark FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList"); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | HUnitID, 计量单位代码 HUnitCode, 计量单位名称 HUnitName, 批次 HBatchNo, |
| | | 设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife,应收数量 HQtyMust, 实收数量 HQty, 单价 HPrice, 金额 HMoney, HWHID1 HWHID, 收料仓库代码 HWHCode, 收料仓库名称 HWHName, |
| | | HSPID, 仓位代码 HSPCode, 仓位名称 HSPName,模具新规格 HNewModel,壁厚 HWallThickness,硬度 HHardness,最后生产产品 HLastProdModel, 直径 HDiameter,退库类型 HBackFlag, |
| | | 表体备注 HRemark FROM h_v_Sc_MouldProdBackBillList_Edit where 1 = 1 "); |
| | | 表体备注 HRemark FROM h_v_Sc_MouldProdBackBillList where 1 = 1 "); |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList_Edit"); |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList"); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |