1、拉取时间范围修改

2、9宫格修改
This commit is contained in:
llllon 2025-10-29 12:27:29 +08:00
parent 56ed9d679a
commit d298fbbdf5
7 changed files with 12 additions and 11 deletions

View File

@ -64,11 +64,12 @@ public class NineGridCountJob implements IJob {
//取财务数据
int lastMonthValue = now.minusMonths(1).getMonthValue();
int year = now.minusMonths(1).getYear();
RowMap cwsj = DBSql.getMap("SELECT (DNSJLJ/10000) AS DNSJLJ FROM BO_EU_CWSJ_INTERFACE_LRZE " +
"WHERE BK = '公司整体' AND DWMC = '合并' AND YEAR = '" + year + "' AND MONTH = '" + lastMonthValue + "'");
String lastMonthValueStr = lastMonthValue<10?"0"+lastMonthValue:lastMonthValue+"";
RowMap cwsj = DBSql.getMap("SELECT (DNSJLJ) AS DNSJLJ FROM BO_EU_CWSJ_INTERFACE_LRZE " +
"WHERE BK = '公司整体' AND DWMC = '合并' AND YEAR = '" + year + "' AND MONTH = '" + lastMonthValueStr + "'");
bo.set("ZB3",cwsj==null?"":cwsj.getString("DNSJLJ"));//利润总额
//预算完成率
RowMap yswcl = DBSql.getMap("select hz.ysze AS ysze,BUDGETTARGET,(hz.ysze / mb.BUDGETTARGET)*100 AS yewcl " +
RowMap yswcl = DBSql.getMap("select hz.ysze AS ysze,BUDGETTARGET,(hz.ysze / mb.BUDGETTARGET) AS yewcl " +
" from " +
" (select sum( `BHSYYSR`) / 10000 ysze " +
" from BO_EU_XS_YESR " +
@ -79,7 +80,7 @@ public class NineGridCountJob implements IJob {
String lastMonth = now.minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
LOGGER.info("lastMonth:{}",lastMonth);
RowMap cl = DBSql.getMap("SELECT YEARS_MONTH," +
" (MAX(CASE WHEN PRODEUCT = '石膏板' THEN YTD END)/10000) AS SGBYTD," +
" (MAX(CASE WHEN PRODEUCT = '石膏板' THEN YTD END)) AS SGBYTD," +
" (MAX(CASE WHEN PRODEUCT = '轻钢龙骨' THEN YTD END)/10000) AS QGLGYTD" +
" FROM BO_EU_CLMXB" +
" WHERE YEARS_MONTH = '" + lastMonth + "' AND GONGCHANG IN ('小计(万㎡)','小计(吨)')" +

View File

@ -119,7 +119,7 @@ public class ProductionDataSyncServiceImpl implements DataSyncService {
} else {
// 计算时间范围当前日期-30天 ~ 昨天
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1); // 昨天
// cal.add(Calendar.DATE, -1); // 昨天
endDate = cal.getTime();
cal.add(Calendar.DATE, -DAYS_BACK + 1); // 30天前
startDate = cal.getTime();
@ -277,8 +277,8 @@ public class ProductionDataSyncServiceImpl implements DataSyncService {
for (int i = 0; i < timeRanges.size(); i++) {
Date[] range = timeRanges.get(i);
String startDate = simpleDateFormat2.format(range[0])+"";
String endDate = simpleDateFormat2.format(range[1])+"";
String startDate = simpleDateFormat2.format(range[0])+" 00:00:00";
String endDate = simpleDateFormat2.format(range[1])+" 00:00:00";
LOGGER.info("正在处理第 {} 个时间区间: {} 至 {}", i + 1, startDate, endDate);
if ("ORACLE".equalsIgnoreCase(DBname)) {

View File

@ -145,7 +145,7 @@ public class PurchaseDataSyncServiceImpl implements DataSyncService {
} else {
// 计算时间范围当前日期-30天 ~ 昨天
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1); // 昨天
// cal.add(Calendar.DATE, -1); // 昨天
endDate = cal.getTime();
cal.add(Calendar.DATE, -DAYS_BACK + 1); // 30天前
startDate = cal.getTime();
@ -302,8 +302,8 @@ public class PurchaseDataSyncServiceImpl implements DataSyncService {
for (int i = 0; i < timeRanges.size(); i++) {
Date[] range = timeRanges.get(i);
String startDate = simpleDateFormat2.format(range[0]);
String endDate = simpleDateFormat2.format(range[1]);
String startDate = simpleDateFormat2.format(range[0])+" 00:00:00";
String endDate = simpleDateFormat2.format(range[1])+" 00:00:00";
LOGGER.info("正在处理第 {} 个时间区间: {} 至 {}", i + 1, startDate, endDate);
if ("ORACLE".equalsIgnoreCase(DBname)) {

View File

@ -129,7 +129,7 @@ public class SaleDataSyncServiceImpl implements DataSyncService {
} else {
// 计算时间范围当前日期-30天 ~ 昨天
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1); // 昨天
// cal.add(Calendar.DATE, -1); // 昨天
endDate = cal.getTime();
cal.add(Calendar.DATE, -DAYS_BACK + 1); // 30天前
startDate = cal.getTime();