| | |
| | | /// <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) |
| | | { |
| | | |
| | | |
| | |
| | | { |
| | | 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("自动生成工作联系单..."+ oBill.omodel.HInterID); |
| | | LogService.Write("开工单自动生成工作联系单..."+ oBill.omodel.HInterID); |
| | | |
| | | //自动生成工作联系单 |
| | | ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + oBill.omodel.HInterID + "," + 3787, "h_p_OA_WorkLinkBill_Create"); |