| | |
| | | #endregion |
| | | |
| | | |
| | | #region ä¸ç¹ç
§åæ«ç è®°å½å模åè°ç¨æ¹æ³ 20240723 |
| | | |
| | | #region ä¸ç¹ç
§åæ«ç è®°å½åæ«ç æ¨¡å æ«æå®¢æ·æ¡ç è°ç¨æ¹æ³ |
| | | /// <summary> |
| | | /// æ«æå®¢æ·æ¡ç |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/Get_CusBarCode_CusBarCodeCheck_Json")] |
| | | [HttpGet] |
| | | public object Get_CusBarCode_CusBarCodeCheck_Json(string HCusBarCode_Y, string HCusBarCode_N) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_WMS_CheckCusBarCode_CusBarCodeCheck '" + HCusBarCode_Y + "','" + HCusBarCode_N + "'", "h_p_WMS_CheckCusBarCode_CusBarCodeCheck"); |
| | | 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]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | 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/Get_BarCode_CusBarCodeCheck_Json")] |
| | | [HttpGet] |
| | | public object Get_BarCode_CusBarCodeCheck_Json(string HBarCode, string HCusBarCode_Y, string HCusBarCode_N, Int64 HInterID, string HBillType, string HBillNo, string HMaker, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_WMS_AddBarCode_CusBarCodeCheck " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode + "','" + HCusBarCode_Y + "','" + HCusBarCode_N + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddBarCode_CusBarCodeCheck"); |
| | | 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]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | 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/GetCusBarCodeCheckBillTmpList_Json")] |
| | | [HttpGet] |
| | | public object GetCusBarCodeCheckBillTmpList_Json(Int64 HInterID, string HBillNo, string HBillType) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_WMS_CusBarCodeCheckBillTmpList " + HInterID.ToString() + ",'" + HBillType + "'", "h_p_WMS_CusBarCodeCheckBillTmpList"); |
| | | 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 |
| | | |
| | | #region ä¸ç¹ç
§åæ«ç è®°å½åæ«ç 模å å é¤åè½æé®è°ç¨ å é¤éä¸è¡ä¸´æ¶è¡¨è®°å½ |
| | | |
| | | /// <summary> |
| | | /// å é¤éä¸è¡ä¸´æ¶è¡¨è®°å½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_DelCusBarCodeCheckBill_temp_Json")] |
| | | [HttpGet] |
| | | public object set_DelCusBarCodeCheckBill_temp_Json(Int64 HInterID, string HBillType, Int64 HItemID) |
| | | { |
| | | try |
| | | { |
| | | oCn.RunProc("Delete from WMS_CusBarCodeCheckBill_temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + " and HItemID=" + HItemID.ToString(), ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "0"; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ä¸ç¹ç
§åæ«ç è®°å½å ä¸ä¼ çå |
| | | |
| | | /// <summary> |
| | | /// ä¸ç¹ç
§åæ«ç è®°å½åæ°å¢ä¸ä¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveCusBarCodeCheckBill_Json")] |
| | | [HttpPost] |
| | | public object set_SaveCusBarCodeCheckBill_Json([FromBody] JObject oMain) |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | try |
| | | { |
| | | string sMainStr = "[" + msg1.ToString() + "]"; |
| | | List<Model.ClsWMS_CusBarCodeCheckBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsWMS_CusBarCodeCheckBillMain>>(sMainStr); |
| | | Model.ClsWMS_CusBarCodeCheckBillMain omodel = new Model.ClsWMS_CusBarCodeCheckBillMain(); |
| | | omodel.HInterID = mainList[0].HInterID; |
| | | omodel.HBillNo = mainList[0].HBillNo; |
| | | omodel.HBillType = mainList[0].HBillType; |
| | | omodel.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString()); |
| | | omodel.HRemark = mainList[0].HRemark; |
| | | omodel.HMaker = mainList[0].HMaker; |
| | | omodel.HSTOCKORGID = mainList[0].HSTOCKORGID; |
| | | omodel.HDeptID = mainList[0].HDeptID; |
| | | |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Today, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | omodel.HYear = sYear; |
| | | omodel.HPeriod = sPeriod; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | //çæä¸ç¹ç
§åæ«ç è®°å½å |
| | | //æå
¥å表 |
| | | oCn.RunProc("EXEC h_p_WMS_CusBarCodeCheckBillSub_Insert " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'"); |
| | | //æå
¥ä¸»è¡¨ |
| | | oCn.RunProc("Insert Into WMS_CusBarCodeCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + |
| | | ",HDeptID,HStockOrgID" + |
| | | ") " + |
| | | " values('" + omodel.HBillType + "','" + omodel.HBillType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToShortDateString() + "'" + |
| | | ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" + |
| | | ", " + omodel.HDeptID.ToString() + "," + omodel.HSTOCKORGID.ToString() + |
| | | ") "); |
| | | |
| | | oCn.Commit(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "çæä¸ç¹ç
§åæ«ç è®°å½åæåï¼åæ®å·ä¸ºï¼" + omodel.HBillNo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¸ç¹ç
§åæ«ç è®°å½åä¸ä¼ 失败ï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region ç©ææ¡ç æ¥è¯¢è°ç¨æ¹æ³ |
| | | /// <summary> |
| | | /// è·åæ¡ç ä¿¡æ¯ |