| | |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetUser_Json")] |
| | | [HttpGet] |
| | | [AllowAnonymous] |
| | | public object GetUser_Json(string HUserNumber, string HPassWord, Int64 HStockOrgID, string HStockOrgName) |
| | | { |
| | | try |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if(!oSystemParameter.ShowBill(ref DBUtility.ClsPub.sErrInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç»å½å¼å¸¸ï¼Token çæå¼å¸¸ï¼æ æ³è·åå
¬å¸ä¿¡æ¯ï¼"; |
| | | } |
| | | |
| | | string tokenStr = JWTHelper.GenerateToken(ds.Tables[0].Rows[0]["Czybm"].ToString(), ds.Tables[0].Rows[0]["Czmm"].ToString()); |
| | | |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ç»å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | JObject jobjJsonResult = JObject.FromObject(objJsonResult); |
| | | jobjJsonResult["token"] = tokenStr; |
| | | return jobjJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å 餿¡ç åºå
¥åºç¼åå表æ¡ç è®°å½å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region æ«ç æ¨¡å æ ¹æ®æ¡ç å é¤ç¼åå表ä¸å¯¹åºæ¡ç è®°å½ |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ¡ç æ´æ°æ¡ç åºå
¥åºç¼å表æ°é |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_UpdatePonderationBillMain_Temp_BarCode_Json")] |
| | | [HttpGet] |
| | | public object set_UpdatePonderationBillMain_Temp_BarCode_Json(long HInterID, string HBillType, string HBarCode, double HQty, long HItemID) |
| | | { |
| | | try |
| | | { |
| | | //(HBarCode_Pack <> '' and HInterID = { HInterID.ToString() } and HBillType = '{HBillType}' and HBarCode_Pack = '{HBarCode}') or |
| | | // (HBarCode <> '' and HInterID ={ HInterID.ToString()} |
| | | //and HBillType = '{HBillType}' and HBarCode = '{HBarCode}') |
| | | // æ ¹æ®ææ¡ç åæ®µåæ¡ç åæ®µ 夿 æ´æ°çæ¡ç æ°éæ¯å¦å¤§äºæå¤§æ°éæå°äº0 |
| | | ds = oCn.RunProcReturn($@"select * from KF_PonderationBillMain_Temp where |
| | | HItemID = {HItemID} |
| | | ", "KF_PonderationBillMain_Temp"); |
| | | |
| | | if(ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | // ææ«æ¡ç ä¸åå¨ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°å¤±è´¥ï¼ææ«æ¡ç ä¸åå¨..."; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if(HQty < 0) |
| | | { |
| | | // æ´æ°çæ¡ç æ°éå°äº0 |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°å¤±è´¥ï¼æ´æ°æ°éå°äº0..."; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if(Double.Parse(ds.Tables[0].Rows[0]["HQtyMust"].ToString()) < HQty) |
| | | //{ |
| | | //// æ´æ°çæ¡ç æ°éæ¯å¦å¤§äºæå¤§æ°é |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = $"æ´æ°å¤±è´¥ï¼æ¡ç æ°é{HQty}å¤§äºæå¤§å¯æ«æ°é{ds.Tables[0].Rows[0]["HQtyMust"].ToString()}..."; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | |
| | | //æ ¹æ®ææ¡ç åæ®µæ´æ°æ¬åæ¡ç åºå
¥åºç¼åè¡¨æ°æ® |
| | | //oCn.RunProc($"Update KF_PonderationBillMain_Temp set HQty = {HQty} where HBarCode_Pack<>'' and HInterID={HInterID.ToString()} and HBillType='{HBillType}' and HBarCode_Pack='{HBarCode}'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //æ ¹æ®æ¡ç åæ®µæ´æ°æ¬åæ¡ç åºå
¥åºç¼åè¡¨æ°æ® |
| | | //oCn.RunProc($"Update KF_PonderationBillMain_Temp set HQty = {HQty} where HBarCode<>'' and HInterID={HInterID.ToString()} and HBillType='{HBillType}' and HBarCode='{HBarCode}'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //æ ¹æ®æ¡ç èªå¢å æ´æ° æ¡ç åºå
¥åºç¼åè¡¨æ°æ® |
| | | oCn.RunProc($"exec h_p_KF_PonderationBillMain_Temp_Update {HInterID}, '{HBillType}', '{HBarCode}', {HQty}, {HItemID}", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | objJsonResult.code = "1"; |
| | | 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; |
| | | } |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveQCPOStockInCheckBill_Json")] |
| | | [HttpPost] |
| | | [HttpGet] |
| | | public object set_SaveQCPOStockInCheckBill_Json(Int64 HInterID, string HBillNo, string HSourceBillType, string HSourceBillNo, Int64 HSourceInterID, string sHSourceEntryID, Int64 HFirstCheckEmp, string HMaker) |
| | | { |
| | | try |
| | |
| | | oSub.HBadQty = Pub_Class.ClsPub.isDoule(Ds.Tables[1].Rows[i]["HBadQty"]); |
| | | |
| | | oCn.RunProc("Insert Into QC_POStockInCheckBillSub " + |
| | | "(HInterID,HEntryID,,HBillNo_bak,HRemark" + |
| | | "(HInterID,HEntryID,HBillNo_bak,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue" + |
| | | "HResult,HProcCheckEmp,HProcCheckTime" + |
| | | "HMaterID,HInStockQty,HCheckQty,HRightQty,HBadQty" + |
| | | ",HResult,HProcCheckEmp,HProcCheckTime" + |
| | | ",HMaterID,HInStockQty,HCheckQty,HRightQty,HBadQty" + |
| | | ") " + |
| | | " values(" + oMain.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oMain.HBillNo + "','" + oSub.HRemark + "'" + |
| | | ", " + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" + |
| | | ", " + oSub.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "'" + |
| | | ",'" + oSub.HResult + "'," + oSub.HProcCheckEmp.ToString() + "',getdate()" + |
| | | ",'" + oSub.HResult + "'," + oSub.HProcCheckEmp.ToString() + ",getdate()" + |
| | | ", " + oSub.HMaterID.ToString() + "," + oSub.HInStockQty.ToString() + "," + oSub.HCheckQty.ToString() + "," + oSub.HRightQty.ToString() + "," + oSub.HBadQty.ToString() + |
| | | ") "); |
| | | } |
| | |
| | | if (isSuccess == 1) |
| | | { |
| | | string result = InvokeHelper.Save("QM_InspectBill", sJson); //ä¿å |
| | | |
| | | sRemark = sRemark + " ï¼çæCLOUDåæ®" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff"); |
| | | |
| | | HReturn = result.ToString(); |
| | |
| | | else |
| | | { |
| | | sRemark = sRemark + sJson; |
| | | // æäº¤åä¿ååæ® |
| | | string result1 = string.Empty; |
| | | string result2 = string.Empty; |
| | | var fID = JObject.Parse(result)["Result"]["Id"].ToString(); |
| | | var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString(); |
| | | var json = new |
| | | { |
| | | Ids = fID, |
| | | }; |
| | | |
| | | result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//æäº¤ |
| | | result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//å®¡æ ¸ |
| | | if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | oCn.RollBack(); |
| | | sErrMsg = $"æ¥ææ£éªåå·ï¼{fBillNo}ï¼æäº¤å¤±è´¥" + result; |
| | | return false; |
| | | } |
| | | oCn.Commit(); |
| | | } |
| | | } |
| | |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //æåï¼ |
| | | objJsonResult.data = oDs.Tables[0]; |
| | | return objJsonResult; |