stringsSQL="update wms_in set GOODSPACKSTOCK=GOODSPACK-isnull((select sum(GOODSPACKPFSL_OUT) as GOODSPACKPFSL_OUT from VW_WMS_STOCK_DETAIL where GID='"+enumValue.GID.ToString().Trim()+"'),0),GOODSSTOCK=GOODSRKSL-isnull((select sum(GOODSPFSL_OUT) as GOODSPFSL_OUT from VW_WMS_STOCK_DETAIL where GID='"+enumValue.GID.ToString().Trim()+"'),0) where GID='"+enumValue.GID.ToString().Trim()+"'";
boolbl=T_ALL_DA.GetExecuteSqlCommand(sSQL);
sSQL="update wms set GOODSPACKSTOCK=isnull((select sum(GOODSPACKSTOCK) as GOODSPACKSTOCK from wms_in where ASSOCIATEDNO='"+enumValue.WMSGID.ToString().Trim()+"'),0),GOODSSTOCK=isnull((select sum(GOODSSTOCK) as GOODSSTOCK from wms_in where ASSOCIATEDNO='"+enumValue.WMSGID.ToString().Trim()+"'),0) where gid='"+enumValue.WMSGID.ToString().Trim()+"'";
bl=T_ALL_DA.GetExecuteSqlCommand(sSQL);
}
else
{
stringsSQL="update wms_in set GOODSPACKSTOCK=0,GOODSSTOCK=0 where GID='"+enumValue.GID.ToString().Trim()+"'";
boolbl=T_ALL_DA.GetExecuteSqlCommand(sSQL);
sSQL="update wms set GOODSPACKSTOCK=0,GOODSSTOCK=0 where gid='"+enumValue.WMSGID.ToString().Trim()+"'";
//string sSQL = "update wms_in set GOODSPACKSTOCK=GOODSPACK-isnull((select sum(GOODSPACKPFSL_OUT) as GOODSPACKPFSL_OUT from VW_WMS_STOCK where GID='" + enumValue.GID.ToString().Trim() + "'),0),GOODSSTOCK=GOODSRKSL-isnull((select sum(GOODSPFSL_OUT) as GOODSPFSL_OUT from VW_WMS_STOCK where GID='" + enumValue.GID.ToString().Trim() + "'),0) where ASSOCIATEDNO='" + enumValue.GID.ToString().Trim() + "'";
//bool bl = T_ALL_DA.GetExecuteSqlCommand(sSQL);
//string sSQL = "update wms set GOODSPACKSTOCK=GOODSPACK-isnull((select top 1 (GOODSPACKPFSL_OUT) as GOODSPACKPFSL_OUT from VW_WMS_STOCK where GID='" + enumValue.GID.ToString().Trim() + "'),0),GOODSSTOCK=GOODSRKSL-isnull((select top 1 (GOODSPFSL_OUT) as GOODSPFSL_OUT from VW_WMS_STOCK where GID='" + enumValue.GID.ToString().Trim() + "'),0) where GID='" + enumValue.GID.ToString().Trim() + "'";
sSQL="insert into wms_in (GID,ASSOCIATEDNO,BLNO,CONTRACTNO,CTNALL,CNTRNO,SEALNO,BSNO,CLIENTCODE,CLIENTNAME,DODATE,STORAGECODE,STORAGENAME,AREACODE,AREANAME,GOODSCODE,GOODSNAME,GOODSTYPE,GOODSMODEL,GOODSSTANDARD,GOODSPACK,GOODSPACKSTOCK,GOODSKGS,CHARGEUNIT,GOODSRKSL,GOODSSTOCK,FREESTORAGEPERIOD,ISLOCK,LOCKTIME,LOCKUSER,ISDELETE,DELETETIME,DELETEUSER,CREATEUSER,CREATETIME,MODIFIEDUSER,MODIFIEDTIME,REMARK,CLIENTCODEOLD,CLIENTNAMEOLD,KINDPKGS,ARFEE,APFEE,CORPID,GOODSTHICKNESS,GOODSWIDTH,GOODSLENGTH,GOODSSLICE,GOODSGRADE,STACKLOCATION,GOODSPACKACTUAL,GOODSRKSLACTUAL,ISCHANGE,MARKETVALUE,BANKVALUE,LINENUM,GOODSNAMEID,ISLOCK2,XIANGHAO2,JIANSHU2,ZHUANGXIEGONGID,TRUCKNO,CHIMA1,CHIMA2,ZHONGLIANG2,SHIJIZHONGLIANG,SHIJICHIMA,JIANSHU1)"
+" select"
+" '"+_newwmsingid+"' as GID"//惟一编号" //Varchar(100)
+",'"+newWmsGid+"' as ASSOCIATEDNO"//关联号" //Varchar(100)
+",BLNO"//提单号" //Varchar(30)
+",CONTRACTNO"//合同号" //Varchar(100)
+",CTNALL"//箱型" //Varchar(10)
+",CNTRNO"//箱号" //Varchar(30)
+",SEALNO"//封号" //Varchar(12)
+",'"+newWMSNO+"' as BSNO"//入库单号" //Varchar(100)
+",CLIENTCODE"//客户编码" //varchar(20)
+",'"+headData.CLIENTNAMEOLD.ToString()+"' as CLIENTNAME"//客户名称" //varchar(20)
+",'"+headData.DODATE_OUT.ToString()+"' as DODATE"//入库日期" //Datetime
+",STORAGECODE"//仓库编码" //Varchar(50)
+",STORAGENAME"//仓库名称" //Varchar(100)
+",AREACODE"//库位编码" //Varchar(50)
+",AREANAME"//库位名称/储位" //Varchar(100)
+",GOODSCODE"//货物编号" //Varchar(50)
+",GOODSNAME"//货物名称/品名" //Varchar(100)
+",GOODSTYPE"//货物类型" //Varchar(50)
+",GOODSMODEL"//型号/品牌" //Varchar(100)
+",GOODSSTANDARD"//规格" //Varchar(100)
+","+enumValue.GOODSPACKPFSL_OUT+" as GOODSPACK"//入库件数" //Numeric(18,4)
+","+enumValue.GOODSPACKPFSL_OUT+" as GOODSPACKSTOCK"//剩余件数" //Numeric(18,4)
//+ ",0 as GOODSKGS" //单位重量" //Numeric(18,4) 目前已作为重量1使用,应该写入入库数量GOODSRKSL
+","+enumValue.GOODSPACKPFSL_OUT+" as GOODSKGS"//单位重量" //Numeric(18,4)
+",CHARGEUNIT"//计费单位" //Varchar(10)
+","+enumValue.GOODSPFSL_OUT+" as GOODSRKSL"//入库量" //Numeric(18,4)
+","+enumValue.GOODSPFSL_OUT+" as GOODSSTOCK"//库存量" //Numeric(18,4)
+","+feedays+" as FREESTORAGEPERIOD"//免仓储期" //int
+",0 as ISLOCK"//是否锁定" //bit
+",getdate() as LOCKTIME"//锁定时间" //Datetime
+",LOCKUSER"//锁定操作人" //Varchar(36)
+",0 as ISDELETE"//是否废除" //bit
+",getdate() as DELETETIME"//废除时间" //Datetime
+",DELETEUSER"//废除操作人" //Varchar(36)
+",'"+Convert.ToString(Session["USERID"]).Trim()+"' as CREATEUSER"//创建人" //Varchar(36)
+",getdate() as CREATETIME"//创建时间" //Datetime
+",'"+Convert.ToString(Session["USERID"]).Trim()+"' as MODIFIEDUSER"//最后一次更新操作人" //Varchar(36)
+",getdate() as MODIFIEDTIME"//最后一次更新操作时间" //Datetime
+",'货权转移' as REMARK"//备注" //Varchar(1024)
+",CLIENTCODEOLD"//原客户编码" //varchar(20)
+",CLIENTNAME as CLIENTNAMEOLD"//原客户名称" //varchar(20)
+",KINDPKGS"//包装" //varchar(20)
+",0 as ARFEE"//应收账款 account receivable" //Numeric(18,2)
+",0 as APFEE"//应付账款 account payable" //Numeric(18,2)
+",'"+Convert.ToString(Session["COMPANYID"]).Trim()+"' as CORPID"//分公司代码" //Varchar(36)" //" //
+",0 as GOODSTHICKNESS"//厚度" //Numeric(18,4)
+",0 as GOODSWIDTH"//宽度" //Numeric(18,4)
+",0 as GOODSLENGTH"//长度" //Numeric(18,4)
+",0 as GOODSSLICE"//片数/件/包装件数" //Numeric(18,4)
+",GOODSGRADE"//品名的等级" //Varchar(50)
+",STACKLOCATION"//码放位置" //Varchar(50)
+","+enumValue.GOODSPACKPFSL_OUT+" as GOODSPACKACTUAL"//实际件数" //Numeric(18,4)
+","+enumValue.GOODSPFSL_OUT+" as GOODSRKSLACTUAL"//实际数量" //Numeric(18,4)
+",1 as ISCHANGE"//是否是货权转移" //bit
+",0 as MARKETVALUE"//市场货值" //Numeric(18,2)
+",0 as BANKVALUE"//银行货值" //Numeric(18,2)
+",LINENUM=(select top 1 LINENUM=isnull((select top 1 LINENUM from wms_in WITH(NOLOCK) where ASSOCIATEDNO='"+newWmsGid+"' order by LINENUM desc),0)+1)"//单个grid的行号" //Int" //" //
+",GOODSNAMEID"//品名id" //Varchar(50)" //" //
+",0 as ISLOCK2"//是否锁定" //Bit
+",XIANGHAO2"//箱号2" //varchar(100)
+",0 as JIANSHU2"//件数2" //numeric(18, 4)
+",ZHUANGXIEGONGID"//装卸工ID" //varchar(100)
+",TRUCKNO"//车牌号" //varchar(100)
+",0 as CHIMA1"//尺码1" //Float
+",0 as CHIMA2"//尺码2" //Float
+","+enumValue.GOODSPFSL_OUT+" as ZHONGLIANG2"//重量2" //numeric(18, 4)
+",0 as SHIJIZHONGLIANG"//实际重量" //float
+",0 as SHIJICHIMA"//实际尺码" //Float
+",0 as JIANSHU1"//件数1" //numeric(18, 4)
+" from wms_in where GID='"+enumValue.GID.ToString()+"'";
sSQL="insert into wms_in (GID,ASSOCIATEDNO,BLNO,CONTRACTNO,CTNALL,CNTRNO,SEALNO,BSNO,CLIENTCODE,CLIENTNAME,DODATE,STORAGECODE,STORAGENAME,AREACODE,AREANAME,GOODSCODE,GOODSNAME,GOODSTYPE,GOODSMODEL,GOODSSTANDARD,GOODSPACK,GOODSPACKSTOCK,GOODSKGS,CHARGEUNIT,GOODSRKSL,GOODSSTOCK,FREESTORAGEPERIOD,ISLOCK,LOCKTIME,LOCKUSER,ISDELETE,DELETETIME,DELETEUSER,CREATEUSER,CREATETIME,MODIFIEDUSER,MODIFIEDTIME,REMARK,CLIENTCODEOLD,CLIENTNAMEOLD,KINDPKGS,ARFEE,APFEE,CORPID,GOODSTHICKNESS,GOODSWIDTH,GOODSLENGTH,GOODSSLICE,GOODSGRADE,STACKLOCATION,GOODSPACKACTUAL,GOODSRKSLACTUAL,ISCHANGE,MARKETVALUE,BANKVALUE,LINENUM,GOODSNAMEID,ISLOCK2,XIANGHAO2,JIANSHU2,ZHUANGXIEGONGID,TRUCKNO,CHIMA1,CHIMA2,ZHONGLIANG2,SHIJIZHONGLIANG,SHIJICHIMA,JIANSHU1)"//应付仓储费
+" select top 1"
+" newid() as GID"//惟一编号" //Varchar(100)
+",'"+newWmsGid+"' as ASSOCIATEDNO"//关联号" //Varchar(100)
+",BLNO"//提单号" //Varchar(30)
+",CONTRACTNO"//合同号" //Varchar(100)
+",CTNALL"//箱型" //Varchar(10)
+",CNTRNO"//箱号" //Varchar(30)
+",SEALNO"//封号" //Varchar(12)
+",'"+newWMSNO+"' as BSNO"//入库单号" //Varchar(100)
+",CLIENTCODE"//客户编码" //varchar(20)
+",'"+headData.CLIENTNAMEOLD.ToString()+"' as CLIENTNAME"//客户名称" //varchar(20)
+",'"+headData.DODATE_OUT.ToString()+"' as DODATE"//入库日期" //Datetime
+",STORAGECODE"//仓库编码" //Varchar(50)
+",STORAGENAME"//仓库名称" //Varchar(100)
+",AREACODE"//库位编码" //Varchar(50)
+",AREANAME"//库位名称/储位" //Varchar(100)
+",GOODSCODE"//货物编号" //Varchar(50)
+",GOODSNAME"//货物名称/品名" //Varchar(100)
+",GOODSTYPE"//货物类型" //Varchar(50)
+",GOODSMODEL"//型号/品牌" //Varchar(100)
+",GOODSSTANDARD"//规格" //Varchar(100)
+","+dataList[0].GOODSPACKPFSL_OUT+" as GOODSPACK"//入库件数" //Numeric(18,4)
+","+dataList[0].GOODSPACKPFSL_OUT+" as GOODSPACKSTOCK"//剩余件数" //Numeric(18,4)
+","+dataList[0].GOODSPACKPFSL_OUT+" as GOODSKGS"//单位重量" //Numeric(18,4)//重量1
+",CHARGEUNIT"//计费单位" //Varchar(10)
+","+dataList[0].GOODSPFSL_OUT+" as GOODSRKSL"//入库量" //Numeric(18,4)
+","+dataList[0].GOODSPFSL_OUT+" as GOODSSTOCK"//库存量" //Numeric(18,4)
+","+feedays+" as FREESTORAGEPERIOD"//免仓储期" //int
+",0 as ISLOCK"//是否锁定" //bit
+",LOCKTIME"//锁定时间" //Datetime
+",LOCKUSER"//锁定操作人" //Varchar(36)
+",0 as ISDELETE"//是否废除" //bit
+",DELETETIME"//废除时间" //Datetime
+",DELETEUSER"//废除操作人" //Varchar(36)
+",'"+Convert.ToString(Session["USERID"]).Trim()+"' as CREATEUSER"//创建人" //Varchar(36)
+",getdate() as CREATETIME"//创建时间" //Datetime
+",'"+Convert.ToString(Session["USERID"]).Trim()+"' as MODIFIEDUSER"//最后一次更新操作人" //Varchar(36)
+",getdate() as MODIFIEDTIME"//最后一次更新操作时间" //Datetime
+",'货权转移' as REMARK"//备注" //Varchar(1024)
+",CLIENTCODEOLD"//原客户编码" //varchar(20)
+",CLIENTNAME as CLIENTNAMEOLD"//原客户名称" //varchar(20)
+",KINDPKGS"//包装" //varchar(20)
+",0 as ARFEE"//应收账款 account receivable" //Numeric(18,2)
+",0 as APFEE"//应付账款 account payable" //Numeric(18,2)
+",'"+Convert.ToString(Session["COMPANYID"]).Trim()+"' as CORPID"//分公司代码" //Varchar(36)" //" //
+",0 as GOODSTHICKNESS"//厚度" //Numeric(18,4)
+",0 as GOODSWIDTH"//宽度" //Numeric(18,4)
+",0 as GOODSLENGTH"//长度" //Numeric(18,4)
+",0 as GOODSSLICE"//片数/件/包装件数" //Numeric(18,4)
+",GOODSGRADE"//品名的等级" //Varchar(50)
+",STACKLOCATION"//码放位置" //Varchar(50)
+","+dataList[0].GOODSPACKPFSL_OUT+" as GOODSPACKACTUAL"//实际件数" //Numeric(18,4)
+","+dataList[0].GOODSPFSL_OUT+" as GOODSRKSLACTUAL"//实际数量" //Numeric(18,4)
+",1 as ISCHANGE"//是否是货权转移" //bit
+",0 as MARKETVALUE"//市场货值" //Numeric(18,2)
+",0 as BANKVALUE"//银行货值" //Numeric(18,2)
+",LINENUM=(select top 1 LINENUM=isnull((select top 1 LINENUM from wms_in WITH(NOLOCK) where ASSOCIATEDNO='"+newWmsGid+"' order by LINENUM desc),0)+1)"//单个grid的行号" //Int" //" //
+",GOODSNAMEID"//品名id" //Varchar(50)" //" //
+",0 as ISLOCK2"//是否锁定" //Bit
+",XIANGHAO2"//箱号2" //varchar(100)
+",0 as JIANSHU2"//件数2" //numeric(18, 4)
+",ZHUANGXIEGONGID"//装卸工ID" //varchar(100)
+",TRUCKNO"//车牌号" //varchar(100)
+",0 as CHIMA1"//尺码1" //Float
+",0 as CHIMA2"//尺码2" //Float
+","+dataList[0].GOODSPFSL_OUT+" as ZHONGLIANG2"//重量2" //numeric(18, 4)
+",0 as SHIJIZHONGLIANG"//实际重量" //float
+",0 as SHIJICHIMA"//实际尺码" //Float
+",0 as JIANSHU1"//件数1" //numeric(18, 4)
+" from wms_in where ASSOCIATEDNO='"+dataList[0].GID.ToString()+"'";
#endregion
boolbl=T_ALL_DA.GetExecuteSqlCommand(sSQL);
}
}
#endregion
#region 提取原入库主表信息插入
varBLNOstr=",BLNO,CONTRACTNO";
varASSOCIATEDNOStr=",ASSOCIATEDNO";
if(stockType2){
BLNOstr=",'' BLNO,'' CONTRACTNO";
ASSOCIATEDNOStr=",'"+newWmsGid+"' ASSOCIATEDNO";
}
sSQL="insert into wms (GID,WMSNO,WMSDATE,CUSTOMERNAME,WMSOP,STOREMAN,CREATEUSER,CREATETIME,MODIFIEDUSER,MODIFIEDTIME,ISDELETE,DELETEUSER,DELETETIME,ARCLIENT,TRUCKNAME,ISLOCK,LOCKTIME,LOCKUSER,GOODSNAME,GOODSMODEL,CHARGEUNIT,GOODSPACK,GOODSPACKSTOCK,GOODSRKSL,GOODSSTOCK,ARFEE,APFEE,FREESTORAGEPERIOD,ASSOCIATEDNO,BLNO,CONTRACTNO,CLIENTCODEOLD,CLIENTNAMEOLD,STORAGENAME,CORPID,STARTBILLINGDATE,CUSTOMNO,CUSTNO,GOODSSTANDARD,GOODSPACKACTUAL,GOODSRKSLACTUAL,FREESTORAGEPERIODAP,STARTBILLINGDATEAP,ISCHANGE,AREANAME,MARKETVALUE,BANKVALUE,BZTCHNO,CLIENTBSNO,WHS_CODE,GOODSNAMEID,ACCDATE,FEESTATUS,ISLOCK2)"
+" select "
+" '"+newWmsGid+"' as GID"//惟一编号 Varchar(36)
+",'"+newWMSNO+"' as WMSNO"//入库单号 Varchar(100)
+",'"+headData.DODATE_OUT.ToString()+"' as WMSDATE"//入库时间 Datetime
+",'"+headData.CLIENTNAMEOLD.ToString()+"' as CUSTOMERNAME"//客户名称 Varchar(20)
+",'"+Convert.ToString(Session["SHOWNAME"]).Trim()+"' as WMSOP"//制表人 Varchar(10)
+",'"+Convert.ToString(Session["SHOWNAME"]).Trim()+"' as STOREMAN"//保管人 Varchar(10)
+",'"+Convert.ToString(Session["USERID"]).Trim()+"' as CREATEUSER"//创建人 Varchar(36)
+",getdate() as CREATETIME"//创建时间 Datetime
+",'"+Convert.ToString(Session["USERID"]).Trim()+"' as MODIFIEDUSER"//最后一次更新操作人 Varchar(36)
+",getdate() as MODIFIEDTIME"//最后一次更新操作时间 Datetime
+",0 as ISDELETE"//是否废除 Bit
+",DELETEUSER"//废除人 Varchar(36)
+",getdate() as DELETETIME"//废除时间 Datetime
+",'"+headData.CLIENTNAMEOLD.ToString()+"' as ARCLIENT"//应收账款客户名称/仓库或客户 Varchar(20)
+",'"+headData.CLIENTNAMEOLD.ToString()+"' as TRUCKNAME"//装卸队名称 /应付账款客户名称 Varchar(20)
+",0 as ISLOCK"//是否锁定 Bit/新协行tinyint
+",getdate() as LOCKTIME"//锁定时间 Datetime
+",LOCKUSER"//锁定操作人 Varchar(36)
+",GOODSNAME"//货物名称/品名 Varchar(100)
+",GOODSMODEL"//型号 Varchar(100)
+",CHARGEUNIT"//计费单位 Varchar(10)
+","+dlGOODSPACKPFSL_OUT+" as GOODSPACK"//入库件数 Numeric(18,4)
+","+dlGOODSPACKPFSL_OUT+" as GOODSPACKSTOCK"//*剩余件数(出货时减) Numeric(18,4)
+","+dlGOODSPFSL_OUT+" as GOODSRKSL"//入库量 Numeric(18,4)
+","+dlGOODSPFSL_OUT+" as GOODSSTOCK"//*库存量(出货时减) Numeric(18,4)
+",0 as ARFEE"//应收账款 account receivable Numeric(18,2)
+",0 as APFEE"//应付账款 account payable Numeric(18,2)
+",CUSTOMERNAME as CLIENTNAMEOLD"//原客户名称 Varchar(20)
+",STORAGENAME"//仓库名称 Varchar(100)
+",'"+Convert.ToString(Session["COMPANYID"]).Trim()+"' as CORPID"//分公司代码 Varchar(36)
+",'"+headData.OLDCUSTFEEDATE.AddDays(1)+"' as STARTBILLINGDATE"//应收开始计费日期 Datetime
+",CUSTOMNO"//报关单号/备案清单号 Varchar(20)
+",CUSTNO"//委托编号 Varchar(30)
+",GOODSSTANDARD"//规格 Varchar(100)
+","+dlGOODSPACKPFSL_OUT+" as GOODSPACKACTUAL"//实际件数 Numeric(18,4)
+","+dlGOODSPFSL_OUT+" as GOODSRKSLACTUAL"//实际数量 Numeric(18,4)
+","+feedays+" as FREESTORAGEPERIODAP"//应付免仓储期 int
+",'"+headData.OLDCUSTFEEDATE.AddDays(1)+"' as STARTBILLINGDATEAP"//应付开始计费日期 Datetime
+",1 as ISCHANGE"//是否是货权转移 Bit
+",AREANAME"//库位名称/储位 Varchar(100)
+",0 as MARKETVALUE"//市场货值 Numeric(18,2)
+",0 as BANKVALUE"//银行货值 Numeric(18,2)
+",BZTCHNO"//批次号/电子账册号 Varchar(100)
+",CLIENTBSNO"//不同客户的重复的出库单/客户出库仓单号 Varchar(100)
+",WHS_CODE"//库别 Varchar(20)
+",GOODSNAMEID"//品名id Varchar(50)
+",ACCDATE"//会计期间 Varchar(7)
+",0 as FEESTATUS"//费用状态 Bit
+",0 as ISLOCK2"//是否锁定 Bit
+" from wms where GID='"+WMSGID+"'";
#endregion
boolbl6=T_ALL_DA.GetExecuteSqlCommand(sSQL);
#region 入库仓储费率表
sSQL="insert into wms_rate (GID,CUSTOMERNAME,FEETYPE,FEEGRADE,FEESCALE,FEEPRICE,FEEUNIT,CREATEUSER,CREATETIME,MODIFIEDUSER,MODIFIEDTIME,REMARK,BSNO,ADDPRICE,ENDBILLINGDATE,RATETYPE,FEENAME,ISCHANGE,CAPPRICE)"
+" select newid() as GID"//惟一编号" //Varchar(36)
+",'"+headData.CLIENTNAMEOLD.ToString()+"' as CUSTOMERNAME"//客户名称" //varchar(20)
+",FEETYPE"//费用类别" //Int
+",FEEGRADE"//计费等级" //Int
+",FEESCALE"//计费区间" //Int
+",FEEPRICE"//计费单价" //Numeric(18,2)
+",FEEUNIT"//计费单位" //Varchar(10)
+",'"+Convert.ToString(Session["USERID"]).Trim()+"' as CREATEUSER"//创建人" //Varchar(20)
+",getdate() as CREATETIME"//创建时间" //Datetime
+",'"+Convert.ToString(Session["SHOWNAME"]).Trim()+"' as MODIFIEDUSER"//最后一次操作人" //Varchar(20)
+",getdate() as MODIFIEDTIME"//最后一次操作时间" //Datetime
+",'货权转移' as REMARK"//备注" //varchar(100)
+",'"+newWmsGid+"' as BSNO"//关联GID" //varchar(100)
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
else
{
if(result2.Success==true)
{
#region 出库件数 返 入库库存//需求编号:SR2017073000001
foreach(varenumValueinbodyList)
{
if(enumValue.CHARGEUNIT.ToString().Trim()=="箱")
{
stringsSQL="update wms_in set GOODSPACKSTOCK=GOODSPACK-isnull((select sum(GOODSPACKPFSL_OUT) as GOODSPACKPFSL_OUT from VW_WMS_DETAIL where GID='"+enumValue.GID.ToString().Trim()+"'),0),GOODSSTOCK=GOODSRKSL-isnull((select sum(GOODSPFSL_OUT) as GOODSPFSL_OUT from VW_WMS_DETAIL where GID='"+enumValue.GID.ToString().Trim()+"'),0) where GID='"+enumValue.GID.ToString().Trim()+"'";
boolbl=T_ALL_DA.GetExecuteSqlCommand(sSQL);
sSQL="update wms set GOODSPACKSTOCK=isnull((select sum(GOODSPACKSTOCK) as GOODSPACKSTOCK from wms_in where ASSOCIATEDNO='"+enumValue.WMSGID.ToString().Trim()+"'),0),GOODSSTOCK=isnull((select sum(GOODSSTOCK) as GOODSSTOCK from wms_in where ASSOCIATEDNO='"+enumValue.WMSGID.ToString().Trim()+"'),0) where gid='"+enumValue.WMSGID.ToString().Trim()+"'";
bl=T_ALL_DA.GetExecuteSqlCommand(sSQL);
}
else
{
stringsSQL="update wms set GOODSPACKSTOCK=GOODSPACK-isnull((select sum(GOODSPACKPFSL_OUT) as GOODSPACKPFSL_OUT from VW_WMS_DETAIL where GID='"+enumValue.GID.ToString().Trim()+"'),0),GOODSSTOCK=GOODSRKSL-isnull((select sum(GOODSPFSL_OUT) as GOODSPFSL_OUT from VW_WMS_DETAIL where GID='"+enumValue.GID.ToString().Trim()+"'),0) where GID='"+enumValue.GID.ToString().Trim()+"'";
boolbl=T_ALL_DA.GetExecuteSqlCommand(sSQL);
}
}
#endregion
#region 出库后锁定op_apply报关业务BSSTATUS字段
//foreach (var enumValue in bodyList)
//{
// if (enumValue.CHARGEUNIT.ToString().Trim() == "CBM" && enumValue.ISBONDED == 1)
// {
// string sSQL = "update op_apply set BSSTATUS=1 where WMSIN_GID='" + enumValue.GID.ToString().Trim() + "' and ISCLEAR='1' and CUSTOMTYPE='出区报关'";