| | |
| | | /// <returns></returns> |
| | | [Route("Sc_MESBeginWorkBill/SaveGetMESBeginWorkFrom_KS")] |
| | | [HttpGet] |
| | | public object SaveGetMESBeginWorkFrom_KS(string HBillType,int HSourceInterID,int HSourceEntryID,string HSourceBillNo,string user,string HSourceBillType) |
| | | public object SaveGetMESBeginWorkFrom_KS(string HBillType,int HSourceInterID,int HSourceEntryID, |
| | | string HSourceBillNo,string user,string HSourceBillType) |
| | | { |
| | | |
| | | |
| | |
| | | #region 报工平台快捷开工 |
| | | [Route("Sc_MESBeginWorkBill/FastBeginWorkBill")] |
| | | [HttpGet] |
| | | public object FastBeginWorkBill(string HBillType, int HSourceInterID, int HSourceEntryID, string HSourceBillNo, string HSourceBillType,string user) |
| | | public object FastBeginWorkBill(string HBillType, int HSourceInterID, int HSourceEntryID, |
| | | string HSourceBillNo, string HSourceBillType,string user) |
| | | { |
| | | |
| | | |
| | |
| | | objJsonResult.Message = "无保存权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oSystemParameter.ShowBill(ref DBUtility.ClsPub.sErrInfo); |
| | | if(oSystemParameter.omodel.Sc_MESBeginWorkBill_FirstCheckCtl == "Y") |
| | | { |
| | | // 判断是否允许 未首检合格前开工 |
| | | DataSet ds = oCN.RunProcReturn($@"select top 1 * from QC_FirstPieceCheckBillMain |
| | | where HMainSourceBillType = '{HBillType}' and HMainSourceBillNo = '{HSourceBillNo}' |
| | | order by HDate desc", "QC_FirstPieceCheckBillMain"); |
| | | |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "检验首件检验失败,该单据没有做对印的首检单"; |
| | | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HLastResult"].ToString() == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "首件检失败,首件检检验结果为不合格,不允许下推单据"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | ClsSc_MESBeginWorkBillMain.HWorkShiftID = int.Parse(set.Tables[0].Rows[0]["HInterID"].ToString()); |
| | | } |
| | | ds = oCN.RunProcReturn("select * from h_v_Cj_GetDefValByUser where 用户名称='" + user + "'", "h_v_xt_UserAssociationSelect"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Cj_GetDefValByUser where 用户名称='" + user + "'", "h_v_Cj_GetDefValByUser"); |
| | | |
| | | //if (ds.Tables[0].Rows[0]["HGroupID"].ToString() == "0") |
| | | //{ |
| | |
| | | //保存 |
| | | //保存完毕后处理 |
| | | bool bResult = false; |
| | | string RetHInterID = "0"; |
| | | if (oBill.omodel.HInterID == 0) |
| | | { |
| | | |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | if(bResult) |
| | | { |
| | | RetHInterID = DBUtility.ClsPub.sExeReturnInfo; |
| | | } |
| | | } |
| | | ds = oCN.RunProcReturn("select * from Sc_MESBeginWorkBillMain where HBillNo='" + oBill.omodel.HBillNo + "'", "Sc_MESBeginWorkBillMain"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | // ds = oCN.RunProcReturn("select * from Sc_MESBeginWorkBillMain nolock where HBillNo='" + oBill.omodel.HBillNo + "'", "Sc_MESBeginWorkBillMain"); |
| | | //if (ds.Tables[0].Rows.Count == 0) |
| | | if(RetHInterID == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sAutoCheck = oClsXt_SystemParameter.GetSingleSystemParameter("Sc_MESBeginWorkBill_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (sAutoCheck == "Y") |
| | | { |
| | | LogService.Write("开工单自动生成工作联系单...3 " + sAutoCheck); |
| | | |
| | | if (!oBill.CheckBill(long.Parse(ds.Tables[0].Rows[0]["HInterID"].ToString()), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (!oBill.CheckBill(long.Parse(RetHInterID), ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | LogService.Write("开工单自动生成工作联系单...4 "); |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "华舟") |
| | | { |
| | | LogService.Write("自动生成工作联系单..."); |
| | | LogService.Write("开工单自动生成工作联系单..."+ oBill.omodel.HInterID); |
| | | |
| | | //自动生成工作联系单 |
| | | ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + ds.Tables[0].Rows[0]["HInterID"].ToString() + "," + 3772, "h_p_OA_WorkLinkBill_Create"); |
| | | ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + oBill.omodel.HInterID + "," + 3787, "h_p_OA_WorkLinkBill_Create"); |
| | | } |
| | | } |
| | | |