| | |
| | | public object MES_ProcessExchangeBillList_PG(string sWhere, string user, int OperationType) |
| | | { |
| | | DataSet ds; |
| | | string sql = ""; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " order by hmainid desc "; |
| | | |
| | | if (OperationType == 1) |
| | | { |
| | | //获取系统参数 |
| | |
| | | sWhere += " "; |
| | | |
| | | } |
| | | else if (oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") |
| | | { |
| | | sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere; |
| | | } |
| | | else |
| | | { |
| | | sWhere += " "; |
| | |
| | | } |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeArrangementList_PG"); |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeArrangementList_PG"); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | |
| | | } |
| | | else if (oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") |
| | | { |
| | | sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere; |
| | | } |
| | | } |
| | | sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " "; |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere, "h_v_Sc_ProcessExchangeArrangementList_PG"); |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeArrangementList_PG"); |
| | | } |
| | | |
| | | //添加列名 |
| | |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | //return ds.Tables[0].Rows; |
| | | } |
| | | |
| | | //墨西哥白标生成 |
| | | [Route("LEMS/SaveCirculationCard_Json_MXG")] |
| | | [HttpGet] |
| | | public object SaveCirculationCard_Json_MXG(string HBillNo, string HInterID, string HBillNo2, string HBarCode,string HNumber, string HName, string HModel) |
| | | public object SaveCirculationCard_Json_MXG(string HBillNo, string HInterID, string HBillNo2, string HBarCode,string HNumber, string HName, string HModel,string NBXMH, string HOrgID) |
| | | { |
| | | DataSet ds; |
| | | try |
| | |
| | | { |
| | | HBarCode = " "; |
| | | } |
| | | ds = oCN.RunProcReturn("exec Save_Sc_ProcessExchangeBillMainToTmp_MXG '" + HBillNo + "','" + HInterID + "','" + HBillNo2 + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "'", "Save_Sc_ProcessExchangeBillMainToTmp_MXG"); |
| | | ds = oCN.RunProcReturn("exec Save_Sc_ProcessExchangeBillMainToTmp_MXG '" + HBillNo + "','" + HInterID + "','" + HBillNo2 + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "','" + NBXMH + "','" + HOrgID + "'", "Save_Sc_ProcessExchangeBillMainToTmp_MXG"); |
| | | |
| | | } |
| | | catch (Exception e) |
| | |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | //return ds.Tables[0].Rows; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | //return ds.Tables[0].Rows; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | |
| | | [Route("LEMS/SaveToSc_PackUnionBillMain_MXG")] |
| | | [HttpGet] |
| | | public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark, string HProjectNum, string zxQty, string BBM, string LDM, string HMaterNumber, string HBarCode_White,string HOrgID) |
| | | public object SaveToSc_PackUnionBillMain_MXG(string HBillNo, string HRemark, string HProjectNum, string zxQty, string BBM, string LDM, string HMaterNumber, string HBarCode_White,string HOrgID,string NBXMH) |
| | | { |
| | | DataSet ds; |
| | | DataSet dsHSNum; |
| | |
| | | { |
| | | if (LDM != "其他" && BBM != "其他") |
| | | { |
| | | ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_MXG {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}'", "h_p_MES_HBarCode_White_SMR_MXG"); |
| | | ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_MXG {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}','{NBXMH}','{HOrgID}'", "h_p_MES_HBarCode_White_SMR_MXG"); |
| | | HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString(); |
| | | } |
| | | } |
| | |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub '" + HitemID + "','" + HRemark + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | } |
| | | |
| | | [Route("LEMS/SaveToSc_PackUnionBillSub_Batch")] |
| | | [HttpGet] |
| | | public object SaveToSc_PackUnionBillSub_Batch(string HitemID, string HRemark) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (HitemID == null || HitemID.Equals("")) |
| | | { |
| | | return CustomError("更新失败HitemID为空!"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub_Batch '" + HitemID + "','" + HRemark + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub_Batch"); |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | } |
| | | |
| | | [Route("LEMS/Update_Flag_HRelationInterID_Batch")] |
| | | [HttpGet] |
| | | public object Update_Flag_HRelationInterID_Batch(string HitemID) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (HitemID == null || HitemID.Equals("")) |
| | | { |
| | | return CustomError("更新失败HitemID为空!"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Update_Flag_HRelationInterID_Batch '" + HitemID + "'", "h_p_Update_Flag_HRelationInterID_Batch"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | //return ds.Tables[0].Rows; |
| | | } |
| | |
| | | ds = null; |
| | | } |
| | | return CustomCorrect(ds); |
| | | //return ds.Tables[0].Rows; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 产线包装单列表查询 |
| | | |
| | | [Route("LEMS/MES_ProductionLinePackagingList_Json")] |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select top 1000 * from h_v_ProductionLinePackagingList order by 扫码日期 desc, 唯一条码 desc", "h_v_ProductionLinePackagingList"); |
| | | ds = oCN.RunProcReturn("select top 300 * from h_v_ProductionLinePackagingList order by 扫码日期 desc, 唯一条码 desc", "h_v_ProductionLinePackagingList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select top 1000 * from h_v_ProductionLinePackagingList where 1 = 1 "; |
| | | string sql1 = "select top 300 * from h_v_ProductionLinePackagingList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | string sql2 = " order by 扫码日期 desc, 唯一条码 desc"; |
| | | sql = sql + sql2; |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 获取白标项目号 |
| | | |
| | | [Route("LEMS/GetHProject_MXG")] |
| | | [HttpGet] |
| | | public object GetHProject_MXG(string HOrgID) |
| | | { |
| | | DataSet ds; |
| | | DataSet dsHSNum; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | ds = oCN.RunProcReturn("select HInterID,HSupBarCodeNumber HName from Sc_PackUnionBillBarCode_temp where HUSEORGID='" + HOrgID + "'", "Sc_PackUnionBillBarCode_temp"); |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "获取失败" + DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "获取成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 根据ID删除缓存表中扫码记录-产线包装单 |
| | | |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-051]" + ds.Tables[0].Rows[0]["HBackRemark"].ToString() + "!"; |
| | | objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString() + "!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-051]" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); |
| | | objJsonResult.Message =ds.Tables[0].Rows[0]["HBackRemark"].ToString(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | |
| | | { |
| | | if (HBillSubType == "SUB") |
| | | { |
| | | //判断是否有删除权限 |
| | | //判断是否有审核权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //反审核单据 |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_RoutingBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | | ////if (DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["Hback"]) != 0) |
| | | ////{ |
| | | //// objJsonResult.code = "0"; |
| | | //// objJsonResult.count = 1; |
| | | //// objJsonResult.Message = "该任务单已下推流转卡,不允许反审核" + DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HBackRemark"]); |
| | | //// objJsonResult.data = null; |
| | | //// return objJsonResult; |
| | | ////} |
| | | } |
| | | else |
| | | |
| | | string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | |
| | | oCN.RunProc(" Update Gy_RoutingBillMain set HChecker='',HCheckDate=null,HBillStatus=1 Where HInterID=" + HInterID.ToString()); |
| | | |
| | | |
| | | string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Gy_RoutingBill_AfterUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "审核失败!原因:审核后判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //反审核单据 |
| | | // if (BillOld.AbandonCheck(HInterID, ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_RoutingBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | //{ |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | | ////if (DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["Hback"]) != 0) |
| | | ////{ |
| | | //// objJsonResult.code = "0"; |
| | | //// objJsonResult.count = 1; |
| | | //// objJsonResult.Message = "该任务单已下推流转卡,不允许反审核" + DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HBackRemark"]); |
| | | //// objJsonResult.data = null; |
| | | //// return objJsonResult; |
| | | ////} |
| | | //} |
| | | // else |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | } |
| | | |
| | | oCN.Commit();//提交事务 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 工艺路线单关闭/反关闭功能(设置开始时间结束时间) |
| | | [Route("Gy_RoutingBill/CloseSetDate")] |
| | | [HttpGet] |
| | | public object CloseGy_RoutingBill(string HInterID, int Type, string user, string HBillSubType,DateTime HBeginDate,DateTime HEndDate) |
| | | { |
| | | try |
| | | { |
| | | if (HBillSubType == "SUB") |
| | | { |
| | | //判断是否有删除权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "子工艺路线无权限关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //判断是否有删除权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "工艺路线无权限关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Gy_RoutingBillMain"; |
| | | oCN.BeginTran();//开始事务 |
| | | |
| | | //Type 1 关闭 2 反关闭 |
| | | if (Type == 1) |
| | | { |
| | | //判断单据是否已经关闭 |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已关闭!不需要再关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]); |
| | | //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]); |
| | | if (HBillStatus == "6") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据在审核中,不能关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //关闭单据 |
| | | if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "关闭失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //获取系统参数设置失效时间 |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数 |
| | | { |
| | | //刷新失效时间 |
| | | oCN.RunProc("update Gy_RoutingBillMain set HEndDate = CONVERT(date, DATEADD(day, -1, GETDATE())) where HInterID = " + HInterID); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //判断单据是否已经反关闭 |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未手动关闭!需要先关闭"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]); |
| | | //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]); |
| | | if (HBillStatus == "6") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据在审核中,不能反关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //反关闭单据 |
| | | if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反关闭失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //获取系统参数设置失效时间 |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数 |
| | | { |
| | | //刷新失效时间 |
| | | oCN.RunProc($"update Gy_RoutingBillMain set HEndDate = '{HEndDate}',HBeginDate = '{HBeginDate}' where HInterID = " + HInterID); |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//提交事务 |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "执行成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "执行失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 报表查看权限控制 |
| | | /// <summary> |