diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOutputSumInterfaceAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOutputSumInterfaceAppService.cs index 471f4b43..10f04f56 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOutputSumInterfaceAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOutputSumInterfaceAppService.cs @@ -96,6 +96,61 @@ namespace Win.Sfs.SettleAccount.Entities.WMS return ApplicationConsts.SuccessStr; } + /// + /// 准时化出库主表 + /// + /// + /// + [HttpGet] + [Route("WmsOutputList")] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task> GetListAsync(string version,string begin,string end) + { + + return _dapper.GetTask(version,begin, end); + + + } + + /// + /// 准时化出库明细 + /// + /// + /// + [HttpGet] + [Route("WmsOutputDetailList")] + [UnitOfWork(false)] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task> GetDetailListAsync(string taskid,string materialCode,string billnum) + { + return _dapper.GetTaskList(taskid, materialCode, billnum); + + } + + + + [HttpGet] + [Route("WmsOutputVersionList")] + [UnitOfWork(false)] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task> GetVersionListAsync(string taskid, string materialCode, string billnum) + { + return _dapper.GetVersionList(); + + + } + + + + + + + + + + + + diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs index 329b789f..280ae562 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs @@ -47,22 +47,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string KWMENG { set; get; } [ExporterHeader(DisplayName ="工厂")] public string ZNOTE1 { set; get; } - [ExporterHeader(DisplayName ="单价")] public string ZNOTE5 { set; get; } [ExporterHeader(DisplayName ="状态")] public string STATE { set; get; } [ExporterHeader(DisplayName ="单号")] public string REMARK { set; get; } - - - - - - - - - } @@ -73,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { } - public virtual List GetTask(string begin,string end) + public virtual List GetTask(string version,string begin, string end) { var str = ""; @@ -85,45 +75,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { str += string.Format(" and AccountDate<='{0}' ", end); } - - - var sql = "SELECT TOP (1000) [wms_seq]\n" + - " ,[wms_table]\n" + - " ,[wms_table_qty]\n" + - " ,[wms_state]\n" + - " ,[remark]\n" + - " ,[createtime]\n" + - " ,[wms_domin]\n" + - " ,[SourceBillNum]\n" + - " ,[updatetime]\n" + - " ,[wms_uid]\n" + - " ,[JsonString]\n" + - " ,[AccountDate]\n" + - " FROM [TA_WMS_CTRL] WHERE {0}" + - " SourceBillNum LIKE 'S2%' order by createtime desc2"; - - sql= string.Format(sql, str); - var query= DbConnection.Query(sql); - return query.ToList(); - - - - } - - public virtual List GetTaskList(string begin, string end) - { - var str = ""; - if (!string.IsNullOrEmpty(begin)) { - str += string.Format(" and AccountDate>='{0}' ", begin); + str += string.Format(" and JsonString='{0}' ", version); } - if (!string.IsNullOrEmpty(end)) - { - str += string.Format(" and AccountDate<='{0}' ", end); - } - - var sql = "SELECT TOP (1000) [wms_seq]\n" + " ,[wms_table]\n" + " ,[wms_table_qty]\n" + @@ -147,10 +102,67 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + public virtual List GetTaskList(string taskid, string materialCode, string billnum) + { + var str = " where 1=1 "; + + if (!string.IsNullOrEmpty(taskid)) + { + str += string.Format(" and wms_seq='{0}' ", taskid); + } + if (!string.IsNullOrEmpty(materialCode)) + { + str += string.Format(" and ZVBELN='{0}' ", billnum); + } + if (!string.IsNullOrEmpty(billnum)) + { + str += string.Format(" and MATNR='{0}' ", materialCode); + } + + var sql = + " SELECT [wms_seq]\n" + + " ,[POSNR]\n" + + " ,[ZVBELN] \n" + + " ,[KUNNR] \n" + + " ,[AUGRU]\n" + + " ,[MATNR]\n" + + " ,[ZPR0]\n" + + " ,[KWMENG]\n" + + " ,[ZNOTE1]\n" + + " ,[ZNOTE4]\n" + + " ,[ZNOTE5]\n" + + " ,[STATE]\n" + + " ,[REMARK]\n" + + " FROM [TA_WMS_JSKH] {0} "; + + sql = string.Format(sql, str); + var query = DbConnection.Query(sql); + return query.ToList(); + + } + + public virtual List GetVersionList() + { + + + var sql = + " SELECT \n" + + " distinct [JsonString]\n" + + + " FROM [TA_WMS_CTRL] WHERE {0}" + + " SourceBillNum LIKE 'S2%' order by createtime desc2"; + + + var query = DbConnection.Query(sql); + return query.ToList(); + + + + }