| | |
| | | { |
| | | return YqnQbService.SetStationInBill(oMain); |
| | | } |
| | | /// <summary> |
| | | /// 出站站接收单 |
| | | /// </summary> |
| | | /// <param name="oMain"></param> |
| | | /// <returns></returns> |
| | | [Route("api/newBill/setStationOutBill")] |
| | | [HttpPost] |
| | | public ApiResult SetStationOutBill(ClsSc_StationInBillMain oMain) |
| | | { |
| | | return YqnQbService.SetStationInBill(oMain); |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using DBUtility; |
| | | using System; |
| | | using System.Collections.Concurrent; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | |
| | | } |
| | | return new ApiResult { code = 1, msg = "操作成功" }; |
| | | } |
| | | /// <summary> |
| | | /// 出站接收单 |
| | | /// </summary> |
| | | public static ApiResult SetStationOutBill(Model.ClsSc_StationOutBillMain omodel) |
| | | { |
| | | WebS.WebService1 oWebs = new WebS.WebService1(); |
| | | string sErrMsg = string.Empty; |
| | | var result = SetOutBill(omodel); |
| | | return result; |
| | | } |
| | | #region sql语句 |
| | | public static DataSet GetBarCodeDb(string billBarCode) |
| | | { |
| | |
| | | var dataSet = oCN.RunProcReturn("Select HItemID,HNumber 工作中心代码,HName 工作中心 from Gy_Group where HStopflag=0 " + sWhere + " Order by HItemID ", "Gy_Source"); |
| | | return dataSet; |
| | | } |
| | | private static ConcurrentDictionary<string,string> dicLock=new System.Collections.Concurrent.ConcurrentDictionary<string,string>();//并发锁 |
| | | public static ApiResult SetOutBill(Model.ClsSc_StationOutBillMain omodel) |
| | | { |
| | | try |
| | | { |
| | | if (!dicLock.TryAdd(omodel.HBillNo, omodel.HBillNo)) |
| | | return new ApiResult { code = -1, msg = "服务器繁忙" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID("3791", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.BeginTran(); |
| | | var sql = "Insert Into Sc_StationOutBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HRemark" + |
| | | ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" + |
| | | ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID" + |
| | | ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" + |
| | | ",HSupID,HQty,HPrice,HMoney" + |
| | | ") " + |
| | | " values('3791','3791'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",getdate(),'" + DBUtility.ClsPub.CurUserName + "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" + |
| | | "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HProcPlanInterID.ToString() + "," + omodel.HProcPlanEntryID.ToString() + ",'" + omodel.HProcPlanBillNo + "'," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() + |
| | | ",'" + omodel.HProcExchBillNo + "'," + omodel.HMaterID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HICMOQty.ToString() + "," + omodel.HPlanQty.ToString() + ",getdate()," + omodel.HSourceID.ToString() + |
| | | "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + omodel.HBarCodeMaker + "',getdate()" + |
| | | "," + omodel.HSupID.ToString() + "," + omodel.HQty.ToString() + "," + omodel.HPrice.ToString() + "," + omodel.HMoney.ToString() + |
| | | ") "; |
| | | oCN.RunProc(sql); |
| | | oCN.Commit(); |
| | | return new ApiResult { code = 1, msg = "新增成功" }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new ApiResult { code = -1, msg = "保存错误/"+ex.ToString() }; |
| | | } |
| | | finally |
| | | { |
| | | dicLock.TryRemove(omodel.HBillNo, out string key); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |