| | |
| | | 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); |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID("4788", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.BeginTran(); |
| | | var sql = "Insert Into Sc_StationOutBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | |
| | | ",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()" + |
| | | " values('4788','4788'," + 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() + |
| | |
| | | dicLock.TryRemove(omodel.HBillNo, out string key); |
| | | } |
| | | } |
| | | public static ApiResult SetInBill(ClsSc_StationInBillMain omodel) |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | //得到mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID("3790", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //若MAINDI重复则重新获取 |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert Into Sc_StationInBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HRemark" + |
| | | ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" + |
| | | ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationInTime,HSourceID" + |
| | | ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" + |
| | | ",HSupID,HQty,HPrice,HMoney,HMaker" + |
| | | ") " + |
| | | " values('3790','3790'," + 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() + |
| | | ",'"+omodel.HMaker+"') "); |
| | | |
| | | oCN.Commit(); |
| | | return new ApiResult { code = 1, msg = "新增成功" }; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | return new ApiResult { code = -1, msg = "保存错误/" + e.ToString() }; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |