From fc47a705ab33a976f7a116c0ce6e236bb5057fa5 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Fri, 23 Feb 2024 17:19:19 +0800
Subject: [PATCH] binlog 数据同步完善(新增,修改,删除同步)
---
src/main/java/org/springblade/binlog/util/BinLogUtils.java | 68 +++++++---------------------------
1 files changed, 14 insertions(+), 54 deletions(-)
diff --git a/src/main/java/org/springblade/binlog/util/BinLogUtils.java b/src/main/java/org/springblade/binlog/util/BinLogUtils.java
index b477218..3620b12 100644
--- a/src/main/java/org/springblade/binlog/util/BinLogUtils.java
+++ b/src/main/java/org/springblade/binlog/util/BinLogUtils.java
@@ -8,11 +8,8 @@
import org.springblade.binlog.config.DataSourceConfig;
import org.springblade.binlog.vo.BinLogItem;
import org.springblade.binlog.vo.DataProperty;
-import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import javax.annotation.Resource;
import java.io.Serializable;
import java.sql.*;
import java.util.Arrays;
@@ -36,15 +33,6 @@
public class BinLogUtils {
private static BinLogUtils binLogUtils;
-
-// @Resource
-// private SearchStoreLogoExtMapper searchStoreLogoExtMapper;
-
-// @PostConstruct
-// public void init() {
-// binLogUtils = this;
-// binLogUtils.searchStoreLogoExtMapper = this.searchStoreLogoExtMapper;
-// }
/**
* 拼接dbTable
@@ -90,26 +78,6 @@
}
return null;
}
-
-// /**
-// * 根据table获取code
-// *
-// * @param table
-// * @return java.lang.Integer
-// */
-// public static Integer getCodeByTable(String table) {
-// if (StringUtils.isEmpty(table)) {
-// return null;
-// }
-// return CategoryEnum.getCodeByTab(table);
-// }
-
-// public static String getMsgByTab(String table) {
-// if (StringUtils.isEmpty(table)) {
-// return null;
-// }
-// return CategoryEnum.getMsgByTab(table);
-// }
/**
* 根据DBTable获取table
@@ -181,28 +149,6 @@
return null;
}
-
-// /**
-// * 根据storeId获取imgUrl
-// */
-// public static String getImgUrl(Long storeId) {
-//
-// if (storeId == null) {
-// return "";
-// }
-// //获取url
-// SearchStoreLogo searchStoreLogo = new SearchStoreLogo();
-// searchStoreLogo.setStoreId(storeId);
-// List<SearchStoreLogo> searchStoreLogos = binLogUtils.searchStoreLogoExtMapper.selectList(searchStoreLogo);
-// if (CollectionUtil.isNotEmpty(searchStoreLogos)) {
-// SearchStoreLogo storeLogo = searchStoreLogos.get(0);
-// if (storeLogo != null) {
-// return storeLogo.getStoreLogo();
-// }
-// }
-// return "";
-// }
-
/**
* 格式化date
*
@@ -222,6 +168,20 @@
Date formatDate = DateUtil.parse(strDate, dateFormat);
return formatDate;
}
+
+ /**
+ * 格式化date
+ *
+ * @param date
+ * @return java.util.Date
+ */
+ public static String getDateFormatStr(Date date) {
+ if (date == null) {
+ return null;
+ }
+ String dateFormat = "yyyy-MM-dd HH:mm:ss";
+ return DateUtil.format(date, dateFormat);
+ }
}
--
Gitblit v1.9.3