| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn(@"select * from Sc_ICMOBillStatus_Tmp where HSourceInterID='"+ HInterID + "' and HSourceEntryID='"+ HEntryID + "'", "Sc_ICMOBillStatus_Tmp"); |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "该工序已派单,不允许重复排单!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=" + HSourceID + " where HInterID=" + HInterID + " and HEntryID=" + HEntryID); |
| | |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 返回工序流转卡列表 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | #region 工序流转卡下推生产质量汇报单 |
| | | [Route("LEMS/MES_IF_ProcessBillList_Json")] |
| | | [HttpGet] |
| | | public object MES_IF_ProcessBillList_Json(string hinterid, string HEntryID, string user) |
| | |
| | | } |
| | | return GetObjectJson(ds); |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序流转卡下推设备点检参数表 |
| | | [Route("LEMS/MES_IF_EquipICMOTechParamList_Json")] |
| | | [HttpGet] |
| | | public object MES_IF_EquipICMOTechParamList_Json(string hinterid, string HEntryID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery_TechParam where hmainid ='" + hinterid + "' and HEntryID='" + HEntryID + "'", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | return GetObjectJson(ds); |
| | | } |
| | | #endregion |
| | | |
| | | #region 生产订单 下查 |
| | | /// <summary> |
| | |
| | | { |
| | | ds = oCN.RunProcReturn("exec [h_p_Sc_ProductionAnalysisReportList] '" + DateYear + "','" + HType + "'", "[h_p_Sc_ProductionAnalysisReportList]"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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 e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 螺母检验CCD合格率 |
| | | [Route("LEMS/Sc_NutInspectionCCDPassRate")] |
| | | [HttpGet] |
| | | public object Sc_NutInspectionCCDPassRate(string HBatchNo, string user) |
| | | { |
| | | try |
| | | { |
| | | DataSet ds; |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_NutInspectionCCDPassRate '" + HBatchNo + "'", "h_p_Sc_NutInspectionCCDPassRate"); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 生产订单流转卡 履历条件查询 |
| | | [Route("LEMS/GetProcessBillOrICMOBillResumeList")] |
| | | [HttpGet] |
| | | public object GetProcessBillOrICMOBillResumeList(string HInterID,string HEntryID,string sWhere,int type, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | DataSet ds; |
| | | //1表示生产订单 |
| | | if(type == 3710) |
| | | { |
| | | ds = oCN.RunProcReturn($@"select * from |
| | | (select a.HInterID,a.HDate '日期',a.HBillType,x.HName 单据类型,a.HBillNo as '单据号', |
| | | CASE WHEN a.HBillStatus <= 1 THEN '创建' WHEN a.HBillStatus = 2 THEN '已审核' WHEN a.HBillStatus = 3 AND |
| | | a.HCloseType = 0 THEN '自动关闭' WHEN a.HBillStatus = 3 AND |
| | | a.HCloseType = 1 THEN '手动关闭' WHEN a.HBillStatus = 4 THEN '已作废' ELSE '其它状态' END AS 单据状态, |
| | | a.HMaker AS 制单人, a.HMakeDate AS 制单日期,a.HChecker AS 审核人, a.HCheckDate AS 审核日期, a.HUpDater AS 修改人, a.HUpDateDate AS 修改日期, |
| | | a.HCloseMan AS 关闭人, a.HCloseDate AS 关闭日期, a.HDeleteMan AS 作废人, a.HDeleteDate AS 作废日期 |
| | | from ( |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_ICMOBillMain where HInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_MESBeginWorkBillMain where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from QC_FirstPieceCheckBillMain where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from QC_PatrolProcCheckBillMain where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from QC_PatrolProcCheckOtherBillMain where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_StationInBillMain where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_StationOutBillMain where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from SB_EquipICMOTechParamBillMain where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} UNION ALL |
| | | select m.HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,m.HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,m.HCloseType from Sc_MouldUpperBillMain as m,Sc_MouldUpperBillSub as s |
| | | where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} and m.HInterID = s.HInterID UNION ALL |
| | | select m.HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,m.HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,m.HCloseType from Sc_MouldLowerBillMain as m,Sc_MouldLowerBillSub as s |
| | | where HICMOInterID = {HInterID} and HICMOEntryID = {HEntryID} and m.HInterID = s.HInterID |
| | | )as a,Xt_BillType as x |
| | | where a.HBillType = x.HNumber ) AS a where 1=1 " + sWhere + |
| | | @" ORDER BY 日期 ASC;", "Sc_ICMOBillResume"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn($@"select * from |
| | | (select a.HInterID,a.HDate '日期',a.HBillType,x.HName 单据类型,a.HBillNo as '单据号', |
| | | CASE WHEN a.HBillStatus <= 1 THEN '创建' WHEN a.HBillStatus = 2 THEN '已审核' WHEN a.HBillStatus = 3 AND |
| | | a.HCloseType = 0 THEN '自动关闭' WHEN a.HBillStatus = 3 AND |
| | | a.HCloseType = 1 THEN '手动关闭' WHEN a.HBillStatus = 4 THEN '已作废' ELSE '其它状态' END AS 单据状态, |
| | | a.HMaker AS 制单人, a.HMakeDate AS 制单日期,a.HChecker AS 审核人, a.HCheckDate AS 审核日期, a.HUpDater AS 修改人, a.HUpDateDate AS 修改日期, |
| | | a.HCloseMan AS 关闭人, a.HCloseDate AS 关闭日期, a.HDeleteMan AS 作废人, a.HDeleteDate AS 作废日期 |
| | | from ( |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_ProcessExchangeBillMain where HInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_MESBeginWorkBillMain where HProcExchInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from QC_FirstPieceCheckBillMain where HProcExchInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from QC_PatrolProcCheckBillMain where HProcExchInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from QC_PatrolProcCheckOtherBillMain where HProcExchInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_StationInBillMain where HProcExchInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from Sc_StationOutBillMain where HProcExchInterID = {HInterID} UNION ALL |
| | | select HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,HCloseType from SB_EquipICMOTechParamBillMain where HProcExchInterID = {HInterID} UNION ALL |
| | | select m.HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,m.HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,m.HCloseType from Sc_MouldUpperBillMain as m,Sc_MouldUpperBillSub as s |
| | | where s.HProcExchInterID = {HInterID} and m.HInterID = s.HInterID UNION ALL |
| | | select m.HInterID,HDate,HBillType,HBillNo,HBillStatus,HMaker,HMakeDate,HChecker,HCheckDate,HUpDater,HUpDateDate,m.HCloseMan,HCloseDate,HDeleteMan,HDeleteDate,m.HCloseType from Sc_MouldLowerBillMain as m,Sc_MouldLowerBillSub as s |
| | | where s.HProcExchInterID = {HInterID} and m.HInterID = s.HInterID |
| | | )as a,Xt_BillType as x |
| | | where a.HBillType = x.HNumber ) AS a where 1=1 " + sWhere + |
| | | @" ORDER BY 日期 ASC;", "Sc_ProcessExchangeBillResume"); |
| | | } |
| | | //添加动态列信息 |
| | | 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 e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 返回工序委外接收单列表 |
| | | ///参数:string sql。 |