|
@ -1,6 +1,8 @@ |
|
|
using Dapper; |
|
|
using Dapper; |
|
|
|
|
|
using Magicodes.ExporterAndImporter.Core; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
@ -16,9 +18,46 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
public string wms_seq { set; get; } |
|
|
public string wms_seq { set; get; } |
|
|
public string wms_table { set; get; } |
|
|
public string wms_table { set; get; } |
|
|
public string wms_state { 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)) |
|
|
if (!string.IsNullOrEmpty(begin)) |
|
|
{ |
|
|
{ |
|
|
str += string.Format(" and AccountDate>={0} ", begin); |
|
|
str += string.Format(" and AccountDate>='{0}' ", begin); |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(end)) |
|
|
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]\n" + |
|
|
" ,[wms_table_qty]\n" + |
|
|
" ,[wms_table_qty]\n" + |
|
|
" ,[wms_state]\n" + |
|
|
" ,[wms_state]\n" + |
|
@ -65,6 +104,52 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual List<TA_WMS_CTRL> 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<TA_WMS_CTRL>(sql); |
|
|
|
|
|
return query.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void InsertWmsSum(List<WmsOutputSumReport> p_list,string version,DateTime accountDate) |
|
|
public virtual void InsertWmsSum(List<WmsOutputSumReport> p_list,string version,DateTime accountDate) |
|
|
{ |
|
|
{ |
|
|
StringBuilder _buffer = new StringBuilder(); |
|
|
StringBuilder _buffer = new StringBuilder(); |
|
@ -73,52 +158,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report |
|
|
foreach (var itm in p_list) |
|
|
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" + |
|
|
var sql = "INSERT INTO [dbo].[TA_WMS_JSKH]\n" + |
|
|
" ([wms_seq]\n" + |
|
|
" ([wms_seq]\n" + |
|
|
" ,[POSNR]\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 ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|