using Kingdee.BOS;
|
using Kingdee.BOS.App.Data;
|
using Kingdee.BOS.Contracts;
|
using Kingdee.BOS.Contracts.Report;
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
using Kingdee.BOS.Core.List;
|
using Kingdee.BOS.Core.Report;
|
using Kingdee.BOS.Orm.DataEntity;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using Kingdee.BOS.ServiceHelper;
|
using Kingdee.BOS.Util;
|
using ZD.Cloud.Logger;
|
|
namespace zymes_Project.Report
|
{
|
/// <summary>
|
/// 供应商送料计划订单明细列表
|
/// </summary>
|
[Description("供应商送料计划订单明细列表")]
|
[HotUpdate]
|
public class FeedPlanOrderDetailReport : SysReportBaseService
|
{
|
|
public override void Initialize()
|
{
|
base.Initialize();
|
// 简单账表类型:普通、树形、分页
|
this.ReportProperty.ReportType = ReportType.REPORTTYPE_NORMAL;
|
this.IsCreateTempTableByPlugin = true;
|
//取代码中配置的列
|
this.ReportProperty.IsUIDesignerColumns = false;
|
//是否分组汇总
|
this.ReportProperty.IsGroupSummary = true;
|
}
|
|
public override ReportHeader GetReportHeaders(IRptParams filter)
|
{
|
ReportHeader header = new ReportHeader();
|
header.AddChild("FIDENTITYID", new LocaleValue("序号"));
|
header.AddChild("Fcolumn2", new LocaleValue("日期"));
|
header.AddChild("Fcolumn3", new LocaleValue("模块"));
|
header.AddChild("Fcolumn4", new LocaleValue("部门 / 供应商 / 仓库"));
|
header.AddChild("Fcolumn5", new LocaleValue("旧物料代码"));
|
header.AddChild("Fcolumn6", new LocaleValue("物料代码"));
|
header.AddChild("Fcolumn7", new LocaleValue("物料名称"));
|
header.AddChild("Fcolumn8", new LocaleValue("规格型号"));
|
header.AddChild("Fcolumn9", new LocaleValue("数量"));
|
header.AddChild("Fcolumn10", new LocaleValue("厂区"));
|
// header.AddChild("Fcolumn11", new LocaleValue("单据号"));
|
// header.AddChild("Fcolumn12", new LocaleValue("销售订单号"));
|
return header;
|
}
|
|
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
|
{
|
base.BuilderReportSqlAndTempTable(filter, tableName);
|
|
DynamicObject customFil = filter.FilterParameter.CustomFilter;
|
string FMateriel = ""; //物料
|
string FMaterielName = "";//物料名称
|
string FModel = "";//规格型号
|
string FSupplier = "0";//供应商 默认值为0
|
string FOrgId = "100092"; //组织(默认取值当前组织)
|
string FFactoryArea = ""; //厂区
|
string FBuyer = ""; //采购员
|
string FWarehouse = "";//仓库
|
bool FIsMainMaterial = false;//是否主料
|
string saleOrderNo = "";//采购订单号
|
//5fe5d920a3f2bf
|
//5fe5d926a3f2c1
|
//5fe5d92ca3f2c3
|
|
|
|
if (((DynamicObject)customFil["FMateriel"]) != null)
|
{
|
FMateriel = ((DynamicObject)customFil["FMateriel"])["Number"].ToString();
|
FMaterielName = ((DynamicObject)customFil["FMateriel"])["Name"].ToString();
|
FModel = ((DynamicObject)customFil["FMateriel"])["Specification"].ToString();
|
|
}
|
if (((DynamicObject)customFil["FSupplier"]) != null)
|
{
|
FSupplier = ((DynamicObject)customFil["FSupplier"])["Number"].ToString();
|
}
|
if (((DynamicObject)customFil["FFactoryArea"]) != null)
|
{
|
FFactoryArea = ((DynamicObject)customFil["FFactoryArea"])["Id"].ToString();
|
}
|
if ((customFil["FSaleOrderNo"]) != null)
|
{
|
saleOrderNo = customFil["FSaleOrderNo"].ToString();
|
}
|
if (((DynamicObject)customFil["FOrgId"]) != null)
|
{
|
FOrgId = ((DynamicObject)customFil["FOrgId"])["Id"].ToString();
|
}
|
//跳转框赋值 (物料编码 + 仓库FentryID)
|
LogHelper.Info("物料:"+ FMateriel);
|
LogHelper.Info("厂区:"+FFactoryArea);
|
|
if ((customFil["Fmaterial"]) != null && FMateriel == "")
|
{
|
FMateriel = customFil["Fmaterial"].ToString();
|
LogHelper.Info("FMateriel:" + FMateriel);
|
|
}
|
if ((customFil["Fstockid"]) != null && FFactoryArea == "")
|
{
|
FFactoryArea = customFil["Fstockid"].ToString();
|
LogHelper.Info("FFactoryArea:" + FFactoryArea);
|
|
}
|
string sql = string.Format(@"/*dialect*/
|
exec [h_p_Cg_SupSendGoodsPlanZSFMXDD] '{0}','{1}','{2}','{3}','{4}','{5}','{6}' ,'{7}'
|
", FSupplier, FOrgId, FFactoryArea, FMateriel, FMaterielName, FModel, saleOrderNo, tableName);
|
LogHelper.Info(sql);
|
DBUtils.Execute(this.Context, sql);
|
//EXEC h_p_Cg_SupSendGoodsPlanZSFMXDD 0,100092,'5fe5d926a3f2c1','1.00.002.1647','','','W595801'
|
}
|
public override void CloseReport()
|
{
|
|
}
|
}
|
}
|