提交 7ea67311 authored 作者: 谭富强's avatar 谭富强

1

上级 0a1a4ef2
......@@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\..\新秀丽\XXL\k3cloud\bin\</OutputPath>
<OutputPath>..\..\..\..\新秀丽\XXL\k3cloud\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
......
......@@ -37,16 +37,16 @@ namespace LQKJ.K3.CZXT.Pluglus
base.BuilderReportSqlAndTempTable(filter, strTable);
//对初步的查询结果进行处理,然后写回基类默认的存放查询结果的临时表
StringBuilder sb = new StringBuilder();
string Sql = @"/*dialect*/SELECT T1.*,T2.F_LQKJ_Unitvolume AS F_LQKJ_Unitvolume--单位体积
,T1.FSTOCKJCQTY * T2.F_LQKJ_Unitvolume AS F_LQKJ_Totalvolume --总体积
string Sql = @"/*dialect*/SELECT T1.*,CASE WHEN T2.F_LQKJ_Unitvolume = 0 THEN 1 ELSE T2.F_LQKJ_Unitvolume END AS F_LQKJ_Unitvolume--单位体积
,T1.FSTOCKJCQTY * CASE WHEN T2.F_LQKJ_Unitvolume = 0 THEN 1 ELSE T2.F_LQKJ_Unitvolume END AS F_LQKJ_Totalvolume --总体积
,T2.F_LQKJ_Warehouserent AS F_LQKJ_Warehouserent--仓租单价
,T2.F_LQKJ_Warehouserent * (T1.FSTOCKJCQTY * T2.F_LQKJ_Unitvolume) AS F_LQKJ_Warehouse --仓租
,T2.F_LQKJ_Warehouserent * (T1.FSTOCKJCQTY * CASE WHEN T2.F_LQKJ_Unitvolume = 0 THEN 1 ELSE T2.F_LQKJ_Unitvolume END) AS F_LQKJ_Warehouse --仓租
,T2.F_LQKJ_Unloadingfee AS F_LQKJ_Unloadingfee --卸车单价
,T2.F_LQKJ_Unloadingfee * (T1.FSTOCKJCQTY * T2.F_LQKJ_Unitvolume) AS F_LQKJ_Unloading --卸车费
,T2.F_LQKJ_Unloadingfee * (T1.FSTOCKJCQTY * CASE WHEN T2.F_LQKJ_Unitvolume = 0 THEN 1 ELSE T2.F_LQKJ_Unitvolume END) AS F_LQKJ_Unloading --卸车费
,T2.F_LQKJ_Loadingfee AS F_LQKJ_Loadingfee --装车单价
,T2.F_LQKJ_Loadingfee * (T1.FSTOCKJCQTY * T2.F_LQKJ_Unitvolume) AS F_LQKJ_Loading--装车费
,T2.F_LQKJ_Loadingfee * (T1.FSTOCKJCQTY * CASE WHEN T2.F_LQKJ_Unitvolume = 0 THEN 1 ELSE T2.F_LQKJ_Unitvolume END) AS F_LQKJ_Loading--装车费
,T2.F_LQKJ_Sortingfees AS F_LQKJ_Sortingfees--分拣费单价
,T2.F_LQKJ_Sortingfees * (T1.FSTOCKJCQTY * T2.F_LQKJ_Unitvolume) AS F_LQKJ_Sorting--分拣费
,T2.F_LQKJ_Sortingfees * (T1.FSTOCKJCQTY * CASE WHEN T2.F_LQKJ_Unitvolume = 0 THEN 1 ELSE T2.F_LQKJ_Unitvolume END) AS F_LQKJ_Sorting--分拣费
INTO {0}
FROM {1} T1
LEFT JOIN LQKJ_SettupParameters T2 on 1=1";
......
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace LQKJ.K3.CZXT.Pluglus
......@@ -13,37 +15,95 @@ namespace LQKJ.K3.CZXT.Pluglus
{
public override void ButtonClick(ButtonClickEventArgs e)
{
List<string> combinedMessages = new List<string>();
if (e.Key == "F_LQKJ_CONFIRMREVISE")
{
// 创建整单错误信息列表
List<string> errorMessagest = new List<string>();
List<string> stringst = new List<string>();
bool hasChanges = false;
DynamicObject rowData = this.View.Model.DataObject;
decimal F_LQKJ_Unitvolume = Convert.ToDecimal(rowData["F_LQKJ_Unitvolume"]);//单位体积
decimal F_LQKJ_Warehouserent = Convert.ToDecimal(rowData["F_LQKJ_Warehouserent"]);//仓租单价
decimal F_LQKJ_Unloadingfee = Convert.ToDecimal(rowData["F_LQKJ_Unloadingfee"]);//卸车费单价
decimal F_LQKJ_Loadingfee = Convert.ToDecimal(rowData["F_LQKJ_Loadingfee"]);//装车费单价
decimal F_LQKJ_Sortingfees = Convert.ToDecimal(rowData["F_LQKJ_Sortingfees"]);//分拣费单价
// 创建表的SQL语句(如果表不存在)
//string createTableSql = @"/*dialect*/IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = 'LQKJ_SettupParameters' )
// BEGIN
// CREATE TABLE LQKJ_SettupParameters (
// Id INT PRIMARY KEY IDENTITY(1,1),
// F_LQKJ_Unitvolume DECIMAL(18,2),
// F_LQKJ_Warehouserent DECIMAL(18,2),
// F_LQKJ_Unloadingfee DECIMAL(18,2),
// F_LQKJ_Loadingfee DECIMAL(18,2),
// F_LQKJ_Sortingfees DECIMAL(18,2),
// CreateDate DATETIME DEFAULT GETDATE()
// );
// INSERT INTO LQKJ_SettupParameters (F_LQKJ_Unitvolume, F_LQKJ_Warehouserent, F_LQKJ_Unloadingfee, F_LQKJ_Loadingfee, F_LQKJ_Sortingfees)
// VALUES (0, 0, 0, 0, 0);
// END";
// 执行创建表的SQL语句
//DBUtils.Execute(this.Context, createTableSql);
string SQL = $@"UPDATE LQKJ_SettupParameters SET F_LQKJ_Unitvolume={F_LQKJ_Unitvolume}, F_LQKJ_Warehouserent={F_LQKJ_Warehouserent}, F_LQKJ_Unloadingfee={F_LQKJ_Unloadingfee}, F_LQKJ_Loadingfee={F_LQKJ_Loadingfee}, F_LQKJ_Sortingfees={F_LQKJ_Sortingfees} WHERE Id=1";
// 执行添加数据的SQL语句
DBUtils.Execute(this.Context, SQL);
this.View.Close();
this.View.ParentFormView.UpdateView();
//判断所有字段是否为0
if(F_LQKJ_Unitvolume == 0)
{
errorMessagest.Add("单位体积");
hasChanges = true;
}
if (F_LQKJ_Warehouserent == 0)
{
errorMessagest.Add("仓租单价");
hasChanges = true;
}
if (F_LQKJ_Unloadingfee == 0)
{
errorMessagest.Add("卸车费单价");
hasChanges = true;
}
if (F_LQKJ_Loadingfee == 0)
{
errorMessagest.Add("装车费单价");
hasChanges = true;
}
if (F_LQKJ_Sortingfees == 0)
{
errorMessagest.Add("分拣费单价");
hasChanges = true;
}
if (hasChanges)
{
string errorMessage = "";
errorMessage += string.Join("、", errorMessagest);
stringst.Add(errorMessage);
}
if((F_LQKJ_Unitvolume + F_LQKJ_Warehouserent + F_LQKJ_Unloadingfee+ F_LQKJ_Loadingfee+ F_LQKJ_Sortingfees) ==0)
{
combinedMessages.Add($"当前所有参数都为0");
}
else if((F_LQKJ_Unitvolume + F_LQKJ_Warehouserent + F_LQKJ_Unloadingfee + F_LQKJ_Loadingfee + F_LQKJ_Sortingfees) > 0 && stringst.Count > 0)
{
combinedMessages.Add($"{string.Join("\n", stringst)}为0");
}
if (combinedMessages.Count > 0)
{
this.View.ShowMessage($"{string.Join("\n", combinedMessages)},是否继续确认修改!",
//提示信息:是、否
MessageBoxOptions.YesNo,
new Action<MessageBoxResult>((result) =>
{
if (result == MessageBoxResult.Yes)
{
//如果选择的是,给备注赋值,是
string SQL = $@"UPDATE LQKJ_SettupParameters SET F_LQKJ_Unitvolume={F_LQKJ_Unitvolume}, F_LQKJ_Warehouserent={F_LQKJ_Warehouserent}, F_LQKJ_Unloadingfee={F_LQKJ_Unloadingfee}, F_LQKJ_Loadingfee={F_LQKJ_Loadingfee}, F_LQKJ_Sortingfees={F_LQKJ_Sortingfees} WHERE Id=1";
// 执行添加数据的SQL语句
DBUtils.Execute(this.Context, SQL);
this.View.Close();
this.View.ParentFormView.UpdateView();
}
else if (result == MessageBoxResult.No)
{
//如果选择的否,给备注赋值,否
//this.View.Close();
return;
}
// 清空 combinedMessages 列表
combinedMessages.Clear();
}));
}
else
{
//如果选择的是,给备注赋值,是
string SQL = $@"UPDATE LQKJ_SettupParameters SET F_LQKJ_Unitvolume={F_LQKJ_Unitvolume}, F_LQKJ_Warehouserent={F_LQKJ_Warehouserent}, F_LQKJ_Unloadingfee={F_LQKJ_Unloadingfee}, F_LQKJ_Loadingfee={F_LQKJ_Loadingfee}, F_LQKJ_Sortingfees={F_LQKJ_Sortingfees} WHERE Id=1";
// 执行添加数据的SQL语句
DBUtils.Execute(this.Context, SQL);
this.View.Close();
this.View.ParentFormView.UpdateView();
}
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论