diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Exception.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Exception.cs new file mode 100644 index 00000000..dfd38404 --- /dev/null +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Exception.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Mvc.Filters; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc.ExceptionHandling; +using Volo.Abp.Authorization; +using Volo.Abp.Validation; + +namespace Win.Sfs.SettleAccount +{ + + + + +} diff --git a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs index 50228999..f678b9e4 100644 --- a/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs +++ b/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs @@ -52,6 +52,7 @@ using Volo.Abp.Hangfire; using Win.Sfs.SettleAccount.ImportExcelCommon; using Volo.Abp.RabbitMQ; using Volo.Abp.EventBus.RabbitMq; +using Volo.Abp.AspNetCore.Mvc.ExceptionHandling; namespace Win.Sfs.SettleAccount { @@ -84,9 +85,13 @@ namespace Win.Sfs.SettleAccount public override void ConfigureServices(ServiceConfigurationContext context) { - - // System.AbpStringExtensions.ToCamelCase(System.String, Boolean)' - var configuration = context.Services.GetConfiguration(); + + + + + + // System.AbpStringExtensions.ToCamelCase(System.String, Boolean)' + var configuration = context.Services.GetConfiguration(); //文件上传大小限制 ConfigureBodyLengthLimit(context); @@ -120,6 +125,20 @@ namespace Win.Sfs.SettleAccount ConfigureBLOBTSecSummaryServices(configuration); ConfigureHangfire(context, configuration); + + + + //context.Services.Configure(options => + //{ + // options.Map("Volo.Qa:010002", System.Net.HttpStatusCode.Conflict); + + + //}); + //context.Services.Configure(options => + //{ + // options.SendExceptionsDetailsToClients = false; + //}); + /* Configure(options => { diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index 4541bfd9..45bdb3e7 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -354,6 +354,13 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices string year, string period, string version,string sapCode, string customerCode, string factory, string matialCode, string state ) { + + + + + + + //if (!_settleAccountVersionrepository.Any(p => p.Version == version)) //{ // throw new BusinessException("8989", string.Format("不存结算{0}期间",version)); 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 4c44ebca..22b295cb 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 @@ -1,6 +1,8 @@ using Dapper; +using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -16,9 +18,46 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string wms_seq { set; get; } public string wms_table { set; get; } public string wms_state { set; get; } - public string SourceBillNum { set; get; } + public string SourceBillNum { set; get; }//单号 + + public DateTime AccountDate { set; get; }//过账日期 + } + + public class TA_WMS_JSKH + { [ExporterHeader(DisplayName ="GUID",IsIgnore =true)] + public string wms_seq { set; get; } + [ExporterHeader(DisplayName = "行号")] + public string POSNR { set; get; } + [ExporterHeader(DisplayName ="结算单号")] + public string ZVBELN { set; get; } + [ExporterHeader(DisplayName ="售达方")] + public string KUNNR { set; get; } + [ExporterHeader(DisplayName ="订单原因")] + public string AUGRU { set; get; } + [ExporterHeader(DisplayName ="物料编码")] + public string MATNR { set; get; } + [ExporterHeader(DisplayName ="销售价格")] + public string ZPR0 { set; get; } + [ExporterHeader(DisplayName ="数量")] + 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; } + + + + + + + + - public DateTime AccountDate { set; get; } } @@ -35,15 +74,15 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report if (!string.IsNullOrEmpty(begin)) { - str += string.Format(" and AccountDate>={0} ", begin); + str += string.Format(" and AccountDate>='{0}' ", begin); } if (!string.IsNullOrEmpty(end)) { - str += string.Format(" and AccountDate<={0} ", end); + str += string.Format(" and AccountDate<='{0}' ", end); } - var sql = "SELECT TOP (1000) [wms_seq]\n" + + var sql = "SELECT TOP (1000) [wms_seq]\n" + " ,[wms_table]\n" + " ,[wms_table_qty]\n" + " ,[wms_state]\n" + @@ -65,6 +104,52 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } + + public virtual List GetTaskList(string begin, string end) + { + var str = ""; + + if (!string.IsNullOrEmpty(begin)) + { + str += string.Format(" and AccountDate>='{0}' ", begin); + } + 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" + + " ,[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 void InsertWmsSum(List p_list,string version,DateTime accountDate) { StringBuilder _buffer = new StringBuilder(); @@ -73,52 +158,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report foreach (var itm in p_list) { - // var sql ="INSERT INTO [dbo].[TA_WMS_JSKH]\n" + - //" ([wms_seq]\n" + - //" ,[POSNR]\n" + - //" ,[ZVBELN]\n" + - //" ,[AUART]\n" + - //" ,[VKORG]\n" + - //" ,[SPART]\n" + - //" ,[VTWEG]\n" + - //" ,[KUNNR]\n" + - //" ,[KUNNR2]\n" + - //" ,[AUGRU]\n" + - //" ,[MATNR]\n" + - //" ,[WERKS]\n" + - //" ,[LGORT]\n" + - //" ,[ZPR0]\n" + - //" ,[KWMENG]\n" + - //" ,[ZNOTE1]\n" + - //" ,[ZNOTE2]\n" + - //" ,[ZNOTE3]\n" + - //" ,[ZNOTE4]\n" + - //" ,[ZNOTE5]\n" + - //" ,[STATE]\n" + - //" ,[REMARK])\n" + - //" VALUES\n" + - //" ( '{0}' wms_seq,\n" + - //" '{1}' POSNR, \n" + - //" '{2}' ZVBELN, \n" + - //" '{3}' AUART, \n" + - //" '{4}' VKORG, \n" + - //" '{5}' SPART, \n" + - //" '{6}' VTWEG, \n" + - //" '{7}' KUNNR, \n" + - //" '{8}' KUNNR2, \n" + - //" '{9}' AUGRU, \n" + - //" '{10}' MATNR, \n" + - //" '{11}' WERKS, \n" + - //" '{12}' LGORT, \n" + - //" '{13}' ZPR0, \n" + - //" '{14}' KWMENG, \n" + - //" '{15}' ZNOTE1, \n" + - //" '{16}' ZNOTE2, \n" + - //" '{17}' ZNOTE3, \n" + - //" '{18}' ZNOTE4, \n" + - //" '{19}' ZNOTE5, \n" + - //" {20} STATE, \n" + - //" '{21}' REMARK ) \n"+ var sql = "INSERT INTO [dbo].[TA_WMS_JSKH]\n" + " ([wms_seq]\n" + " ,[POSNR]\n" + @@ -244,45 +283,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report - - - - - -//" \n" + -//"SELECT NEWID() [wms_seq] \n" + -//" ,[行号] [POSNR] \n" + -//" ,[结算单] [ZVBELN] \n" + -//" ,'ZOR1' [AUART] \n" + -//" ,'1001' [VKORG] \n" + -//" ,'00' [SPART] \n" + -//" ,[销售渠道] [VTWEG] \n" + -//" ,[客户代码] [KUNNR] \n" + -//" ,[客户代码] [KUNNR2] \n" + -//" ,[结算编码] [AUGRU] \n" + -//" ,[物料号] [MATNR] \n" + -//" ,'1000' [WERKS] \n" + -//" ,[寄售类别] [LGORT] \n" + -//" ,[实际出库数量] [KWMENG] \n" + -//" ,已出库金额 [ZPR0]\n" + -//" ,'' [ZNOTE1] \n" + -//" ,'' [ZNOTE2] \n" + -//" ,'' [ZNOTE3] \n" + -//" ,'' [ZNOTE4] \n" + -//" ,'' [ZNOTE5] \n" + -//" ,0 [STATE] \n" + -//" ,'' [REMARK] \n" + -//" \n" + -//" FROM [CPAT_WMS_TEST].[dbo].[temp1]" - - - - - - - //DbConnection.Execute("INSERT ") - - } } }