更新支付账单服务逻辑,调整源ID赋值方式;修改SQL映射中的源ID字段为费用ID;新增UUID到BIGINT迁移配置
This commit is contained in:
+106
@@ -0,0 +1,106 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,14 @@ 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:
|
||||
batch-size: 200
|
||||
# 1=single thread; sprint on 4c8g use 2~3 (max 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
|
||||
|
||||
Reference in New Issue
Block a user