| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 工序流转卡的末道工序 |
| | | /// </summary> |
| | | /// <param name="sBillBarCode"></param> |
| | | /// <returns></returns> |
| | | [Route("LEMS/TxtHBarCode_KeyDown_Last")] |
| | | [HttpGet] |
| | | public object TxtHBarCode_KeyDown_Last(string sBillBarCode) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sBillBarCode == null || sBillBarCode.Equals("")) |
| | | { |
| | | return CustomError("未输入条形码!"); |
| | | } |
| | | else |
| | | { |
| | | //拆分条形码 |
| | | string[] NewBarCode; |
| | | if (sBillBarCode.CompareTo("#") > 0) |
| | | { |
| | | NewBarCode = sBillBarCode.Split(Convert.ToChar("#")); |
| | | sBillBarCode = NewBarCode[0]; |
| | | } |
| | | string sBillNo = sBillBarCode; |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList where 单据号= '" + sBillNo + "' and 末道工序='是' ", "h_v_Sc_ProcessExchangeBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | return CustomError("不存在此流转卡号!"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 流水号回车方法(进站接收单、出站汇报单) |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | |
| | | /// </summary> |
| | | [Route("LEMS/SaveToSc_PackUnionBillMain")] |
| | | [HttpGet] |
| | | public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark,string HProjectNum) |
| | | public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark,string HProjectNum,string HBarCode_White) |
| | | { |
| | | DataSet ds; |
| | | DataSet dsHSNum; |
| | |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "','" + HRemark + "'," + HSNum + ",'" + HSNum2 + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain"); |
| | | ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "','" + HRemark + "'," + HSNum + ",'" + HSNum2 + "','" + HBarCode_White + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain"); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_ProductionLinePackagingList order by 唯一条码 desc", "h_v_ProductionLinePackagingList"); |
| | | ds = oCN.RunProcReturn("select top 1000 * from h_v_ProductionLinePackagingList order by 扫码日期 desc, 唯一条码 desc", "h_v_ProductionLinePackagingList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_ProductionLinePackagingList where 1 = 1 "; |
| | | string sql1 = "select * from h_v_ProductionLinePackagingList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | string sql2 = " order by 唯一条码 desc"; |
| | | string sql2 = " order by 扫码日期 desc, 唯一条码 desc"; |
| | | sql = sql + sql2; |
| | | ds = oCN.RunProcReturn(sql, "h_v_ProductionLinePackagingList"); |
| | | } |
| | |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除对应的包装单 |
| | | /// </summary> |
| | | /// <param name="sWhere"></param> |
| | | /// <returns></returns> |
| | | [Route("LEMS/DelMES_ProductionLinePackagingList")] |
| | | [HttpGet] |
| | | public object DelMES_ProductionLinePackagingList(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | oCN.RunProc("Delete from Sc_PackUnionBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete from Sc_PackUnionBillSub where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID = " + HInterID); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!"; |
| | | objJsonResult.data = e.ToString(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 扫批次条码方法(产线组装追溯单)--根据批次条码到条码档案表中获取数据保存到temp表 |
| | | ///参数:string sql。 |
| | |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID = " + sHInterID + " and HSourceBillNo = '" + HSourceBillNo + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.RunProc("Delete TOP(1) from KF_PonderationBillMain_Temp where HInterID = " + sHInterID + " and HSourceBillNo = '" + HSourceBillNo + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | |
| | | objJsonResult.data = e.ToString(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | |
| | | //判断条码是否是不良的状态 |
| | | [Route("LEMS/HbadStaus")] |
| | | [HttpGet] |
| | | public object HbadStaus(string SubBarcode) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn(@"select HBillNo,HReasult from tiaom where HBillNo='" + SubBarcode + @"' |
| | | union |
| | | select HBarCode HBillNo,HStatus HReasult from Gy_BarCodeBill |
| | | where HBarCode='" + SubBarcode + "'", "Gy_BarCodeBill"); |
| | | if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ok!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (ds.Tables[0].Rows[0]["HReasult"].ToString() =="不良") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "当前条码的状态为:"+ ds.Tables[0].Rows[0]["HReasult"].ToString() + "!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!"; |
| | | objJsonResult.data = e.ToString(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //判断条码之前的工序是否出站 |
| | | [Route("LEMS/SNBarcodeProcCtrl")] |
| | | [HttpGet] |
| | | public object SNBarcodeProcCtrl(string SubBarcode,string HProcExchBillNo) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HSourceBillNo='" + HProcExchBillNo + "' and HBarCode='" + SubBarcode + "'", "Gy_BarCodeBill"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查无数据,条码:" + SubBarcode + "不属于当前流转卡:" + HProcExchBillNo + "!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn(@"exec h_p_Sc_SNBarcodeProcCtrl '" + SubBarcode + "'", "h_p_Sc_SNBarcodeProcCtrl"); |
| | | if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查无数据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString() + "!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!"; |
| | | objJsonResult.data = e.ToString(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | //判断总的包装数量是否超过流转卡数量 |
| | | [Route("LEMS/h_p_Sc_ProductionLinePackaging_Checkqty")] |
| | | [HttpGet] |
| | | public object h_p_Sc_ProductionLinePackaging_Checkqty(long HInterID) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_ProductionLinePackaging_Checkqty " + HInterID, "h_p_Sc_ProductionLinePackaging_Checkqty"); |
| | | if (ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取信息成功!";//返回剩余数量 |
| | | objJsonResult.data = Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = Convert.ToString(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!"; |
| | | objJsonResult.data = e.ToString(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 缓存表包装单记录 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("LEMS/PackUnionCacheList")] |
| | | [HttpGet] |
| | | public object PackUnionCacheList(string sWhere) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select top 5000 * from h_v_PackUnionBillCacheList order by 扫码时间 desc", "h_v_PackUnionBillCacheList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_PackUnionBillCacheList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | string sql2 = " order by 扫码时间 desc"; |
| | | sql += sql2; |
| | | ds = oCN.RunProcReturn(sql, "h_v_PackUnionBillCacheList"); |
| | | } |
| | | 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 = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region 打印查询数据 |
| | | [Route("Gy_SOPBillList/WindowPrintList")] |
| | | [HttpGet] |
| | | public object WindowPrintList(string sWhere) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn(sWhere, "WindowPrint"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | // |
| | | } |
| | | } |