ouyangqing
2021-01-20 6b9fb0c1991f1770d8459f55a0e6a8e457ca6657
nothing
1个文件已修改
39 ■■■■■ 已修改文件
WebAPI/Service/YqnQbService.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Service/YqnQbService.cs
@@ -153,7 +153,7 @@
                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" +
@@ -163,7 +163,7 @@
                    ",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() +
@@ -183,6 +183,41 @@
                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
    }