@ -20,6 +20,7 @@ using HcUtility.Core;
using DSWeb.SoftMng.BLL ;
using DSWeb.SoftMng.BLL ;
using System.Xml.Serialization ;
using System.Xml.Serialization ;
using System.IO ;
using System.IO ;
using DSWeb.Areas.Import.DAL.audit ;
// ReSharper disable once CheckNamespace
// ReSharper disable once CheckNamespace
namespace DSWeb.SoftMng.DAL
namespace DSWeb.SoftMng.DAL
{
{
@ -177,6 +178,7 @@ namespace DSWeb.SoftMng.DAL
new SqlParameter ( "@ClientSeqNo" , SqlDbType . NVarChar , 18 ) ,
new SqlParameter ( "@ClientSeqNo" , SqlDbType . NVarChar , 18 ) ,
new SqlParameter ( "@ApplyType" , SqlDbType . TinyInt , 4 )
new SqlParameter ( "@ApplyType" , SqlDbType . TinyInt , 4 )
} ;
} ;
parameters [ 0 ] . Value = model . GID ? ? ( Object ) DBNull . Value ;
parameters [ 0 ] . Value = model . GID ? ? ( Object ) DBNull . Value ;
@ -302,6 +304,7 @@ namespace DSWeb.SoftMng.DAL
parameters [ 120 ] . Value = model . BillState ? ? ( Object ) DBNull . Value ;
parameters [ 120 ] . Value = model . BillState ? ? ( Object ) DBNull . Value ;
parameters [ 121 ] . Value = model . ClientSeqNo ? ? ( Object ) DBNull . Value ;
parameters [ 121 ] . Value = model . ClientSeqNo ? ? ( Object ) DBNull . Value ;
parameters [ 122 ] . Value = model . ApplyType ? ? ( Object ) DBNull . Value ;
parameters [ 122 ] . Value = model . ApplyType ? ? ( Object ) DBNull . Value ;
//parameters[123].Value = model.ApplyType_Text ?? (Object)DBNull.Value;
//parameters[123].Value = model.ApplyType_Text ?? (Object)DBNull.Value;
return DbHelperSQL . ExecuteSql ( strSql . ToString ( ) , parameters ) ;
return DbHelperSQL . ExecuteSql ( strSql . ToString ( ) , parameters ) ;
}
}
@ -311,12 +314,24 @@ namespace DSWeb.SoftMng.DAL
/// </summary>
/// </summary>
public int UpdateBillState ( string gid , string state , string reason )
public int UpdateBillState ( string gid , string state , string reason )
{
{
StringBuilder strSql = new StringBuilder ( ) ;
/ *
this . storeBillState . add ( { "FSTATUS" : "N" , "NAME" : "新建" } ) ;
this . storeBillState . add ( { "FSTATUS" : "S" , "NAME" : "审核" } ) ;
this . storeBillState . add ( { "FSTATUS" : "P" , "NAME" : "复核" } ) ;
this . storeBillState . add ( { "FSTATUS" : "L" , "NAME" : "已上传" } ) ;
this . storeBillState . add ( { "FSTATUS" : "R" , "NAME" : "驳回提交" } ) ;
this . storeBillState . add ( { "FSTATUS" : "" , "NAME" : "全部" } ) ;
* /
StringBuilder strSql = new StringBuilder ( ) ;
strSql . Append ( "update DecHead set " ) ;
strSql . Append ( "update DecHead set " ) ;
strSql . Append ( " BillState = '" + state + "'" ) ;
strSql . Append ( " BillState = '" + state + "'" ) ;
if ( state = = "R" )
if ( state = = "R" )
strSql . Append ( ",RejectReason='" + reason + "'" ) ;
strSql . Append ( ",RejectReason='" + reason + "'" ) ;
if ( state = = "P" ) //20230831 如果复核完成 增加记录复核时间
strSql . Append ( ",AuditDate=getdate()" ) ;
strSql . Append ( " where GID = '" + gid + "' " ) ;
strSql . Append ( " where GID = '" + gid + "' " ) ;
return DbHelperSQL . ExecuteSql ( strSql . ToString ( ) ) ;
return DbHelperSQL . ExecuteSql ( strSql . ToString ( ) ) ;
}
}
@ -451,6 +466,7 @@ namespace DSWeb.SoftMng.DAL
strSql . Append ( " Insp_cert = @Insp_cert," ) ;
strSql . Append ( " Insp_cert = @Insp_cert," ) ;
strSql . Append ( " BillState = @BillState" ) ;
strSql . Append ( " BillState = @BillState" ) ;
strSql . Append ( " ,ApplyType = @ApplyType" ) ;
strSql . Append ( " ,ApplyType = @ApplyType" ) ;
//strSql.Append(" ApplyType_Text = @ApplyType_Text");
//strSql.Append(" ApplyType_Text = @ApplyType_Text");
strSql . Append ( " where GID=@GID " ) ;
strSql . Append ( " where GID=@GID " ) ;
SqlParameter [ ] parameters = {
SqlParameter [ ] parameters = {
@ -700,6 +716,7 @@ namespace DSWeb.SoftMng.DAL
parameters [ 119 ] . Value = model . Insp_cert ? ? ( Object ) DBNull . Value ;
parameters [ 119 ] . Value = model . Insp_cert ? ? ( Object ) DBNull . Value ;
parameters [ 120 ] . Value = model . BillState ? ? ( Object ) DBNull . Value ;
parameters [ 120 ] . Value = model . BillState ? ? ( Object ) DBNull . Value ;
parameters [ 121 ] . Value = model . ApplyType ? ? ( Object ) DBNull . Value ;
parameters [ 121 ] . Value = model . ApplyType ? ? ( Object ) DBNull . Value ;
//parameters[122].Value = model.ApplyType_Text ?? (Object)DBNull.Value;
//parameters[122].Value = model.ApplyType_Text ?? (Object)DBNull.Value;
return DbHelperSQL . ExecuteSql ( strSql . ToString ( ) , parameters ) ;
return DbHelperSQL . ExecuteSql ( strSql . ToString ( ) , parameters ) ;
}
}
@ -833,7 +850,7 @@ namespace DSWeb.SoftMng.DAL
}
}
* /
* /
var strSql = new StringBuilder ( ) ;
var strSql = new StringBuilder ( ) ;
strSql . Append ( "select d.GID, d.BSNO,d.IEFlag,d.Type,d.EdiId,d.Risk,d.CopCode,d.CopName,d.PDate,d.TypistNo,d.InputerName,d.PartenerID,d.TgdNo, d.DataSource,d.DeclTrnRel,d.ChkSurety,d.CopCodeScc,d.CheckFlow,d.TaxAaminMark,d.EntyPortCode,d.BLNo,d.BillType,d.ApprNo,d.CustomMaster, d.CustomMaster_Text,d.AgentStatus,d.SeqNo,d.PreEntryId,d.EntryId,d.IEPort,d.IEPort_Text,d.ManualNo,d.ContrNo,d.IEDate,d.DDate,d.TradeCoScc, d.TradeCode,d.TradeCiqCode,d.TradeName,d.OverseasConsignorCode,d.OverseasConsignorCname,d.OverseasConsignorEname,d.OverseasConsignorAddr, d.OverseasConsigneeCode,d.OverseasConsigneeEname,d.DomesticConsigneeEname,d.EdiRemark2,d.EdiRemark,d.OwnerCodeScc,d.OwnerCode,d. OwnerCiqCode,d.OwnerName,d.AgentCodeScc,d.AgentCode,d.DeclCiqCode,d.AgentName,d.TrafMode,d.TrafMode_Text,d.TrafName,d.NativeVoyageNo, d.BillNo,d.TradeMode,d.TradeMode_Text,d.CutMode,d.CutMode_Text,d.LicenseNo,d.TradeCountry,d.TradeCountry_Text,d.DistinatePort, d.DistinatePort_Text,d.TransMode,d.TransMode_Text,d.FeeMark,d.FeeRate,d.FeeCurr,d.FeeCurr_Text,d.InsurMark,d.InsurRate,d.InsurCurr, d.InsurCurr_Text,d.OtherMark,d.OtherRate,d.OtherCurr,d.OtherCurr_Text,d.PackNo,d.WrapType,d.WrapType_Text,d.GrossWet,d.NetWt,d.TradeAreaCode,d.TradeAreaCode_Text,d.ContaCount,d.AttaDocuCdstr,d.GoodsPlace,d.DespPortCode,d.DespPortCode_Text,d.EntryType,d.EntryType_Text,d.NoteS, d.MarkNo,d.OrgCode,d.OrgCode_Text,d.VsaOrgCode,d.VsaOrgCode_Text,d.InspOrgCode,d.InspOrgCode_Text,d.PurpOrgCode,d.PurpOrgCode_Text, d.CorrelationNo,d.CorrelationReasonFlag,d.CorrelationReasonFlag_Text,d.DespDate,d.CmplDschrgDt,d.OrigBoxFlag,d.SpecDeclFlag, d.SpecDeclFlag_Text,d.PromiseItmes,d.DeclareName,d.NoOtherPack,d.Insp_cert,d.BillState,o.CUSTNO,o.CUSTOMNO,o.MBLNO,o.CUSTOMERNAME,o.VESSEL,o.VOYNO,o.ETD,o.ETA ,d.ClientSeqNo ,d.ApplyType ") ;
strSql . Append ( "select d.GID, d.BSNO,d.IEFlag,d.Type,d.EdiId,d.Risk,d.CopCode,d.CopName,d.PDate,d.TypistNo,d.InputerName,d.PartenerID,d.TgdNo, d.DataSource,d.DeclTrnRel,d.ChkSurety,d.CopCodeScc,d.CheckFlow,d.TaxAaminMark,d.EntyPortCode,d.BLNo,d.BillType,d.ApprNo,d.CustomMaster, d.CustomMaster_Text,d.AgentStatus,d.SeqNo,d.PreEntryId,d.EntryId,d.IEPort,d.IEPort_Text,d.ManualNo,d.ContrNo,d.IEDate,d.DDate,d.TradeCoScc, d.TradeCode,d.TradeCiqCode,d.TradeName,d.OverseasConsignorCode,d.OverseasConsignorCname,d.OverseasConsignorEname,d.OverseasConsignorAddr, d.OverseasConsigneeCode,d.OverseasConsigneeEname,d.DomesticConsigneeEname,d.EdiRemark2,d.EdiRemark,d.OwnerCodeScc,d.OwnerCode,d. OwnerCiqCode,d.OwnerName,d.AgentCodeScc,d.AgentCode,d.DeclCiqCode,d.AgentName,d.TrafMode,d.TrafMode_Text,d.TrafName,d.NativeVoyageNo, d.BillNo,d.TradeMode,d.TradeMode_Text,d.CutMode,d.CutMode_Text,d.LicenseNo,d.TradeCountry,d.TradeCountry_Text,d.DistinatePort, d.DistinatePort_Text,d.TransMode,d.TransMode_Text,d.FeeMark,d.FeeRate,d.FeeCurr,d.FeeCurr_Text,d.InsurMark,d.InsurRate,d.InsurCurr, d.InsurCurr_Text,d.OtherMark,d.OtherRate,d.OtherCurr,d.OtherCurr_Text,d.PackNo,d.WrapType,d.WrapType_Text,d.GrossWet,d.NetWt,d.TradeAreaCode,d.TradeAreaCode_Text,d.ContaCount,d.AttaDocuCdstr,d.GoodsPlace,d.DespPortCode,d.DespPortCode_Text,d.EntryType,d.EntryType_Text,d.NoteS, d.MarkNo,d.OrgCode,d.OrgCode_Text,d.VsaOrgCode,d.VsaOrgCode_Text,d.InspOrgCode,d.InspOrgCode_Text,d.PurpOrgCode,d.PurpOrgCode_Text, d.CorrelationNo,d.CorrelationReasonFlag,d.CorrelationReasonFlag_Text,d.DespDate,d.CmplDschrgDt,d.OrigBoxFlag,d.SpecDeclFlag, d.SpecDeclFlag_Text,d.PromiseItmes,d.DeclareName,d.NoOtherPack,d.Insp_cert,d.BillState,o.CUSTNO,o.CUSTOMNO,o.MBLNO,o.CUSTOMERNAME,o.VESSEL,o.VOYNO,o.ETD,o.ETA ,d.ClientSeqNo ,d.ApplyType ,d.AuditDate ") ;
strSql . Append ( ",s.COMPOP,s.COMPTIME from DecHead d inner join op_apply o on o.bsno = d.BSNO " ) ;
strSql . Append ( ",s.COMPOP,s.COMPTIME from DecHead d inner join op_apply o on o.bsno = d.BSNO " ) ;
strSql . Append ( " left join (SELECT [ST_ID],[BSNO],[STATUS],[ISCOMP],[COMPTIME],[COMPOP],[REMARK],[INPUTBY],[INPUTTIME],[ORDNO],[STATUS_OPSEAE],[STTYPE],[ISOPEN] from (" ) ;
strSql . Append ( " left join (SELECT [ST_ID],[BSNO],[STATUS],[ISCOMP],[COMPTIME],[COMPOP],[REMARK],[INPUTBY],[INPUTTIME],[ORDNO],[STATUS_OPSEAE],[STTYPE],[ISOPEN] from (" ) ;
strSql . Append ( "SELECT [ST_ID],[BSNO],[STATUS],[ISCOMP],[COMPTIME],[COMPOP],[REMARK],[INPUTBY],[INPUTTIME],[ORDNO],[STATUS_OPSEAE],[STTYPE],[ISOPEN], row_number() over(partition by BSNO ORDER BY INPUTTIME desc) as rowno" ) ;
strSql . Append ( "SELECT [ST_ID],[BSNO],[STATUS],[ISCOMP],[COMPTIME],[COMPOP],[REMARK],[INPUTBY],[INPUTTIME],[ORDNO],[STATUS_OPSEAE],[STTYPE],[ISOPEN], row_number() over(partition by BSNO ORDER BY INPUTTIME desc) as rowno" ) ;
@ -1936,6 +1953,10 @@ namespace DSWeb.SoftMng.DAL
{
{
model . COMPTIME = Convert . ToDateTime ( row [ "COMPTIME" ] ) . ToString ( "yyyy-MM-dd hh:mm:ss" ) ;
model . COMPTIME = Convert . ToDateTime ( row [ "COMPTIME" ] ) . ToString ( "yyyy-MM-dd hh:mm:ss" ) ;
}
}
if ( row [ "AuditDate" ] ! = DBNull . Value )
{
model . AuditDate = Convert . ToDateTime ( row [ "AuditDate" ] ) . ToString ( "yyyy-MM-dd hh:mm:ss" ) ;
}
}
}
headList . Add ( model ) ;
headList . Add ( model ) ;
}
}