|
|
@@ -143,7 +143,7 @@ select b.code as code, min(a.shtime) as shtime
|
|
|
INSERT INTO dwd_t8_material_online_cycle
|
|
|
(tenant_id, factory_id, biz_date, source_ztid, item_code, online_date, receipt_date, cycle_days, batch_id, create_time)
|
|
|
VALUES
|
|
|
- (0, 1, @bizDate, @ztid, @itemCode, @online, @receipt, @cycleDays, @batchId, @now)
|
|
|
+ (1300000000001, 1, @bizDate, @ztid, @itemCode, @online, @receipt, @cycleDays, @batchId, @now)
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
online_date=VALUES(online_date), receipt_date=VALUES(receipt_date),
|
|
|
cycle_days=VALUES(cycle_days), batch_id=VALUES(batch_id), update_time=@now",
|
|
|
@@ -220,7 +220,7 @@ INSERT INTO dwd_t8_material_online_fulfillment
|
|
|
(tenant_id, factory_id, biz_date, source_ztid, work_order_no,
|
|
|
before_kgdate_rows, total_rows, fulfillment_rate, batch_id, create_time)
|
|
|
VALUES
|
|
|
- (0, 1, @bizDate, @ztid, @workOrderNo, @beforeKg, @total, @rate, @batchId, @now)
|
|
|
+ (1300000000001, 1, @bizDate, @ztid, @workOrderNo, @beforeKg, @total, @rate, @batchId, @now)
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
before_kgdate_rows=VALUES(before_kgdate_rows),
|
|
|
total_rows=VALUES(total_rows),
|
|
|
@@ -301,7 +301,7 @@ INSERT INTO dwd_t8_material_warehouse_efficiency
|
|
|
(tenant_id, factory_id, biz_month, source_ztid, period_start, period_end,
|
|
|
online_qty, warehouse_headcount, efficiency, denominator_status, batch_id, create_time)
|
|
|
VALUES
|
|
|
- (0, 1, @bizMonth, @ztid, @periodStart, @periodEnd,
|
|
|
+ (1300000000001, 1, @bizMonth, @ztid, @periodStart, @periodEnd,
|
|
|
@onlineQty, @headcount, @efficiency, @denomStatus, @batchId, @now)
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
period_start=VALUES(period_start), period_end=VALUES(period_end),
|
|
|
@@ -365,7 +365,7 @@ INSERT INTO dwd_t8_material_inventory_turnover
|
|
|
warehouse_code, warehouse_name, item_code, item_name, category_code, category_name,
|
|
|
avg_inventory_value, monthly_outbound_cost, turnover_days, batch_id, create_time)
|
|
|
VALUES
|
|
|
- (0, 1, @bizMonth, @ztid, @startYm, @endYm,
|
|
|
+ (1300000000001, 1, @bizMonth, @ztid, @startYm, @endYm,
|
|
|
@ckcode, @ckname, @itemCode, @itemName, @pcode, @pname,
|
|
|
@je3, @je2, @turnoverDays, @batchId, @now)
|
|
|
ON DUPLICATE KEY UPDATE
|
|
|
@@ -422,7 +422,7 @@ ON DUPLICATE KEY UPDATE
|
|
|
// FIX-2:截断时分秒(月度 KPI 入参可能为 YYYY-MM-DD 23:59:59),保证 SELECT WHERE biz_date=@BizDate 与 DB date 列匹配,避免重复 INSERT。
|
|
|
bizDate = bizDate.Date;
|
|
|
var existingId = await _db.Ado.GetLongAsync(
|
|
|
- "SELECT IFNULL((SELECT id FROM ado_s9_kpi_value_l1_day WHERE tenant_id=0 AND factory_id=1 " +
|
|
|
+ "SELECT IFNULL((SELECT id FROM ado_s9_kpi_value_l1_day WHERE tenant_id=1300000000001 AND factory_id=1 " +
|
|
|
"AND module_code=@ModuleCode AND metric_code=@MetricCode AND biz_date=@BizDate AND is_deleted=0 " +
|
|
|
"ORDER BY id LIMIT 1), 0)",
|
|
|
new List<SugarParameter>
|
|
|
@@ -450,7 +450,7 @@ INSERT INTO ado_s9_kpi_value_l1_day
|
|
|
create_time, update_time, is_deleted, is_active,
|
|
|
module_code, metric_code, metric_value, calc_time)
|
|
|
VALUES
|
|
|
- (@Id, 0, NULL, NULL, 1, NULL, @BizDate,
|
|
|
+ (@Id, 1300000000001, NULL, NULL, 1, NULL, @BizDate,
|
|
|
@Now, @Now, 0, 1,
|
|
|
@ModuleCode, @MetricCode, @MetricValue, @Now)",
|
|
|
new SugarParameter("@Id", nextId),
|
|
|
@@ -467,7 +467,7 @@ VALUES
|
|
|
INSERT INTO mdp_transform_run_log
|
|
|
(tenant_id, job_code, job_name, trigger_type, batch_id, status, start_time, stage_rows, standard_rows, dwd_rows, create_time, update_time)
|
|
|
VALUES
|
|
|
- (0, @JobCode, @JobName, @TriggerType, @BatchId, 'RUNNING', @StartTime, 0, 0, 0, @StartTime, @StartTime)",
|
|
|
+ (1300000000001, @JobCode, @JobName, @TriggerType, @BatchId, 'RUNNING', @StartTime, 0, 0, 0, @StartTime, @StartTime)",
|
|
|
new SugarParameter("@JobCode", JobCode),
|
|
|
new SugarParameter("@JobName", JobName),
|
|
|
new SugarParameter("@TriggerType", triggerType),
|