| | |
| | | /// <returns></returns> |
| | | [Route("Sc_MESBeginWorkBill/DeltetMESBeginWorkBill")] |
| | | [HttpGet] |
| | | public object DeltetMESBeginWorkBill(string HInterID,string UserName) |
| | | public object DeltetMESBeginWorkBill(string HInterID, string UserName) |
| | | { |
| | | DBUtility.ClsPub.CurUserName = UserName; |
| | | //ç¼è¾æé |
| | |
| | | [HttpGet] |
| | | public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "MES_MESBeginWorkBill_Check"; |
| | | string ModRightNameCheck = "MES_MESBeginWorkBill_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | |
| | | [HttpPost] |
| | | public object SaveGetMESBeginWorkFrom([FromBody] JObject msg) |
| | | { |
| | | |
| | | |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | DBUtility.ClsPub.CurUserName =oItem.HMaker; |
| | | ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter(); |
| | | string sCapName = oClsXt_SystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (sCapName.Contains("å¯è´")) |
| | | { |
| | | DataTable dt = getInfodatanow(oItem.HSourceID.ToString()); |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | DataRow dr = dt.Rows[0]; |
| | | oItem.HRunStatus = dr["runStu"].ToString(); |
| | | oItem.HSourceBeginQty = Convert.ToDecimal(dr["countAll"]); |
| | | } |
| | | } |
| | | DBUtility.ClsPub.CurUserName = oItem.HMaker; |
| | | oItem.HBillType = "3787"; |
| | | oItem.HBillSubType = "3787"; |
| | | oItem.HBillStatus = 1; //åæ®ç¶æï¼1æªå®¡ï¼2å®¡æ ¸éè¿ï¼3å
³éï¼4ä½åºï¼5å®¡æ ¸éå,6å®¡æ ¸ä¸,7å·²é
ï¼8å·²åå¤ï¼9ç»æ¡ï¼10éªè¯,11ä¸è¾¾ï¼12å¼å·¥,13ç³è¯·å®¡æ¹,15ç³è¯·æ£éªï¼16 å¤å®åæ ¼ï¼17å¤å®ä¸åæ ¼ï¼ |
| | |
| | | bool bResult; |
| | | if (oBill.omodel.HInterID == 0) |
| | | { |
| | | |
| | | |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (bResult) |
| | | if (bResult) |
| | | { |
| | | objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //è¿å主ID |
| | | //ç³»ç»åæ° èªå¨å®¡æ ¸ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | if (bResult) |
| | | { |
| | | |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | public DataTable getInfodatanow(string hsoucreID) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | string sql = $" select HMacAddr, runStu, countAll from Gy_Source t1 left join HX_LIOTsys..Info_data_now t2 on t1.HMacAddr = t2.hid where t1.hitemid={hsoucreID}"; |
| | | DataTable dt = oCn.RunProcReturn(sql, "dt").Tables[0]; |
| | | return dt; |
| | | } |
| | | |
| | | #region æ¥å·¥å¹³å°éªè¯åæ®ç¶æ |
| | | [Route("Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus")] |
| | |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "Sc_ICMOBillWorkQtyStatus_Tmp"); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region æ¥å·¥å¹³å°äº§éæ±éªè¯æ±æ¥æ°éæ¯å¦è¶
åºè®¡åæ°éè¾ |
| | | /// <summary> |
| | | /// |
| | |
| | | if (bResult) |
| | | { |
| | | objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //è¿å主ID |
| | | //ç³»ç»åæ° èªå¨å®¡æ ¸ |
| | | //ç³»ç»åæ° èªå¨å®¡æ ¸ |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | |
| | | /// <returns></returns> |
| | | [Route("Sc_MESBeginWorkBill/MESProductAuditProcessReportList")] |
| | | [HttpGet] |
| | | public object MESProductAuditProcessReportList(int HSourceID,int HSourceInterID,int HSourceEntryID,string HSourceBillNo, int HICMOInterID,int HICMOEntryID, int HInterID, int IsAudit, string CurUserName) |
| | | public object MESProductAuditProcessReportList(int HSourceID, int HSourceInterID, int HSourceEntryID, string HSourceBillNo, int HICMOInterID, int HICMOEntryID, int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | string ModRightNameCheck = "MES_ProcExchReport_Check"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | |
| | | { |
| | | string StrMessage = ""; |
| | | //å®¡æ ¸æé |
| | | if (!WebClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName,ref StrMessage)) |
| | | if (!WebClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName, ref StrMessage)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | if (IsAudit == 0) //å®¡æ ¸æäº¤ |
| | | { |
| | | //å®¡æ ¸æäº¤ |
| | | if (oBill.CheckBill(HSourceID, HSourceInterID,HSourceEntryID,HSourceBillNo,HICMOInterID, HICMOEntryID, lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.CheckBill(HSourceID, HSourceInterID, HSourceEntryID, HSourceBillNo, HICMOInterID, HICMOEntryID, lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | #region æ¥å·¥å¹³å°äº§éæ±æ¥å é¤ |
| | | [Route("Sc_MESBeginWorkBill/DeltetMESProductReportBill")] |
| | | [HttpGet] |
| | | public object DeleteGetLineBindBillList(string HInterID,string HICMOInterID,string HICMOEntryID,string UserName) |
| | | public object DeleteGetLineBindBillList(string HInterID, string HICMOInterID, string HICMOEntryID, string UserName) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | //æ¥è¯¢äº§éæ±æ¥ä¸´æ¶è¡¨æ°é |
| | | ds = oCN.RunProcReturn("select isnull(HQty,0) HQty,isnull(HWasterQty,0) HWasterQty,isnull(HBadQty,0) HBadQty from Sc_ICMOBillWorkQtyStatus_Tmp where HInterID='" + HInterID + "' and HICMOInterID='" + HICMOInterID + "' and HICMOEntryID='" + HICMOEntryID + "'", "Sc_ICMOBillWorkQtyStatus_Tmp"); |
| | | double HQty =double.Parse(ds.Tables[0].Rows[0]["HQty"].ToString()); |
| | | double HQty = double.Parse(ds.Tables[0].Rows[0]["HQty"].ToString()); |
| | | double HWasterQty = double.Parse(ds.Tables[0].Rows[0]["HWasterQty"].ToString()); |
| | | double HBadQty = double.Parse(ds.Tables[0].Rows[0]["HBadQty"].ToString()); |
| | | double sumqty = HQty + HBadQty + HWasterQty; //æ±æ¥æ°é+ä¸è¯+æ¥åº |
| | | //æ´æ°äº§éè£
é临æ¶è¡¨å·²æ±æ¥æ°é |
| | | string sql1 = string.Format(@"update Sc_ICMOBillStatus_Tmp set HICMOStatus='1',HFinishFlag='0', HRelationInterID=0,HSplitRelationQty=HSplitRelationQty-" + sumqty + ",HDateFinishQty=HDateFinishQty-"+ sumqty + " where HICMOInterID='"+ HICMOInterID + "' and HICMOEntryID='"+ HICMOEntryID + "'"); |
| | | //æ´æ°äº§éè£
é临æ¶è¡¨å·²æ±æ¥æ°é |
| | | string sql1 = string.Format(@"update Sc_ICMOBillStatus_Tmp set HICMOStatus='1',HFinishFlag='0', HRelationInterID=0,HSplitRelationQty=HSplitRelationQty-" + sumqty + ",HDateFinishQty=HDateFinishQty-" + sumqty + " where HICMOInterID='" + HICMOInterID + "' and HICMOEntryID='" + HICMOEntryID + "'"); |
| | | oCN.RunProc(sql1); |
| | | //æ´æ°åæ¢ç¶æå¼ |
| | | string sql = string.Format(@"delete Sc_ICMOBillWorkQtyStatus_Tmp where HInterID='" + HInterID + "'"); |
| | |
| | | #region æ¥å·¥å¹³å°æ¥æ£ç³è¯·ä¿å |
| | | [Route("Sc_MESBeginWorkBill/SaveGetMESProductReportBillList")] |
| | | [HttpGet] |
| | | public object SaveGetMESProductReportBillList(string ScMaxWork,string HSourceBillType, string workcode,int HSourceID,int HICMOInterID,int HICMOEntryID,string HMaker,string Czybm) |
| | | { |
| | | public object SaveGetMESProductReportBillList(string ScMaxWork, string HSourceBillType, string workcode, int HSourceID, int HICMOInterID, int HICMOEntryID, string HMaker, string Czybm) |
| | | { |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | |
| | | //} |
| | | |
| | | string sHSourceType = HSourceBillType; |
| | | string BillType = "3711"; //åæ®ç±»å (çäº§æ±æ¥å) |
| | | //å¾å°mainid |
| | | long HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | string BillType = "3711"; //åæ®ç±»å (çäº§æ±æ¥å) |
| | | //å¾å°mainid |
| | | long HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //oCN.BeginTran(); |
| | | //æ ¹æ®åå·ãèµæºIDã订å主IDã订ååIDãå¶åäººè¿æ»¤äº§éæ±æ¥æ¥æ£ç³è¯·æäº¤æ°æ® |
| | | //string sql = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set |
| | |
| | | //ds = oCN.RunProcReturn("select top 1 * from Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='" + HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp"); |
| | | //if (ds.Tables[0].Rows.Count <= 0) |
| | | //{ |
| | | //oCN.RollBack(); |
| | | //oCN.RollBack(); |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "å½ååæ®æ äº§éæ±æ¥è®°å½ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | |
| | | WebS.ClsSc_ICMOReportBillMain model = new WebS.ClsSc_ICMOReportBillMain(); |
| | | model.HInterID = HInterID; |
| | | model.HBillNo = ScMaxWork; |
| | |
| | | //model.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]); |
| | | model.HMainSourceInterID = HICMOInterID; |
| | | model.HMainSourceEntryID = HICMOEntryID; |
| | | |
| | | |
| | | //oWebs.Timeout = 30000; |
| | | bool flag=oWebs.set_SaveICMOProductReportBill_Layui(model,workcode,HSourceID, sHSourceType, ref DBUtility.ClsPub.sErrInfo); |
| | | bool flag = oWebs.set_SaveICMOProductReportBill_Layui(model, workcode, HSourceID, sHSourceType, ref DBUtility.ClsPub.sErrInfo); |
| | | if (flag) |
| | | { |
| | | //oCN.Commit(); |
| | |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | else |
| | | { |
| | | //oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼"+ flag+ ";"+ DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + flag + ";" + DBUtility.ClsPub.sErrInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |