This commit is contained in:
李狗蛋
2025-07-02 10:10:05 +08:00
parent 5088e60df2
commit 4c8304f04f
39 changed files with 437 additions and 1013 deletions

View File

@@ -59,7 +59,7 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
//单据体
var list = reportModel.DataSource.Rows;
string sqlTest = string.Format(@"/*dialect*/Select FAmount,FDate From MBBA_t_Cust100006 Where Month(FDATE) = Month(DATEADD(MONTH, -1, '{0}'))", fDate);
string sqlTest = string.Format(@"/*dialect*/SELECT * FROM YingShouZhanKuanMX_GZTH");
var sqlTestList = DBUtils.ExecuteDynamicObject(Context, sqlTest);
@@ -69,8 +69,8 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
if (sqlTestList.Count() > 0)
{
Num = 1;
fAmount = Math.Round(Convert.ToDecimal(sqlTestList[0]["FAmount"]),2);
fDate2 = sqlTestList[0]["FDate"].ToString().Split(' ')[0];
fAmount = Math.Round(Convert.ToDecimal(sqlTestList[0]["OrderAmount"]),2);
fDate2 = sqlTestList[0]["Date"].ToString().Split(' ')[0];
}
Main(filePath, fClient, fDate, fProject, list, Num, fAmount, fDate2, Context);
@@ -524,10 +524,17 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
int lastCol = 5; // 合并到第三列0-based index
int lastCol2 = 9; // 合并到第三列0-based index
int lastCol3 = 3; // 合并到第三列0-based index
// 创建CellRangeAddress对象
CellRangeAddress cellRangeAddress = new CellRangeAddress(firstRow, lastRow, firstCol, lastCol);
CellRangeAddress cellRangeAddress2 = new CellRangeAddress(firstRow, lastRow, firstCol2, lastCol2);
CellRangeAddress cellRangeAddress3 = new CellRangeAddress(firstRow, lastRow, firstCol3, lastCol3);
// 检查并移除重叠的合并区域
RemoveOverlappingMergedRegions(sheet, cellRangeAddress);
RemoveOverlappingMergedRegions(sheet, cellRangeAddress2);
RemoveOverlappingMergedRegions(sheet, cellRangeAddress3);
// 合并单元格
sheet.AddMergedRegion(cellRangeAddress);
sheet.AddMergedRegion(cellRangeAddress2);
@@ -551,6 +558,18 @@ namespace Pilot.Report.Exploitation.AccountsReceivable
}
private static void RemoveOverlappingMergedRegions(ISheet sheet, CellRangeAddress newRegion)
{
for (int i = sheet.NumMergedRegions - 1; i >= 0; i--)
{
CellRangeAddress existingRegion = sheet.GetMergedRegion(i);
if (existingRegion.Intersects(newRegion))
{
sheet.RemoveMergedRegion(i);
}
}
}
public static string ToChineseNumber(decimal number, Kingdee.BOS.Context Context)
{
//Select top 1 dbo.ConvertAmountToChineseWords(12345.14) as 'PriceText' From T_SAL_ORDER