| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·²ä¸ä¼ æ¥è¯¢çé¢ï¼æ ¹æ®åæ®ç±»åãåæ®å·ãæºåå·ãç¨æ·ãèªå®ä¹å段æ¥è¯¢å·²ä¸ä¼ åæ®ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetKf_ICStockBillList_Json")] |
| | | [HttpGet] |
| | | public object GetKf_ICStockBillList_Json(string HBillType, string HBillNo, string HSourceBillNo, string HMaker, Int64 HStockOrgID, string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryList_New '" + HBillType + "','" + HBillNo + "','" + HSourceBillNo + "','" + HMaker + "'," + HStockOrgID.ToString() + ",'" + sWhere+"'", "h_p_Kf_ICStockBillQueryList_New"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢ä¸å°è¯¥åæ®è®°å½ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //è·åå°DataColumnå对象çåå |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·ååæ®ä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è·åå·²ä¸ä¼ åæ®ä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region åºé¨ç¡®è®¤å模åè°ç¨æ¹æ³ 20240308 |
| | | |
| | | #region æ«æåæ®å·æ¡ç è°ç¨ |
| | | |
| | | /// <summary> |
| | | /// æ«æåæ®å·æ¡ç |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/Get_SourceBarCode_OutDoorCheck_Json")] |
| | | [HttpGet] |
| | | public object Get_SourceBarCode_OutDoorCheck_Json(string HBarCode, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OutDoorCheck '" + HBarCode + "'," + HStockOrgID.ToString(), "h_p_WMS_AddSourceBarCode_OutDoorCheck"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ«æåæ®å·æ¡ç å¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //è·åå°DataColumnå对象çåå |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ«æåæ®å·æ¡ç 失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | 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> |
| | | /// æ°å¢çæåºé¨ç¡®è®¤å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveOutDoorCheckBill_Json")] |
| | | [HttpPost] |
| | | public object set_SaveOutDoorCheckBill_Json([FromBody] JObject sMainSub) |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | try |
| | | { |
| | | List<Model.ClsXs_OutDoorCheckBillMain> lsmain = new List<Model.ClsXs_OutDoorCheckBillMain>(); |
| | | ListModels oListModels = new ListModels(); |
| | | lsmain = oListModels.getOutDoorCheckBillMainByJson(msg1); |
| | | ClsXs_OutDoorCheckBillMain oMain = new ClsXs_OutDoorCheckBillMain(); |
| | | string sSourceType = lsmain[0].HMainSourceBillType; |
| | | oMain.HInterID = lsmain[0].HInterID; |
| | | oMain.HBillNo = lsmain[0].HBillNo; |
| | | oMain.HBillType = lsmain[0].HBillType; |
| | | oMain.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString()); |
| | | oMain.HMainSourceBillType = lsmain[0].HMainSourceBillType; |
| | | oMain.HMainSourceInterID = lsmain[0].HMainSourceInterID; |
| | | oMain.HMainSourceEntryID = lsmain[0].HMainSourceEntryID; |
| | | oMain.HMainSourceBillNo = lsmain[0].HMainSourceBillNo; |
| | | oMain.HExplanation = lsmain[0].HExplanation; |
| | | oMain.HRemark = lsmain[0].HRemark; |
| | | oMain.HMaker = lsmain[0].HMaker; |
| | | oMain.HSTOCKORGID = lsmain[0].HSTOCKORGID; |
| | | |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | oMain.HYear = sYear; |
| | | oMain.HPeriod = sPeriod; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | //çæåºé¨ç¡®è®¤åï¼åªéçæä¸»è¡¨æ°æ®ï¼ |
| | | //æå
¥ä¸»è¡¨ |
| | | oCn.RunProc("Insert Into Xs_OutDoorCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HBillStatus,HRemark,HMaker,HMakeDate" + |
| | | ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + |
| | | ",HExplanation,HSTOCKORGID" + |
| | | ") " + |
| | | " values('" + oMain.HBillType + "','" + oMain.HBillType + "'," + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HDate.ToShortDateString() + "'" + |
| | | ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",1,'" + oMain.HRemark + "','" + oMain.HMaker + "',getdate()" + |
| | | ",'" + oMain.HMainSourceBillType + "'," + oMain.HMainSourceInterID.ToString() + "," + oMain.HMainSourceEntryID.ToString() + ",'" + oMain.HMainSourceBillNo + "'" + |
| | | ",'" + oMain.HExplanation + "'," + oMain.HSTOCKORGID.ToString() + |
| | | ") "); |
| | | |
| | | //å®¡æ ¸åæ® |
| | | oCn.RunProc("Update Xs_OutDoorCheckBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString()); |
| | | |
| | | oCn.Commit(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "çæå¹¶å®¡æ ¸åºé¨ç¡®è®¤åæåï¼åæ®å·ä¸ºï¼" + oMain.HBillNo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åºé¨ç¡®è®¤åä¸ä¼ 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region å¤çæ¹æ³ |
| | | |
| | | |