删除 UUID 到 bigint 阴影同步相关的控制器、服务、映射器及配置文件

This commit is contained in:
wuweihua
2026-11-18 09:36:53 +08:00
parent ca45e15559
commit fb15b12275
21 changed files with 6 additions and 2109 deletions
@@ -1,106 +0,0 @@
package com.bms.web.controller.monitor;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bms.common.annotation.Log;
import com.bms.common.core.controller.BaseController;
import com.bms.common.core.domain.AjaxResult;
import com.bms.common.core.page.TableDataInfo;
import com.bms.common.enums.BusinessType;
import com.bms.price.migration.domain.MigBiJobLog;
import com.bms.price.migration.service.IUuidToNewMonitorService;
/**
* 监控:UUID -> bigint 阴影同步进度与开关
*/
@RestController
@RequestMapping("/monitor/uuidToNew")
public class UuidToNewMonitorController extends BaseController
{
@Autowired
private IUuidToNewMonitorService monitorService;
@PreAuthorize("@ss.hasPermi('monitor:uuidToNew:list')")
@GetMapping("/progress")
public AjaxResult progress()
{
return success(monitorService.getProgress());
}
@PreAuthorize("@ss.hasPermi('monitor:uuidToNew:list')")
@GetMapping("/jobLog/list")
public TableDataInfo jobLogList(MigBiJobLog query)
{
startPage();
List<MigBiJobLog> list = monitorService.selectJobLogList(query);
return getDataTable(list);
}
/**
* 打开/关闭连续同步。
* body: { "enabled": true, "threadCount": 2, "batchSize": 200 }
*/
@PreAuthorize("@ss.hasPermi('monitor:uuidToNew:switch')")
@Log(title = "UUID阴影同步开关", businessType = BusinessType.UPDATE)
@PostMapping("/enabled")
public AjaxResult setEnabled(@RequestBody Map<String, Object> body)
{
boolean enabled = false;
Integer threadCount = null;
Integer batchSize = null;
if (body != null)
{
if (body.get("enabled") != null)
{
enabled = Boolean.parseBoolean(String.valueOf(body.get("enabled")));
}
threadCount = toInt(body.get("threadCount"));
batchSize = toInt(body.get("batchSize"));
}
monitorService.setEnabled(enabled, threadCount, batchSize);
return success(monitorService.getProgress());
}
/**
* 仅开关关闭时修改线程/批次。
* body: { "threadCount": 2, "batchSize": 200 }
*/
@PreAuthorize("@ss.hasPermi('monitor:uuidToNew:switch')")
@Log(title = "UUID阴影同步配置", businessType = BusinessType.UPDATE)
@PostMapping("/config")
public AjaxResult updateConfig(@RequestBody Map<String, Object> body)
{
Integer threadCount = null;
Integer batchSize = null;
if (body != null)
{
threadCount = toInt(body.get("threadCount"));
batchSize = toInt(body.get("batchSize"));
}
monitorService.updateRuntimeConfig(threadCount, batchSize);
return success(monitorService.getProgress());
}
private Integer toInt(Object v)
{
if (v == null || "".equals(String.valueOf(v).trim()))
{
return null;
}
try
{
return Integer.valueOf(String.valueOf(v).trim());
}
catch (Exception e)
{
return null;
}
}
}
@@ -31,16 +31,6 @@ bms:
tms:
# Agreed API identification code for TMS callers
api-code: BMS.TMS.ZYaOvlQzpcfau8TUaCFfO3Hp8ieHIqGw
# UUID -> bigint shadow sync. Toggle on monitor page (no cron).
mig:
uuid-to-new:
# disabled after Long PK cutover; do not enable
enabled: false
batch-size: 200
# 1~16 (same ceiling as local-rebill default); 4c8g often 2~4
thread-count: 2
# sleep when no pending orders while switch is ON
idle-sleep-ms: 3000
billing:
# MQ mode: redis (default list queue) | local (Spring event)
mq-mode: redis